HLSL: implement numthreads for compute shaders
This PR adds handling of the numthreads attribute for compute shaders, as well as a general infrastructure for returning attribute values from acceptAttributes, which may be needed in other cases, e.g, unroll(x), or merely to know if some attribute without params was given. A map of enum values from TAttributeType to TIntermAggregate nodes is built and returned. It can be queried with operator[] on the map. In the future there may be a need to also handle strings (e.g, for patchconstantfunc), and those can be easily added into the class if needed. New test is in hlsl.numthreads.comp.
This commit is contained in:
60
Test/baseResults/hlsl.numthreads.comp.out
Normal file
60
Test/baseResults/hlsl.numthreads.comp.out
Normal file
@@ -0,0 +1,60 @@
|
||||
hlsl.numthreads.comp
|
||||
Shader version: 450
|
||||
local_size = (4, 4, 2)
|
||||
0:? Sequence
|
||||
0:4 Function Definition: main(vu3; (temp void)
|
||||
0:4 Function Parameters:
|
||||
0:4 'tid' (in 3-component vector of uint)
|
||||
0:9 Function Definition: main_aux1(vu3; (temp void)
|
||||
0:9 Function Parameters:
|
||||
0:9 'tid' (in 3-component vector of uint LocalInvocationID)
|
||||
0:? Linker Objects
|
||||
0:? 'tid' (in 3-component vector of uint LocalInvocationID)
|
||||
|
||||
|
||||
Linked compute stage:
|
||||
|
||||
|
||||
Shader version: 450
|
||||
local_size = (4, 4, 2)
|
||||
0:? Sequence
|
||||
0:4 Function Definition: main(vu3; (temp void)
|
||||
0:4 Function Parameters:
|
||||
0:4 'tid' (in 3-component vector of uint)
|
||||
0:9 Function Definition: main_aux1(vu3; (temp void)
|
||||
0:9 Function Parameters:
|
||||
0:9 'tid' (in 3-component vector of uint LocalInvocationID)
|
||||
0:? Linker Objects
|
||||
0:? 'tid' (in 3-component vector of uint LocalInvocationID)
|
||||
|
||||
// Module Version 10000
|
||||
// Generated by (magic number): 80001
|
||||
// Id's are bound by 15
|
||||
|
||||
Capability Shader
|
||||
1: ExtInstImport "GLSL.std.450"
|
||||
MemoryModel Logical GLSL450
|
||||
EntryPoint GLCompute 4 "main_aux1" 14
|
||||
ExecutionMode 4 LocalSize 4 4 2
|
||||
Name 4 "main_aux1"
|
||||
Name 11 "main(vu3;"
|
||||
Name 10 "tid"
|
||||
Name 14 "tid"
|
||||
Decorate 14(tid) BuiltIn LocalInvocationId
|
||||
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: TypePointer Input 7(ivec3)
|
||||
14(tid): 13(ptr) Variable Input
|
||||
4(main_aux1): 2 Function None 3
|
||||
5: Label
|
||||
Return
|
||||
FunctionEnd
|
||||
11(main(vu3;): 2 Function None 9
|
||||
10(tid): 8(ptr) FunctionParameter
|
||||
12: Label
|
||||
Return
|
||||
FunctionEnd
|
||||
Reference in New Issue
Block a user