-
Notifications
You must be signed in to change notification settings - Fork 168
Enable SetInlineConstants for WebGPU #757
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: inline_constants
Are you sure you want to change the base?
Enable SetInlineConstants for WebGPU #757
Conversation
| { | ||
| TDeviceContextBase::Draw(Attribs, 0); | ||
|
|
||
| if (Attribs.NumVertices == 0 || Attribs.NumInstances == 0) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 AFTERCommitInlineConstants()andCommitDescriptorSets()insidePrepareForDraw() -
WebGPU:
DvpValidateCommittedShaderResources()was called BEFOREPrepareForDraw(), but inline constant buffers are updated INSIDEPrepareForDraw()
Call DvpValidateCommittedShaderResources after CommitBindGroups just to align with vulkan impl. This also fixed the issue with "frame 2 is out-of-date" .
df639a8 to
1bf76e0
Compare
No description provided.