//TEST_CATEGORY(wave-mask, compute) //DISABLE_TEST:COMPARE_COMPUTE_EX:-cpu -compute -shaderobj //DISABLE_TEST:COMPARE_COMPUTE_EX:-slang -compute -shaderobj //TEST:COMPARE_COMPUTE_EX:-slang -compute -dx12 -profile cs_6_5 -shaderobj -render-feature hardware-device //DISABLE_TEST(vulkan):COMPARE_COMPUTE_EX:-vk -compute -shaderobj //TEST:COMPARE_COMPUTE_EX:-cuda -compute -shaderobj //TEST_INPUT:ubuffer(data=[0 0 0 0 0 0 0 0], stride=4):out,name outputBuffer RWStructuredBuffer outputBuffer; [numthreads(8, 1, 1)] void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID) { const WaveMask mask = 0xff; const int idx = int(dispatchThreadID.x); // NOTE! dxc only supports bit ops on uint and associated types NOT int // Also GLSL does not have built in support for int matrices. So we'll just try with float for now // GLSL does not support matrix types for Wave like intrinsics matrix v0 = matrix(idx + 1, idx + 2, idx + 3, idx + 4); matrix v1 = matrix(v0) + matrix(1, 1, 1, 1); matrix uv0 = matrix(v0[0][0], v0[0][1], v0[1][0], v0[0][1]); matrix r0 = WaveMaskSum(mask, v0); matrix r1 = WaveMaskSum(mask, v1); matrix r2 = WaveMaskBitXor(mask, uv0); matrix r3 = WaveMaskBitOr(mask, uv0); matrix r4 = WaveMaskBitAnd(mask, uv0); matrix r5 = r2 + r3 + r4; matrix r6 = matrix(int(r5[0][0]), int(r5[0][1]), int(r5[1][0]), int(r5[1][1])); matrix r = r0 + matrix(r1) + r6; outputBuffer[idx] = r[0][0] + r[0][1] + r[1][0] + r[1][1]; }