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