glslang icon indicating copy to clipboard operation
glslang copied to clipboard

Test failure with tip-of-tree spirv-tools

Open dj2 opened this issue 1 year ago • 4 comments

When building glslang with tip-of-tree spirv-tools (which contains https://github.com/KhronosGroup/SPIRV-Tools/commit/784b064f90a597d2478064161438f4986485b5d4) the glslang tests fail with:

out/Debug/gtests/glslangtests --gtest_filter="Glsl/CompileVulkanToSpirvTest.FromFile/spv_bufferhandle3_frag"

The following warnings/errors occurred:
error: SPIRV-Tools Validation Errors
error: [VUID-StandaloneSpirv-Input-09557] Input/Output interface variable id <42> contains a PhysicalStorageBuffer pointer, which is not allowed. If you want to interface shader stages with a PhysicalStorageBuffer, cast to a uint64 or uvec2 instead.
  %k = OpVariable %_ptr_Input__ptr_PhysicalStorageBuffer_t4 Input

dj2 avatar Feb 12 '24 18:02 dj2

@spencer-lunarg

dj2 avatar Feb 12 '24 18:02 dj2

sorry @arcady-lunarg I totally dropped to ball and forgot to warn you of this (wasn't sure why I didn't expect glslang to possibly do this)

https://gitlab.khronos.org/vulkan/vulkan/-/merge_requests/6344

We decided in the Working Group that Physical Storage Buffers should not directly be used as an interface storage class it really gets messy deciding how to mark Location in the interface, so instead they should be sent as int 64 or uvec2 across stages

for glslang, I think the simplest solution is to just warn the developers its not legal... maybe it is easy to just parse it as a int64 interface, but rather get this fixed first

spencer-lunarg avatar Feb 12 '24 23:02 spencer-lunarg

Will this be relatively quick to fix, or should we revert the spirv-tools change until we can get glslang ready to work with it?

dj2 avatar Feb 13 '24 15:02 dj2

@dj2 so talking to @arcady-lunarg we feel this whole thing is sticky because in GLSL, this interface usage is "allowed"... basically this probably should have got more agreement from everyone

Right now the GLSL extension spec says "The reference type can be used to declare block references in any storage type, including as block members, local variables, and function parameters and return types."

spencer-lunarg avatar Feb 14 '24 00:02 spencer-lunarg