cs.groupshared.hlsl 955 B

1234567891011121314151617181920212223242526
  1. // Run: %dxc -T cs_6_0 -E main
  2. struct S {
  3. float f1;
  4. float3 f2;
  5. };
  6. // CHECK: %a = OpVariable %_ptr_Workgroup_float Workgroup
  7. groupshared float a;
  8. // CHECK: %b = OpVariable %_ptr_Workgroup_v3float Workgroup
  9. groupshared float3 b;
  10. // CHECK: %c = OpVariable %_ptr_Workgroup_mat2v3float Workgroup
  11. groupshared column_major float2x3 c;
  12. // CHECK: %d = OpVariable %_ptr_Workgroup__arr_v2float_uint_5 Workgroup
  13. groupshared float2 d[5];
  14. // CHECK: %s = OpVariable %_ptr_Workgroup_S Workgroup
  15. groupshared S s;
  16. [numthreads(8, 8, 8)]
  17. void main(uint2 tid : SV_DispatchThreadID, uint2 gid : SV_GroupID) {
  18. // Make sure pointers have the correct storage class
  19. // CHECK: {{%\d+}} = OpAccessChain %_ptr_Workgroup_float %s %int_0
  20. // CHECK: [[d0:%\d+]] = OpAccessChain %_ptr_Workgroup_v2float %d %int_0
  21. // CHECK: {{%\d+}} = OpAccessChain %_ptr_Workgroup_float [[d0]] %int_1
  22. d[0].y = s.f1;
  23. }