complete-cs.azsl 6.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. ShaderResourceGroupSemantic sem0 { FrequencyId = 0; };
  2. ShaderResourceGroup SRG : sem0
  3. {
  4. RWByteAddressBuffer g_ByteBuffer;
  5. };
  6. groupshared uint gs_GpShared[1024];
  7. [numthreads(1, 1, 1)]
  8. void MainCS( uint2 thread_id :SV_DispatchThreadID)
  9. {
  10. uint origVal;
  11. InterlockedAdd(gs_GpShared[thread_id.x], 1); // Same as gs_GpShared[thread_id.x] += 1;
  12. InterlockedAdd(gs_GpShared[thread_id.x], 1, origVal); // Same as origVal = gs_GpShared[thread_id.x]; gs_GpShared[thread_id.x] += 1;
  13. InterlockedOr (gs_GpShared[thread_id.x], 1); // Same as gs_GpShared[thread_id.x] |= 1;
  14. InterlockedOr (gs_GpShared[thread_id.x], 1, origVal); // Same as origVal = gs_GpShared[thread_id.x]; gs_GpShared[thread_id.x] |= 1;
  15. InterlockedAnd(gs_GpShared[thread_id.x], 1); // Same as gs_GpShared[thread_id.x] &= 1;
  16. InterlockedAnd(gs_GpShared[thread_id.x], 1, origVal); // Same as origVal = gs_GpShared[thread_id.x]; gs_GpShared[thread_id.x] &= 1;
  17. InterlockedXor(gs_GpShared[thread_id.x], 1); // Same as gs_GpShared[thread_id.x] ^= 1;
  18. InterlockedXor(gs_GpShared[thread_id.x], 1, origVal); // Same as origVal = gs_GpShared[thread_id.x]; gs_GpShared[thread_id.x] ^= 1;
  19. InterlockedMin(gs_GpShared[thread_id.x], 1); // Same as gs_GpShared[thread_id.x] = min(gs_GpShared[thread_id.x], 1);
  20. InterlockedMin(gs_GpShared[thread_id.x], 1, origVal); // Same as origVal = gs_GpShared[thread_id.x]; gs_GpShared[thread_id.x] = min(gs_GpShared[thread_id.x], 1);
  21. InterlockedMax(gs_GpShared[thread_id.x], 1); // Same as gs_GpShared[thread_id.x] = max(gs_GpShared[thread_id.x], 1);
  22. InterlockedMax(gs_GpShared[thread_id.x], 1, origVal); // Same as origVal = gs_GpShared[thread_id.x]; gs_GpShared[thread_id.x] = max(gs_GpShared[thread_id.x], 1);
  23. InterlockedCompareStore (gs_GpShared[thread_id.x], 0, 5); // Same as if (gs_GpShared[thread_id.x] == 0) { gs_GpShared[thread_id.x] = 5; }
  24. InterlockedCompareExchange(gs_GpShared[thread_id.x], 0, 5, origVal); // Same as if (gs_GpShared[thread_id.x] == 0) { origVal = gs_GpShared[thread_id.x]; gs_GpShared[thread_id.x] = 5; }
  25. InterlockedExchange (gs_GpShared[thread_id.x], 5, origVal); // Same as origVal = gs_GpShared[thread_id.x]; gs_GpShared[thread_id.x] = 5;
  26. AllMemoryBarrier(); // Blocks execution of all threads in a group until all memory accesses have been completed.
  27. AllMemoryBarrierWithGroupSync(); // Blocks execution of all threads in a group until all memory accesses have been completed and all threads in the group have reached this call.
  28. DeviceMemoryBarrier(); // Blocks execution of all threads in a group until all device memory accesses have been completed.
  29. DeviceMemoryBarrierWithGroupSync(); // Blocks execution of all threads in a group until all device memory accesses have been completed and all threads in the group have reached this call.
  30. GroupMemoryBarrier(); // Blocks execution of all threads in a group until all group shared accesses have been completed.
  31. GroupMemoryBarrierWithGroupSync(); // Blocks execution of all threads in a group until all group shared accesses have been completed and all threads in the group have reached this call.
  32. SRG::g_ByteBuffer.InterlockedAdd(thread_id.x, 1); // Same as g_ByteBuffer[thread_id.x] += 1;
  33. SRG::g_ByteBuffer.InterlockedAdd(thread_id.x, 1, origVal); // Same as origVal = g_ByteBuffer[thread_id.x]; g_ByteBuffer[thread_id.x] += 1;
  34. SRG::g_ByteBuffer.InterlockedOr (thread_id.x, 1); // Same as g_ByteBuffer[thread_id.x] |= 1;
  35. SRG::g_ByteBuffer.InterlockedOr (thread_id.x, 1, origVal); // Same as origVal = g_ByteBuffer[thread_id.x]; g_ByteBuffer[thread_id.x] |= 1;
  36. SRG::g_ByteBuffer.InterlockedAnd(thread_id.x, 1); // Same as g_ByteBuffer[thread_id.x] &= 1;
  37. SRG::g_ByteBuffer.InterlockedAnd(thread_id.x, 1, origVal); // Same as origVal = g_ByteBuffer[thread_id.x]; g_ByteBuffer[thread_id.x] &= 1;
  38. SRG::g_ByteBuffer.InterlockedXor(thread_id.x, 1); // Same as g_ByteBuffer[thread_id.x] ^= 1;
  39. SRG::g_ByteBuffer.InterlockedXor(thread_id.x, 1, origVal); // Same as origVal = g_ByteBuffer[thread_id.x]; g_ByteBuffer[thread_id.x] ^= 1;
  40. SRG::g_ByteBuffer.InterlockedMin(thread_id.x, 1); // Same as g_ByteBuffer[thread_id.x] = min(g_ByteBuffer[thread_id.x], 1);
  41. SRG::g_ByteBuffer.InterlockedMin(thread_id.x, 1, origVal); // Same as origVal = g_ByteBuffer[thread_id.x]; g_ByteBuffer[thread_id.x] = min(g_ByteBuffer[thread_id.x], 1);
  42. SRG::g_ByteBuffer.InterlockedMax(thread_id.x, 1); // Same as g_ByteBuffer[thread_id.x] = max(g_ByteBuffer[thread_id.x], 1);
  43. SRG::g_ByteBuffer.InterlockedMax(thread_id.x, 1, origVal); // Same as origVal = g_ByteBuffer[thread_id.x]; g_ByteBuffer[thread_id.x] = max(g_ByteBuffer[thread_id.x], 1);
  44. SRG::g_ByteBuffer.InterlockedCompareStore (thread_id.x, 0, 5); // Same as if (g_ByteBuffer[thread_id.x] == 0) { g_ByteBuffer[thread_id.x] = 5; }
  45. SRG::g_ByteBuffer.InterlockedCompareExchange(thread_id.x, 0, 5, origVal); // Same as if (g_ByteBuffer[thread_id.x] == 0) { origVal = g_ByteBuffer[thread_id.x]; g_ByteBuffer[thread_id.x] = 5; }
  46. SRG::g_ByteBuffer.InterlockedExchange (thread_id.x, 5, origVal); // Same as origVal = g_ByteBuffer[thread_id.x]; g_ByteBuffer[thread_id.x] = 5;
  47. AllMemoryBarrier(); // Blocks execution of all threads in a group until all memory accesses have been completed.
  48. AllMemoryBarrierWithGroupSync(); // Blocks execution of all threads in a group until all memory accesses have been completed and all threads in the group have reached this call.
  49. DeviceMemoryBarrier(); // Blocks execution of all threads in a group until all device memory accesses have been completed.
  50. DeviceMemoryBarrierWithGroupSync(); // Blocks execution of all threads in a group until all device memory accesses have been completed and all threads in the group have reached this call.
  51. GroupMemoryBarrier(); // Blocks execution of all threads in a group until all group shared accesses have been completed.
  52. GroupMemoryBarrierWithGroupSync(); // Blocks execution of all threads in a group until all group shared accesses have been completed and all threads in the group have reached this call.
  53. }
  54. // Generated code: ShaderVariantOptions fallback value getters: