KhronosGroup / glslang

Khronos-reference front end for GLSL/ESSL, partial front end for HLSL, and a SPIR-V generator.
Other
3k stars 828 forks source link

Test failure with tip-of-tree spirv-tools #3505

Open dj2 opened 7 months ago

dj2 commented 7 months ago

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 commented 7 months ago

@spencer-lunarg

spencer-lunarg commented 7 months ago

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

dj2 commented 7 months ago

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?

spencer-lunarg commented 7 months ago

@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."