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
Both variables are included in the interface of the OpEntryPoint, which according to the Vulkan spec means that they are considered "statically used":
9.24. Static Use
A SPIR-V module declares a global object in memory using the OpVariable instruction, which results in a pointer x to that object. A specific entry point in a SPIR-V module is said to statically use that object if that entry point’s call tree contains a function containing a instruction with x as an id operand. A shader entry point also statically uses any variables explicitly declared in its interface.
But the spec section "15.8.3. DescriptorSet and Binding Assignment" contains a note stating that this is disallowed:
If multiple shader variables with the same set and binding values are declared in a single shader, but with different declared types, where any of those are not supported by the relevant bound descriptor, that shader can only be executed if the variables with the unsupported type are not statically used.
This issue only exists when optimizations are disabled. With the -O option, the unused variable is eliminated and no longer appears in the interface. It doesn't happen with SPIR-V versions below 1.4, because descriptor binding variables are not allowed/included in interfaces in older versions.
The text was updated successfully, but these errors were encountered:
The following vertex shader declares two different variables with the same descriptor set and binding number, but only one of them is statically used:
Compiling with
glslc -S --target-env=vulkan1.3
gives the following result (showing only relevant parts):Both variables are included in the interface of the
OpEntryPoint
, which according to the Vulkan spec means that they are considered "statically used":But the spec section "15.8.3. DescriptorSet and Binding Assignment" contains a note stating that this is disallowed:
This issue only exists when optimizations are disabled. With the
-O
option, the unused variable is eliminated and no longer appears in the interface. It doesn't happen with SPIR-V versions below 1.4, because descriptor binding variables are not allowed/included in interfaces in older versions.The text was updated successfully, but these errors were encountered: