Shader input/output validation#705
Conversation
cwfitzgerald
left a comment
There was a problem hiding this comment.
One comment, otherwise looks okay to me.
| ) | ||
| .unwrap(); | ||
| validated_stages |= wgt::ShaderStage::FRAGMENT; | ||
| } |
There was a problem hiding this comment.
This seems to be referring to fragment stage this whole time, up until validated_stages == wgt::ShaderStage::VERTEX which seems to be talking to vertex. Either I misunderstand the code, or something is fishy
There was a problem hiding this comment.
The point here is not validating the fragment shader if the vertex shader wasn't validated, since we wouldn't know about FS inputs in this case.
kvark
left a comment
There was a problem hiding this comment.
Thank you for the quick review!
| ) | ||
| .unwrap(); | ||
| validated_stages |= wgt::ShaderStage::FRAGMENT; | ||
| } |
There was a problem hiding this comment.
The point here is not validating the fragment shader if the vertex shader wasn't validated, since we wouldn't know about FS inputs in this case.
|
Looks like we have no major concerns, let's proceed! |
354: Update to wgpu with shader validation r=cwfitzgerald a=kvark Depends on gfx-rs/wgpu#705 Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
354: Update to wgpu with shader validation r=cwfitzgerald a=kvark Depends on gfx-rs#705 Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
Connections
Fixes #269
It still has a few gaps (like the
storage_texture_formatmatching, bugs, optional validation), but the main logic is there. Anything else should come in smaller issues as a follow-up.Description
The main goal of this PR is to validate:
I figured that
WGPU_SHADER_VALIDATIONenvironment is not a great path forward. It doesn't help engine authors, for example. So I'm switching it to just a boolean field inDeviceDescriptor. Hopefully, we'll remove it soon :)Testing
Just running wgpu-rs examples - gfx-rs/wgpu-rs#354
Review notes: the commit in the middle just moves stuff around. I think it's easier to just review the first and the last commit, ignoring the middle.