Rendering: SPIR-V reflection incorrectly determined writable
state
#103614
+5
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Identified from testing #101696
Resolves a bug in
RenderingDeviceDriver::_reflect_spirv
:godot/servers/rendering/rendering_device_driver.cpp
Lines 163 to 167 in 1af1edf
When reflecting an image type, the
binding.block
struct is invalid, as that only applies tostruct
types. Here is the dumped value of thebinding
variable from the debugger, abbreviated:Note that the the entire
binding.block
struct is0
, which means this will evaluate totrue
, as the second part of the expression does not have theSPV_REFLECT_DECORATION_NON_WRITABLE
bit set, as it is invalid and always0
:Metal has its own implementation to reflect the SPIR-V, which distinguishes the types:
godot/drivers/metal/rendering_device_driver_metal.mm
Lines 1787 to 1796 in d89cc01
Note
SPIR-V cross throws an exception if you try to fetch the block metadata for an image.