//TEST_CATEGORY(wave, 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_0 -shaderobj //TEST(vulkan):COMPARE_COMPUTE_EX:-vk -compute -shaderobj //TEST:COMPARE_COMPUTE_EX:-cuda -compute -shaderobj //TEST:COMPARE_COMPUTE_EX:-wgpu -compute -shaderobj //TEST:COMPARE_COMPUTE_EX:-metal -compute -shaderobj //TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name outputBuffer RWStructuredBuffer outputBuffer; [numthreads(4, 1, 1)] void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID) { uint idx = dispatchThreadID.x; uint laneId = WaveGetLaneIndex(); // The laneCount will be dependent on target hardware. It seems a count of 1 is valid in spec. // For now we'll just check it's not 0. uint laneCount = WaveGetLaneCount(); outputBuffer[idx] = int(((laneCount > 0) ? 0x100 : 0) + laneId); }