HLSL: cbuffer and tbuffer grammar and production.
This commit is contained in:
153
Test/baseResults/hlsl.buffer.frag.out
Executable file
153
Test/baseResults/hlsl.buffer.frag.out
Executable file
@@ -0,0 +1,153 @@
|
||||
hlsl.buffer.frag
|
||||
Shader version: 450
|
||||
gl_FragCoord origin is upper left
|
||||
0:? Sequence
|
||||
0:23 Function Definition: PixelShaderFunction(vf4; (global 4-component vector of float)
|
||||
0:20 Function Parameters:
|
||||
0:20 'input' (in 4-component vector of float)
|
||||
0:? Sequence
|
||||
0:21 Branch: Return with expression
|
||||
0:21 add (temp 4-component vector of float)
|
||||
0:21 add (temp 4-component vector of float)
|
||||
0:21 add (temp 4-component vector of float)
|
||||
0:21 'input' (in 4-component vector of float)
|
||||
0:21 v1: direct index for structure (layout(column_major std140 ) uniform 4-component vector of float)
|
||||
0:21 'anon@0' (layout(column_major std140 ) uniform block{layout(column_major std140 ) uniform 4-component vector of float v1})
|
||||
0:21 Constant:
|
||||
0:21 0 (const uint)
|
||||
0:21 add (temp 4-component vector of float)
|
||||
0:21 v2: direct index for structure (layout(column_major std430 ) buffer 4-component vector of float)
|
||||
0:21 'anon@1' (layout(column_major std430 ) buffer block{layout(column_major std430 ) buffer 4-component vector of float v2})
|
||||
0:21 Constant:
|
||||
0:21 0 (const uint)
|
||||
0:21 v3: direct index for structure (layout(column_major std140 ) uniform 4-component vector of float)
|
||||
0:21 'anon@2' (layout(column_major std140 ) uniform block{layout(column_major std140 ) uniform 4-component vector of float v3, layout(column_major std140 ) uniform int i3})
|
||||
0:21 Constant:
|
||||
0:21 0 (const uint)
|
||||
0:21 v4: direct index for structure (layout(column_major std430 ) buffer 4-component vector of float)
|
||||
0:21 'anon@3' (layout(column_major std430 ) buffer block{layout(column_major std430 ) buffer 4-component vector of float v4, layout(column_major std430 ) buffer int i4})
|
||||
0:21 Constant:
|
||||
0:21 0 (const uint)
|
||||
0:? Linker Objects
|
||||
0:? 'anon@0' (layout(column_major std140 ) uniform block{layout(column_major std140 ) uniform 4-component vector of float v1})
|
||||
0:? 'anon@1' (layout(column_major std430 ) buffer block{layout(column_major std430 ) buffer 4-component vector of float v2})
|
||||
0:? 'anon@2' (layout(column_major std140 ) uniform block{layout(column_major std140 ) uniform 4-component vector of float v3, layout(column_major std140 ) uniform int i3})
|
||||
0:? 'anon@3' (layout(column_major std430 ) buffer block{layout(column_major std430 ) buffer 4-component vector of float v4, layout(column_major std430 ) buffer int i4})
|
||||
|
||||
|
||||
Linked fragment stage:
|
||||
|
||||
|
||||
Shader version: 450
|
||||
gl_FragCoord origin is upper left
|
||||
0:? Sequence
|
||||
0:23 Function Definition: PixelShaderFunction(vf4; (global 4-component vector of float)
|
||||
0:20 Function Parameters:
|
||||
0:20 'input' (in 4-component vector of float)
|
||||
0:? Sequence
|
||||
0:21 Branch: Return with expression
|
||||
0:21 add (temp 4-component vector of float)
|
||||
0:21 add (temp 4-component vector of float)
|
||||
0:21 add (temp 4-component vector of float)
|
||||
0:21 'input' (in 4-component vector of float)
|
||||
0:21 v1: direct index for structure (layout(column_major std140 ) uniform 4-component vector of float)
|
||||
0:21 'anon@0' (layout(column_major std140 ) uniform block{layout(column_major std140 ) uniform 4-component vector of float v1})
|
||||
0:21 Constant:
|
||||
0:21 0 (const uint)
|
||||
0:21 add (temp 4-component vector of float)
|
||||
0:21 v2: direct index for structure (layout(column_major std430 ) buffer 4-component vector of float)
|
||||
0:21 'anon@1' (layout(column_major std430 ) buffer block{layout(column_major std430 ) buffer 4-component vector of float v2})
|
||||
0:21 Constant:
|
||||
0:21 0 (const uint)
|
||||
0:21 v3: direct index for structure (layout(column_major std140 ) uniform 4-component vector of float)
|
||||
0:21 'anon@2' (layout(column_major std140 ) uniform block{layout(column_major std140 ) uniform 4-component vector of float v3, layout(column_major std140 ) uniform int i3})
|
||||
0:21 Constant:
|
||||
0:21 0 (const uint)
|
||||
0:21 v4: direct index for structure (layout(column_major std430 ) buffer 4-component vector of float)
|
||||
0:21 'anon@3' (layout(column_major std430 ) buffer block{layout(column_major std430 ) buffer 4-component vector of float v4, layout(column_major std430 ) buffer int i4})
|
||||
0:21 Constant:
|
||||
0:21 0 (const uint)
|
||||
0:? Linker Objects
|
||||
0:? 'anon@0' (layout(column_major std140 ) uniform block{layout(column_major std140 ) uniform 4-component vector of float v1})
|
||||
0:? 'anon@1' (layout(column_major std430 ) buffer block{layout(column_major std430 ) buffer 4-component vector of float v2})
|
||||
0:? 'anon@2' (layout(column_major std140 ) uniform block{layout(column_major std140 ) uniform 4-component vector of float v3, layout(column_major std140 ) uniform int i3})
|
||||
0:? 'anon@3' (layout(column_major std430 ) buffer block{layout(column_major std430 ) buffer 4-component vector of float v4, layout(column_major std430 ) buffer int i4})
|
||||
|
||||
// Module Version 10000
|
||||
// Generated by (magic number): 80001
|
||||
// Id's are bound by 39
|
||||
|
||||
Capability Shader
|
||||
1: ExtInstImport "GLSL.std.450"
|
||||
MemoryModel Logical GLSL450
|
||||
EntryPoint Fragment 4 "PixelShaderFunction" 9
|
||||
ExecutionMode 4 OriginUpperLeft
|
||||
Source HLSL 450
|
||||
Name 4 "PixelShaderFunction"
|
||||
Name 9 "input"
|
||||
Name 11 ""
|
||||
MemberName 11 0 "v1"
|
||||
Name 13 ""
|
||||
Name 20 ""
|
||||
MemberName 20 0 "v2"
|
||||
Name 22 ""
|
||||
Name 25 ""
|
||||
MemberName 25 0 "v3"
|
||||
MemberName 25 1 "i3"
|
||||
Name 27 ""
|
||||
Name 32 ""
|
||||
MemberName 32 0 "v4"
|
||||
MemberName 32 1 "i4"
|
||||
Name 34 ""
|
||||
MemberDecorate 11 0 Offset 0
|
||||
Decorate 11 Block
|
||||
Decorate 13 DescriptorSet 0
|
||||
MemberDecorate 20 0 Offset 0
|
||||
Decorate 20 BufferBlock
|
||||
Decorate 22 DescriptorSet 0
|
||||
MemberDecorate 25 0 Offset 0
|
||||
MemberDecorate 25 1 Offset 16
|
||||
Decorate 25 Block
|
||||
Decorate 27 DescriptorSet 0
|
||||
MemberDecorate 32 0 Offset 0
|
||||
MemberDecorate 32 1 Offset 16
|
||||
Decorate 32 BufferBlock
|
||||
Decorate 34 DescriptorSet 0
|
||||
2: TypeVoid
|
||||
3: TypeFunction 2
|
||||
6: TypeFloat 32
|
||||
7: TypeVector 6(float) 4
|
||||
8: TypePointer Input 7(fvec4)
|
||||
9(input): 8(ptr) Variable Input
|
||||
11: TypeStruct 7(fvec4)
|
||||
12: TypePointer Uniform 11(struct)
|
||||
13: 12(ptr) Variable Uniform
|
||||
14: TypeInt 32 1
|
||||
15: 14(int) Constant 0
|
||||
16: TypePointer Uniform 7(fvec4)
|
||||
20: TypeStruct 7(fvec4)
|
||||
21: TypePointer Uniform 20(struct)
|
||||
22: 21(ptr) Variable Uniform
|
||||
25: TypeStruct 7(fvec4) 14(int)
|
||||
26: TypePointer Uniform 25(struct)
|
||||
27: 26(ptr) Variable Uniform
|
||||
32: TypeStruct 7(fvec4) 14(int)
|
||||
33: TypePointer Uniform 32(struct)
|
||||
34: 33(ptr) Variable Uniform
|
||||
4(PixelShaderFunction): 2 Function None 3
|
||||
5: Label
|
||||
10: 7(fvec4) Load 9(input)
|
||||
17: 16(ptr) AccessChain 13 15
|
||||
18: 7(fvec4) Load 17
|
||||
19: 7(fvec4) FAdd 10 18
|
||||
23: 16(ptr) AccessChain 22 15
|
||||
24: 7(fvec4) Load 23
|
||||
28: 16(ptr) AccessChain 27 15
|
||||
29: 7(fvec4) Load 28
|
||||
30: 7(fvec4) FAdd 24 29
|
||||
31: 7(fvec4) FAdd 19 30
|
||||
35: 16(ptr) AccessChain 34 15
|
||||
36: 7(fvec4) Load 35
|
||||
37: 7(fvec4) FAdd 31 36
|
||||
ReturnValue 37
|
||||
FunctionEnd
|
||||
22
Test/hlsl.buffer.frag
Normal file
22
Test/hlsl.buffer.frag
Normal file
@@ -0,0 +1,22 @@
|
||||
cbuffer {
|
||||
float4 v1;
|
||||
};
|
||||
|
||||
tbuffer {
|
||||
float4 v2;
|
||||
};
|
||||
|
||||
cbuffer cbufName : register(b2) {
|
||||
float4 v3;
|
||||
int i3 : packoffset(c1.y);
|
||||
};
|
||||
|
||||
tbuffer tbufName : register(b8) {
|
||||
float4 v4 : packoffset(c1);
|
||||
int i4 : packoffset(c3);
|
||||
};
|
||||
|
||||
float4 PixelShaderFunction(float4 input) : COLOR0
|
||||
{
|
||||
return input + v1 + v2 + v3 + v4;
|
||||
}
|
||||
Reference in New Issue
Block a user