From ef08bdaf501982ae24a73200e55f99157e4b7e6a Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Fri, 8 Feb 2019 11:41:26 -0500 Subject: Hotfix/dispatch thread id improvements (#834) * * Make vector comparisons out correct functions on glsl * Test for vector comparisons * Typo fixes * Glsl vector comparisons use functions. * Added a coercion test. * Do checking for the SV_DispatchThreadId type to see if it appears valid. * Fix typo * Make glsl do type conversion for SV_DispatchThreadID parameter. * Fix glsl to match func-resource-param-array with changes to how SV_DispatchThreadID changes. --- tests/bugs/vec-compare.slang | 2 +- .../func-resource-param-array.slang.glsl | 22 ++++++++++++++-------- 2 files changed, 15 insertions(+), 9 deletions(-) (limited to 'tests') diff --git a/tests/bugs/vec-compare.slang b/tests/bugs/vec-compare.slang index 0eaec0191..b3075efe9 100644 --- a/tests/bugs/vec-compare.slang +++ b/tests/bugs/vec-compare.slang @@ -7,7 +7,7 @@ RWStructuredBuffer outputBuffer; [numthreads(4,4,1)] -void computeMain(uint3 pixelIndex : SV_DispatchThreadID) +void computeMain(uint2 pixelIndex : SV_DispatchThreadID) { // We will test floats, uints, and int vectors diff --git a/tests/cross-compile/func-resource-param-array.slang.glsl b/tests/cross-compile/func-resource-param-array.slang.glsl index 6224ccd1c..d7f9c17bc 100644 --- a/tests/cross-compile/func-resource-param-array.slang.glsl +++ b/tests/cross-compile/func-resource-param-array.slang.glsl @@ -25,11 +25,15 @@ #define g_c_t _S9 #define g_c_i _S10 #define g_c_j _S11 -#define tmp_f_a_ii _S12 -#define tmp_f_a_jj _S13 -#define tmp_f_b _S14 -#define tmp_g_b _S15 -#define tmp_g_c _S16 + +#define tid _S12 + +#define tmp_f_a_ii _S13 +#define tmp_f_a_jj _S14 + +#define tmp_f_b _S15 +#define tmp_g_b _S16 +#define tmp_g_c _S17 layout(std430, binding = 0) buffer a_block { int _data[]; @@ -67,9 +71,11 @@ layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; void main() { - uint ii = gl_GlobalInvocationID.x; - uint jj = gl_GlobalInvocationID.y; - uint kk = gl_GlobalInvocationID.z; + uvec3 tid = uvec3(gl_GlobalInvocationID); + + uint ii = tid.x; + uint jj = tid.y; + uint kk = tid.z; int tmp_f_a_ii = f_a(ii); -- cgit v1.2.3