HLSL: various SPIR-V compute shader IDs must be a 3-vector of integers.

This PR forces the external definition of SV_GroupID variables to 3-vectors.
The conversion process between the shader-declared type and the external type
happens in wrapped main IO variable conversion.

The same applies to SV_DispatchThreadID and SV_GroupThreadID.

Fixes: #1371
This commit is contained in:
LoopDawg
2018-05-15 14:52:14 -06:00
parent 1831087e48
commit 91a8178efb
6 changed files with 237 additions and 67 deletions

9
Test/hlsl.groupid.comp Normal file
View File

@@ -0,0 +1,9 @@
RWTexture2D < float4 > OutputTexture;
// Test conversion between SPIR-V required uint3 group id, and sub-vec3 shader declaration.
[ numthreads ( 8 , 8 , 1 ) ]
void main ( uint2 vGroupId : SV_GroupID )
{
OutputTexture[ vGroupId . xy ] = float4(1.0, 0.0, 0.0, 1.0);
}