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
In this case the OpLoad was 5 words long but then an access to word index [5] was out of bounds. There was no subsequent crash but I'm guessing that was just luck.
Expected behavior
There would be no assert when processing shaders.
Valid Usage ID
N/A
Additional context
I think the problem here is that although OpLoad is normally only 4 words, it can be 5 words if there are memory operands which do not include Aligned (since [4] is the memory operands and [5] if any will be the parameters) - in my case this is some generated SPIR-V inside RenderDoc and it always emits the memory operands parameter even if it's None, but the same could happen if there was a parameter-less memory operand. The length check should maybe be <= to cover this case.
I'm not sure if you want to also add a check that the memory operands have Aligned set as well, since although e.g. MakePointerAvailable would also have a param the pointer can't validly be BDA if it doesn't include Aligned (whose operand would come first). The 'alignment' value loaded in that case would not be used for anything currently, but might be confusing?
The text was updated successfully, but these errors were encountered:
Environment:
Describe the Issue
When running with GPU-AV I encountered an assert inside the BDA SPIR-V pass:
Vulkan-ValidationLayers/layers/gpu/spirv/buffer_device_address_pass.cpp
Lines 80 to 84 in f00d38b
In this case the OpLoad was 5 words long but then an access to word index [5] was out of bounds. There was no subsequent crash but I'm guessing that was just luck.
Expected behavior
There would be no assert when processing shaders.
Valid Usage ID
N/A
Additional context
I think the problem here is that although OpLoad is normally only 4 words, it can be 5 words if there are memory operands which do not include
Aligned
(since [4] is the memory operands and [5] if any will be the parameters) - in my case this is some generated SPIR-V inside RenderDoc and it always emits the memory operands parameter even if it'sNone
, but the same could happen if there was a parameter-less memory operand. The length check should maybe be<=
to cover this case.I'm not sure if you want to also add a check that the memory operands have
Aligned
set as well, since although e.g.MakePointerAvailable
would also have a param the pointer can't validly be BDA if it doesn't includeAligned
(whose operand would come first). The 'alignment' value loaded in that case would not be used for anything currently, but might be confusing?The text was updated successfully, but these errors were encountered: