Make gl_SubGroupARB a flat int in Vulkan

gl_SubGroupARB was being correctly declared as an Input variable in
Vulkan but it was missing the Flat decoration, which made spirv-val emit
the VUID-StandaloneSpirv-Flat-04744 validation error with shaders using
that built-in.
This commit is contained in:
Ricardo Garcia
2022-09-21 10:04:50 +02:00
parent b40f87f1d3
commit d4865f0b68
4 changed files with 86 additions and 6 deletions

View File

@@ -0,0 +1,34 @@
spv.subgroupSizeARB.frag
// Module Version 10000
// Generated by (magic number): 8000a
// Id's are bound by 12
Capability Shader
Capability SubgroupBallotKHR
Extension "SPV_KHR_shader_ballot"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 8 10
ExecutionMode 4 OriginUpperLeft
Source GLSL 450
SourceExtension "GL_ARB_shader_ballot"
SourceExtension "GL_KHR_shader_subgroup_basic"
Name 4 "main"
Name 8 "result"
Name 10 "gl_SubGroupSizeARB"
Decorate 8(result) Location 0
Decorate 10(gl_SubGroupSizeARB) Flat
Decorate 10(gl_SubGroupSizeARB) BuiltIn SubgroupSize
2: TypeVoid
3: TypeFunction 2
6: TypeInt 32 0
7: TypePointer Output 6(int)
8(result): 7(ptr) Variable Output
9: TypePointer Input 6(int)
10(gl_SubGroupSizeARB): 9(ptr) Variable Input
4(main): 2 Function None 3
5: Label
11: 6(int) Load 10(gl_SubGroupSizeARB)
Store 8(result) 11
Return
FunctionEnd