mirror of
https://github.com/KhronosGroup/glslang
synced 2024-09-19 20:29:54 +00:00
Merge pull request #1166 from tafuri/#1165-invalid_Store
#1165 invalid store
This commit is contained in:
commit
1ce94b2d68
173
Test/baseResults/hlsl.store.rwbyteaddressbuffer.type.comp.out
Normal file
173
Test/baseResults/hlsl.store.rwbyteaddressbuffer.type.comp.out
Normal file
@ -0,0 +1,173 @@
|
||||
hlsl.store.rwbyteaddressbuffer.type.comp
|
||||
Shader version: 500
|
||||
local_size = (64, 1, 1)
|
||||
0:? Sequence
|
||||
0:5 Function Definition: @main(vu3; ( temp void)
|
||||
0:5 Function Parameters:
|
||||
0:5 'dispatchThreadID' ( in 3-component vector of uint)
|
||||
0:? Sequence
|
||||
0:6 Test condition and select ( temp void)
|
||||
0:6 Condition
|
||||
0:6 Compare Equal ( temp bool)
|
||||
0:6 direct index ( temp uint)
|
||||
0:6 'dispatchThreadID' ( in 3-component vector of uint)
|
||||
0:6 Constant:
|
||||
0:6 0 (const int)
|
||||
0:6 Constant:
|
||||
0:6 0 (const uint)
|
||||
0:6 true case
|
||||
0:? Sequence
|
||||
0:7 move second child to first child ( temp int)
|
||||
0:7 'byteAddrTemp' ( temp int)
|
||||
0:7 right-shift ( temp int)
|
||||
0:7 Constant:
|
||||
0:7 0 (const int)
|
||||
0:7 Constant:
|
||||
0:7 2 (const int)
|
||||
0:7 move second child to first child ( temp uint)
|
||||
0:7 indirect index (layout( row_major std430) buffer uint)
|
||||
0:7 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint)
|
||||
0:7 'buffer' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data})
|
||||
0:7 Constant:
|
||||
0:7 0 (const uint)
|
||||
0:7 'byteAddrTemp' ( temp int)
|
||||
0:7 Constant:
|
||||
0:7 2 (const uint)
|
||||
0:5 Function Definition: main( ( temp void)
|
||||
0:5 Function Parameters:
|
||||
0:? Sequence
|
||||
0:5 move second child to first child ( temp 3-component vector of uint)
|
||||
0:? 'dispatchThreadID' ( temp 3-component vector of uint)
|
||||
0:? 'dispatchThreadID' ( in 3-component vector of uint GlobalInvocationID)
|
||||
0:5 Function Call: @main(vu3; ( temp void)
|
||||
0:? 'dispatchThreadID' ( temp 3-component vector of uint)
|
||||
0:? Linker Objects
|
||||
0:? 'buffer' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data})
|
||||
0:? 'dispatchThreadID' ( in 3-component vector of uint GlobalInvocationID)
|
||||
|
||||
|
||||
Linked compute stage:
|
||||
|
||||
|
||||
Shader version: 500
|
||||
local_size = (64, 1, 1)
|
||||
0:? Sequence
|
||||
0:5 Function Definition: @main(vu3; ( temp void)
|
||||
0:5 Function Parameters:
|
||||
0:5 'dispatchThreadID' ( in 3-component vector of uint)
|
||||
0:? Sequence
|
||||
0:6 Test condition and select ( temp void)
|
||||
0:6 Condition
|
||||
0:6 Compare Equal ( temp bool)
|
||||
0:6 direct index ( temp uint)
|
||||
0:6 'dispatchThreadID' ( in 3-component vector of uint)
|
||||
0:6 Constant:
|
||||
0:6 0 (const int)
|
||||
0:6 Constant:
|
||||
0:6 0 (const uint)
|
||||
0:6 true case
|
||||
0:? Sequence
|
||||
0:7 move second child to first child ( temp int)
|
||||
0:7 'byteAddrTemp' ( temp int)
|
||||
0:7 right-shift ( temp int)
|
||||
0:7 Constant:
|
||||
0:7 0 (const int)
|
||||
0:7 Constant:
|
||||
0:7 2 (const int)
|
||||
0:7 move second child to first child ( temp uint)
|
||||
0:7 indirect index (layout( row_major std430) buffer uint)
|
||||
0:7 @data: direct index for structure (layout( row_major std430) buffer implicitly-sized array of uint)
|
||||
0:7 'buffer' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data})
|
||||
0:7 Constant:
|
||||
0:7 0 (const uint)
|
||||
0:7 'byteAddrTemp' ( temp int)
|
||||
0:7 Constant:
|
||||
0:7 2 (const uint)
|
||||
0:5 Function Definition: main( ( temp void)
|
||||
0:5 Function Parameters:
|
||||
0:? Sequence
|
||||
0:5 move second child to first child ( temp 3-component vector of uint)
|
||||
0:? 'dispatchThreadID' ( temp 3-component vector of uint)
|
||||
0:? 'dispatchThreadID' ( in 3-component vector of uint GlobalInvocationID)
|
||||
0:5 Function Call: @main(vu3; ( temp void)
|
||||
0:? 'dispatchThreadID' ( temp 3-component vector of uint)
|
||||
0:? Linker Objects
|
||||
0:? 'buffer' (layout( row_major std430) buffer block{layout( row_major std430) buffer implicitly-sized array of uint @data})
|
||||
0:? 'dispatchThreadID' ( in 3-component vector of uint GlobalInvocationID)
|
||||
|
||||
// Module Version 10000
|
||||
// Generated by (magic number): 80002
|
||||
// Id's are bound by 42
|
||||
|
||||
Capability Shader
|
||||
1: ExtInstImport "GLSL.std.450"
|
||||
MemoryModel Logical GLSL450
|
||||
EntryPoint GLCompute 4 "main" 37
|
||||
ExecutionMode 4 LocalSize 64 1 1
|
||||
Source HLSL 500
|
||||
Name 4 "main"
|
||||
Name 11 "@main(vu3;"
|
||||
Name 10 "dispatchThreadID"
|
||||
Name 23 "byteAddrTemp"
|
||||
Name 28 "buffer"
|
||||
MemberName 28(buffer) 0 "@data"
|
||||
Name 30 "buffer"
|
||||
Name 35 "dispatchThreadID"
|
||||
Name 37 "dispatchThreadID"
|
||||
Name 39 "param"
|
||||
Decorate 27 ArrayStride 4
|
||||
MemberDecorate 28(buffer) 0 Offset 0
|
||||
Decorate 28(buffer) BufferBlock
|
||||
Decorate 30(buffer) DescriptorSet 0
|
||||
Decorate 37(dispatchThreadID) BuiltIn GlobalInvocationId
|
||||
2: TypeVoid
|
||||
3: TypeFunction 2
|
||||
6: TypeInt 32 0
|
||||
7: TypeVector 6(int) 3
|
||||
8: TypePointer Function 7(ivec3)
|
||||
9: TypeFunction 2 8(ptr)
|
||||
13: 6(int) Constant 0
|
||||
14: TypePointer Function 6(int)
|
||||
17: TypeBool
|
||||
21: TypeInt 32 1
|
||||
22: TypePointer Function 21(int)
|
||||
24: 21(int) Constant 0
|
||||
25: 21(int) Constant 2
|
||||
27: TypeRuntimeArray 6(int)
|
||||
28(buffer): TypeStruct 27
|
||||
29: TypePointer Uniform 28(buffer)
|
||||
30(buffer): 29(ptr) Variable Uniform
|
||||
32: 6(int) Constant 2
|
||||
33: TypePointer Uniform 6(int)
|
||||
36: TypePointer Input 7(ivec3)
|
||||
37(dispatchThreadID): 36(ptr) Variable Input
|
||||
4(main): 2 Function None 3
|
||||
5: Label
|
||||
35(dispatchThreadID): 8(ptr) Variable Function
|
||||
39(param): 8(ptr) Variable Function
|
||||
38: 7(ivec3) Load 37(dispatchThreadID)
|
||||
Store 35(dispatchThreadID) 38
|
||||
40: 7(ivec3) Load 35(dispatchThreadID)
|
||||
Store 39(param) 40
|
||||
41: 2 FunctionCall 11(@main(vu3;) 39(param)
|
||||
Return
|
||||
FunctionEnd
|
||||
11(@main(vu3;): 2 Function None 9
|
||||
10(dispatchThreadID): 8(ptr) FunctionParameter
|
||||
12: Label
|
||||
23(byteAddrTemp): 22(ptr) Variable Function
|
||||
15: 14(ptr) AccessChain 10(dispatchThreadID) 13
|
||||
16: 6(int) Load 15
|
||||
18: 17(bool) IEqual 16 13
|
||||
SelectionMerge 20 None
|
||||
BranchConditional 18 19 20
|
||||
19: Label
|
||||
26: 21(int) ShiftRightArithmetic 24 25
|
||||
Store 23(byteAddrTemp) 26
|
||||
31: 21(int) Load 23(byteAddrTemp)
|
||||
34: 33(ptr) AccessChain 30(buffer) 24 31
|
||||
Store 34 32
|
||||
Branch 20
|
||||
20: Label
|
||||
Return
|
||||
FunctionEnd
|
File diff suppressed because it is too large
Load Diff
8
Test/hlsl.store.rwbyteaddressbuffer.type.comp
Normal file
8
Test/hlsl.store.rwbyteaddressbuffer.type.comp
Normal file
@ -0,0 +1,8 @@
|
||||
RWByteAddressBuffer buffer;
|
||||
|
||||
[numthreads(64, 1, 1)]
|
||||
void main( uint3 dispatchThreadID : SV_DispatchThreadID)
|
||||
{
|
||||
if(dispatchThreadID.x == 0)
|
||||
buffer.Store(0, 2);
|
||||
}
|
@ -302,6 +302,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
{"hlsl.shapeConvRet.frag", "main"},
|
||||
{"hlsl.snorm.uav.comp", "main"},
|
||||
{"hlsl.staticMemberFunction.frag", "main"},
|
||||
{"hlsl.store.rwbyteaddressbuffer.type.comp", "main"},
|
||||
{"hlsl.stringtoken.frag", "main"},
|
||||
{"hlsl.string.frag", "main"},
|
||||
{"hlsl.struct.split-1.vert", "main"},
|
||||
|
@ -3274,6 +3274,9 @@ void HlslParseContext::decomposeStructBufferMethods(const TSourceLoc& loc, TInte
|
||||
: EOpIndexIndirect;
|
||||
|
||||
TIntermTyped* lValue = intermediate.addIndex(idxOp, argArray, offsetIdx, loc);
|
||||
const TType derefType(argArray->getType(), 0);
|
||||
lValue->setType(derefType);
|
||||
|
||||
TIntermTyped* rValue = (size == 1) ? argValue :
|
||||
intermediate.addIndex(EOpIndexDirect, argValue, idxConst, loc);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user