diff --git a/SPIRV/SpvBuilder.cpp b/SPIRV/SpvBuilder.cpp index 3c23cffd553896f45f9956c1bb30862e26adbe5a..f6b0b86710648dd0cee8d3043dd7686f34139c2b 100644 --- a/SPIRV/SpvBuilder.cpp +++ b/SPIRV/SpvBuilder.cpp @@ -1125,7 +1125,8 @@ Id Builder::createAccessChain(StorageClass storageClass, Id base, const std::vec Id Builder::createArrayLength(Id base, unsigned int member) { - Instruction* length = new Instruction(getUniqueId(), makeIntType(32), OpArrayLength); + spv::Id intType = makeIntType(32); + Instruction* length = new Instruction(getUniqueId(), intType, OpArrayLength); length->addIdOperand(base); length->addImmediateOperand(member); buildPoint->addInstruction(std::unique_ptr<Instruction>(length)); diff --git a/Test/baseResults/hlsl.structbuffer.atomics.frag.out b/Test/baseResults/hlsl.structbuffer.atomics.frag.out new file mode 100644 index 0000000000000000000000000000000000000000..7f20d5fb547e6dca56134eae4d095d42accf73b5 --- /dev/null +++ b/Test/baseResults/hlsl.structbuffer.atomics.frag.out @@ -0,0 +1,599 @@ +hlsl.structbuffer.atomics.frag +Shader version: 450 +gl_FragCoord origin is upper left +0:? Sequence +0:5 Function Definition: @main(u1; (temp 4-component vector of float) +0:5 Function Parameters: +0:5 'pos' (in uint) +0:? Sequence +0:8 AtomicAdd (temp void) +0:8 indirect index (layout(row_major std430 ) buffer uint) +0:8 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:8 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:8 Constant: +0:8 0 (const uint) +0:8 right-shift (temp int) +0:8 Constant: +0:8 8 (const int) +0:8 Constant: +0:8 2 (const int) +0:8 Constant: +0:8 1 (const int) +0:9 move second child to first child (temp uint) +0:9 'u' (temp uint) +0:9 AtomicAdd (temp uint) +0:9 indirect index (layout(row_major std430 ) buffer uint) +0:9 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:9 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:9 Constant: +0:9 0 (const uint) +0:9 right-shift (temp int) +0:9 Constant: +0:9 8 (const int) +0:9 Constant: +0:9 2 (const int) +0:9 Constant: +0:9 1 (const int) +0:10 AtomicAnd (temp void) +0:10 indirect index (layout(row_major std430 ) buffer uint) +0:10 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:10 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:10 Constant: +0:10 0 (const uint) +0:10 right-shift (temp int) +0:10 Constant: +0:10 8 (const int) +0:10 Constant: +0:10 2 (const int) +0:10 Constant: +0:10 1 (const int) +0:11 move second child to first child (temp uint) +0:11 'u' (temp uint) +0:11 AtomicAnd (temp uint) +0:11 indirect index (layout(row_major std430 ) buffer uint) +0:11 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:11 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:11 Constant: +0:11 0 (const uint) +0:11 right-shift (temp int) +0:11 Constant: +0:11 8 (const int) +0:11 Constant: +0:11 2 (const int) +0:11 Constant: +0:11 1 (const int) +0:12 move second child to first child (temp uint) +0:12 'u' (temp uint) +0:12 Convert int to uint (temp uint) +0:12 AtomicCompSwap (temp int) +0:12 indirect index (layout(row_major std430 ) buffer uint) +0:12 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:12 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:12 Constant: +0:12 0 (const uint) +0:12 right-shift (temp int) +0:12 Constant: +0:12 8 (const int) +0:12 Constant: +0:12 2 (const int) +0:12 Constant: +0:12 1 (const int) +0:12 Constant: +0:12 2 (const int) +0:14 move second child to first child (temp uint) +0:14 'u' (temp uint) +0:14 AtomicExchange (temp uint) +0:14 indirect index (layout(row_major std430 ) buffer uint) +0:14 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:14 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:14 Constant: +0:14 0 (const uint) +0:14 right-shift (temp int) +0:14 Constant: +0:14 8 (const int) +0:14 Constant: +0:14 2 (const int) +0:14 Constant: +0:14 1 (const int) +0:15 AtomicMax (temp void) +0:15 indirect index (layout(row_major std430 ) buffer uint) +0:15 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:15 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:15 Constant: +0:15 0 (const uint) +0:15 right-shift (temp int) +0:15 Constant: +0:15 8 (const int) +0:15 Constant: +0:15 2 (const int) +0:15 Constant: +0:15 1 (const int) +0:16 move second child to first child (temp uint) +0:16 'u' (temp uint) +0:16 AtomicMax (temp uint) +0:16 indirect index (layout(row_major std430 ) buffer uint) +0:16 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:16 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:16 Constant: +0:16 0 (const uint) +0:16 right-shift (temp int) +0:16 Constant: +0:16 8 (const int) +0:16 Constant: +0:16 2 (const int) +0:16 Constant: +0:16 1 (const int) +0:17 AtomicMin (temp void) +0:17 indirect index (layout(row_major std430 ) buffer uint) +0:17 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:17 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:17 Constant: +0:17 0 (const uint) +0:17 right-shift (temp int) +0:17 Constant: +0:17 8 (const int) +0:17 Constant: +0:17 2 (const int) +0:17 Constant: +0:17 1 (const int) +0:18 move second child to first child (temp uint) +0:18 'u' (temp uint) +0:18 AtomicMin (temp uint) +0:18 indirect index (layout(row_major std430 ) buffer uint) +0:18 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:18 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:18 Constant: +0:18 0 (const uint) +0:18 right-shift (temp int) +0:18 Constant: +0:18 8 (const int) +0:18 Constant: +0:18 2 (const int) +0:18 Constant: +0:18 1 (const int) +0:19 AtomicOr (temp void) +0:19 indirect index (layout(row_major std430 ) buffer uint) +0:19 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:19 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:19 Constant: +0:19 0 (const uint) +0:19 right-shift (temp int) +0:19 Constant: +0:19 8 (const int) +0:19 Constant: +0:19 2 (const int) +0:19 Constant: +0:19 1 (const int) +0:20 move second child to first child (temp uint) +0:20 'u' (temp uint) +0:20 AtomicOr (temp uint) +0:20 indirect index (layout(row_major std430 ) buffer uint) +0:20 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:20 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:20 Constant: +0:20 0 (const uint) +0:20 right-shift (temp int) +0:20 Constant: +0:20 8 (const int) +0:20 Constant: +0:20 2 (const int) +0:20 Constant: +0:20 1 (const int) +0:21 AtomicXor (temp void) +0:21 indirect index (layout(row_major std430 ) buffer uint) +0:21 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:21 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:21 Constant: +0:21 0 (const uint) +0:21 right-shift (temp int) +0:21 Constant: +0:21 8 (const int) +0:21 Constant: +0:21 2 (const int) +0:21 Constant: +0:21 1 (const int) +0:22 move second child to first child (temp uint) +0:22 'u' (temp uint) +0:22 AtomicXor (temp uint) +0:22 indirect index (layout(row_major std430 ) buffer uint) +0:22 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:22 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:22 Constant: +0:22 0 (const uint) +0:22 right-shift (temp int) +0:22 Constant: +0:22 8 (const int) +0:22 Constant: +0:22 2 (const int) +0:22 Constant: +0:22 1 (const int) +0:24 Branch: Return with expression +0:24 Construct vec4 (temp 4-component vector of float) +0:24 Convert uint to float (temp float) +0:24 indirect index (layout(row_major std430 ) buffer uint) +0:24 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:24 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:24 Constant: +0:24 0 (const uint) +0:24 right-shift (temp int) +0:24 'pos' (in uint) +0:24 Constant: +0:24 2 (const int) +0:5 Function Definition: main( (temp void) +0:5 Function Parameters: +0:? Sequence +0:5 move second child to first child (temp uint) +0:? 'pos' (temp uint) +0:? 'pos' (layout(location=0 ) in uint) +0:5 move second child to first child (temp 4-component vector of float) +0:? '@entryPointOutput' (layout(location=0 ) out 4-component vector of float) +0:5 Function Call: @main(u1; (temp 4-component vector of float) +0:? 'pos' (temp uint) +0:? Linker Objects +0:? 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:? '@entryPointOutput' (layout(location=0 ) out 4-component vector of float) +0:? 'pos' (layout(location=0 ) in uint) + + +Linked fragment stage: + + +Shader version: 450 +gl_FragCoord origin is upper left +0:? Sequence +0:5 Function Definition: @main(u1; (temp 4-component vector of float) +0:5 Function Parameters: +0:5 'pos' (in uint) +0:? Sequence +0:8 AtomicAdd (temp void) +0:8 indirect index (layout(row_major std430 ) buffer uint) +0:8 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:8 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:8 Constant: +0:8 0 (const uint) +0:8 right-shift (temp int) +0:8 Constant: +0:8 8 (const int) +0:8 Constant: +0:8 2 (const int) +0:8 Constant: +0:8 1 (const int) +0:9 move second child to first child (temp uint) +0:9 'u' (temp uint) +0:9 AtomicAdd (temp uint) +0:9 indirect index (layout(row_major std430 ) buffer uint) +0:9 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:9 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:9 Constant: +0:9 0 (const uint) +0:9 right-shift (temp int) +0:9 Constant: +0:9 8 (const int) +0:9 Constant: +0:9 2 (const int) +0:9 Constant: +0:9 1 (const int) +0:10 AtomicAnd (temp void) +0:10 indirect index (layout(row_major std430 ) buffer uint) +0:10 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:10 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:10 Constant: +0:10 0 (const uint) +0:10 right-shift (temp int) +0:10 Constant: +0:10 8 (const int) +0:10 Constant: +0:10 2 (const int) +0:10 Constant: +0:10 1 (const int) +0:11 move second child to first child (temp uint) +0:11 'u' (temp uint) +0:11 AtomicAnd (temp uint) +0:11 indirect index (layout(row_major std430 ) buffer uint) +0:11 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:11 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:11 Constant: +0:11 0 (const uint) +0:11 right-shift (temp int) +0:11 Constant: +0:11 8 (const int) +0:11 Constant: +0:11 2 (const int) +0:11 Constant: +0:11 1 (const int) +0:12 move second child to first child (temp uint) +0:12 'u' (temp uint) +0:12 Convert int to uint (temp uint) +0:12 AtomicCompSwap (temp int) +0:12 indirect index (layout(row_major std430 ) buffer uint) +0:12 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:12 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:12 Constant: +0:12 0 (const uint) +0:12 right-shift (temp int) +0:12 Constant: +0:12 8 (const int) +0:12 Constant: +0:12 2 (const int) +0:12 Constant: +0:12 1 (const int) +0:12 Constant: +0:12 2 (const int) +0:14 move second child to first child (temp uint) +0:14 'u' (temp uint) +0:14 AtomicExchange (temp uint) +0:14 indirect index (layout(row_major std430 ) buffer uint) +0:14 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:14 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:14 Constant: +0:14 0 (const uint) +0:14 right-shift (temp int) +0:14 Constant: +0:14 8 (const int) +0:14 Constant: +0:14 2 (const int) +0:14 Constant: +0:14 1 (const int) +0:15 AtomicMax (temp void) +0:15 indirect index (layout(row_major std430 ) buffer uint) +0:15 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:15 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:15 Constant: +0:15 0 (const uint) +0:15 right-shift (temp int) +0:15 Constant: +0:15 8 (const int) +0:15 Constant: +0:15 2 (const int) +0:15 Constant: +0:15 1 (const int) +0:16 move second child to first child (temp uint) +0:16 'u' (temp uint) +0:16 AtomicMax (temp uint) +0:16 indirect index (layout(row_major std430 ) buffer uint) +0:16 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:16 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:16 Constant: +0:16 0 (const uint) +0:16 right-shift (temp int) +0:16 Constant: +0:16 8 (const int) +0:16 Constant: +0:16 2 (const int) +0:16 Constant: +0:16 1 (const int) +0:17 AtomicMin (temp void) +0:17 indirect index (layout(row_major std430 ) buffer uint) +0:17 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:17 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:17 Constant: +0:17 0 (const uint) +0:17 right-shift (temp int) +0:17 Constant: +0:17 8 (const int) +0:17 Constant: +0:17 2 (const int) +0:17 Constant: +0:17 1 (const int) +0:18 move second child to first child (temp uint) +0:18 'u' (temp uint) +0:18 AtomicMin (temp uint) +0:18 indirect index (layout(row_major std430 ) buffer uint) +0:18 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:18 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:18 Constant: +0:18 0 (const uint) +0:18 right-shift (temp int) +0:18 Constant: +0:18 8 (const int) +0:18 Constant: +0:18 2 (const int) +0:18 Constant: +0:18 1 (const int) +0:19 AtomicOr (temp void) +0:19 indirect index (layout(row_major std430 ) buffer uint) +0:19 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:19 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:19 Constant: +0:19 0 (const uint) +0:19 right-shift (temp int) +0:19 Constant: +0:19 8 (const int) +0:19 Constant: +0:19 2 (const int) +0:19 Constant: +0:19 1 (const int) +0:20 move second child to first child (temp uint) +0:20 'u' (temp uint) +0:20 AtomicOr (temp uint) +0:20 indirect index (layout(row_major std430 ) buffer uint) +0:20 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:20 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:20 Constant: +0:20 0 (const uint) +0:20 right-shift (temp int) +0:20 Constant: +0:20 8 (const int) +0:20 Constant: +0:20 2 (const int) +0:20 Constant: +0:20 1 (const int) +0:21 AtomicXor (temp void) +0:21 indirect index (layout(row_major std430 ) buffer uint) +0:21 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:21 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:21 Constant: +0:21 0 (const uint) +0:21 right-shift (temp int) +0:21 Constant: +0:21 8 (const int) +0:21 Constant: +0:21 2 (const int) +0:21 Constant: +0:21 1 (const int) +0:22 move second child to first child (temp uint) +0:22 'u' (temp uint) +0:22 AtomicXor (temp uint) +0:22 indirect index (layout(row_major std430 ) buffer uint) +0:22 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:22 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:22 Constant: +0:22 0 (const uint) +0:22 right-shift (temp int) +0:22 Constant: +0:22 8 (const int) +0:22 Constant: +0:22 2 (const int) +0:22 Constant: +0:22 1 (const int) +0:24 Branch: Return with expression +0:24 Construct vec4 (temp 4-component vector of float) +0:24 Convert uint to float (temp float) +0:24 indirect index (layout(row_major std430 ) buffer uint) +0:24 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:24 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:24 Constant: +0:24 0 (const uint) +0:24 right-shift (temp int) +0:24 'pos' (in uint) +0:24 Constant: +0:24 2 (const int) +0:5 Function Definition: main( (temp void) +0:5 Function Parameters: +0:? Sequence +0:5 move second child to first child (temp uint) +0:? 'pos' (temp uint) +0:? 'pos' (layout(location=0 ) in uint) +0:5 move second child to first child (temp 4-component vector of float) +0:? '@entryPointOutput' (layout(location=0 ) out 4-component vector of float) +0:5 Function Call: @main(u1; (temp 4-component vector of float) +0:? 'pos' (temp uint) +0:? Linker Objects +0:? 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:? '@entryPointOutput' (layout(location=0 ) out 4-component vector of float) +0:? 'pos' (layout(location=0 ) in uint) + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 87 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 80 83 + ExecutionMode 4 OriginUpperLeft + Name 4 "main" + Name 12 "@main(u1;" + Name 11 "pos" + Name 15 "sbuf" + MemberName 15(sbuf) 0 "sbuf" + Name 17 "" + Name 29 "u" + Name 78 "pos" + Name 80 "pos" + Name 83 "@entryPointOutput" + Name 84 "param" + Decorate 14 ArrayStride 4 + MemberDecorate 15(sbuf) 0 Offset 0 + Decorate 15(sbuf) BufferBlock + Decorate 17 DescriptorSet 0 + Decorate 80(pos) Location 0 + Decorate 83(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypePointer Function 6(int) + 8: TypeFloat 32 + 9: TypeVector 8(float) 4 + 10: TypeFunction 9(fvec4) 7(ptr) + 14: TypeRuntimeArray 6(int) + 15(sbuf): TypeStruct 14 + 16: TypePointer Uniform 15(sbuf) + 17: 16(ptr) Variable Uniform + 18: TypeInt 32 1 + 19: 18(int) Constant 0 + 20: 18(int) Constant 8 + 21: 18(int) Constant 2 + 23: TypePointer Uniform 6(int) + 25: 18(int) Constant 1 + 26: 6(int) Constant 1 + 27: 6(int) Constant 0 + 79: TypePointer Input 6(int) + 80(pos): 79(ptr) Variable Input + 82: TypePointer Output 9(fvec4) +83(@entryPointOutput): 82(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 78(pos): 7(ptr) Variable Function + 84(param): 7(ptr) Variable Function + 81: 6(int) Load 80(pos) + Store 78(pos) 81 + 85: 6(int) Load 78(pos) + Store 84(param) 85 + 86: 9(fvec4) FunctionCall 12(@main(u1;) 84(param) + Store 83(@entryPointOutput) 86 + Return + FunctionEnd + 12(@main(u1;): 9(fvec4) Function None 10 + 11(pos): 7(ptr) FunctionParameter + 13: Label + 29(u): 7(ptr) Variable Function + 22: 18(int) ShiftRightArithmetic 20 21 + 24: 23(ptr) AccessChain 17 19 22 + 28: 2 AtomicIAdd 24 26 27 25 + 30: 18(int) ShiftRightArithmetic 20 21 + 31: 23(ptr) AccessChain 17 19 30 + 32: 6(int) AtomicIAdd 31 26 27 25 + Store 29(u) 32 + 33: 18(int) ShiftRightArithmetic 20 21 + 34: 23(ptr) AccessChain 17 19 33 + 35: 2 AtomicAnd 34 26 27 25 + 36: 18(int) ShiftRightArithmetic 20 21 + 37: 23(ptr) AccessChain 17 19 36 + 38: 6(int) AtomicAnd 37 26 27 25 + Store 29(u) 38 + 39: 18(int) ShiftRightArithmetic 20 21 + 40: 23(ptr) AccessChain 17 19 39 + 41: 18(int) AtomicCompareExchange 40 26 27 27 21 25 + 42: 6(int) Bitcast 41 + Store 29(u) 42 + 43: 18(int) ShiftRightArithmetic 20 21 + 44: 23(ptr) AccessChain 17 19 43 + 45: 6(int) AtomicExchange 44 26 27 25 + Store 29(u) 45 + 46: 18(int) ShiftRightArithmetic 20 21 + 47: 23(ptr) AccessChain 17 19 46 + 48: 2 AtomicSMax 47 26 27 25 + 49: 18(int) ShiftRightArithmetic 20 21 + 50: 23(ptr) AccessChain 17 19 49 + 51: 6(int) AtomicUMax 50 26 27 25 + Store 29(u) 51 + 52: 18(int) ShiftRightArithmetic 20 21 + 53: 23(ptr) AccessChain 17 19 52 + 54: 2 AtomicSMin 53 26 27 25 + 55: 18(int) ShiftRightArithmetic 20 21 + 56: 23(ptr) AccessChain 17 19 55 + 57: 6(int) AtomicUMin 56 26 27 25 + Store 29(u) 57 + 58: 18(int) ShiftRightArithmetic 20 21 + 59: 23(ptr) AccessChain 17 19 58 + 60: 2 AtomicOr 59 26 27 25 + 61: 18(int) ShiftRightArithmetic 20 21 + 62: 23(ptr) AccessChain 17 19 61 + 63: 6(int) AtomicOr 62 26 27 25 + Store 29(u) 63 + 64: 18(int) ShiftRightArithmetic 20 21 + 65: 23(ptr) AccessChain 17 19 64 + 66: 2 AtomicXor 65 26 27 25 + 67: 18(int) ShiftRightArithmetic 20 21 + 68: 23(ptr) AccessChain 17 19 67 + 69: 6(int) AtomicXor 68 26 27 25 + Store 29(u) 69 + 70: 6(int) Load 11(pos) + 71: 18(int) ShiftRightLogical 70 21 + 72: 23(ptr) AccessChain 17 19 71 + 73: 6(int) Load 72 + 74: 8(float) ConvertUToF 73 + 75: 9(fvec4) CompositeConstruct 74 74 74 74 + ReturnValue 75 + FunctionEnd diff --git a/Test/baseResults/hlsl.structbuffer.byte.frag.out b/Test/baseResults/hlsl.structbuffer.byte.frag.out new file mode 100644 index 0000000000000000000000000000000000000000..57e6f0cb108e4b6d51796f49e6d6ec0cdbcdce26 --- /dev/null +++ b/Test/baseResults/hlsl.structbuffer.byte.frag.out @@ -0,0 +1,476 @@ +hlsl.structbuffer.byte.frag +Shader version: 450 +gl_FragCoord origin is upper left +0:? Sequence +0:5 Function Definition: @main(u1; (temp 4-component vector of float) +0:5 Function Parameters: +0:5 'pos' (in uint) +0:? Sequence +0:7 Sequence +0:7 move second child to first child (temp uint) +0:7 'size' (temp uint) +0:7 array length (temp uint) +0:7 sbuf: direct index for structure (layout(row_major std430 ) readonly buffer implicitly-sized array of uint) +0:7 'anon@0' (layout(row_major std430 ) readonly buffer block{layout(row_major std430 ) readonly buffer implicitly-sized array of uint sbuf}) +0:7 Constant: +0:7 0 (const uint) +0:12 Branch: Return with expression +0:11 add (temp 4-component vector of float) +0:10 add (temp 4-component vector of float) +0:9 add (temp 4-component vector of float) +0:9 Convert uint to float (temp float) +0:9 indirect index (layout(row_major std430 ) readonly buffer uint) +0:9 sbuf: direct index for structure (layout(row_major std430 ) readonly buffer implicitly-sized array of uint) +0:9 'anon@0' (layout(row_major std430 ) readonly buffer block{layout(row_major std430 ) readonly buffer implicitly-sized array of uint sbuf}) +0:9 Constant: +0:9 0 (const uint) +0:9 right-shift (temp int) +0:9 'pos' (in uint) +0:9 Constant: +0:9 2 (const int) +0:? Construct vec4 (temp 4-component vector of float) +0:? Convert uint to float (temp 2-component vector of float) +0:? Sequence +0:10 move second child to first child (temp int) +0:10 'byteAddrTemp' (temp int) +0:10 right-shift (temp int) +0:10 add (temp uint) +0:10 'pos' (in uint) +0:10 Constant: +0:10 4 (const uint) +0:10 Constant: +0:10 2 (const int) +0:? Construct vec2 (temp 2-component vector of uint) +0:10 indirect index (temp float) +0:10 sbuf: direct index for structure (layout(row_major std430 ) readonly buffer implicitly-sized array of uint) +0:10 'anon@0' (layout(row_major std430 ) readonly buffer block{layout(row_major std430 ) readonly buffer implicitly-sized array of uint sbuf}) +0:10 Constant: +0:10 0 (const uint) +0:10 'byteAddrTemp' (temp int) +0:10 indirect index (temp float) +0:10 sbuf: direct index for structure (layout(row_major std430 ) readonly buffer implicitly-sized array of uint) +0:10 'anon@0' (layout(row_major std430 ) readonly buffer block{layout(row_major std430 ) readonly buffer implicitly-sized array of uint sbuf}) +0:10 Constant: +0:10 0 (const uint) +0:10 add (temp int) +0:10 'byteAddrTemp' (temp int) +0:10 Constant: +0:10 1 (const int) +0:10 Constant: +0:10 0.000000 +0:10 Constant: +0:10 0.000000 +0:? Construct vec4 (temp 4-component vector of float) +0:? Convert uint to float (temp 3-component vector of float) +0:? Sequence +0:11 move second child to first child (temp int) +0:11 'byteAddrTemp' (temp int) +0:11 right-shift (temp int) +0:11 add (temp uint) +0:11 'pos' (in uint) +0:11 Constant: +0:11 8 (const uint) +0:11 Constant: +0:11 2 (const int) +0:? Construct vec3 (temp 3-component vector of uint) +0:11 indirect index (temp float) +0:11 sbuf: direct index for structure (layout(row_major std430 ) readonly buffer implicitly-sized array of uint) +0:11 'anon@0' (layout(row_major std430 ) readonly buffer block{layout(row_major std430 ) readonly buffer implicitly-sized array of uint sbuf}) +0:11 Constant: +0:11 0 (const uint) +0:11 'byteAddrTemp' (temp int) +0:11 indirect index (temp float) +0:11 sbuf: direct index for structure (layout(row_major std430 ) readonly buffer implicitly-sized array of uint) +0:11 'anon@0' (layout(row_major std430 ) readonly buffer block{layout(row_major std430 ) readonly buffer implicitly-sized array of uint sbuf}) +0:11 Constant: +0:11 0 (const uint) +0:11 add (temp int) +0:11 'byteAddrTemp' (temp int) +0:11 Constant: +0:11 1 (const int) +0:11 indirect index (temp float) +0:11 sbuf: direct index for structure (layout(row_major std430 ) readonly buffer implicitly-sized array of uint) +0:11 'anon@0' (layout(row_major std430 ) readonly buffer block{layout(row_major std430 ) readonly buffer implicitly-sized array of uint sbuf}) +0:11 Constant: +0:11 0 (const uint) +0:11 add (temp int) +0:11 'byteAddrTemp' (temp int) +0:11 Constant: +0:11 2 (const int) +0:11 Constant: +0:11 0.000000 +0:? Convert uint to float (temp 4-component vector of float) +0:? Sequence +0:12 move second child to first child (temp int) +0:12 'byteAddrTemp' (temp int) +0:12 right-shift (temp int) +0:12 add (temp uint) +0:12 'pos' (in uint) +0:12 Constant: +0:12 12 (const uint) +0:12 Constant: +0:12 2 (const int) +0:? Construct vec4 (temp 4-component vector of uint) +0:12 indirect index (temp float) +0:12 sbuf: direct index for structure (layout(row_major std430 ) readonly buffer implicitly-sized array of uint) +0:12 'anon@0' (layout(row_major std430 ) readonly buffer block{layout(row_major std430 ) readonly buffer implicitly-sized array of uint sbuf}) +0:12 Constant: +0:12 0 (const uint) +0:12 'byteAddrTemp' (temp int) +0:12 indirect index (temp float) +0:12 sbuf: direct index for structure (layout(row_major std430 ) readonly buffer implicitly-sized array of uint) +0:12 'anon@0' (layout(row_major std430 ) readonly buffer block{layout(row_major std430 ) readonly buffer implicitly-sized array of uint sbuf}) +0:12 Constant: +0:12 0 (const uint) +0:12 add (temp int) +0:12 'byteAddrTemp' (temp int) +0:12 Constant: +0:12 1 (const int) +0:12 indirect index (temp float) +0:12 sbuf: direct index for structure (layout(row_major std430 ) readonly buffer implicitly-sized array of uint) +0:12 'anon@0' (layout(row_major std430 ) readonly buffer block{layout(row_major std430 ) readonly buffer implicitly-sized array of uint sbuf}) +0:12 Constant: +0:12 0 (const uint) +0:12 add (temp int) +0:12 'byteAddrTemp' (temp int) +0:12 Constant: +0:12 2 (const int) +0:12 indirect index (temp float) +0:12 sbuf: direct index for structure (layout(row_major std430 ) readonly buffer implicitly-sized array of uint) +0:12 'anon@0' (layout(row_major std430 ) readonly buffer block{layout(row_major std430 ) readonly buffer implicitly-sized array of uint sbuf}) +0:12 Constant: +0:12 0 (const uint) +0:12 add (temp int) +0:12 'byteAddrTemp' (temp int) +0:12 Constant: +0:12 3 (const int) +0:5 Function Definition: main( (temp void) +0:5 Function Parameters: +0:? Sequence +0:5 move second child to first child (temp uint) +0:? 'pos' (temp uint) +0:? 'pos' (layout(location=0 ) in uint) +0:5 move second child to first child (temp 4-component vector of float) +0:? '@entryPointOutput' (layout(location=0 ) out 4-component vector of float) +0:5 Function Call: @main(u1; (temp 4-component vector of float) +0:? 'pos' (temp uint) +0:? Linker Objects +0:? 'anon@0' (layout(row_major std430 ) readonly buffer block{layout(row_major std430 ) readonly buffer implicitly-sized array of uint sbuf}) +0:? '@entryPointOutput' (layout(location=0 ) out 4-component vector of float) +0:? 'pos' (layout(location=0 ) in uint) + + +Linked fragment stage: + + +Shader version: 450 +gl_FragCoord origin is upper left +0:? Sequence +0:5 Function Definition: @main(u1; (temp 4-component vector of float) +0:5 Function Parameters: +0:5 'pos' (in uint) +0:? Sequence +0:7 Sequence +0:7 move second child to first child (temp uint) +0:7 'size' (temp uint) +0:7 array length (temp uint) +0:7 sbuf: direct index for structure (layout(row_major std430 ) readonly buffer implicitly-sized array of uint) +0:7 'anon@0' (layout(row_major std430 ) readonly buffer block{layout(row_major std430 ) readonly buffer implicitly-sized array of uint sbuf}) +0:7 Constant: +0:7 0 (const uint) +0:12 Branch: Return with expression +0:11 add (temp 4-component vector of float) +0:10 add (temp 4-component vector of float) +0:9 add (temp 4-component vector of float) +0:9 Convert uint to float (temp float) +0:9 indirect index (layout(row_major std430 ) readonly buffer uint) +0:9 sbuf: direct index for structure (layout(row_major std430 ) readonly buffer implicitly-sized array of uint) +0:9 'anon@0' (layout(row_major std430 ) readonly buffer block{layout(row_major std430 ) readonly buffer implicitly-sized array of uint sbuf}) +0:9 Constant: +0:9 0 (const uint) +0:9 right-shift (temp int) +0:9 'pos' (in uint) +0:9 Constant: +0:9 2 (const int) +0:? Construct vec4 (temp 4-component vector of float) +0:? Convert uint to float (temp 2-component vector of float) +0:? Sequence +0:10 move second child to first child (temp int) +0:10 'byteAddrTemp' (temp int) +0:10 right-shift (temp int) +0:10 add (temp uint) +0:10 'pos' (in uint) +0:10 Constant: +0:10 4 (const uint) +0:10 Constant: +0:10 2 (const int) +0:? Construct vec2 (temp 2-component vector of uint) +0:10 indirect index (temp float) +0:10 sbuf: direct index for structure (layout(row_major std430 ) readonly buffer implicitly-sized array of uint) +0:10 'anon@0' (layout(row_major std430 ) readonly buffer block{layout(row_major std430 ) readonly buffer implicitly-sized array of uint sbuf}) +0:10 Constant: +0:10 0 (const uint) +0:10 'byteAddrTemp' (temp int) +0:10 indirect index (temp float) +0:10 sbuf: direct index for structure (layout(row_major std430 ) readonly buffer implicitly-sized array of uint) +0:10 'anon@0' (layout(row_major std430 ) readonly buffer block{layout(row_major std430 ) readonly buffer implicitly-sized array of uint sbuf}) +0:10 Constant: +0:10 0 (const uint) +0:10 add (temp int) +0:10 'byteAddrTemp' (temp int) +0:10 Constant: +0:10 1 (const int) +0:10 Constant: +0:10 0.000000 +0:10 Constant: +0:10 0.000000 +0:? Construct vec4 (temp 4-component vector of float) +0:? Convert uint to float (temp 3-component vector of float) +0:? Sequence +0:11 move second child to first child (temp int) +0:11 'byteAddrTemp' (temp int) +0:11 right-shift (temp int) +0:11 add (temp uint) +0:11 'pos' (in uint) +0:11 Constant: +0:11 8 (const uint) +0:11 Constant: +0:11 2 (const int) +0:? Construct vec3 (temp 3-component vector of uint) +0:11 indirect index (temp float) +0:11 sbuf: direct index for structure (layout(row_major std430 ) readonly buffer implicitly-sized array of uint) +0:11 'anon@0' (layout(row_major std430 ) readonly buffer block{layout(row_major std430 ) readonly buffer implicitly-sized array of uint sbuf}) +0:11 Constant: +0:11 0 (const uint) +0:11 'byteAddrTemp' (temp int) +0:11 indirect index (temp float) +0:11 sbuf: direct index for structure (layout(row_major std430 ) readonly buffer implicitly-sized array of uint) +0:11 'anon@0' (layout(row_major std430 ) readonly buffer block{layout(row_major std430 ) readonly buffer implicitly-sized array of uint sbuf}) +0:11 Constant: +0:11 0 (const uint) +0:11 add (temp int) +0:11 'byteAddrTemp' (temp int) +0:11 Constant: +0:11 1 (const int) +0:11 indirect index (temp float) +0:11 sbuf: direct index for structure (layout(row_major std430 ) readonly buffer implicitly-sized array of uint) +0:11 'anon@0' (layout(row_major std430 ) readonly buffer block{layout(row_major std430 ) readonly buffer implicitly-sized array of uint sbuf}) +0:11 Constant: +0:11 0 (const uint) +0:11 add (temp int) +0:11 'byteAddrTemp' (temp int) +0:11 Constant: +0:11 2 (const int) +0:11 Constant: +0:11 0.000000 +0:? Convert uint to float (temp 4-component vector of float) +0:? Sequence +0:12 move second child to first child (temp int) +0:12 'byteAddrTemp' (temp int) +0:12 right-shift (temp int) +0:12 add (temp uint) +0:12 'pos' (in uint) +0:12 Constant: +0:12 12 (const uint) +0:12 Constant: +0:12 2 (const int) +0:? Construct vec4 (temp 4-component vector of uint) +0:12 indirect index (temp float) +0:12 sbuf: direct index for structure (layout(row_major std430 ) readonly buffer implicitly-sized array of uint) +0:12 'anon@0' (layout(row_major std430 ) readonly buffer block{layout(row_major std430 ) readonly buffer implicitly-sized array of uint sbuf}) +0:12 Constant: +0:12 0 (const uint) +0:12 'byteAddrTemp' (temp int) +0:12 indirect index (temp float) +0:12 sbuf: direct index for structure (layout(row_major std430 ) readonly buffer implicitly-sized array of uint) +0:12 'anon@0' (layout(row_major std430 ) readonly buffer block{layout(row_major std430 ) readonly buffer implicitly-sized array of uint sbuf}) +0:12 Constant: +0:12 0 (const uint) +0:12 add (temp int) +0:12 'byteAddrTemp' (temp int) +0:12 Constant: +0:12 1 (const int) +0:12 indirect index (temp float) +0:12 sbuf: direct index for structure (layout(row_major std430 ) readonly buffer implicitly-sized array of uint) +0:12 'anon@0' (layout(row_major std430 ) readonly buffer block{layout(row_major std430 ) readonly buffer implicitly-sized array of uint sbuf}) +0:12 Constant: +0:12 0 (const uint) +0:12 add (temp int) +0:12 'byteAddrTemp' (temp int) +0:12 Constant: +0:12 2 (const int) +0:12 indirect index (temp float) +0:12 sbuf: direct index for structure (layout(row_major std430 ) readonly buffer implicitly-sized array of uint) +0:12 'anon@0' (layout(row_major std430 ) readonly buffer block{layout(row_major std430 ) readonly buffer implicitly-sized array of uint sbuf}) +0:12 Constant: +0:12 0 (const uint) +0:12 add (temp int) +0:12 'byteAddrTemp' (temp int) +0:12 Constant: +0:12 3 (const int) +0:5 Function Definition: main( (temp void) +0:5 Function Parameters: +0:? Sequence +0:5 move second child to first child (temp uint) +0:? 'pos' (temp uint) +0:? 'pos' (layout(location=0 ) in uint) +0:5 move second child to first child (temp 4-component vector of float) +0:? '@entryPointOutput' (layout(location=0 ) out 4-component vector of float) +0:5 Function Call: @main(u1; (temp 4-component vector of float) +0:? 'pos' (temp uint) +0:? Linker Objects +0:? 'anon@0' (layout(row_major std430 ) readonly buffer block{layout(row_major std430 ) readonly buffer implicitly-sized array of uint sbuf}) +0:? '@entryPointOutput' (layout(location=0 ) out 4-component vector of float) +0:? 'pos' (layout(location=0 ) in uint) + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 114 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 107 110 + ExecutionMode 4 OriginUpperLeft + Name 4 "main" + Name 12 "@main(u1;" + Name 11 "pos" + Name 14 "size" + Name 16 "sbuf" + MemberName 16(sbuf) 0 "sbuf" + Name 18 "" + Name 30 "byteAddrTemp" + Name 53 "byteAddrTemp" + Name 78 "byteAddrTemp" + Name 105 "pos" + Name 107 "pos" + Name 110 "@entryPointOutput" + Name 111 "param" + Decorate 15 ArrayStride 4 + MemberDecorate 16(sbuf) 0 NonWritable + MemberDecorate 16(sbuf) 0 Offset 0 + Decorate 16(sbuf) BufferBlock + Decorate 18 DescriptorSet 0 + Decorate 107(pos) Location 0 + Decorate 110(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypePointer Function 6(int) + 8: TypeFloat 32 + 9: TypeVector 8(float) 4 + 10: TypeFunction 9(fvec4) 7(ptr) + 15: TypeRuntimeArray 6(int) + 16(sbuf): TypeStruct 15 + 17: TypePointer Uniform 16(sbuf) + 18: 17(ptr) Variable Uniform + 19: TypeInt 32 1 + 21: 19(int) Constant 0 + 23: 19(int) Constant 2 + 25: TypePointer Uniform 6(int) + 29: TypePointer Function 19(int) + 32: 6(int) Constant 4 + 39: 19(int) Constant 1 + 43: TypeVector 6(int) 2 + 45: TypeVector 8(float) 2 + 47: 8(float) Constant 0 + 55: 6(int) Constant 8 + 69: TypeVector 6(int) 3 + 71: TypeVector 8(float) 3 + 80: 6(int) Constant 12 + 95: 19(int) Constant 3 + 99: TypeVector 6(int) 4 + 106: TypePointer Input 6(int) + 107(pos): 106(ptr) Variable Input + 109: TypePointer Output 9(fvec4) +110(@entryPointOutput): 109(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 105(pos): 7(ptr) Variable Function + 111(param): 7(ptr) Variable Function + 108: 6(int) Load 107(pos) + Store 105(pos) 108 + 112: 6(int) Load 105(pos) + Store 111(param) 112 + 113: 9(fvec4) FunctionCall 12(@main(u1;) 111(param) + Store 110(@entryPointOutput) 113 + Return + FunctionEnd + 12(@main(u1;): 9(fvec4) Function None 10 + 11(pos): 7(ptr) FunctionParameter + 13: Label + 14(size): 7(ptr) Variable Function +30(byteAddrTemp): 29(ptr) Variable Function +53(byteAddrTemp): 29(ptr) Variable Function +78(byteAddrTemp): 29(ptr) Variable Function + 20: 19(int) ArrayLength 18 0 + Store 14(size) 20 + 22: 6(int) Load 11(pos) + 24: 19(int) ShiftRightLogical 22 23 + 26: 25(ptr) AccessChain 18 21 24 + 27: 6(int) Load 26 + 28: 8(float) ConvertUToF 27 + 31: 6(int) Load 11(pos) + 33: 6(int) IAdd 31 32 + 34: 19(int) ShiftRightLogical 33 23 + Store 30(byteAddrTemp) 34 + 35: 19(int) Load 30(byteAddrTemp) + 36: 25(ptr) AccessChain 18 21 35 + 37: 6(int) Load 36 + 38: 19(int) Load 30(byteAddrTemp) + 40: 19(int) IAdd 38 39 + 41: 25(ptr) AccessChain 18 21 40 + 42: 6(int) Load 41 + 44: 43(ivec2) CompositeConstruct 37 42 + 46: 45(fvec2) ConvertUToF 44 + 48: 8(float) CompositeExtract 46 0 + 49: 8(float) CompositeExtract 46 1 + 50: 9(fvec4) CompositeConstruct 48 49 47 47 + 51: 9(fvec4) CompositeConstruct 28 28 28 28 + 52: 9(fvec4) FAdd 51 50 + 54: 6(int) Load 11(pos) + 56: 6(int) IAdd 54 55 + 57: 19(int) ShiftRightLogical 56 23 + Store 53(byteAddrTemp) 57 + 58: 19(int) Load 53(byteAddrTemp) + 59: 25(ptr) AccessChain 18 21 58 + 60: 6(int) Load 59 + 61: 19(int) Load 53(byteAddrTemp) + 62: 19(int) IAdd 61 39 + 63: 25(ptr) AccessChain 18 21 62 + 64: 6(int) Load 63 + 65: 19(int) Load 53(byteAddrTemp) + 66: 19(int) IAdd 65 23 + 67: 25(ptr) AccessChain 18 21 66 + 68: 6(int) Load 67 + 70: 69(ivec3) CompositeConstruct 60 64 68 + 72: 71(fvec3) ConvertUToF 70 + 73: 8(float) CompositeExtract 72 0 + 74: 8(float) CompositeExtract 72 1 + 75: 8(float) CompositeExtract 72 2 + 76: 9(fvec4) CompositeConstruct 73 74 75 47 + 77: 9(fvec4) FAdd 52 76 + 79: 6(int) Load 11(pos) + 81: 6(int) IAdd 79 80 + 82: 19(int) ShiftRightLogical 81 23 + Store 78(byteAddrTemp) 82 + 83: 19(int) Load 78(byteAddrTemp) + 84: 25(ptr) AccessChain 18 21 83 + 85: 6(int) Load 84 + 86: 19(int) Load 78(byteAddrTemp) + 87: 19(int) IAdd 86 39 + 88: 25(ptr) AccessChain 18 21 87 + 89: 6(int) Load 88 + 90: 19(int) Load 78(byteAddrTemp) + 91: 19(int) IAdd 90 23 + 92: 25(ptr) AccessChain 18 21 91 + 93: 6(int) Load 92 + 94: 19(int) Load 78(byteAddrTemp) + 96: 19(int) IAdd 94 95 + 97: 25(ptr) AccessChain 18 21 96 + 98: 6(int) Load 97 + 100: 99(ivec4) CompositeConstruct 85 89 93 98 + 101: 9(fvec4) ConvertUToF 100 + 102: 9(fvec4) FAdd 77 101 + ReturnValue 102 + FunctionEnd diff --git a/Test/baseResults/hlsl.structbuffer.coherent.frag.out b/Test/baseResults/hlsl.structbuffer.coherent.frag.out new file mode 100644 index 0000000000000000000000000000000000000000..56b5abb3f0844304ce83fa55e86349b9f43ec070 --- /dev/null +++ b/Test/baseResults/hlsl.structbuffer.coherent.frag.out @@ -0,0 +1,308 @@ +hlsl.structbuffer.coherent.frag +Shader version: 450 +gl_FragCoord origin is upper left +0:? Sequence +0:12 Function Definition: @main(u1; (temp 4-component vector of float) +0:12 Function Parameters: +0:12 'pos' (in uint) +0:? Sequence +0:13 move second child to first child (temp float) +0:13 indirect index (layout(row_major std430 ) coherent temp float) +0:13 sbuf2: direct index for structure (layout(row_major std430 ) coherent buffer implicitly-sized array of float) +0:13 'anon@1' (layout(row_major std430 ) coherent buffer block{layout(row_major std430 ) coherent buffer implicitly-sized array of float sbuf2}) +0:13 Constant: +0:13 0 (const uint) +0:13 add (temp uint) +0:13 'pos' (in uint) +0:13 Constant: +0:13 1 (const uint) +0:13 Constant: +0:13 42.000000 +0:17 Sequence +0:17 move second child to first child (temp uint) +0:17 'size' (temp uint) +0:17 array length (temp uint) +0:17 sbuf: direct index for structure (layout(row_major std430 ) coherent buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test}) +0:17 'anon@0' (layout(row_major std430 ) coherent buffer block{layout(row_major std430 ) coherent buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test} sbuf}) +0:17 Constant: +0:17 0 (const uint) +0:17 move second child to first child (temp uint) +0:17 'stride' (temp uint) +0:17 Constant: +0:17 16 (const uint) +0:19 Test condition and select (temp void) +0:19 Condition +0:19 test: direct index for structure (temp bool) +0:19 indirect index (layout(row_major std430 ) coherent temp structure{temp 3-component vector of float color, temp bool test}) +0:19 sbuf: direct index for structure (layout(row_major std430 ) coherent buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test}) +0:19 'anon@0' (layout(row_major std430 ) coherent buffer block{layout(row_major std430 ) coherent buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test} sbuf}) +0:19 Constant: +0:19 0 (const uint) +0:19 'pos' (in uint) +0:19 Constant: +0:19 1 (const int) +0:19 true case +0:20 Branch: Return with expression +0:? Construct vec4 (temp 4-component vector of float) +0:20 add (temp 3-component vector of float) +0:20 color: direct index for structure (temp 3-component vector of float) +0:20 indirect index (layout(row_major std430 ) coherent temp structure{temp 3-component vector of float color, temp bool test}) +0:20 sbuf: direct index for structure (layout(row_major std430 ) coherent buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test}) +0:20 'anon@0' (layout(row_major std430 ) coherent buffer block{layout(row_major std430 ) coherent buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test} sbuf}) +0:20 Constant: +0:20 0 (const uint) +0:20 'pos' (in uint) +0:20 Constant: +0:20 0 (const int) +0:20 indirect index (layout(row_major std430 ) coherent temp float) +0:20 sbuf2: direct index for structure (layout(row_major std430 ) coherent buffer implicitly-sized array of float) +0:20 'anon@1' (layout(row_major std430 ) coherent buffer block{layout(row_major std430 ) coherent buffer implicitly-sized array of float sbuf2}) +0:20 Constant: +0:20 0 (const uint) +0:20 'pos' (in uint) +0:20 Constant: +0:20 0.000000 +0:19 false case +0:22 Branch: Return with expression +0:22 Construct vec4 (temp 4-component vector of float) +0:22 Convert uint to float (temp float) +0:22 add (temp uint) +0:22 'size' (temp uint) +0:22 'stride' (temp uint) +0:12 Function Definition: main( (temp void) +0:12 Function Parameters: +0:? Sequence +0:12 move second child to first child (temp uint) +0:? 'pos' (temp uint) +0:? 'pos' (layout(location=0 ) in uint) +0:12 move second child to first child (temp 4-component vector of float) +0:? '@entryPointOutput' (layout(location=0 ) out 4-component vector of float) +0:12 Function Call: @main(u1; (temp 4-component vector of float) +0:? 'pos' (temp uint) +0:? Linker Objects +0:? 'anon@0' (layout(row_major std430 ) coherent buffer block{layout(row_major std430 ) coherent buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test} sbuf}) +0:? 'anon@1' (layout(row_major std430 ) coherent buffer block{layout(row_major std430 ) coherent buffer implicitly-sized array of float sbuf2}) +0:? '@entryPointOutput' (layout(location=0 ) out 4-component vector of float) +0:? 'pos' (layout(location=0 ) in uint) + + +Linked fragment stage: + + +Shader version: 450 +gl_FragCoord origin is upper left +0:? Sequence +0:12 Function Definition: @main(u1; (temp 4-component vector of float) +0:12 Function Parameters: +0:12 'pos' (in uint) +0:? Sequence +0:13 move second child to first child (temp float) +0:13 indirect index (layout(row_major std430 ) coherent temp float) +0:13 sbuf2: direct index for structure (layout(row_major std430 ) coherent buffer implicitly-sized array of float) +0:13 'anon@1' (layout(row_major std430 ) coherent buffer block{layout(row_major std430 ) coherent buffer implicitly-sized array of float sbuf2}) +0:13 Constant: +0:13 0 (const uint) +0:13 add (temp uint) +0:13 'pos' (in uint) +0:13 Constant: +0:13 1 (const uint) +0:13 Constant: +0:13 42.000000 +0:17 Sequence +0:17 move second child to first child (temp uint) +0:17 'size' (temp uint) +0:17 array length (temp uint) +0:17 sbuf: direct index for structure (layout(row_major std430 ) coherent buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test}) +0:17 'anon@0' (layout(row_major std430 ) coherent buffer block{layout(row_major std430 ) coherent buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test} sbuf}) +0:17 Constant: +0:17 0 (const uint) +0:17 move second child to first child (temp uint) +0:17 'stride' (temp uint) +0:17 Constant: +0:17 16 (const uint) +0:19 Test condition and select (temp void) +0:19 Condition +0:19 test: direct index for structure (temp bool) +0:19 indirect index (layout(row_major std430 ) coherent temp structure{temp 3-component vector of float color, temp bool test}) +0:19 sbuf: direct index for structure (layout(row_major std430 ) coherent buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test}) +0:19 'anon@0' (layout(row_major std430 ) coherent buffer block{layout(row_major std430 ) coherent buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test} sbuf}) +0:19 Constant: +0:19 0 (const uint) +0:19 'pos' (in uint) +0:19 Constant: +0:19 1 (const int) +0:19 true case +0:20 Branch: Return with expression +0:? Construct vec4 (temp 4-component vector of float) +0:20 add (temp 3-component vector of float) +0:20 color: direct index for structure (temp 3-component vector of float) +0:20 indirect index (layout(row_major std430 ) coherent temp structure{temp 3-component vector of float color, temp bool test}) +0:20 sbuf: direct index for structure (layout(row_major std430 ) coherent buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test}) +0:20 'anon@0' (layout(row_major std430 ) coherent buffer block{layout(row_major std430 ) coherent buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test} sbuf}) +0:20 Constant: +0:20 0 (const uint) +0:20 'pos' (in uint) +0:20 Constant: +0:20 0 (const int) +0:20 indirect index (layout(row_major std430 ) coherent temp float) +0:20 sbuf2: direct index for structure (layout(row_major std430 ) coherent buffer implicitly-sized array of float) +0:20 'anon@1' (layout(row_major std430 ) coherent buffer block{layout(row_major std430 ) coherent buffer implicitly-sized array of float sbuf2}) +0:20 Constant: +0:20 0 (const uint) +0:20 'pos' (in uint) +0:20 Constant: +0:20 0.000000 +0:19 false case +0:22 Branch: Return with expression +0:22 Construct vec4 (temp 4-component vector of float) +0:22 Convert uint to float (temp float) +0:22 add (temp uint) +0:22 'size' (temp uint) +0:22 'stride' (temp uint) +0:12 Function Definition: main( (temp void) +0:12 Function Parameters: +0:? Sequence +0:12 move second child to first child (temp uint) +0:? 'pos' (temp uint) +0:? 'pos' (layout(location=0 ) in uint) +0:12 move second child to first child (temp 4-component vector of float) +0:? '@entryPointOutput' (layout(location=0 ) out 4-component vector of float) +0:12 Function Call: @main(u1; (temp 4-component vector of float) +0:? 'pos' (temp uint) +0:? Linker Objects +0:? 'anon@0' (layout(row_major std430 ) coherent buffer block{layout(row_major std430 ) coherent buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test} sbuf}) +0:? 'anon@1' (layout(row_major std430 ) coherent buffer block{layout(row_major std430 ) coherent buffer implicitly-sized array of float sbuf2}) +0:? '@entryPointOutput' (layout(location=0 ) out 4-component vector of float) +0:? 'pos' (layout(location=0 ) in uint) + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 78 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 71 74 + ExecutionMode 4 OriginUpperLeft + Name 4 "main" + Name 12 "@main(u1;" + Name 11 "pos" + Name 15 "sbuf2" + MemberName 15(sbuf2) 0 "sbuf2" + Name 17 "" + Name 26 "size" + Name 28 "sb_t" + MemberName 28(sb_t) 0 "color" + MemberName 28(sb_t) 1 "test" + Name 30 "sbuf" + MemberName 30(sbuf) 0 "sbuf" + Name 32 "" + Name 34 "stride" + Name 69 "pos" + Name 71 "pos" + Name 74 "@entryPointOutput" + Name 75 "param" + Decorate 14 ArrayStride 4 + MemberDecorate 15(sbuf2) 0 Coherent + MemberDecorate 15(sbuf2) 0 Offset 0 + Decorate 15(sbuf2) BufferBlock + Decorate 17 DescriptorSet 0 + MemberDecorate 28(sb_t) 0 Coherent + MemberDecorate 28(sb_t) 0 Offset 0 + MemberDecorate 28(sb_t) 1 Coherent + MemberDecorate 28(sb_t) 1 Offset 12 + Decorate 29 ArrayStride 16 + MemberDecorate 30(sbuf) 0 Coherent + MemberDecorate 30(sbuf) 0 Offset 0 + Decorate 30(sbuf) BufferBlock + Decorate 32 DescriptorSet 0 + Decorate 71(pos) Location 0 + Decorate 74(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypePointer Function 6(int) + 8: TypeFloat 32 + 9: TypeVector 8(float) 4 + 10: TypeFunction 9(fvec4) 7(ptr) + 14: TypeRuntimeArray 8(float) + 15(sbuf2): TypeStruct 14 + 16: TypePointer Uniform 15(sbuf2) + 17: 16(ptr) Variable Uniform + 18: TypeInt 32 1 + 19: 18(int) Constant 0 + 21: 6(int) Constant 1 + 23: 8(float) Constant 1109917696 + 24: TypePointer Uniform 8(float) + 27: TypeVector 8(float) 3 + 28(sb_t): TypeStruct 27(fvec3) 6(int) + 29: TypeRuntimeArray 28(sb_t) + 30(sbuf): TypeStruct 29 + 31: TypePointer Uniform 30(sbuf) + 32: 31(ptr) Variable Uniform + 35: 6(int) Constant 16 + 37: 18(int) Constant 1 + 38: TypePointer Uniform 6(int) + 41: TypeBool + 42: 6(int) Constant 0 + 47: TypePointer Uniform 27(fvec3) + 55: 8(float) Constant 0 + 70: TypePointer Input 6(int) + 71(pos): 70(ptr) Variable Input + 73: TypePointer Output 9(fvec4) +74(@entryPointOutput): 73(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 69(pos): 7(ptr) Variable Function + 75(param): 7(ptr) Variable Function + 72: 6(int) Load 71(pos) + Store 69(pos) 72 + 76: 6(int) Load 69(pos) + Store 75(param) 76 + 77: 9(fvec4) FunctionCall 12(@main(u1;) 75(param) + Store 74(@entryPointOutput) 77 + Return + FunctionEnd + 12(@main(u1;): 9(fvec4) Function None 10 + 11(pos): 7(ptr) FunctionParameter + 13: Label + 26(size): 7(ptr) Variable Function + 34(stride): 7(ptr) Variable Function + 20: 6(int) Load 11(pos) + 22: 6(int) IAdd 20 21 + 25: 24(ptr) AccessChain 17 19 22 + Store 25 23 + 33: 18(int) ArrayLength 32 0 + Store 26(size) 33 + Store 34(stride) 35 + 36: 6(int) Load 11(pos) + 39: 38(ptr) AccessChain 32 19 36 37 + 40: 6(int) Load 39 + 43: 41(bool) INotEqual 40 42 + SelectionMerge 45 None + BranchConditional 43 44 61 + 44: Label + 46: 6(int) Load 11(pos) + 48: 47(ptr) AccessChain 32 19 46 19 + 49: 27(fvec3) Load 48 + 50: 6(int) Load 11(pos) + 51: 24(ptr) AccessChain 17 19 50 + 52: 8(float) Load 51 + 53: 27(fvec3) CompositeConstruct 52 52 52 + 54: 27(fvec3) FAdd 49 53 + 56: 8(float) CompositeExtract 54 0 + 57: 8(float) CompositeExtract 54 1 + 58: 8(float) CompositeExtract 54 2 + 59: 9(fvec4) CompositeConstruct 56 57 58 55 + ReturnValue 59 + 61: Label + 62: 6(int) Load 26(size) + 63: 6(int) Load 34(stride) + 64: 6(int) IAdd 62 63 + 65: 8(float) ConvertUToF 64 + 66: 9(fvec4) CompositeConstruct 65 65 65 65 + ReturnValue 66 + 45: Label + 68: 9(fvec4) Undef + ReturnValue 68 + FunctionEnd diff --git a/Test/baseResults/hlsl.structbuffer.frag.out b/Test/baseResults/hlsl.structbuffer.frag.out new file mode 100644 index 0000000000000000000000000000000000000000..75edf55dee0f464e499590d8e2657dad046a4b7e --- /dev/null +++ b/Test/baseResults/hlsl.structbuffer.frag.out @@ -0,0 +1,347 @@ +hlsl.structbuffer.frag +Shader version: 450 +gl_FragCoord origin is upper left +0:? Sequence +0:12 Function Definition: @main(u1; (temp 4-component vector of float) +0:12 Function Parameters: +0:12 'pos' (in uint) +0:? Sequence +0:13 Sequence +0:13 move second child to first child (temp structure{temp 3-component vector of float color, temp bool test, temp bool test2}) +0:13 'mydata' (temp structure{temp 3-component vector of float color, temp bool test, temp bool test2}) +0:13 indirect index (layout(binding=10 row_major std430 ) readonly buffer structure{temp 3-component vector of float color, temp bool test, temp bool test2}) +0:13 sbuf: direct index for structure (layout(binding=10 row_major std430 ) readonly buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test, temp bool test2}) +0:13 'anon@0' (layout(binding=10 row_major std430 ) readonly buffer block{layout(binding=10 row_major std430 ) readonly buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test, temp bool test2} sbuf}) +0:13 Constant: +0:13 0 (const uint) +0:13 'pos' (in uint) +0:17 Sequence +0:17 move second child to first child (temp uint) +0:17 'size' (temp uint) +0:17 array length (temp uint) +0:17 sbuf: direct index for structure (layout(binding=10 row_major std430 ) readonly buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test, temp bool test2}) +0:17 'anon@0' (layout(binding=10 row_major std430 ) readonly buffer block{layout(binding=10 row_major std430 ) readonly buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test, temp bool test2} sbuf}) +0:17 Constant: +0:17 0 (const uint) +0:17 move second child to first child (temp uint) +0:17 'stride' (temp uint) +0:17 Constant: +0:17 32 (const uint) +0:19 Test condition and select (temp void) +0:19 Condition +0:19 test: direct index for structure (temp bool) +0:19 indirect index (layout(binding=10 row_major std430 ) readonly temp structure{temp 3-component vector of float color, temp bool test, temp bool test2}) +0:19 sbuf: direct index for structure (layout(binding=10 row_major std430 ) readonly buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test, temp bool test2}) +0:19 'anon@0' (layout(binding=10 row_major std430 ) readonly buffer block{layout(binding=10 row_major std430 ) readonly buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test, temp bool test2} sbuf}) +0:19 Constant: +0:19 0 (const uint) +0:19 'pos' (in uint) +0:19 Constant: +0:19 1 (const int) +0:19 true case +0:20 Branch: Return with expression +0:? Construct vec4 (temp 4-component vector of float) +0:20 add (temp 3-component vector of float) +0:20 color: direct index for structure (temp 3-component vector of float) +0:20 indirect index (layout(binding=10 row_major std430 ) readonly temp structure{temp 3-component vector of float color, temp bool test, temp bool test2}) +0:20 sbuf: direct index for structure (layout(binding=10 row_major std430 ) readonly buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test, temp bool test2}) +0:20 'anon@0' (layout(binding=10 row_major std430 ) readonly buffer block{layout(binding=10 row_major std430 ) readonly buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test, temp bool test2} sbuf}) +0:20 Constant: +0:20 0 (const uint) +0:20 'pos' (in uint) +0:20 Constant: +0:20 0 (const int) +0:20 indirect index (layout(row_major std430 ) readonly temp float) +0:20 sbuf2: direct index for structure (layout(row_major std430 ) readonly buffer implicitly-sized array of float) +0:20 'anon@1' (layout(row_major std430 ) readonly buffer block{layout(row_major std430 ) readonly buffer implicitly-sized array of float sbuf2}) +0:20 Constant: +0:20 0 (const uint) +0:20 'pos' (in uint) +0:20 Constant: +0:20 0.000000 +0:19 false case +0:22 Branch: Return with expression +0:22 Construct vec4 (temp 4-component vector of float) +0:22 add (temp float) +0:22 add (temp float) +0:22 direct index (temp float) +0:22 color: direct index for structure (temp 3-component vector of float) +0:22 'mydata' (temp structure{temp 3-component vector of float color, temp bool test, temp bool test2}) +0:22 Constant: +0:22 0 (const int) +0:22 Constant: +0:22 0 (const int) +0:22 Convert uint to float (temp float) +0:22 'size' (temp uint) +0:22 Convert uint to float (temp float) +0:22 'stride' (temp uint) +0:12 Function Definition: main( (temp void) +0:12 Function Parameters: +0:? Sequence +0:12 move second child to first child (temp uint) +0:? 'pos' (temp uint) +0:? 'pos' (layout(location=0 ) in uint) +0:12 move second child to first child (temp 4-component vector of float) +0:? '@entryPointOutput' (layout(location=0 ) out 4-component vector of float) +0:12 Function Call: @main(u1; (temp 4-component vector of float) +0:? 'pos' (temp uint) +0:? Linker Objects +0:? 'anon@0' (layout(binding=10 row_major std430 ) readonly buffer block{layout(binding=10 row_major std430 ) readonly buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test, temp bool test2} sbuf}) +0:? 'anon@1' (layout(row_major std430 ) readonly buffer block{layout(row_major std430 ) readonly buffer implicitly-sized array of float sbuf2}) +0:? '@entryPointOutput' (layout(location=0 ) out 4-component vector of float) +0:? 'pos' (layout(location=0 ) in uint) + + +Linked fragment stage: + + +Shader version: 450 +gl_FragCoord origin is upper left +0:? Sequence +0:12 Function Definition: @main(u1; (temp 4-component vector of float) +0:12 Function Parameters: +0:12 'pos' (in uint) +0:? Sequence +0:13 Sequence +0:13 move second child to first child (temp structure{temp 3-component vector of float color, temp bool test, temp bool test2}) +0:13 'mydata' (temp structure{temp 3-component vector of float color, temp bool test, temp bool test2}) +0:13 indirect index (layout(binding=10 row_major std430 ) readonly buffer structure{temp 3-component vector of float color, temp bool test, temp bool test2}) +0:13 sbuf: direct index for structure (layout(binding=10 row_major std430 ) readonly buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test, temp bool test2}) +0:13 'anon@0' (layout(binding=10 row_major std430 ) readonly buffer block{layout(binding=10 row_major std430 ) readonly buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test, temp bool test2} sbuf}) +0:13 Constant: +0:13 0 (const uint) +0:13 'pos' (in uint) +0:17 Sequence +0:17 move second child to first child (temp uint) +0:17 'size' (temp uint) +0:17 array length (temp uint) +0:17 sbuf: direct index for structure (layout(binding=10 row_major std430 ) readonly buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test, temp bool test2}) +0:17 'anon@0' (layout(binding=10 row_major std430 ) readonly buffer block{layout(binding=10 row_major std430 ) readonly buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test, temp bool test2} sbuf}) +0:17 Constant: +0:17 0 (const uint) +0:17 move second child to first child (temp uint) +0:17 'stride' (temp uint) +0:17 Constant: +0:17 32 (const uint) +0:19 Test condition and select (temp void) +0:19 Condition +0:19 test: direct index for structure (temp bool) +0:19 indirect index (layout(binding=10 row_major std430 ) readonly temp structure{temp 3-component vector of float color, temp bool test, temp bool test2}) +0:19 sbuf: direct index for structure (layout(binding=10 row_major std430 ) readonly buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test, temp bool test2}) +0:19 'anon@0' (layout(binding=10 row_major std430 ) readonly buffer block{layout(binding=10 row_major std430 ) readonly buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test, temp bool test2} sbuf}) +0:19 Constant: +0:19 0 (const uint) +0:19 'pos' (in uint) +0:19 Constant: +0:19 1 (const int) +0:19 true case +0:20 Branch: Return with expression +0:? Construct vec4 (temp 4-component vector of float) +0:20 add (temp 3-component vector of float) +0:20 color: direct index for structure (temp 3-component vector of float) +0:20 indirect index (layout(binding=10 row_major std430 ) readonly temp structure{temp 3-component vector of float color, temp bool test, temp bool test2}) +0:20 sbuf: direct index for structure (layout(binding=10 row_major std430 ) readonly buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test, temp bool test2}) +0:20 'anon@0' (layout(binding=10 row_major std430 ) readonly buffer block{layout(binding=10 row_major std430 ) readonly buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test, temp bool test2} sbuf}) +0:20 Constant: +0:20 0 (const uint) +0:20 'pos' (in uint) +0:20 Constant: +0:20 0 (const int) +0:20 indirect index (layout(row_major std430 ) readonly temp float) +0:20 sbuf2: direct index for structure (layout(row_major std430 ) readonly buffer implicitly-sized array of float) +0:20 'anon@1' (layout(row_major std430 ) readonly buffer block{layout(row_major std430 ) readonly buffer implicitly-sized array of float sbuf2}) +0:20 Constant: +0:20 0 (const uint) +0:20 'pos' (in uint) +0:20 Constant: +0:20 0.000000 +0:19 false case +0:22 Branch: Return with expression +0:22 Construct vec4 (temp 4-component vector of float) +0:22 add (temp float) +0:22 add (temp float) +0:22 direct index (temp float) +0:22 color: direct index for structure (temp 3-component vector of float) +0:22 'mydata' (temp structure{temp 3-component vector of float color, temp bool test, temp bool test2}) +0:22 Constant: +0:22 0 (const int) +0:22 Constant: +0:22 0 (const int) +0:22 Convert uint to float (temp float) +0:22 'size' (temp uint) +0:22 Convert uint to float (temp float) +0:22 'stride' (temp uint) +0:12 Function Definition: main( (temp void) +0:12 Function Parameters: +0:? Sequence +0:12 move second child to first child (temp uint) +0:? 'pos' (temp uint) +0:? 'pos' (layout(location=0 ) in uint) +0:12 move second child to first child (temp 4-component vector of float) +0:? '@entryPointOutput' (layout(location=0 ) out 4-component vector of float) +0:12 Function Call: @main(u1; (temp 4-component vector of float) +0:? 'pos' (temp uint) +0:? Linker Objects +0:? 'anon@0' (layout(binding=10 row_major std430 ) readonly buffer block{layout(binding=10 row_major std430 ) readonly buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test, temp bool test2} sbuf}) +0:? 'anon@1' (layout(row_major std430 ) readonly buffer block{layout(row_major std430 ) readonly buffer implicitly-sized array of float sbuf2}) +0:? '@entryPointOutput' (layout(location=0 ) out 4-component vector of float) +0:? 'pos' (layout(location=0 ) in uint) + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 94 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 87 90 + ExecutionMode 4 OriginUpperLeft + Name 4 "main" + Name 12 "@main(u1;" + Name 11 "pos" + Name 16 "sb_t" + MemberName 16(sb_t) 0 "color" + MemberName 16(sb_t) 1 "test" + MemberName 16(sb_t) 2 "test2" + Name 18 "mydata" + Name 19 "sb_t" + MemberName 19(sb_t) 0 "color" + MemberName 19(sb_t) 1 "test" + MemberName 19(sb_t) 2 "test2" + Name 21 "sbuf" + MemberName 21(sbuf) 0 "sbuf" + Name 23 "" + Name 40 "size" + Name 42 "stride" + Name 57 "sbuf2" + MemberName 57(sbuf2) 0 "sbuf2" + Name 59 "" + Name 85 "pos" + Name 87 "pos" + Name 90 "@entryPointOutput" + Name 91 "param" + MemberDecorate 19(sb_t) 0 NonWritable + MemberDecorate 19(sb_t) 0 Offset 0 + MemberDecorate 19(sb_t) 1 NonWritable + MemberDecorate 19(sb_t) 1 Offset 12 + MemberDecorate 19(sb_t) 2 NonWritable + MemberDecorate 19(sb_t) 2 Offset 16 + Decorate 20 ArrayStride 32 + MemberDecorate 21(sbuf) 0 NonWritable + MemberDecorate 21(sbuf) 0 Offset 0 + Decorate 21(sbuf) BufferBlock + Decorate 23 DescriptorSet 0 + Decorate 23 Binding 10 + Decorate 56 ArrayStride 4 + MemberDecorate 57(sbuf2) 0 NonWritable + MemberDecorate 57(sbuf2) 0 Offset 0 + Decorate 57(sbuf2) BufferBlock + Decorate 59 DescriptorSet 0 + Decorate 87(pos) Location 0 + Decorate 90(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypePointer Function 6(int) + 8: TypeFloat 32 + 9: TypeVector 8(float) 4 + 10: TypeFunction 9(fvec4) 7(ptr) + 14: TypeVector 8(float) 3 + 15: TypeBool + 16(sb_t): TypeStruct 14(fvec3) 15(bool) 15(bool) + 17: TypePointer Function 16(sb_t) + 19(sb_t): TypeStruct 14(fvec3) 6(int) 6(int) + 20: TypeRuntimeArray 19(sb_t) + 21(sbuf): TypeStruct 20 + 22: TypePointer Uniform 21(sbuf) + 23: 22(ptr) Variable Uniform + 24: TypeInt 32 1 + 25: 24(int) Constant 0 + 27: TypePointer Uniform 19(sb_t) + 31: TypePointer Function 14(fvec3) + 34: 24(int) Constant 1 + 35: TypePointer Function 15(bool) + 38: 24(int) Constant 2 + 43: 6(int) Constant 32 + 45: TypePointer Uniform 6(int) + 48: 6(int) Constant 0 + 53: TypePointer Uniform 14(fvec3) + 56: TypeRuntimeArray 8(float) + 57(sbuf2): TypeStruct 56 + 58: TypePointer Uniform 57(sbuf2) + 59: 58(ptr) Variable Uniform + 61: TypePointer Uniform 8(float) + 66: 8(float) Constant 0 + 73: TypePointer Function 8(float) + 86: TypePointer Input 6(int) + 87(pos): 86(ptr) Variable Input + 89: TypePointer Output 9(fvec4) +90(@entryPointOutput): 89(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 85(pos): 7(ptr) Variable Function + 91(param): 7(ptr) Variable Function + 88: 6(int) Load 87(pos) + Store 85(pos) 88 + 92: 6(int) Load 85(pos) + Store 91(param) 92 + 93: 9(fvec4) FunctionCall 12(@main(u1;) 91(param) + Store 90(@entryPointOutput) 93 + Return + FunctionEnd + 12(@main(u1;): 9(fvec4) Function None 10 + 11(pos): 7(ptr) FunctionParameter + 13: Label + 18(mydata): 17(ptr) Variable Function + 40(size): 7(ptr) Variable Function + 42(stride): 7(ptr) Variable Function + 26: 6(int) Load 11(pos) + 28: 27(ptr) AccessChain 23 25 26 + 29: 19(sb_t) Load 28 + 30: 14(fvec3) CompositeExtract 29 0 + 32: 31(ptr) AccessChain 18(mydata) 25 + Store 32 30 + 33: 6(int) CompositeExtract 29 1 + 36: 35(ptr) AccessChain 18(mydata) 34 + Store 36 33 + 37: 6(int) CompositeExtract 29 2 + 39: 35(ptr) AccessChain 18(mydata) 38 + Store 39 37 + 41: 24(int) ArrayLength 23 0 + Store 40(size) 41 + Store 42(stride) 43 + 44: 6(int) Load 11(pos) + 46: 45(ptr) AccessChain 23 25 44 34 + 47: 6(int) Load 46 + 49: 15(bool) INotEqual 47 48 + SelectionMerge 51 None + BranchConditional 49 50 72 + 50: Label + 52: 6(int) Load 11(pos) + 54: 53(ptr) AccessChain 23 25 52 25 + 55: 14(fvec3) Load 54 + 60: 6(int) Load 11(pos) + 62: 61(ptr) AccessChain 59 25 60 + 63: 8(float) Load 62 + 64: 14(fvec3) CompositeConstruct 63 63 63 + 65: 14(fvec3) FAdd 55 64 + 67: 8(float) CompositeExtract 65 0 + 68: 8(float) CompositeExtract 65 1 + 69: 8(float) CompositeExtract 65 2 + 70: 9(fvec4) CompositeConstruct 67 68 69 66 + ReturnValue 70 + 72: Label + 74: 73(ptr) AccessChain 18(mydata) 25 48 + 75: 8(float) Load 74 + 76: 6(int) Load 40(size) + 77: 8(float) ConvertUToF 76 + 78: 8(float) FAdd 75 77 + 79: 6(int) Load 42(stride) + 80: 8(float) ConvertUToF 79 + 81: 8(float) FAdd 78 80 + 82: 9(fvec4) CompositeConstruct 81 81 81 81 + ReturnValue 82 + 51: Label + 84: 9(fvec4) Undef + ReturnValue 84 + FunctionEnd diff --git a/Test/baseResults/hlsl.structbuffer.rw.frag.out b/Test/baseResults/hlsl.structbuffer.rw.frag.out new file mode 100644 index 0000000000000000000000000000000000000000..a319a2e7302c8fb3f237af26359efcfa3635a61f --- /dev/null +++ b/Test/baseResults/hlsl.structbuffer.rw.frag.out @@ -0,0 +1,304 @@ +hlsl.structbuffer.rw.frag +Shader version: 450 +gl_FragCoord origin is upper left +0:? Sequence +0:12 Function Definition: @main(u1; (temp 4-component vector of float) +0:12 Function Parameters: +0:12 'pos' (in uint) +0:? Sequence +0:13 move second child to first child (temp float) +0:13 indirect index (layout(row_major std430 ) temp float) +0:13 sbuf2: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of float) +0:13 'anon@1' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of float sbuf2}) +0:13 Constant: +0:13 0 (const uint) +0:13 add (temp uint) +0:13 'pos' (in uint) +0:13 Constant: +0:13 1 (const uint) +0:13 Constant: +0:13 42.000000 +0:17 Sequence +0:17 move second child to first child (temp uint) +0:17 'size' (temp uint) +0:17 array length (temp uint) +0:17 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test}) +0:17 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test} sbuf}) +0:17 Constant: +0:17 0 (const uint) +0:17 move second child to first child (temp uint) +0:17 'stride' (temp uint) +0:17 Constant: +0:17 16 (const uint) +0:19 Test condition and select (temp void) +0:19 Condition +0:19 test: direct index for structure (temp bool) +0:19 indirect index (layout(row_major std430 ) temp structure{temp 3-component vector of float color, temp bool test}) +0:19 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test}) +0:19 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test} sbuf}) +0:19 Constant: +0:19 0 (const uint) +0:19 'pos' (in uint) +0:19 Constant: +0:19 1 (const int) +0:19 true case +0:20 Branch: Return with expression +0:? Construct vec4 (temp 4-component vector of float) +0:20 add (temp 3-component vector of float) +0:20 color: direct index for structure (temp 3-component vector of float) +0:20 indirect index (layout(row_major std430 ) temp structure{temp 3-component vector of float color, temp bool test}) +0:20 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test}) +0:20 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test} sbuf}) +0:20 Constant: +0:20 0 (const uint) +0:20 'pos' (in uint) +0:20 Constant: +0:20 0 (const int) +0:20 indirect index (layout(row_major std430 ) temp float) +0:20 sbuf2: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of float) +0:20 'anon@1' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of float sbuf2}) +0:20 Constant: +0:20 0 (const uint) +0:20 'pos' (in uint) +0:20 Constant: +0:20 0.000000 +0:19 false case +0:22 Branch: Return with expression +0:22 Construct vec4 (temp 4-component vector of float) +0:22 Convert uint to float (temp float) +0:22 add (temp uint) +0:22 'size' (temp uint) +0:22 'stride' (temp uint) +0:12 Function Definition: main( (temp void) +0:12 Function Parameters: +0:? Sequence +0:12 move second child to first child (temp uint) +0:? 'pos' (temp uint) +0:? 'pos' (layout(location=0 ) in uint) +0:12 move second child to first child (temp 4-component vector of float) +0:? '@entryPointOutput' (layout(location=0 ) out 4-component vector of float) +0:12 Function Call: @main(u1; (temp 4-component vector of float) +0:? 'pos' (temp uint) +0:? Linker Objects +0:? 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test} sbuf}) +0:? 'anon@1' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of float sbuf2}) +0:? '@entryPointOutput' (layout(location=0 ) out 4-component vector of float) +0:? 'pos' (layout(location=0 ) in uint) + + +Linked fragment stage: + + +Shader version: 450 +gl_FragCoord origin is upper left +0:? Sequence +0:12 Function Definition: @main(u1; (temp 4-component vector of float) +0:12 Function Parameters: +0:12 'pos' (in uint) +0:? Sequence +0:13 move second child to first child (temp float) +0:13 indirect index (layout(row_major std430 ) temp float) +0:13 sbuf2: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of float) +0:13 'anon@1' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of float sbuf2}) +0:13 Constant: +0:13 0 (const uint) +0:13 add (temp uint) +0:13 'pos' (in uint) +0:13 Constant: +0:13 1 (const uint) +0:13 Constant: +0:13 42.000000 +0:17 Sequence +0:17 move second child to first child (temp uint) +0:17 'size' (temp uint) +0:17 array length (temp uint) +0:17 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test}) +0:17 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test} sbuf}) +0:17 Constant: +0:17 0 (const uint) +0:17 move second child to first child (temp uint) +0:17 'stride' (temp uint) +0:17 Constant: +0:17 16 (const uint) +0:19 Test condition and select (temp void) +0:19 Condition +0:19 test: direct index for structure (temp bool) +0:19 indirect index (layout(row_major std430 ) temp structure{temp 3-component vector of float color, temp bool test}) +0:19 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test}) +0:19 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test} sbuf}) +0:19 Constant: +0:19 0 (const uint) +0:19 'pos' (in uint) +0:19 Constant: +0:19 1 (const int) +0:19 true case +0:20 Branch: Return with expression +0:? Construct vec4 (temp 4-component vector of float) +0:20 add (temp 3-component vector of float) +0:20 color: direct index for structure (temp 3-component vector of float) +0:20 indirect index (layout(row_major std430 ) temp structure{temp 3-component vector of float color, temp bool test}) +0:20 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test}) +0:20 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test} sbuf}) +0:20 Constant: +0:20 0 (const uint) +0:20 'pos' (in uint) +0:20 Constant: +0:20 0 (const int) +0:20 indirect index (layout(row_major std430 ) temp float) +0:20 sbuf2: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of float) +0:20 'anon@1' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of float sbuf2}) +0:20 Constant: +0:20 0 (const uint) +0:20 'pos' (in uint) +0:20 Constant: +0:20 0.000000 +0:19 false case +0:22 Branch: Return with expression +0:22 Construct vec4 (temp 4-component vector of float) +0:22 Convert uint to float (temp float) +0:22 add (temp uint) +0:22 'size' (temp uint) +0:22 'stride' (temp uint) +0:12 Function Definition: main( (temp void) +0:12 Function Parameters: +0:? Sequence +0:12 move second child to first child (temp uint) +0:? 'pos' (temp uint) +0:? 'pos' (layout(location=0 ) in uint) +0:12 move second child to first child (temp 4-component vector of float) +0:? '@entryPointOutput' (layout(location=0 ) out 4-component vector of float) +0:12 Function Call: @main(u1; (temp 4-component vector of float) +0:? 'pos' (temp uint) +0:? Linker Objects +0:? 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of structure{temp 3-component vector of float color, temp bool test} sbuf}) +0:? 'anon@1' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of float sbuf2}) +0:? '@entryPointOutput' (layout(location=0 ) out 4-component vector of float) +0:? 'pos' (layout(location=0 ) in uint) + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 78 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 71 74 + ExecutionMode 4 OriginUpperLeft + Name 4 "main" + Name 12 "@main(u1;" + Name 11 "pos" + Name 15 "sbuf2" + MemberName 15(sbuf2) 0 "sbuf2" + Name 17 "" + Name 26 "size" + Name 28 "sb_t" + MemberName 28(sb_t) 0 "color" + MemberName 28(sb_t) 1 "test" + Name 30 "sbuf" + MemberName 30(sbuf) 0 "sbuf" + Name 32 "" + Name 34 "stride" + Name 69 "pos" + Name 71 "pos" + Name 74 "@entryPointOutput" + Name 75 "param" + Decorate 14 ArrayStride 4 + MemberDecorate 15(sbuf2) 0 Offset 0 + Decorate 15(sbuf2) BufferBlock + Decorate 17 DescriptorSet 0 + MemberDecorate 28(sb_t) 0 Offset 0 + MemberDecorate 28(sb_t) 1 Offset 12 + Decorate 29 ArrayStride 16 + MemberDecorate 30(sbuf) 0 Offset 0 + Decorate 30(sbuf) BufferBlock + Decorate 32 DescriptorSet 0 + Decorate 71(pos) Location 0 + Decorate 74(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypePointer Function 6(int) + 8: TypeFloat 32 + 9: TypeVector 8(float) 4 + 10: TypeFunction 9(fvec4) 7(ptr) + 14: TypeRuntimeArray 8(float) + 15(sbuf2): TypeStruct 14 + 16: TypePointer Uniform 15(sbuf2) + 17: 16(ptr) Variable Uniform + 18: TypeInt 32 1 + 19: 18(int) Constant 0 + 21: 6(int) Constant 1 + 23: 8(float) Constant 1109917696 + 24: TypePointer Uniform 8(float) + 27: TypeVector 8(float) 3 + 28(sb_t): TypeStruct 27(fvec3) 6(int) + 29: TypeRuntimeArray 28(sb_t) + 30(sbuf): TypeStruct 29 + 31: TypePointer Uniform 30(sbuf) + 32: 31(ptr) Variable Uniform + 35: 6(int) Constant 16 + 37: 18(int) Constant 1 + 38: TypePointer Uniform 6(int) + 41: TypeBool + 42: 6(int) Constant 0 + 47: TypePointer Uniform 27(fvec3) + 55: 8(float) Constant 0 + 70: TypePointer Input 6(int) + 71(pos): 70(ptr) Variable Input + 73: TypePointer Output 9(fvec4) +74(@entryPointOutput): 73(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 69(pos): 7(ptr) Variable Function + 75(param): 7(ptr) Variable Function + 72: 6(int) Load 71(pos) + Store 69(pos) 72 + 76: 6(int) Load 69(pos) + Store 75(param) 76 + 77: 9(fvec4) FunctionCall 12(@main(u1;) 75(param) + Store 74(@entryPointOutput) 77 + Return + FunctionEnd + 12(@main(u1;): 9(fvec4) Function None 10 + 11(pos): 7(ptr) FunctionParameter + 13: Label + 26(size): 7(ptr) Variable Function + 34(stride): 7(ptr) Variable Function + 20: 6(int) Load 11(pos) + 22: 6(int) IAdd 20 21 + 25: 24(ptr) AccessChain 17 19 22 + Store 25 23 + 33: 18(int) ArrayLength 32 0 + Store 26(size) 33 + Store 34(stride) 35 + 36: 6(int) Load 11(pos) + 39: 38(ptr) AccessChain 32 19 36 37 + 40: 6(int) Load 39 + 43: 41(bool) INotEqual 40 42 + SelectionMerge 45 None + BranchConditional 43 44 61 + 44: Label + 46: 6(int) Load 11(pos) + 48: 47(ptr) AccessChain 32 19 46 19 + 49: 27(fvec3) Load 48 + 50: 6(int) Load 11(pos) + 51: 24(ptr) AccessChain 17 19 50 + 52: 8(float) Load 51 + 53: 27(fvec3) CompositeConstruct 52 52 52 + 54: 27(fvec3) FAdd 49 53 + 56: 8(float) CompositeExtract 54 0 + 57: 8(float) CompositeExtract 54 1 + 58: 8(float) CompositeExtract 54 2 + 59: 9(fvec4) CompositeConstruct 56 57 58 55 + ReturnValue 59 + 61: Label + 62: 6(int) Load 26(size) + 63: 6(int) Load 34(stride) + 64: 6(int) IAdd 62 63 + 65: 8(float) ConvertUToF 64 + 66: 9(fvec4) CompositeConstruct 65 65 65 65 + ReturnValue 66 + 45: Label + 68: 9(fvec4) Undef + ReturnValue 68 + FunctionEnd diff --git a/Test/baseResults/hlsl.structbuffer.rwbyte.frag.out b/Test/baseResults/hlsl.structbuffer.rwbyte.frag.out new file mode 100644 index 0000000000000000000000000000000000000000..328642bbb5eb7eaabb8fea2a56de34c070d6f128 --- /dev/null +++ b/Test/baseResults/hlsl.structbuffer.rwbyte.frag.out @@ -0,0 +1,1307 @@ +hlsl.structbuffer.rwbyte.frag +Shader version: 450 +gl_FragCoord origin is upper left +0:? Sequence +0:5 Function Definition: @main(u1; (temp 4-component vector of float) +0:5 Function Parameters: +0:5 'pos' (in uint) +0:? Sequence +0:7 Sequence +0:7 move second child to first child (temp uint) +0:7 'size' (temp uint) +0:7 array length (temp uint) +0:7 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:7 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:7 Constant: +0:7 0 (const uint) +0:? Sequence +0:9 move second child to first child (temp int) +0:9 'byteAddrTemp' (temp int) +0:9 right-shift (temp int) +0:9 'pos' (in uint) +0:9 Constant: +0:9 2 (const int) +0:9 move second child to first child (temp float) +0:9 indirect index (temp float) +0:9 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:9 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:9 Constant: +0:9 0 (const uint) +0:9 'byteAddrTemp' (temp int) +0:9 Convert uint to float (temp float) +0:9 indirect index (layout(row_major std430 ) buffer uint) +0:9 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:9 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:9 Constant: +0:9 0 (const uint) +0:9 right-shift (temp int) +0:9 'pos' (in uint) +0:9 Constant: +0:9 2 (const int) +0:? Sequence +0:10 move second child to first child (temp int) +0:10 'byteAddrTemp' (temp int) +0:10 right-shift (temp int) +0:10 'pos' (in uint) +0:10 Constant: +0:10 2 (const int) +0:10 move second child to first child (temp float) +0:10 indirect index (temp float) +0:10 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:10 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:10 Constant: +0:10 0 (const uint) +0:10 'byteAddrTemp' (temp int) +0:10 direct index (temp float) +0:? Sequence +0:10 move second child to first child (temp int) +0:10 'byteAddrTemp' (temp int) +0:10 right-shift (temp int) +0:10 'pos' (in uint) +0:10 Constant: +0:10 2 (const int) +0:? Construct vec2 (temp 2-component vector of uint) +0:10 indirect index (temp float) +0:10 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:10 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:10 Constant: +0:10 0 (const uint) +0:10 'byteAddrTemp' (temp int) +0:10 indirect index (temp float) +0:10 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:10 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:10 Constant: +0:10 0 (const uint) +0:10 add (temp int) +0:10 'byteAddrTemp' (temp int) +0:10 Constant: +0:10 1 (const int) +0:10 Constant: +0:10 0 (const int) +0:10 move second child to first child (temp float) +0:10 indirect index (temp float) +0:10 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:10 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:10 Constant: +0:10 0 (const uint) +0:10 add (temp int) +0:10 'byteAddrTemp' (temp int) +0:10 Constant: +0:10 1 (const int) +0:10 direct index (temp float) +0:? Sequence +0:10 move second child to first child (temp int) +0:10 'byteAddrTemp' (temp int) +0:10 right-shift (temp int) +0:10 'pos' (in uint) +0:10 Constant: +0:10 2 (const int) +0:? Construct vec2 (temp 2-component vector of uint) +0:10 indirect index (temp float) +0:10 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:10 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:10 Constant: +0:10 0 (const uint) +0:10 'byteAddrTemp' (temp int) +0:10 indirect index (temp float) +0:10 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:10 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:10 Constant: +0:10 0 (const uint) +0:10 add (temp int) +0:10 'byteAddrTemp' (temp int) +0:10 Constant: +0:10 1 (const int) +0:10 Constant: +0:10 1 (const int) +0:? Sequence +0:11 move second child to first child (temp int) +0:11 'byteAddrTemp' (temp int) +0:11 right-shift (temp int) +0:11 'pos' (in uint) +0:11 Constant: +0:11 2 (const int) +0:11 move second child to first child (temp float) +0:11 indirect index (temp float) +0:11 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:11 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:11 Constant: +0:11 0 (const uint) +0:11 'byteAddrTemp' (temp int) +0:11 direct index (temp float) +0:? Sequence +0:11 move second child to first child (temp int) +0:11 'byteAddrTemp' (temp int) +0:11 right-shift (temp int) +0:11 'pos' (in uint) +0:11 Constant: +0:11 2 (const int) +0:? Construct vec3 (temp 3-component vector of uint) +0:11 indirect index (temp float) +0:11 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:11 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:11 Constant: +0:11 0 (const uint) +0:11 'byteAddrTemp' (temp int) +0:11 indirect index (temp float) +0:11 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:11 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:11 Constant: +0:11 0 (const uint) +0:11 add (temp int) +0:11 'byteAddrTemp' (temp int) +0:11 Constant: +0:11 1 (const int) +0:11 indirect index (temp float) +0:11 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:11 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:11 Constant: +0:11 0 (const uint) +0:11 add (temp int) +0:11 'byteAddrTemp' (temp int) +0:11 Constant: +0:11 2 (const int) +0:11 Constant: +0:11 0 (const int) +0:11 move second child to first child (temp float) +0:11 indirect index (temp float) +0:11 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:11 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:11 Constant: +0:11 0 (const uint) +0:11 add (temp int) +0:11 'byteAddrTemp' (temp int) +0:11 Constant: +0:11 1 (const int) +0:11 direct index (temp float) +0:? Sequence +0:11 move second child to first child (temp int) +0:11 'byteAddrTemp' (temp int) +0:11 right-shift (temp int) +0:11 'pos' (in uint) +0:11 Constant: +0:11 2 (const int) +0:? Construct vec3 (temp 3-component vector of uint) +0:11 indirect index (temp float) +0:11 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:11 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:11 Constant: +0:11 0 (const uint) +0:11 'byteAddrTemp' (temp int) +0:11 indirect index (temp float) +0:11 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:11 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:11 Constant: +0:11 0 (const uint) +0:11 add (temp int) +0:11 'byteAddrTemp' (temp int) +0:11 Constant: +0:11 1 (const int) +0:11 indirect index (temp float) +0:11 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:11 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:11 Constant: +0:11 0 (const uint) +0:11 add (temp int) +0:11 'byteAddrTemp' (temp int) +0:11 Constant: +0:11 2 (const int) +0:11 Constant: +0:11 1 (const int) +0:11 move second child to first child (temp float) +0:11 indirect index (temp float) +0:11 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:11 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:11 Constant: +0:11 0 (const uint) +0:11 add (temp int) +0:11 'byteAddrTemp' (temp int) +0:11 Constant: +0:11 2 (const int) +0:11 direct index (temp float) +0:? Sequence +0:11 move second child to first child (temp int) +0:11 'byteAddrTemp' (temp int) +0:11 right-shift (temp int) +0:11 'pos' (in uint) +0:11 Constant: +0:11 2 (const int) +0:? Construct vec3 (temp 3-component vector of uint) +0:11 indirect index (temp float) +0:11 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:11 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:11 Constant: +0:11 0 (const uint) +0:11 'byteAddrTemp' (temp int) +0:11 indirect index (temp float) +0:11 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:11 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:11 Constant: +0:11 0 (const uint) +0:11 add (temp int) +0:11 'byteAddrTemp' (temp int) +0:11 Constant: +0:11 1 (const int) +0:11 indirect index (temp float) +0:11 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:11 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:11 Constant: +0:11 0 (const uint) +0:11 add (temp int) +0:11 'byteAddrTemp' (temp int) +0:11 Constant: +0:11 2 (const int) +0:11 Constant: +0:11 2 (const int) +0:? Sequence +0:12 move second child to first child (temp int) +0:12 'byteAddrTemp' (temp int) +0:12 right-shift (temp int) +0:12 'pos' (in uint) +0:12 Constant: +0:12 2 (const int) +0:12 move second child to first child (temp float) +0:12 indirect index (temp float) +0:12 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:12 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:12 Constant: +0:12 0 (const uint) +0:12 'byteAddrTemp' (temp int) +0:12 direct index (temp float) +0:? Sequence +0:12 move second child to first child (temp int) +0:12 'byteAddrTemp' (temp int) +0:12 right-shift (temp int) +0:12 'pos' (in uint) +0:12 Constant: +0:12 2 (const int) +0:? Construct vec4 (temp 4-component vector of uint) +0:12 indirect index (temp float) +0:12 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:12 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:12 Constant: +0:12 0 (const uint) +0:12 'byteAddrTemp' (temp int) +0:12 indirect index (temp float) +0:12 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:12 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:12 Constant: +0:12 0 (const uint) +0:12 add (temp int) +0:12 'byteAddrTemp' (temp int) +0:12 Constant: +0:12 1 (const int) +0:12 indirect index (temp float) +0:12 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:12 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:12 Constant: +0:12 0 (const uint) +0:12 add (temp int) +0:12 'byteAddrTemp' (temp int) +0:12 Constant: +0:12 2 (const int) +0:12 indirect index (temp float) +0:12 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:12 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:12 Constant: +0:12 0 (const uint) +0:12 add (temp int) +0:12 'byteAddrTemp' (temp int) +0:12 Constant: +0:12 3 (const int) +0:12 Constant: +0:12 0 (const int) +0:12 move second child to first child (temp float) +0:12 indirect index (temp float) +0:12 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:12 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:12 Constant: +0:12 0 (const uint) +0:12 add (temp int) +0:12 'byteAddrTemp' (temp int) +0:12 Constant: +0:12 1 (const int) +0:12 direct index (temp float) +0:? Sequence +0:12 move second child to first child (temp int) +0:12 'byteAddrTemp' (temp int) +0:12 right-shift (temp int) +0:12 'pos' (in uint) +0:12 Constant: +0:12 2 (const int) +0:? Construct vec4 (temp 4-component vector of uint) +0:12 indirect index (temp float) +0:12 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:12 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:12 Constant: +0:12 0 (const uint) +0:12 'byteAddrTemp' (temp int) +0:12 indirect index (temp float) +0:12 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:12 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:12 Constant: +0:12 0 (const uint) +0:12 add (temp int) +0:12 'byteAddrTemp' (temp int) +0:12 Constant: +0:12 1 (const int) +0:12 indirect index (temp float) +0:12 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:12 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:12 Constant: +0:12 0 (const uint) +0:12 add (temp int) +0:12 'byteAddrTemp' (temp int) +0:12 Constant: +0:12 2 (const int) +0:12 indirect index (temp float) +0:12 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:12 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:12 Constant: +0:12 0 (const uint) +0:12 add (temp int) +0:12 'byteAddrTemp' (temp int) +0:12 Constant: +0:12 3 (const int) +0:12 Constant: +0:12 1 (const int) +0:12 move second child to first child (temp float) +0:12 indirect index (temp float) +0:12 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:12 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:12 Constant: +0:12 0 (const uint) +0:12 add (temp int) +0:12 'byteAddrTemp' (temp int) +0:12 Constant: +0:12 2 (const int) +0:12 direct index (temp float) +0:? Sequence +0:12 move second child to first child (temp int) +0:12 'byteAddrTemp' (temp int) +0:12 right-shift (temp int) +0:12 'pos' (in uint) +0:12 Constant: +0:12 2 (const int) +0:? Construct vec4 (temp 4-component vector of uint) +0:12 indirect index (temp float) +0:12 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:12 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:12 Constant: +0:12 0 (const uint) +0:12 'byteAddrTemp' (temp int) +0:12 indirect index (temp float) +0:12 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:12 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:12 Constant: +0:12 0 (const uint) +0:12 add (temp int) +0:12 'byteAddrTemp' (temp int) +0:12 Constant: +0:12 1 (const int) +0:12 indirect index (temp float) +0:12 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:12 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:12 Constant: +0:12 0 (const uint) +0:12 add (temp int) +0:12 'byteAddrTemp' (temp int) +0:12 Constant: +0:12 2 (const int) +0:12 indirect index (temp float) +0:12 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:12 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:12 Constant: +0:12 0 (const uint) +0:12 add (temp int) +0:12 'byteAddrTemp' (temp int) +0:12 Constant: +0:12 3 (const int) +0:12 Constant: +0:12 2 (const int) +0:12 move second child to first child (temp float) +0:12 indirect index (temp float) +0:12 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:12 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:12 Constant: +0:12 0 (const uint) +0:12 add (temp int) +0:12 'byteAddrTemp' (temp int) +0:12 Constant: +0:12 3 (const int) +0:12 direct index (temp float) +0:? Sequence +0:12 move second child to first child (temp int) +0:12 'byteAddrTemp' (temp int) +0:12 right-shift (temp int) +0:12 'pos' (in uint) +0:12 Constant: +0:12 2 (const int) +0:? Construct vec4 (temp 4-component vector of uint) +0:12 indirect index (temp float) +0:12 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:12 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:12 Constant: +0:12 0 (const uint) +0:12 'byteAddrTemp' (temp int) +0:12 indirect index (temp float) +0:12 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:12 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:12 Constant: +0:12 0 (const uint) +0:12 add (temp int) +0:12 'byteAddrTemp' (temp int) +0:12 Constant: +0:12 1 (const int) +0:12 indirect index (temp float) +0:12 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:12 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:12 Constant: +0:12 0 (const uint) +0:12 add (temp int) +0:12 'byteAddrTemp' (temp int) +0:12 Constant: +0:12 2 (const int) +0:12 indirect index (temp float) +0:12 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:12 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:12 Constant: +0:12 0 (const uint) +0:12 add (temp int) +0:12 'byteAddrTemp' (temp int) +0:12 Constant: +0:12 3 (const int) +0:12 Constant: +0:12 3 (const int) +0:14 Branch: Return with expression +0:14 Construct vec4 (temp 4-component vector of float) +0:14 Convert uint to float (temp float) +0:14 indirect index (layout(row_major std430 ) buffer uint) +0:14 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:14 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:14 Constant: +0:14 0 (const uint) +0:14 right-shift (temp int) +0:14 'pos' (in uint) +0:14 Constant: +0:14 2 (const int) +0:5 Function Definition: main( (temp void) +0:5 Function Parameters: +0:? Sequence +0:5 move second child to first child (temp uint) +0:? 'pos' (temp uint) +0:? 'pos' (layout(location=0 ) in uint) +0:5 move second child to first child (temp 4-component vector of float) +0:? '@entryPointOutput' (layout(location=0 ) out 4-component vector of float) +0:5 Function Call: @main(u1; (temp 4-component vector of float) +0:? 'pos' (temp uint) +0:? Linker Objects +0:? 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:? '@entryPointOutput' (layout(location=0 ) out 4-component vector of float) +0:? 'pos' (layout(location=0 ) in uint) + + +Linked fragment stage: + + +Shader version: 450 +gl_FragCoord origin is upper left +0:? Sequence +0:5 Function Definition: @main(u1; (temp 4-component vector of float) +0:5 Function Parameters: +0:5 'pos' (in uint) +0:? Sequence +0:7 Sequence +0:7 move second child to first child (temp uint) +0:7 'size' (temp uint) +0:7 array length (temp uint) +0:7 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:7 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:7 Constant: +0:7 0 (const uint) +0:? Sequence +0:9 move second child to first child (temp int) +0:9 'byteAddrTemp' (temp int) +0:9 right-shift (temp int) +0:9 'pos' (in uint) +0:9 Constant: +0:9 2 (const int) +0:9 move second child to first child (temp float) +0:9 indirect index (temp float) +0:9 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:9 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:9 Constant: +0:9 0 (const uint) +0:9 'byteAddrTemp' (temp int) +0:9 Convert uint to float (temp float) +0:9 indirect index (layout(row_major std430 ) buffer uint) +0:9 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:9 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:9 Constant: +0:9 0 (const uint) +0:9 right-shift (temp int) +0:9 'pos' (in uint) +0:9 Constant: +0:9 2 (const int) +0:? Sequence +0:10 move second child to first child (temp int) +0:10 'byteAddrTemp' (temp int) +0:10 right-shift (temp int) +0:10 'pos' (in uint) +0:10 Constant: +0:10 2 (const int) +0:10 move second child to first child (temp float) +0:10 indirect index (temp float) +0:10 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:10 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:10 Constant: +0:10 0 (const uint) +0:10 'byteAddrTemp' (temp int) +0:10 direct index (temp float) +0:? Sequence +0:10 move second child to first child (temp int) +0:10 'byteAddrTemp' (temp int) +0:10 right-shift (temp int) +0:10 'pos' (in uint) +0:10 Constant: +0:10 2 (const int) +0:? Construct vec2 (temp 2-component vector of uint) +0:10 indirect index (temp float) +0:10 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:10 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:10 Constant: +0:10 0 (const uint) +0:10 'byteAddrTemp' (temp int) +0:10 indirect index (temp float) +0:10 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:10 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:10 Constant: +0:10 0 (const uint) +0:10 add (temp int) +0:10 'byteAddrTemp' (temp int) +0:10 Constant: +0:10 1 (const int) +0:10 Constant: +0:10 0 (const int) +0:10 move second child to first child (temp float) +0:10 indirect index (temp float) +0:10 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:10 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:10 Constant: +0:10 0 (const uint) +0:10 add (temp int) +0:10 'byteAddrTemp' (temp int) +0:10 Constant: +0:10 1 (const int) +0:10 direct index (temp float) +0:? Sequence +0:10 move second child to first child (temp int) +0:10 'byteAddrTemp' (temp int) +0:10 right-shift (temp int) +0:10 'pos' (in uint) +0:10 Constant: +0:10 2 (const int) +0:? Construct vec2 (temp 2-component vector of uint) +0:10 indirect index (temp float) +0:10 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:10 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:10 Constant: +0:10 0 (const uint) +0:10 'byteAddrTemp' (temp int) +0:10 indirect index (temp float) +0:10 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:10 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:10 Constant: +0:10 0 (const uint) +0:10 add (temp int) +0:10 'byteAddrTemp' (temp int) +0:10 Constant: +0:10 1 (const int) +0:10 Constant: +0:10 1 (const int) +0:? Sequence +0:11 move second child to first child (temp int) +0:11 'byteAddrTemp' (temp int) +0:11 right-shift (temp int) +0:11 'pos' (in uint) +0:11 Constant: +0:11 2 (const int) +0:11 move second child to first child (temp float) +0:11 indirect index (temp float) +0:11 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:11 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:11 Constant: +0:11 0 (const uint) +0:11 'byteAddrTemp' (temp int) +0:11 direct index (temp float) +0:? Sequence +0:11 move second child to first child (temp int) +0:11 'byteAddrTemp' (temp int) +0:11 right-shift (temp int) +0:11 'pos' (in uint) +0:11 Constant: +0:11 2 (const int) +0:? Construct vec3 (temp 3-component vector of uint) +0:11 indirect index (temp float) +0:11 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:11 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:11 Constant: +0:11 0 (const uint) +0:11 'byteAddrTemp' (temp int) +0:11 indirect index (temp float) +0:11 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:11 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:11 Constant: +0:11 0 (const uint) +0:11 add (temp int) +0:11 'byteAddrTemp' (temp int) +0:11 Constant: +0:11 1 (const int) +0:11 indirect index (temp float) +0:11 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:11 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:11 Constant: +0:11 0 (const uint) +0:11 add (temp int) +0:11 'byteAddrTemp' (temp int) +0:11 Constant: +0:11 2 (const int) +0:11 Constant: +0:11 0 (const int) +0:11 move second child to first child (temp float) +0:11 indirect index (temp float) +0:11 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:11 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:11 Constant: +0:11 0 (const uint) +0:11 add (temp int) +0:11 'byteAddrTemp' (temp int) +0:11 Constant: +0:11 1 (const int) +0:11 direct index (temp float) +0:? Sequence +0:11 move second child to first child (temp int) +0:11 'byteAddrTemp' (temp int) +0:11 right-shift (temp int) +0:11 'pos' (in uint) +0:11 Constant: +0:11 2 (const int) +0:? Construct vec3 (temp 3-component vector of uint) +0:11 indirect index (temp float) +0:11 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:11 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:11 Constant: +0:11 0 (const uint) +0:11 'byteAddrTemp' (temp int) +0:11 indirect index (temp float) +0:11 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:11 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:11 Constant: +0:11 0 (const uint) +0:11 add (temp int) +0:11 'byteAddrTemp' (temp int) +0:11 Constant: +0:11 1 (const int) +0:11 indirect index (temp float) +0:11 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:11 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:11 Constant: +0:11 0 (const uint) +0:11 add (temp int) +0:11 'byteAddrTemp' (temp int) +0:11 Constant: +0:11 2 (const int) +0:11 Constant: +0:11 1 (const int) +0:11 move second child to first child (temp float) +0:11 indirect index (temp float) +0:11 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:11 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:11 Constant: +0:11 0 (const uint) +0:11 add (temp int) +0:11 'byteAddrTemp' (temp int) +0:11 Constant: +0:11 2 (const int) +0:11 direct index (temp float) +0:? Sequence +0:11 move second child to first child (temp int) +0:11 'byteAddrTemp' (temp int) +0:11 right-shift (temp int) +0:11 'pos' (in uint) +0:11 Constant: +0:11 2 (const int) +0:? Construct vec3 (temp 3-component vector of uint) +0:11 indirect index (temp float) +0:11 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:11 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:11 Constant: +0:11 0 (const uint) +0:11 'byteAddrTemp' (temp int) +0:11 indirect index (temp float) +0:11 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:11 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:11 Constant: +0:11 0 (const uint) +0:11 add (temp int) +0:11 'byteAddrTemp' (temp int) +0:11 Constant: +0:11 1 (const int) +0:11 indirect index (temp float) +0:11 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:11 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:11 Constant: +0:11 0 (const uint) +0:11 add (temp int) +0:11 'byteAddrTemp' (temp int) +0:11 Constant: +0:11 2 (const int) +0:11 Constant: +0:11 2 (const int) +0:? Sequence +0:12 move second child to first child (temp int) +0:12 'byteAddrTemp' (temp int) +0:12 right-shift (temp int) +0:12 'pos' (in uint) +0:12 Constant: +0:12 2 (const int) +0:12 move second child to first child (temp float) +0:12 indirect index (temp float) +0:12 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:12 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:12 Constant: +0:12 0 (const uint) +0:12 'byteAddrTemp' (temp int) +0:12 direct index (temp float) +0:? Sequence +0:12 move second child to first child (temp int) +0:12 'byteAddrTemp' (temp int) +0:12 right-shift (temp int) +0:12 'pos' (in uint) +0:12 Constant: +0:12 2 (const int) +0:? Construct vec4 (temp 4-component vector of uint) +0:12 indirect index (temp float) +0:12 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:12 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:12 Constant: +0:12 0 (const uint) +0:12 'byteAddrTemp' (temp int) +0:12 indirect index (temp float) +0:12 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:12 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:12 Constant: +0:12 0 (const uint) +0:12 add (temp int) +0:12 'byteAddrTemp' (temp int) +0:12 Constant: +0:12 1 (const int) +0:12 indirect index (temp float) +0:12 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:12 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:12 Constant: +0:12 0 (const uint) +0:12 add (temp int) +0:12 'byteAddrTemp' (temp int) +0:12 Constant: +0:12 2 (const int) +0:12 indirect index (temp float) +0:12 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:12 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:12 Constant: +0:12 0 (const uint) +0:12 add (temp int) +0:12 'byteAddrTemp' (temp int) +0:12 Constant: +0:12 3 (const int) +0:12 Constant: +0:12 0 (const int) +0:12 move second child to first child (temp float) +0:12 indirect index (temp float) +0:12 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:12 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:12 Constant: +0:12 0 (const uint) +0:12 add (temp int) +0:12 'byteAddrTemp' (temp int) +0:12 Constant: +0:12 1 (const int) +0:12 direct index (temp float) +0:? Sequence +0:12 move second child to first child (temp int) +0:12 'byteAddrTemp' (temp int) +0:12 right-shift (temp int) +0:12 'pos' (in uint) +0:12 Constant: +0:12 2 (const int) +0:? Construct vec4 (temp 4-component vector of uint) +0:12 indirect index (temp float) +0:12 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:12 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:12 Constant: +0:12 0 (const uint) +0:12 'byteAddrTemp' (temp int) +0:12 indirect index (temp float) +0:12 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:12 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:12 Constant: +0:12 0 (const uint) +0:12 add (temp int) +0:12 'byteAddrTemp' (temp int) +0:12 Constant: +0:12 1 (const int) +0:12 indirect index (temp float) +0:12 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:12 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:12 Constant: +0:12 0 (const uint) +0:12 add (temp int) +0:12 'byteAddrTemp' (temp int) +0:12 Constant: +0:12 2 (const int) +0:12 indirect index (temp float) +0:12 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:12 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:12 Constant: +0:12 0 (const uint) +0:12 add (temp int) +0:12 'byteAddrTemp' (temp int) +0:12 Constant: +0:12 3 (const int) +0:12 Constant: +0:12 1 (const int) +0:12 move second child to first child (temp float) +0:12 indirect index (temp float) +0:12 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:12 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:12 Constant: +0:12 0 (const uint) +0:12 add (temp int) +0:12 'byteAddrTemp' (temp int) +0:12 Constant: +0:12 2 (const int) +0:12 direct index (temp float) +0:? Sequence +0:12 move second child to first child (temp int) +0:12 'byteAddrTemp' (temp int) +0:12 right-shift (temp int) +0:12 'pos' (in uint) +0:12 Constant: +0:12 2 (const int) +0:? Construct vec4 (temp 4-component vector of uint) +0:12 indirect index (temp float) +0:12 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:12 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:12 Constant: +0:12 0 (const uint) +0:12 'byteAddrTemp' (temp int) +0:12 indirect index (temp float) +0:12 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:12 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:12 Constant: +0:12 0 (const uint) +0:12 add (temp int) +0:12 'byteAddrTemp' (temp int) +0:12 Constant: +0:12 1 (const int) +0:12 indirect index (temp float) +0:12 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:12 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:12 Constant: +0:12 0 (const uint) +0:12 add (temp int) +0:12 'byteAddrTemp' (temp int) +0:12 Constant: +0:12 2 (const int) +0:12 indirect index (temp float) +0:12 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:12 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:12 Constant: +0:12 0 (const uint) +0:12 add (temp int) +0:12 'byteAddrTemp' (temp int) +0:12 Constant: +0:12 3 (const int) +0:12 Constant: +0:12 2 (const int) +0:12 move second child to first child (temp float) +0:12 indirect index (temp float) +0:12 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:12 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:12 Constant: +0:12 0 (const uint) +0:12 add (temp int) +0:12 'byteAddrTemp' (temp int) +0:12 Constant: +0:12 3 (const int) +0:12 direct index (temp float) +0:? Sequence +0:12 move second child to first child (temp int) +0:12 'byteAddrTemp' (temp int) +0:12 right-shift (temp int) +0:12 'pos' (in uint) +0:12 Constant: +0:12 2 (const int) +0:? Construct vec4 (temp 4-component vector of uint) +0:12 indirect index (temp float) +0:12 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:12 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:12 Constant: +0:12 0 (const uint) +0:12 'byteAddrTemp' (temp int) +0:12 indirect index (temp float) +0:12 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:12 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:12 Constant: +0:12 0 (const uint) +0:12 add (temp int) +0:12 'byteAddrTemp' (temp int) +0:12 Constant: +0:12 1 (const int) +0:12 indirect index (temp float) +0:12 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:12 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:12 Constant: +0:12 0 (const uint) +0:12 add (temp int) +0:12 'byteAddrTemp' (temp int) +0:12 Constant: +0:12 2 (const int) +0:12 indirect index (temp float) +0:12 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:12 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:12 Constant: +0:12 0 (const uint) +0:12 add (temp int) +0:12 'byteAddrTemp' (temp int) +0:12 Constant: +0:12 3 (const int) +0:12 Constant: +0:12 3 (const int) +0:14 Branch: Return with expression +0:14 Construct vec4 (temp 4-component vector of float) +0:14 Convert uint to float (temp float) +0:14 indirect index (layout(row_major std430 ) buffer uint) +0:14 sbuf: direct index for structure (layout(row_major std430 ) buffer implicitly-sized array of uint) +0:14 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:14 Constant: +0:14 0 (const uint) +0:14 right-shift (temp int) +0:14 'pos' (in uint) +0:14 Constant: +0:14 2 (const int) +0:5 Function Definition: main( (temp void) +0:5 Function Parameters: +0:? Sequence +0:5 move second child to first child (temp uint) +0:? 'pos' (temp uint) +0:? 'pos' (layout(location=0 ) in uint) +0:5 move second child to first child (temp 4-component vector of float) +0:? '@entryPointOutput' (layout(location=0 ) out 4-component vector of float) +0:5 Function Call: @main(u1; (temp 4-component vector of float) +0:? 'pos' (temp uint) +0:? Linker Objects +0:? 'anon@0' (layout(row_major std430 ) buffer block{layout(row_major std430 ) buffer implicitly-sized array of uint sbuf}) +0:? '@entryPointOutput' (layout(location=0 ) out 4-component vector of float) +0:? 'pos' (layout(location=0 ) in uint) + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 240 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 233 236 + ExecutionMode 4 OriginUpperLeft + Name 4 "main" + Name 12 "@main(u1;" + Name 11 "pos" + Name 14 "size" + Name 16 "sbuf" + MemberName 16(sbuf) 0 "sbuf" + Name 18 "" + Name 22 "byteAddrTemp" + Name 35 "byteAddrTemp" + Name 39 "byteAddrTemp" + Name 70 "byteAddrTemp" + Name 74 "byteAddrTemp" + Name 129 "byteAddrTemp" + Name 133 "byteAddrTemp" + Name 231 "pos" + Name 233 "pos" + Name 236 "@entryPointOutput" + Name 237 "param" + Decorate 15 ArrayStride 4 + MemberDecorate 16(sbuf) 0 Offset 0 + Decorate 16(sbuf) BufferBlock + Decorate 18 DescriptorSet 0 + Decorate 233(pos) Location 0 + Decorate 236(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypePointer Function 6(int) + 8: TypeFloat 32 + 9: TypeVector 8(float) 4 + 10: TypeFunction 9(fvec4) 7(ptr) + 15: TypeRuntimeArray 6(int) + 16(sbuf): TypeStruct 15 + 17: TypePointer Uniform 16(sbuf) + 18: 17(ptr) Variable Uniform + 19: TypeInt 32 1 + 21: TypePointer Function 19(int) + 24: 19(int) Constant 2 + 26: 19(int) Constant 0 + 30: TypePointer Uniform 6(int) + 46: 19(int) Constant 1 + 50: TypeVector 6(int) 2 + 52: 6(int) Constant 0 + 67: 6(int) Constant 1 + 88: TypeVector 6(int) 3 + 126: 6(int) Constant 2 + 148: 19(int) Constant 3 + 152: TypeVector 6(int) 4 + 220: 6(int) Constant 3 + 232: TypePointer Input 6(int) + 233(pos): 232(ptr) Variable Input + 235: TypePointer Output 9(fvec4) +236(@entryPointOutput): 235(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 231(pos): 7(ptr) Variable Function + 237(param): 7(ptr) Variable Function + 234: 6(int) Load 233(pos) + Store 231(pos) 234 + 238: 6(int) Load 231(pos) + Store 237(param) 238 + 239: 9(fvec4) FunctionCall 12(@main(u1;) 237(param) + Store 236(@entryPointOutput) 239 + Return + FunctionEnd + 12(@main(u1;): 9(fvec4) Function None 10 + 11(pos): 7(ptr) FunctionParameter + 13: Label + 14(size): 7(ptr) Variable Function +22(byteAddrTemp): 21(ptr) Variable Function +35(byteAddrTemp): 21(ptr) Variable Function +39(byteAddrTemp): 21(ptr) Variable Function +70(byteAddrTemp): 21(ptr) Variable Function +74(byteAddrTemp): 21(ptr) Variable Function +129(byteAddrTemp): 21(ptr) Variable Function +133(byteAddrTemp): 21(ptr) Variable Function + 20: 19(int) ArrayLength 18 0 + Store 14(size) 20 + 23: 6(int) Load 11(pos) + 25: 19(int) ShiftRightLogical 23 24 + Store 22(byteAddrTemp) 25 + 27: 19(int) Load 22(byteAddrTemp) + 28: 6(int) Load 11(pos) + 29: 19(int) ShiftRightLogical 28 24 + 31: 30(ptr) AccessChain 18 26 29 + 32: 6(int) Load 31 + 33: 8(float) ConvertUToF 32 + 34: 30(ptr) AccessChain 18 26 27 + Store 34 33 + 36: 6(int) Load 11(pos) + 37: 19(int) ShiftRightLogical 36 24 + Store 35(byteAddrTemp) 37 + 38: 19(int) Load 35(byteAddrTemp) + 40: 6(int) Load 11(pos) + 41: 19(int) ShiftRightLogical 40 24 + Store 39(byteAddrTemp) 41 + 42: 19(int) Load 39(byteAddrTemp) + 43: 30(ptr) AccessChain 18 26 42 + 44: 6(int) Load 43 + 45: 19(int) Load 39(byteAddrTemp) + 47: 19(int) IAdd 45 46 + 48: 30(ptr) AccessChain 18 26 47 + 49: 6(int) Load 48 + 51: 50(ivec2) CompositeConstruct 44 49 + 53: 6(int) CompositeExtract 51 0 + 54: 30(ptr) AccessChain 18 26 38 + Store 54 53 + 55: 19(int) Load 35(byteAddrTemp) + 56: 19(int) IAdd 55 46 + 57: 6(int) Load 11(pos) + 58: 19(int) ShiftRightLogical 57 24 + Store 39(byteAddrTemp) 58 + 59: 19(int) Load 39(byteAddrTemp) + 60: 30(ptr) AccessChain 18 26 59 + 61: 6(int) Load 60 + 62: 19(int) Load 39(byteAddrTemp) + 63: 19(int) IAdd 62 46 + 64: 30(ptr) AccessChain 18 26 63 + 65: 6(int) Load 64 + 66: 50(ivec2) CompositeConstruct 61 65 + 68: 6(int) CompositeExtract 66 1 + 69: 30(ptr) AccessChain 18 26 56 + Store 69 68 + 71: 6(int) Load 11(pos) + 72: 19(int) ShiftRightLogical 71 24 + Store 70(byteAddrTemp) 72 + 73: 19(int) Load 70(byteAddrTemp) + 75: 6(int) Load 11(pos) + 76: 19(int) ShiftRightLogical 75 24 + Store 74(byteAddrTemp) 76 + 77: 19(int) Load 74(byteAddrTemp) + 78: 30(ptr) AccessChain 18 26 77 + 79: 6(int) Load 78 + 80: 19(int) Load 74(byteAddrTemp) + 81: 19(int) IAdd 80 46 + 82: 30(ptr) AccessChain 18 26 81 + 83: 6(int) Load 82 + 84: 19(int) Load 74(byteAddrTemp) + 85: 19(int) IAdd 84 24 + 86: 30(ptr) AccessChain 18 26 85 + 87: 6(int) Load 86 + 89: 88(ivec3) CompositeConstruct 79 83 87 + 90: 6(int) CompositeExtract 89 0 + 91: 30(ptr) AccessChain 18 26 73 + Store 91 90 + 92: 19(int) Load 70(byteAddrTemp) + 93: 19(int) IAdd 92 46 + 94: 6(int) Load 11(pos) + 95: 19(int) ShiftRightLogical 94 24 + Store 74(byteAddrTemp) 95 + 96: 19(int) Load 74(byteAddrTemp) + 97: 30(ptr) AccessChain 18 26 96 + 98: 6(int) Load 97 + 99: 19(int) Load 74(byteAddrTemp) + 100: 19(int) IAdd 99 46 + 101: 30(ptr) AccessChain 18 26 100 + 102: 6(int) Load 101 + 103: 19(int) Load 74(byteAddrTemp) + 104: 19(int) IAdd 103 24 + 105: 30(ptr) AccessChain 18 26 104 + 106: 6(int) Load 105 + 107: 88(ivec3) CompositeConstruct 98 102 106 + 108: 6(int) CompositeExtract 107 1 + 109: 30(ptr) AccessChain 18 26 93 + Store 109 108 + 110: 19(int) Load 70(byteAddrTemp) + 111: 19(int) IAdd 110 24 + 112: 6(int) Load 11(pos) + 113: 19(int) ShiftRightLogical 112 24 + Store 74(byteAddrTemp) 113 + 114: 19(int) Load 74(byteAddrTemp) + 115: 30(ptr) AccessChain 18 26 114 + 116: 6(int) Load 115 + 117: 19(int) Load 74(byteAddrTemp) + 118: 19(int) IAdd 117 46 + 119: 30(ptr) AccessChain 18 26 118 + 120: 6(int) Load 119 + 121: 19(int) Load 74(byteAddrTemp) + 122: 19(int) IAdd 121 24 + 123: 30(ptr) AccessChain 18 26 122 + 124: 6(int) Load 123 + 125: 88(ivec3) CompositeConstruct 116 120 124 + 127: 6(int) CompositeExtract 125 2 + 128: 30(ptr) AccessChain 18 26 111 + Store 128 127 + 130: 6(int) Load 11(pos) + 131: 19(int) ShiftRightLogical 130 24 + Store 129(byteAddrTemp) 131 + 132: 19(int) Load 129(byteAddrTemp) + 134: 6(int) Load 11(pos) + 135: 19(int) ShiftRightLogical 134 24 + Store 133(byteAddrTemp) 135 + 136: 19(int) Load 133(byteAddrTemp) + 137: 30(ptr) AccessChain 18 26 136 + 138: 6(int) Load 137 + 139: 19(int) Load 133(byteAddrTemp) + 140: 19(int) IAdd 139 46 + 141: 30(ptr) AccessChain 18 26 140 + 142: 6(int) Load 141 + 143: 19(int) Load 133(byteAddrTemp) + 144: 19(int) IAdd 143 24 + 145: 30(ptr) AccessChain 18 26 144 + 146: 6(int) Load 145 + 147: 19(int) Load 133(byteAddrTemp) + 149: 19(int) IAdd 147 148 + 150: 30(ptr) AccessChain 18 26 149 + 151: 6(int) Load 150 + 153: 152(ivec4) CompositeConstruct 138 142 146 151 + 154: 6(int) CompositeExtract 153 0 + 155: 30(ptr) AccessChain 18 26 132 + Store 155 154 + 156: 19(int) Load 129(byteAddrTemp) + 157: 19(int) IAdd 156 46 + 158: 6(int) Load 11(pos) + 159: 19(int) ShiftRightLogical 158 24 + Store 133(byteAddrTemp) 159 + 160: 19(int) Load 133(byteAddrTemp) + 161: 30(ptr) AccessChain 18 26 160 + 162: 6(int) Load 161 + 163: 19(int) Load 133(byteAddrTemp) + 164: 19(int) IAdd 163 46 + 165: 30(ptr) AccessChain 18 26 164 + 166: 6(int) Load 165 + 167: 19(int) Load 133(byteAddrTemp) + 168: 19(int) IAdd 167 24 + 169: 30(ptr) AccessChain 18 26 168 + 170: 6(int) Load 169 + 171: 19(int) Load 133(byteAddrTemp) + 172: 19(int) IAdd 171 148 + 173: 30(ptr) AccessChain 18 26 172 + 174: 6(int) Load 173 + 175: 152(ivec4) CompositeConstruct 162 166 170 174 + 176: 6(int) CompositeExtract 175 1 + 177: 30(ptr) AccessChain 18 26 157 + Store 177 176 + 178: 19(int) Load 129(byteAddrTemp) + 179: 19(int) IAdd 178 24 + 180: 6(int) Load 11(pos) + 181: 19(int) ShiftRightLogical 180 24 + Store 133(byteAddrTemp) 181 + 182: 19(int) Load 133(byteAddrTemp) + 183: 30(ptr) AccessChain 18 26 182 + 184: 6(int) Load 183 + 185: 19(int) Load 133(byteAddrTemp) + 186: 19(int) IAdd 185 46 + 187: 30(ptr) AccessChain 18 26 186 + 188: 6(int) Load 187 + 189: 19(int) Load 133(byteAddrTemp) + 190: 19(int) IAdd 189 24 + 191: 30(ptr) AccessChain 18 26 190 + 192: 6(int) Load 191 + 193: 19(int) Load 133(byteAddrTemp) + 194: 19(int) IAdd 193 148 + 195: 30(ptr) AccessChain 18 26 194 + 196: 6(int) Load 195 + 197: 152(ivec4) CompositeConstruct 184 188 192 196 + 198: 6(int) CompositeExtract 197 2 + 199: 30(ptr) AccessChain 18 26 179 + Store 199 198 + 200: 19(int) Load 129(byteAddrTemp) + 201: 19(int) IAdd 200 148 + 202: 6(int) Load 11(pos) + 203: 19(int) ShiftRightLogical 202 24 + Store 133(byteAddrTemp) 203 + 204: 19(int) Load 133(byteAddrTemp) + 205: 30(ptr) AccessChain 18 26 204 + 206: 6(int) Load 205 + 207: 19(int) Load 133(byteAddrTemp) + 208: 19(int) IAdd 207 46 + 209: 30(ptr) AccessChain 18 26 208 + 210: 6(int) Load 209 + 211: 19(int) Load 133(byteAddrTemp) + 212: 19(int) IAdd 211 24 + 213: 30(ptr) AccessChain 18 26 212 + 214: 6(int) Load 213 + 215: 19(int) Load 133(byteAddrTemp) + 216: 19(int) IAdd 215 148 + 217: 30(ptr) AccessChain 18 26 216 + 218: 6(int) Load 217 + 219: 152(ivec4) CompositeConstruct 206 210 214 218 + 221: 6(int) CompositeExtract 219 3 + 222: 30(ptr) AccessChain 18 26 201 + Store 222 221 + 223: 6(int) Load 11(pos) + 224: 19(int) ShiftRightLogical 223 24 + 225: 30(ptr) AccessChain 18 26 224 + 226: 6(int) Load 225 + 227: 8(float) ConvertUToF 226 + 228: 9(fvec4) CompositeConstruct 227 227 227 227 + ReturnValue 228 + FunctionEnd diff --git a/Test/hlsl.structbuffer.atomics.frag b/Test/hlsl.structbuffer.atomics.frag new file mode 100644 index 0000000000000000000000000000000000000000..f389e27981e25f2191bb7f743b073224b554b017 --- /dev/null +++ b/Test/hlsl.structbuffer.atomics.frag @@ -0,0 +1,25 @@ + +RWByteAddressBuffer sbuf; + +float4 main(uint pos : FOO) : SV_Target0 +{ + uint u; + + sbuf.InterlockedAdd(8, 1); + sbuf.InterlockedAdd(8, 1, u); + sbuf.InterlockedAnd(8, 1); + sbuf.InterlockedAnd(8, 1, u); + sbuf.InterlockedCompareExchange(8, 1, 2, u); + // sbuf.InterlockedCompareStore(8, 1, 2); // TODO: ... + sbuf.InterlockedExchange(8, 1, u); + sbuf.InterlockedMax(8, 1); + sbuf.InterlockedMax(8, 1, u); + sbuf.InterlockedMin(8, 1); + sbuf.InterlockedMin(8, 1, u); + sbuf.InterlockedOr(8, 1); + sbuf.InterlockedOr(8, 1, u); + sbuf.InterlockedXor(8, 1); + sbuf.InterlockedXor(8, 1, u); + + return sbuf.Load(pos); +} diff --git a/Test/hlsl.structbuffer.byte.frag b/Test/hlsl.structbuffer.byte.frag new file mode 100644 index 0000000000000000000000000000000000000000..2d504da1cfd2074a85a01d71c1aa69e6e252e0a5 --- /dev/null +++ b/Test/hlsl.structbuffer.byte.frag @@ -0,0 +1,13 @@ + +ByteAddressBuffer sbuf; + +float4 main(uint pos : FOO) : SV_Target0 +{ + uint size; + sbuf.GetDimensions(size); + + return sbuf.Load(pos) + + float4(sbuf.Load2(pos+4), 0, 0) + + float4(sbuf.Load3(pos+8), 0) + + sbuf.Load4(pos+12); +} diff --git a/Test/hlsl.structbuffer.coherent.frag b/Test/hlsl.structbuffer.coherent.frag new file mode 100644 index 0000000000000000000000000000000000000000..1c60ef5aa4c55f34809f4db304026ec6b294d05b --- /dev/null +++ b/Test/hlsl.structbuffer.coherent.frag @@ -0,0 +1,23 @@ +struct sb_t +{ + float3 color; + bool test; +}; + + +globallycoherent RWStructuredBuffer<sb_t> sbuf; +globallycoherent RWStructuredBuffer<float> sbuf2; + +float4 main(uint pos : FOO) : SV_Target0 +{ + sbuf2[pos+1] = 42; + + uint size; + uint stride; + sbuf.GetDimensions(size, stride); + + if (sbuf[pos].test) + return float4(sbuf[pos].color + sbuf2[pos], 0); + else + return size + stride; +} diff --git a/Test/hlsl.structbuffer.frag b/Test/hlsl.structbuffer.frag new file mode 100644 index 0000000000000000000000000000000000000000..4eb6912bf42ccd297f5bb21c4fad1d782bbb490f --- /dev/null +++ b/Test/hlsl.structbuffer.frag @@ -0,0 +1,23 @@ +struct sb_t +{ + float3 color; + bool test; + bool test2; +}; // stride = 20 + +StructuredBuffer<sb_t> sbuf : register(c10); +StructuredBuffer<float> sbuf2; + +float4 main(uint pos : FOO) : SV_Target0 +{ + sb_t mydata = sbuf.Load(pos); + + uint size; + uint stride; + sbuf.GetDimensions(size, stride); + + if (sbuf[pos].test) + return float4(sbuf[pos].color + sbuf2[pos], 0); + else + return mydata.color.x + size + stride; +} diff --git a/Test/hlsl.structbuffer.rw.frag b/Test/hlsl.structbuffer.rw.frag new file mode 100644 index 0000000000000000000000000000000000000000..31104847c6b9cb5a3cc812a92fa212efb3479965 --- /dev/null +++ b/Test/hlsl.structbuffer.rw.frag @@ -0,0 +1,23 @@ +struct sb_t +{ + float3 color; + bool test; +}; + + +RWStructuredBuffer<sb_t> sbuf; +RWStructuredBuffer<float> sbuf2; + +float4 main(uint pos : FOO) : SV_Target0 +{ + sbuf2[pos+1] = 42; + + uint size; + uint stride; + sbuf.GetDimensions(size, stride); + + if (sbuf[pos].test) + return float4(sbuf[pos].color + sbuf2[pos], 0); + else + return size + stride; +} diff --git a/Test/hlsl.structbuffer.rwbyte.frag b/Test/hlsl.structbuffer.rwbyte.frag new file mode 100644 index 0000000000000000000000000000000000000000..d0b957d75c707b3b5f7fb36f6e6ac611adf12e51 --- /dev/null +++ b/Test/hlsl.structbuffer.rwbyte.frag @@ -0,0 +1,15 @@ + +RWByteAddressBuffer sbuf; + +float4 main(uint pos : FOO) : SV_Target0 +{ + uint size; + sbuf.GetDimensions(size); + + sbuf.Store(pos, sbuf.Load(pos)); + sbuf.Store2(pos, sbuf.Load2(pos)); + sbuf.Store3(pos, sbuf.Load3(pos)); + sbuf.Store4(pos, sbuf.Load4(pos)); + + return sbuf.Load(pos); +} diff --git a/glslang/Include/intermediate.h b/glslang/Include/intermediate.h index dc87ba905b67a12b999ca75b07e7f55ef605bab4..4b58e9b0d55f1a561fb491656d7f442a1fb3e52e 100644 --- a/glslang/Include/intermediate.h +++ b/glslang/Include/intermediate.h @@ -624,6 +624,15 @@ enum TOperator { EOpMethodCalculateLevelOfDetail, // ... EOpMethodCalculateLevelOfDetailUnclamped, // ... + // Load already defined above for textures + EOpMethodLoad2, // Structure buffer object methods. These are translated to existing + EOpMethodLoad3, // AST methods, and exist to represent HLSL semantics until that + EOpMethodLoad4, // translation is performed. See HlslParseContext::decomposeSampleMethods(). + EOpMethodStore, // ... + EOpMethodStore2, // ... + EOpMethodStore3, // ... + EOpMethodStore4, // ... + // SM5 texture methods EOpMethodGatherRed, // These are covered under the above EOpMethodSample comment about EOpMethodGatherGreen, // translation to existing AST opcodes. They exist temporarily diff --git a/gtests/Hlsl.FromFile.cpp b/gtests/Hlsl.FromFile.cpp index ed1cb008e3ee423142aa2576dcda257210d9ebfd..3187f436f30f9986f98609300d55c24fd0b54017 100644 --- a/gtests/Hlsl.FromFile.cpp +++ b/gtests/Hlsl.FromFile.cpp @@ -221,6 +221,12 @@ INSTANTIATE_TEST_CASE_P( {"hlsl.struct.split.trivial.vert", "main"}, {"hlsl.structarray.flatten.frag", "main"}, {"hlsl.structarray.flatten.geom", "main"}, + {"hlsl.structbuffer.frag", "main"}, + {"hlsl.structbuffer.atomics.frag", "main"}, + {"hlsl.structbuffer.byte.frag", "main"}, + {"hlsl.structbuffer.coherent.frag", "main"}, + {"hlsl.structbuffer.rw.frag", "main"}, + {"hlsl.structbuffer.rwbyte.frag", "main"}, {"hlsl.structin.vert", "main"}, {"hlsl.structIoFourWay.frag", "main"}, {"hlsl.intrinsics.vert", "VertexShaderFunction"}, diff --git a/hlsl/hlslGrammar.cpp b/hlsl/hlslGrammar.cpp index ea2ae5559a0bd388e5805a5cafd74b3fa4160875..974c8959ee6ba019975f4351a2250efe5e1d06c6 100755 --- a/hlsl/hlslGrammar.cpp +++ b/hlsl/hlslGrammar.cpp @@ -406,6 +406,27 @@ bool HlslGrammar::acceptDeclaration(TIntermNode*& node, TIntermNode*& node2) } } + TString* blockName = idToken.string; + + // For structbuffers, we couldn't create the block type while accepting the + // template type, because we need the identifier name. Now that we have that, + // we can create the buffer type. + // TODO: how to determine this without looking for implicit array sizes? + if (variableType.getBasicType() == EbtBlock) { + const int memberCount = variableType.getStruct()->size(); + assert(memberCount > 0); + + TType* contentType = (*variableType.getStruct())[memberCount-1].type; + + // Set the field name and qualifier from the declaration, now that we know it. + if (contentType->isRuntimeSizedArray()) { + contentType->getQualifier() = variableType.getQualifier(); + blockName = nullptr; // this will be an anonymous block... + contentType->setFieldName(*idToken.string); // field name is declaration name + variableType.setTypeName(*idToken.string); + } + } + // Hand off the actual declaration // TODO: things scoped within an annotation need their own name space; @@ -414,7 +435,7 @@ bool HlslGrammar::acceptDeclaration(TIntermNode*& node, TIntermNode*& node2) if (typedefDecl) parseContext.declareTypedef(idToken.loc, *idToken.string, variableType); else if (variableType.getBasicType() == EbtBlock) - parseContext.declareBlock(idToken.loc, variableType, idToken.string); + parseContext.declareBlock(idToken.loc, variableType, blockName); else { if (variableType.getQualifier().storage == EvqUniform && ! variableType.containsOpaque()) { // this isn't really an individual variable, but a member of the $Global buffer @@ -533,8 +554,11 @@ bool HlslGrammar::acceptFullySpecifiedType(TType& type) qualifier.layoutFormat = type.getQualifier().layoutFormat; qualifier.precision = type.getQualifier().precision; - if (type.getQualifier().storage == EvqVaryingOut) + if (type.getQualifier().storage == EvqVaryingOut || + type.getQualifier().storage == EvqBuffer) { qualifier.storage = type.getQualifier().storage; + qualifier.readonly = type.getQualifier().readonly; + } type.getQualifier() = qualifier; } @@ -609,6 +633,9 @@ bool HlslGrammar::acceptQualifier(TQualifier& qualifier) if (! acceptLayoutQualifierList(qualifier)) return false; continue; + case EHTokGloballyCoherent: + qualifier.coherent = true; + break; // GS geometries: these are specified on stage input variables, and are an error (not verified here) // for output variables. @@ -1246,11 +1273,19 @@ bool HlslGrammar::acceptType(TType& type) return acceptTextureType(type); break; + case EHTokAppendStructuredBuffer: + case EHTokByteAddressBuffer: + case EHTokConsumeStructuredBuffer: + case EHTokRWByteAddressBuffer: + case EHTokRWStructuredBuffer: + case EHTokStructuredBuffer: + return acceptStructBufferType(type); + break; + case EHTokStruct: case EHTokCBuffer: case EHTokTBuffer: return acceptStruct(type); - break; case EHTokIdentifier: // An identifier could be for a user-defined type. @@ -1783,6 +1818,93 @@ bool HlslGrammar::acceptStruct(TType& type) return true; } +// struct_buffer +// : APPENDSTRUCTUREDBUFFER +// | BYTEADDRESSBUFFER +// | CONSUMESTRUCTUREDBUFFER +// | RWBYTEADDRESSBUFFER +// | RWSTRUCTUREDBUFFER +// | STRUCTUREDBUFFER +bool HlslGrammar::acceptStructBufferType(TType& type) +{ + const EHlslTokenClass structBuffType = peek(); + + // TODO: globallycoherent + bool hasTemplateType = true; + bool readonly = false; + + TStorageQualifier storage = EvqBuffer; + + switch (structBuffType) { + case EHTokAppendStructuredBuffer: + unimplemented("AppendStructuredBuffer"); + return false; + case EHTokByteAddressBuffer: + hasTemplateType = false; + readonly = true; + break; + case EHTokConsumeStructuredBuffer: + unimplemented("ConsumeStructuredBuffer"); + return false; + case EHTokRWByteAddressBuffer: + hasTemplateType = false; + break; + case EHTokRWStructuredBuffer: + break; + case EHTokStructuredBuffer: + readonly = true; + break; + default: + return false; // not a structure buffer type + } + + advanceToken(); // consume the structure keyword + + // type on which this StructedBuffer is templatized. E.g, StructedBuffer<MyStruct> ==> MyStruct + TType* templateType = new TType; + + if (hasTemplateType) { + if (! acceptTokenClass(EHTokLeftAngle)) { + expected("left angle bracket"); + return false; + } + + if (! acceptType(*templateType)) { + expected("type"); + return false; + } + if (! acceptTokenClass(EHTokRightAngle)) { + expected("right angle bracket"); + return false; + } + } else { + // byte address buffers have no explicit type. + TType uintType(EbtUint, storage); + templateType->shallowCopy(uintType); + } + + // Create an unsized array out of that type. + // TODO: does this work if it's already an array type? + TArraySizes unsizedArray; + unsizedArray.addInnerSize(UnsizedArraySize); + templateType->newArraySizes(unsizedArray); + templateType->getQualifier().storage = storage; + templateType->getQualifier().readonly = readonly; + + // Create block type. TODO: hidden internal uint member when needed + TTypeList* blockStruct = new TTypeList; + TTypeLoc member = { templateType, token.loc }; + blockStruct->push_back(member); + + TType blockType(blockStruct, "", templateType->getQualifier()); + + // It's not until we see the name during declaration that we can set the + // field name. That happens in HlslGrammar::acceptDeclaration. + type.shallowCopy(blockType); + + return true; +} + // struct_declaration_list // : struct_declaration SEMI_COLON struct_declaration SEMI_COLON ... // diff --git a/hlsl/hlslGrammar.h b/hlsl/hlslGrammar.h index f98d650cb5e69560260cfcac0cc945e7d47005ce..c8753fdc68934d4cfa534e01be8e4c4ef085d049 100755 --- a/hlsl/hlslGrammar.h +++ b/hlsl/hlslGrammar.h @@ -83,6 +83,7 @@ namespace glslang { bool acceptAnnotations(TQualifier&); bool acceptSamplerType(TType&); bool acceptTextureType(TType&); + bool acceptStructBufferType(TType&); bool acceptStruct(TType&); bool acceptStructDeclarationList(TTypeList*&); bool acceptFunctionParameters(TFunction&); diff --git a/hlsl/hlslParseHelper.cpp b/hlsl/hlslParseHelper.cpp index 5ff54d4824e3cfb68e53e631004e37a20f2956c5..af4edc211dea63d103996d760ce5673ff23d15c2 100755 --- a/hlsl/hlslParseHelper.cpp +++ b/hlsl/hlslParseHelper.cpp @@ -790,6 +790,61 @@ TIntermTyped* HlslParseContext::handleUnaryMath(const TSourceLoc& loc, const cha return childNode; } +// +// Return true if the name is a sampler method +// +bool HlslParseContext::isSamplerMethod(const TString& name) const +{ + return + name == "CalculateLevelOfDetail" || + name == "CalculateLevelOfDetailUnclamped" || + name == "Gather" || + name == "GatherRed" || + name == "GatherGreen" || + name == "GatherBlue" || + name == "GatherAlpha" || + name == "GatherCmp" || + name == "GatherCmpRed" || + name == "GatherCmpGreen" || + name == "GatherCmpBlue" || + name == "GatherCmpAlpha" || + name == "GetDimensions" || + name == "GetSamplePosition" || + name == "Load" || + name == "Sample" || + name == "SampleBias" || + name == "SampleCmp" || + name == "SampleCmpLevelZero" || + name == "SampleGrad" || + name == "SampleLevel"; +} + +// +// Return true if the name is a struct buffer method +// +bool HlslParseContext::isStructBufferMethod(const TString& name) const +{ + return + name == "GetDimensions" || + name == "Load" || + name == "Load2" || + name == "Load3" || + name == "Load4" || + name == "Store" || + name == "Store2" || + name == "Store3" || + name == "Store4" || + name == "InterlockedAdd" || + name == "InterlockedAnd" || + name == "InterlockedCompareExchange" || + name == "InterlockedCompareStore" || + name == "InterlockedExchange" || + name == "InterlockedMax" || + name == "InterlockedMin" || + name == "InterlockedOr" || + name == "InterlockedXor"; +} + // // Handle seeing a base.field dereference in the grammar. // @@ -804,35 +859,18 @@ TIntermTyped* HlslParseContext::handleDotDereference(const TSourceLoc& loc, TInt // if (field == "length") { return intermediate.addMethod(base, TType(EbtInt), &field, loc); - } else if (field == "CalculateLevelOfDetail" || - field == "CalculateLevelOfDetailUnclamped" || - field == "Gather" || - field == "GatherRed" || - field == "GatherGreen" || - field == "GatherBlue" || - field == "GatherAlpha" || - field == "GatherCmp" || - field == "GatherCmpRed" || - field == "GatherCmpGreen" || - field == "GatherCmpBlue" || - field == "GatherCmpAlpha" || - field == "GetDimensions" || - field == "GetSamplePosition" || - field == "Load" || - field == "Sample" || - field == "SampleBias" || - field == "SampleCmp" || - field == "SampleCmpLevelZero" || - field == "SampleGrad" || - field == "SampleLevel") { - // If it's not a method on a sampler object, we fall through in case it is a struct member. - if (base->getType().getBasicType() == EbtSampler) { - const TSampler& sampler = base->getType().getSampler(); - if (! sampler.isPureSampler()) { - const int vecSize = sampler.isShadow() ? 1 : 4; // TODO: handle arbitrary sample return sizes - return intermediate.addMethod(base, TType(sampler.type, EvqTemporary, vecSize), &field, loc); - } - } + } else if (isSamplerMethod(field) && base->getType().getBasicType() == EbtSampler) { + // If it's not a method on a sampler object, we fall through to let other objects have a go. + const TSampler& sampler = base->getType().getSampler(); + if (! sampler.isPureSampler()) { + const int vecSize = sampler.isShadow() ? 1 : 4; // TODO: handle arbitrary sample return sizes + return intermediate.addMethod(base, TType(sampler.type, EvqTemporary, vecSize), &field, loc); + } + } else if (isStructBufferMethod(field) && + base->getType().isRuntimeSizedArray() && + (base->getQualifier().storage == EvqUniform || base->getQualifier().storage == EvqBuffer)) { + TType retType(base->getType(), 0); + return intermediate.addMethod(base, retType, &field, loc); } else if (field == "Append" || field == "RestartStrip") { // We cannot check the type here: it may be sanitized if we're not compiling a geometry shader, but @@ -2236,6 +2274,236 @@ TIntermAggregate* HlslParseContext::handleSamplerTextureCombine(const TSourceLoc return txcombine; } +// +// Decompose structure buffer methods into AST +// +void HlslParseContext::decomposeStructBufferMethods(const TSourceLoc& loc, TIntermTyped*& node, TIntermNode* arguments) +{ + if (!node || !node->getAsOperator()) + return; + + const TOperator op = node->getAsOperator()->getOp(); + TIntermAggregate* argAggregate = arguments ? arguments->getAsAggregate() : nullptr; + + TIntermTyped* argArray = argAggregate ? argAggregate->getSequence()[0]->getAsTyped() : nullptr; // array + + // Bail out if not a block method + if (argArray == nullptr || !argArray->getType().isRuntimeSizedArray()) + return; + + switch (op) { + case EOpMethodLoad: + { + TIntermTyped* argIndex = argAggregate->getSequence()[1]->getAsTyped(); // index + + // Byte address buffers index in bytes (only multiples of 4 permitted... not so much a byte address + // buffer then, but that's what it calls itself. + const bool isByteAddressBuffer = (argArray->getBasicType() == EbtUint); + if (isByteAddressBuffer) + argIndex = intermediate.addBinaryNode(EOpRightShift, argIndex, intermediate.addConstantUnion(2, loc, true), + loc, TType(EbtInt)); + + // Index into the array to find the item being loaded. + const TOperator idxOp = (argIndex->getQualifier().storage == EvqConst) ? EOpIndexDirect : EOpIndexIndirect; + + node = intermediate.addIndex(idxOp, argArray, argIndex, loc); + + const TType derefType(argArray->getType(), 0); + node->setType(derefType); + } + + break; + + case EOpMethodLoad2: + case EOpMethodLoad3: + case EOpMethodLoad4: + { + TIntermTyped* argIndex = argAggregate->getSequence()[1]->getAsTyped(); // index + + TOperator constructOp = EOpNull; + int size = 0; + + switch (op) { + case EOpMethodLoad2: size = 2; constructOp = EOpConstructVec2; break; + case EOpMethodLoad3: size = 3; constructOp = EOpConstructVec3; break; + case EOpMethodLoad4: size = 4; constructOp = EOpConstructVec4; break; + default: assert(0); + } + + TIntermTyped* body = nullptr; + + // First, we'll store the address in a variable to avoid multiple shifts + // (we must convert the byte address to an item address) + TIntermTyped* byteAddrIdx = intermediate.addBinaryNode(EOpRightShift, argIndex, + intermediate.addConstantUnion(2, loc, true), loc, TType(EbtInt)); + + TVariable* byteAddrSym = makeInternalVariable("byteAddrTemp", TType(EbtInt, EvqTemporary)); + TIntermTyped* byteAddrIdxVar = intermediate.addSymbol(*byteAddrSym, loc); + + body = intermediate.growAggregate(body, intermediate.addAssign(EOpAssign, byteAddrIdxVar, byteAddrIdx, loc)); + + TIntermTyped* vec = nullptr; + + // These are only valid on (rw)byteaddressbuffers, so we can always perform the >>2 + // address conversion. + for (int idx=0; idx<size; ++idx) { + TIntermTyped* offsetIdx = byteAddrIdxVar; + + // add index offset + if (idx != 0) + offsetIdx = intermediate.addBinaryNode(EOpAdd, offsetIdx, intermediate.addConstantUnion(idx, loc, true), + loc, TType(EbtInt)); + + const TOperator idxOp = (offsetIdx->getQualifier().storage == EvqConst) ? EOpIndexDirect : EOpIndexIndirect; + + vec = intermediate.growAggregate(vec, intermediate.addIndex(idxOp, argArray, offsetIdx, loc)); + } + + vec->setType(TType(argArray->getBasicType(), EvqTemporary, size)); + vec->getAsAggregate()->setOperator(constructOp); + + body = intermediate.growAggregate(body, vec); + body->setType(vec->getType()); + body->getAsAggregate()->setOperator(EOpSequence); + + node = body; + } + + break; + + case EOpMethodStore: + case EOpMethodStore2: + case EOpMethodStore3: + case EOpMethodStore4: + { + TIntermTyped* argIndex = argAggregate->getSequence()[1]->getAsTyped(); // address + TIntermTyped* argValue = argAggregate->getSequence()[2]->getAsTyped(); // value + + // Index into the array to find the item being loaded. + // Byte address buffers index in bytes (only multiples of 4 permitted... not so much a byte address + // buffer then, but that's what it calls itself. + + int size = 0; + + switch (op) { + case EOpMethodStore: size = 1; break; + case EOpMethodStore2: size = 2; break; + case EOpMethodStore3: size = 3; break; + case EOpMethodStore4: size = 4; break; + default: assert(0); + } + + TIntermAggregate* body = nullptr; + + // First, we'll store the address in a variable to avoid multiple shifts + // (we must convert the byte address to an item address) + TIntermTyped* byteAddrIdx = intermediate.addBinaryNode(EOpRightShift, argIndex, + intermediate.addConstantUnion(2, loc, true), loc, TType(EbtInt)); + + TVariable* byteAddrSym = makeInternalVariable("byteAddrTemp", TType(EbtInt, EvqTemporary)); + TIntermTyped* byteAddrIdxVar = intermediate.addSymbol(*byteAddrSym, loc); + + body = intermediate.growAggregate(body, intermediate.addAssign(EOpAssign, byteAddrIdxVar, byteAddrIdx, loc)); + + for (int idx=0; idx<size; ++idx) { + TIntermTyped* offsetIdx = byteAddrIdxVar; + TIntermTyped* idxConst = intermediate.addConstantUnion(idx, loc, true); + + // add index offset + if (idx != 0) + offsetIdx = intermediate.addBinaryNode(EOpAdd, offsetIdx, idxConst, loc, TType(EbtInt)); + + const TOperator idxOp = (offsetIdx->getQualifier().storage == EvqConst) ? EOpIndexDirect : EOpIndexIndirect; + + TIntermTyped* lValue = intermediate.addIndex(idxOp, argArray, offsetIdx, loc); + TIntermTyped* rValue = (size == 1) ? argValue : + intermediate.addIndex(EOpIndexDirect, argValue, idxConst, loc); + + TIntermTyped* assign = intermediate.addAssign(EOpAssign, lValue, rValue, loc); + + body = intermediate.growAggregate(body, assign); + } + + body->setOperator(EOpSequence); + node = body; + } + + break; + + case EOpMethodGetDimensions: + { + const int numArgs = argAggregate->getSequence().size(); + TIntermTyped* argNumItems = argAggregate->getSequence()[1]->getAsTyped(); // out num items + TIntermTyped* argStride = numArgs > 2 ? argAggregate->getSequence()[2]->getAsTyped() : nullptr; // out stride + + TIntermAggregate* body = nullptr; + + // Length output: + if (argArray->getType().isRuntimeSizedArray()) { + TIntermTyped* lengthCall = intermediate.addBuiltInFunctionCall(loc, EOpArrayLength, true, argArray, + argNumItems->getType()); + TIntermTyped* assign = intermediate.addAssign(EOpAssign, argNumItems, lengthCall, loc); + body = intermediate.growAggregate(body, assign, loc); + } else { + const int length = argArray->getType().getOuterArraySize(); + TIntermTyped* assign = intermediate.addAssign(EOpAssign, argNumItems, intermediate.addConstantUnion(length, loc, true), loc); + body = intermediate.growAggregate(body, assign, loc); + } + + // Stride output: + if (argStride != nullptr) { + int size; + int stride; + intermediate.getBaseAlignment(argArray->getType(), size, stride, false, + argArray->getType().getQualifier().layoutMatrix == ElmRowMajor); + + TIntermTyped* assign = intermediate.addAssign(EOpAssign, argStride, intermediate.addConstantUnion(stride, loc, true), loc); + + body = intermediate.growAggregate(body, assign); + } + + body->setOperator(EOpSequence); + node = body; + } + + break; + + case EOpInterlockedAdd: + case EOpInterlockedAnd: + case EOpInterlockedExchange: + case EOpInterlockedMax: + case EOpInterlockedMin: + case EOpInterlockedOr: + case EOpInterlockedXor: + case EOpInterlockedCompareExchange: + case EOpInterlockedCompareStore: + { + // We'll replace the first argument with the block dereference, and let + // downstream decomposition handle the rest. + + TIntermSequence& sequence = argAggregate->getSequence(); + + TIntermTyped* argIndex = sequence[1]->getAsTyped(); // index + argIndex = intermediate.addBinaryNode(EOpRightShift, argIndex, intermediate.addConstantUnion(2, loc, true), + loc, TType(EbtInt)); + + const TOperator idxOp = (argIndex->getQualifier().storage == EvqConst) ? EOpIndexDirect : EOpIndexIndirect; + TIntermTyped* element = intermediate.addIndex(idxOp, argArray, argIndex, loc); + + const TType derefType(argArray->getType(), 0); + element->setType(derefType); + + // Replace the numeric byte offset parameter with array reference. + sequence[1] = element; + sequence.erase(sequence.begin(), sequence.begin()+1); + } + break; + + default: + break; // most pass through unchanged + } +} + // // Decompose DX9 and DX10 sample intrinsics & object methods into AST // @@ -2264,6 +2532,15 @@ void HlslParseContext::decomposeSampleMethods(const TSourceLoc& loc, TIntermType const TOperator op = node->getAsOperator()->getOp(); const TIntermAggregate* argAggregate = arguments ? arguments->getAsAggregate() : nullptr; + // Bail out if not a sampler method + if (arguments != nullptr) { + if ((argAggregate != nullptr && argAggregate->getSequence()[0]->getAsTyped()->getBasicType() != EbtSampler)) + return; + + if (argAggregate == nullptr && arguments->getAsTyped()->getBasicType() != EbtSampler) + return; + } + switch (op) { // **** DX9 intrinsics: **** case EOpTexture: @@ -3359,9 +3636,27 @@ TIntermTyped* HlslParseContext::handleFunctionCall(const TSourceLoc& loc, TFunct // // Find it in the symbol table. // - const TFunction* fnCandidate; + const TFunction* fnCandidate = nullptr; bool builtIn; - fnCandidate = findFunction(loc, *function, builtIn, arguments); + + // TODO: this needs improvement: there's no way at present to look up a signature in + // the symbol table for an arbitrary type. This is a temporary hack until that ability exists. + // It will have false positives, since it doesn't check arg counts or types. + if (arguments && arguments->getAsAggregate()) { + if (arguments->getAsAggregate()->getSequence()[0]->getAsTyped()->getType().isRuntimeSizedArray()) { + if (isStructBufferMethod(function->getName())) { + const TString mangle = function->getName() + "("; + TSymbol* symbol = symbolTable.find(mangle, &builtIn); + + if (symbol) + fnCandidate = symbol->getAsFunction(); + } + } + } + + if (fnCandidate == nullptr) + fnCandidate = findFunction(loc, *function, builtIn, arguments); + if (fnCandidate) { // This is a declared function that might map to // - a built-in operator, @@ -3407,9 +3702,10 @@ TIntermTyped* HlslParseContext::handleFunctionCall(const TSourceLoc& loc, TFunct // output conversions. const TIntermTyped* fnNode = result; - decomposeIntrinsic(loc, result, arguments); // HLSL->AST intrinsic decompositions - decomposeSampleMethods(loc, result, arguments); // HLSL->AST sample method decompositions - decomposeGeometryMethods(loc, result, arguments); // HLSL->AST geometry method decompositions + decomposeStructBufferMethods(loc, result, arguments); // HLSL->AST struct buffer method decompositions + decomposeIntrinsic(loc, result, arguments); // HLSL->AST intrinsic decompositions + decomposeSampleMethods(loc, result, arguments); // HLSL->AST sample method decompositions + decomposeGeometryMethods(loc, result, arguments); // HLSL->AST geometry method decompositions // Convert 'out' arguments. If it was a constant folded built-in, it won't be an aggregate anymore. // Built-ins with a single argument aren't called with an aggregate, but they also don't have an output. diff --git a/hlsl/hlslParseHelper.h b/hlsl/hlslParseHelper.h index fa1cbf470559900c2b3c02e3ea14e1c65cdd1156..de1bc9581aec13ae6d883f08b16a7bed7a109c74 100755 --- a/hlsl/hlslParseHelper.h +++ b/hlsl/hlslParseHelper.h @@ -84,6 +84,7 @@ public: TIntermTyped* handleFunctionCall(const TSourceLoc&, TFunction*, TIntermTyped*); void decomposeIntrinsic(const TSourceLoc&, TIntermTyped*& node, TIntermNode* arguments); void decomposeSampleMethods(const TSourceLoc&, TIntermTyped*& node, TIntermNode* arguments); + void decomposeStructBufferMethods(const TSourceLoc&, TIntermTyped*& node, TIntermNode* arguments); void decomposeGeometryMethods(const TSourceLoc&, TIntermTyped*& node, TIntermNode* arguments); TIntermTyped* handleLengthMethod(const TSourceLoc&, TFunction*, TIntermNode*); void addInputArgumentConversions(const TFunction&, TIntermTyped*&); @@ -243,6 +244,10 @@ protected: void correctUniform(TQualifier& qualifier); void clearUniformInputOutput(TQualifier& qualifier); + // Test method names + bool isSamplerMethod(const TString& name) const; + bool isStructBufferMethod(const TString& name) const; + // Pass through to base class after remembering builtin mappings. using TParseContextBase::trackLinkage; void trackLinkage(TSymbol& variable) override; diff --git a/hlsl/hlslParseables.cpp b/hlsl/hlslParseables.cpp index 442f3b17542305fe4d1239a0bdda533605c3bb20..dd336a3f7dc8ece0ab5f89b03150e8ebbb0b0aac 100755 --- a/hlsl/hlslParseables.cpp +++ b/hlsl/hlslParseables.cpp @@ -850,6 +850,26 @@ void TBuiltInParseablesHlsl::initialize(int /*version*/, EProfile /*profile*/, c { "Append", "-", "-", "-", "-", EShLangGS }, { "RestartStrip", "-", "-", "-", "-", EShLangGS }, + // Methods for structurebuffers. TODO: wildcard type matching. + { "Load", nullptr, nullptr, "-", "-", EShLangAll }, + { "Load2", nullptr, nullptr, "-", "-", EShLangAll }, + { "Load3", nullptr, nullptr, "-", "-", EShLangAll }, + { "Load4", nullptr, nullptr, "-", "-", EShLangAll }, + { "Store", nullptr, nullptr, "-", "-", EShLangAll }, + { "Store2", nullptr, nullptr, "-", "-", EShLangAll }, + { "Store3", nullptr, nullptr, "-", "-", EShLangAll }, + { "Store4", nullptr, nullptr, "-", "-", EShLangAll }, + { "GetDimensions", nullptr, nullptr, "-", "-", EShLangAll }, + { "InterlockedAdd", nullptr, nullptr, "-", "-", EShLangAll }, + { "InterlockedAnd", nullptr, nullptr, "-", "-", EShLangAll }, + { "InterlockedCompareExchange", nullptr, nullptr, "-", "-", EShLangAll }, + { "InterlockedCompareStore", nullptr, nullptr, "-", "-", EShLangAll }, + { "InterlockedExchange", nullptr, nullptr, "-", "-", EShLangAll }, + { "InterlockedMax", nullptr, nullptr, "-", "-", EShLangAll }, + { "InterlockedMin", nullptr, nullptr, "-", "-", EShLangAll }, + { "InterlockedOr", nullptr, nullptr, "-", "-", EShLangAll }, + { "InterlockedXor", nullptr, nullptr, "-", "-", EShLangAll }, + // Mark end of list, since we want to avoid a range-based for, as some compilers don't handle it yet. { nullptr, nullptr, nullptr, nullptr, nullptr, 0 }, }; @@ -1144,6 +1164,15 @@ void TBuiltInParseablesHlsl::identifyBuiltIns(int /*version*/, EProfile /*profil symbolTable.relateToOperator("CalculateLevelOfDetail", EOpMethodCalculateLevelOfDetail); symbolTable.relateToOperator("CalculateLevelOfDetailUnclamped", EOpMethodCalculateLevelOfDetailUnclamped); + // Structure buffer methods (excluding associations already made above for texture methods w/ same name) + symbolTable.relateToOperator("Load2", EOpMethodLoad2); + symbolTable.relateToOperator("Load3", EOpMethodLoad3); + symbolTable.relateToOperator("Load4", EOpMethodLoad4); + symbolTable.relateToOperator("Store", EOpMethodStore); + symbolTable.relateToOperator("Store2", EOpMethodStore2); + symbolTable.relateToOperator("Store3", EOpMethodStore3); + symbolTable.relateToOperator("Store4", EOpMethodStore4); + // SM5 Texture methods symbolTable.relateToOperator("GatherRed", EOpMethodGatherRed); symbolTable.relateToOperator("GatherGreen", EOpMethodGatherGreen); diff --git a/hlsl/hlslScanContext.cpp b/hlsl/hlslScanContext.cpp index 7fe8ca262a8d642c924148bd5b115bee5a795184..907ccd1cdd8851a8aae25c4113093c479b47e848 100755 --- a/hlsl/hlslScanContext.cpp +++ b/hlsl/hlslScanContext.cpp @@ -118,6 +118,7 @@ void HlslScanContext::fillInKeywordMap() (*KeywordMap)["out"] = EHTokOut; (*KeywordMap)["inout"] = EHTokInOut; (*KeywordMap)["layout"] = EHTokLayout; + (*KeywordMap)["globallycoherent"] = EHTokGloballyCoherent; (*KeywordMap)["point"] = EHTokPoint; (*KeywordMap)["line"] = EHTokLine; @@ -319,6 +320,13 @@ void HlslScanContext::fillInKeywordMap() (*KeywordMap)["RWTexture3D"] = EHTokRWTexture3d; (*KeywordMap)["RWBuffer"] = EHTokRWBuffer; + (*KeywordMap)["AppendStructuredBuffer"] = EHTokAppendStructuredBuffer; + (*KeywordMap)["ByteAddressBuffer"] = EHTokByteAddressBuffer; + (*KeywordMap)["ConsumeStructuredBuffer"] = EHTokConsumeStructuredBuffer; + (*KeywordMap)["RWByteAddressBuffer"] = EHTokRWByteAddressBuffer; + (*KeywordMap)["RWStructuredBuffer"] = EHTokRWStructuredBuffer; + (*KeywordMap)["StructuredBuffer"] = EHTokStructuredBuffer; + (*KeywordMap)["struct"] = EHTokStruct; (*KeywordMap)["cbuffer"] = EHTokCBuffer; (*KeywordMap)["tbuffer"] = EHTokTBuffer; @@ -527,6 +535,7 @@ EHlslTokenClass HlslScanContext::tokenizeIdentifier() case EHTokInOut: case EHTokPrecise: case EHTokLayout: + case EHTokGloballyCoherent: return keyword; // primitive types @@ -722,6 +731,12 @@ EHlslTokenClass HlslScanContext::tokenizeIdentifier() case EHTokRWTexture2darray: case EHTokRWTexture3d: case EHTokRWBuffer: + case EHTokAppendStructuredBuffer: + case EHTokByteAddressBuffer: + case EHTokConsumeStructuredBuffer: + case EHTokRWByteAddressBuffer: + case EHTokRWStructuredBuffer: + case EHTokStructuredBuffer: return keyword; // variable, user type, ... diff --git a/hlsl/hlslTokens.h b/hlsl/hlslTokens.h index 95b3826ed9f2522c9142cef0415a0a8bdded81fd..824aa8c8f1d1bb6721c493f490e1d9e68e7a73ad 100755 --- a/hlsl/hlslTokens.h +++ b/hlsl/hlslTokens.h @@ -65,6 +65,7 @@ enum EHlslTokenClass { EHTokOut, EHTokInOut, EHTokLayout, + EHTokGloballyCoherent, // primitive types EHTokPoint, @@ -256,6 +257,14 @@ enum EHlslTokenClass { EHTokRWTexture3d, EHTokRWBuffer, + // Structure buffer variants + EHTokAppendStructuredBuffer, + EHTokByteAddressBuffer, + EHTokConsumeStructuredBuffer, + EHTokRWByteAddressBuffer, + EHTokRWStructuredBuffer, + EHTokStructuredBuffer, + // variable, user type, ... EHTokIdentifier, EHTokTypeName,