@@ -313,16 +313,38 @@ namespace IGC
313
313
}
314
314
315
315
llvm::GenIntrinsicInst* pRuntimeVal = llvm::dyn_cast<llvm::GenIntrinsicInst>(pAddress);
316
+ uint runtimeval0;
316
317
317
- if (pRuntimeVal == nullptr ||
318
- pRuntimeVal->getIntrinsicID () != llvm::GenISAIntrinsic::GenISA_RuntimeValue)
318
+ bool isRuntimeValFound = false ;
319
+ if (pRuntimeVal == nullptr )
320
+ {
321
+ auto it = std::find (m_argList.begin (), m_argList.end (), pAddress);
322
+ if (it != m_argList.end ())
323
+ {
324
+ int argIndex = (int ) std::distance (m_argList.begin (), it);
325
+ PushInfo& pushInfo = m_context->getModuleMetaData ()->pushInfo ;
326
+ for (auto index_it = pushInfo.constantReg .begin (); index_it != pushInfo.constantReg .end (); ++index_it)
327
+ {
328
+ if (index_it->second == argIndex)
329
+ {
330
+ runtimeval0 = index_it->first ;
331
+ isRuntimeValFound = true ;
332
+ }
333
+ }
334
+ }
335
+ if (!isRuntimeValFound)
336
+ return false ;
337
+ }
338
+ else if (pRuntimeVal->getIntrinsicID () != llvm::GenISAIntrinsic::GenISA_RuntimeValue)
319
339
return false ;
340
+ if (!isRuntimeValFound)
341
+ runtimeval0 = (uint)llvm::cast<llvm::ConstantInt>(pRuntimeVal->getOperand (0 ))->getZExtValue ();
320
342
321
- IGC_ASSERT (32 == GetSizeInBits (pRuntimeVal->getType ()) ||
322
- 64 == GetSizeInBits (pRuntimeVal->getType ()));
323
- const bool is64Bit = 64 == GetSizeInBits (pRuntimeVal->getType ());
343
+ uint runtimevalSize = GetSizeInBits (pAddress->getType ());
344
+ IGC_ASSERT (32 == runtimevalSize ||
345
+ 64 == runtimevalSize);
346
+ const bool is64Bit = 64 == runtimevalSize;
324
347
325
- uint runtimeval0 = (uint)llvm::cast<llvm::ConstantInt>(pRuntimeVal->getOperand (0 ))->getZExtValue ();
326
348
PushInfo& pushInfo = m_context->getModuleMetaData ()->pushInfo ;
327
349
328
350
// then check for static flag so that we can do push safely
@@ -1473,6 +1495,7 @@ namespace IGC
1473
1495
{
1474
1496
BlockPushConstants ();
1475
1497
}
1498
+
1476
1499
// WA: Gen11+ HW doesn't work correctly if doubles are on vertex shader input and the input has unused components,
1477
1500
// so ElementComponentEnableMask is not full => packing occurs
1478
1501
// Code below fills gaps in inputs, so the ElementComponentEnableMask if full even if we don't use all
0 commit comments