@@ -457,17 +457,50 @@ void DeviceContextD3D11Impl::BindShaderResources(Uint32 BindSRBMask)
457457 else
458458 {
459459 // Bind constant buffers with dynamic offsets. In Direct3D11 only those buffers are counted as dynamic.
460- VERIFY ((m_BindInfo.DynamicSRBMask & SignBit) != 0 ,
461- " When bit in StaleSRBMask is not set, the same bit in DynamicSRBMask must be set. Check GetCommitMask()." );
462- DEV_CHECK_ERR (pResourceCache->HasDynamicResources (),
463- " Bit in DynamicSRBMask is set, but the cache does not contain dynamic resources. This may indicate that resources "
464- " in the cache have changed, but the SRB has not been committed before the draw/dispatch command." );
465- if (pResourceCache->GetUAVCount (PSInd) > 0 )
460+ VERIFY (((m_BindInfo.DynamicSRBMask | m_BindInfo.InlineConstantsSRBMask ) & SignBit) != 0 ,
461+ " When bit in StaleSRBMask is not set, the same bit in either DynamicSRBMask or InlineConstantsSRBMask must be set. Check GetCommitMask()." );
462+
463+ if ((m_BindInfo.DynamicSRBMask & SignBit) != 0 )
464+ {
465+ DEV_CHECK_ERR (pResourceCache->HasDynamicResources (),
466+ " Shader resource cache does not contain dynamic resources, but the corresponding bit in DynamicSRBMask is set. "
467+ " This may indicate that resources in the cache have changed, but the SRB has not been committed before the draw/dispatch command." );
468+ if (pResourceCache->GetUAVCount (PSInd) > 0 )
469+ {
470+ if (PsUavBindMode != PixelShaderUAVBindMode::Bind)
471+ PsUavBindMode = PixelShaderUAVBindMode::Keep;
472+ }
473+ BindDynamicCBs (*pResourceCache, BaseBindings);
474+ }
475+ else
476+ {
477+ DEV_CHECK_ERR (!pResourceCache->HasDynamicResources (),
478+ " Shader resource cache contains dynamic resources, but the corresponding bit in DynamicSRBMask is not set. "
479+ " This may indicate that resources in the cache have changed, but the SRB has not been committed before the draw/dispatch command." );
480+ }
481+ }
482+
483+ if ((m_BindInfo.InlineConstantsSRBMask & SignBit) != 0 )
484+ {
485+ VERIFY (pResourceCache->HasInlineConstants (),
486+ " Shader resource cache does not contain inline constants, but the corresponding bit in InlineConstantsSRBMask is set. "
487+ " This may be a bug because inline constants flag in the cache never changes after SRB creation, "
488+ " while m_BindInfo.InlineConstantsSRBMask is initialized when SRB is committed." );
489+ if (PipelineResourceSignatureD3D11Impl* pSign = m_pPipelineState->GetResourceSignature (SignIdx))
466490 {
467- if (PsUavBindMode != PixelShaderUAVBindMode::Bind)
468- PsUavBindMode = PixelShaderUAVBindMode::Keep;
491+ pSign->UpdateInlineConstantBuffers (*pResourceCache, m_pd3d11DeviceContext);
469492 }
470- BindDynamicCBs (*pResourceCache, BaseBindings);
493+ else
494+ {
495+ UNEXPECTED (" Pipeline resource signature is null for signature index " , SignIdx);
496+ }
497+ }
498+ else
499+ {
500+ VERIFY (!pResourceCache->HasInlineConstants (),
501+ " Shader resource cache contains inline constants, but the corresponding bit in InlineConstantsSRBMask is not set. "
502+ " This may be a bug because inline constants flag in the cache never changes after SRB creation, "
503+ " while m_BindInfo.InlineConstantsSRBMask is initialized when SRB is committed." );
471504 }
472505 }
473506
0 commit comments