Add workaround for static vertex count

Change-Id: I3e20bbeaff390753960ca549d6cf3c6a6bd276a1
This commit is contained in:
David Woo
2020-10-20 20:39:43 -07:00
committed by sys_zuul
parent bfa59e5d7a
commit 942599404d
4 changed files with 15 additions and 2 deletions

View File

@ -250,7 +250,8 @@ void CollectGeometryShaderProperties::HandleCutOrStreamHeader(llvm::GenIntrinsic
auto pVertexCount = llvm::dyn_cast<llvm::ConstantInt>(I.getOperand(I.getNumOperands() - 2));
// if the emitCount is not a constant int, we have runtime value of vertex count
m_gsProps.Output().HasNonstaticVertexCount(pVertexCount == nullptr || IGC_IS_FLAG_ENABLED(ForceStaticToDynamic));
auto ctx = getAnalysis<CodeGenContextWrapper>().getCodeGenContext();
m_gsProps.Output().HasNonstaticVertexCount(pVertexCount == nullptr || ctx->platform.disableStaticVertexCount());
// for static number of vertices, we get the actual value,
// for dynamic, declaration-derived upper bound (for safety)

View File

@ -695,7 +695,8 @@ void GeometryShaderLowering::LowerControlHeader(llvm::Instruction* inst)
// Add write to vertex count field for non-static number of output vertices
IRBuilder<> irb(inst);
Value* undef = llvm::UndefValue::get(Type::getFloatTy(m_pModule->getContext()));
if (pConstVertexIndex == nullptr || IGC_IS_FLAG_ENABLED(ForceStaticToDynamic))
auto pCtx = getAnalysis<CodeGenContextWrapper>().getCodeGenContext();
if (pConstVertexIndex == nullptr || pCtx->platform.disableStaticVertexCount())
{
IGC_ASSERT(m_gsProps->GetProperties().Output().HasNonstaticVertexCount());
// bitcast since data arguments of urbWrite are floats - ugly

View File

@ -395,6 +395,11 @@ bool hasEarlyGRFRead() const
return m_platformInfo.eProductFamily == IGFX_TIGERLAKE_LP && m_platformInfo.usRevId == REVISION_A0;
}
bool disableStaticVertexCount() const
{
return m_WaTable.Wa_14012504847 != 0 || IGC_IS_FLAG_ENABLED(ForceStaticToDynamic);
}
bool hasSamplerSupport() const
{
return true;

View File

@ -8487,6 +8487,12 @@ typedef struct _WA_TABLE
"Workaround",
WA_BUG_TYPE_UNKNOWN,
WA_BUG_PERF_IMPACT_UNKNOWN, WA_COMPONENT_UNKNOWN)
WA_DECLARE(
Wa_14012504847,
"Workaround",
WA_BUG_TYPE_UNKNOWN,
WA_BUG_PERF_IMPACT_UNKNOWN, WA_COMPONENT_UNKNOWN)
} WA_TABLE, *PWA_TABLE;
#ifdef _USC_