Skip to content

Conversation

@hzqst
Copy link
Contributor

@hzqst hzqst commented Jan 13, 2026

No description provided.

@hzqst hzqst marked this pull request as ready for review January 13, 2026 13:40
{
TDeviceContextBase::Draw(Attribs, 0);

if (Attribs.NumVertices == 0 || Attribs.NumInstances == 0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is incorrect. DvpValidateCommittedShaderResources() is now only called for empty draw calls, which is not the purpose.

{
TDeviceContextBase::MultiDraw(Attribs, 0);

if (Attribs.NumInstances == 0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

{
TDeviceContextBase::DrawIndexed(Attribs, 0);

if (Attribs.NumIndices == 0 || Attribs.NumInstances == 0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

{
TDeviceContextBase::MultiDrawIndexed(Attribs, 0);

if (Attribs.NumInstances == 0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here


#ifdef DILIGENT_DEVELOPMENT
// Must be called after CommitBindGroups as inline constant buffers must be updated first
DvpValidateCommittedShaderResources();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the issue with inline constants?
Validation must be performed before committing bind groups because there might be problems that may cause it to crash and there will be no error messages.

Copy link
Contributor Author

@hzqst hzqst Jan 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the issue with inline constants? Validation must be performed before committing bind groups because there might be problems that may cause it to crash and there will be no error messages.

I was debugging an error in TEST_F(InlineConstants, ResourceLayout1), when pPosVar == nullptr (STATIC type), an error occurs: "Dynamic allocation of dynamic buffer 'Implicit signature of PSO 'Inline constants test' - cbInlinePositions' in frame 2 is out-of-date."

  • Vulkan: DvpValidateCommittedShaderResources() is called AFTER CommitInlineConstants() and CommitDescriptorSets() inside PrepareForDraw()

  • WebGPU: DvpValidateCommittedShaderResources() was called BEFORE PrepareForDraw(), but inline constant buffers are updated INSIDE PrepareForDraw()

Call DvpValidateCommittedShaderResources after CommitBindGroups just to align with vulkan impl. This also fixed the issue with "frame 2 is out-of-date" .

image image

@TheMostDiligent TheMostDiligent force-pushed the inline_constants_webgpu branch from df639a8 to 1bf76e0 Compare January 15, 2026 04:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants