You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wanted to check whether a shader has marked a given storage image as readonly. I assume that this would result in SPV_REFLECT_DECORATION_NON_WRITABLE being visible somewhere, but this doesn't seem to be the case. Both SpvReflectDescriptorBinding.block.decoration_flags and SpvReflectDescriptorBinding.type_description->decoration_flags are zero regardless of the memory qualifier on the GLSL side.
I'm not particularly familiar with SPIR-V intricacies, so I don't really know which one of these two would be the right place for the flags for storage images. They're not really blocks, so maybe the type description? But it looks like the only SpvReflectPrvNodes with the correct decorator present are skipped on this line:
- Added parsing for SpvDecorationNonReadable decoration.
- Updated parsing to account for decorations at the descriptor binding
level.
- Added new enum SPV_REFLECT_DECORATION_NON_READABLE.
- Added new member SpvReflectDescriptorBinding::decoration_flags.
- Added test case non_writable_image.glsl which has examples of both
non_writable and non_readable images.
Hi - added decoration_flags to SpvReflectDescriptorBinding per your suggestion. It seemed like the most logical place to go for SPV_REFLECT_DECORATION_NON_WRITABLE and SPV_REFLECT_DECORATION_NON_READABLE.
I haven't updated spirv-reflect to output NON_WRITABLE and NON_READABLE yet. Need to think of a way to output these without it looking too messy. Also affects the tests which is really a constraint on time right now.
Thanks for the example shader. Let me know if you run into any issues.
I wanted to check whether a shader has marked a given storage image as readonly. I assume that this would result in
SPV_REFLECT_DECORATION_NON_WRITABLE
being visible somewhere, but this doesn't seem to be the case. BothSpvReflectDescriptorBinding.block.decoration_flags
andSpvReflectDescriptorBinding.type_description->decoration_flags
are zero regardless of the memory qualifier on the GLSL side.I'm not particularly familiar with SPIR-V intricacies, so I don't really know which one of these two would be the right place for the flags for storage images. They're not really blocks, so maybe the type description? But it looks like the only
SpvReflectPrvNode
s with the correct decorator present are skipped on this line:SPIRV-Reflect/spirv_reflect.c
Line 1832 in 5f6e13e
Maybe a
SpvReflectDecorationFlags decoration_flags;
could be added toSpvReflectImageTraits
instead? Or toSpvReflectDescriptorBinding
directly?Also, looks like there are no tests for storage images. Here's a simple shader to reproduce the issue:
With the
spirv-reflect
program, there's noNON_WRITABLE
in sight. I tested with the master branch in its current state.The text was updated successfully, but these errors were encountered: