spirv.entry-function.wrapper.hlsl 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. // Run: %dxc -T vs_6_0 -E main
  2. struct S {
  3. bool a : A;
  4. uint2 b: B;
  5. float2x3 c: C;
  6. };
  7. struct T {
  8. S x;
  9. int y: D;
  10. bool2 z : E;
  11. };
  12. // CHECK: [[v2uint0:%\d+]] = OpConstantComposite %v2uint %uint_0 %uint_0
  13. // CHECK: [[v2uint1:%\d+]] = OpConstantComposite %v2uint %uint_1 %uint_1
  14. // CHECK: %in_var_A = OpVariable %_ptr_Input_uint Input
  15. // CHECK-NEXT: %in_var_B = OpVariable %_ptr_Input_v2uint Input
  16. // CHECK-NEXT: %in_var_C = OpVariable %_ptr_Input_mat2v3float Input
  17. // CHECK-NEXT: %in_var_D = OpVariable %_ptr_Input_int Input
  18. // CHECK-NEXT: %in_var_E = OpVariable %_ptr_Input_v2uint Input
  19. // CHECK-NEXT: %out_var_A = OpVariable %_ptr_Output_uint Output
  20. // CHECK-NEXT: %out_var_B = OpVariable %_ptr_Output_v2uint Output
  21. // CHECK-NEXT: %out_var_C = OpVariable %_ptr_Output_mat2v3float Output
  22. // CHECK-NEXT: %out_var_D = OpVariable %_ptr_Output_int Output
  23. // CHECK-NEXT: %out_var_E = OpVariable %_ptr_Output_v2uint Output
  24. // CHECK-NEXT: %main = OpFunction %void None {{%\d+}}
  25. // CHECK-NEXT: {{%\d+}} = OpLabel
  26. // CHECK-NEXT: %param_var_input = OpVariable %_ptr_Function_T Function
  27. // CHECK-NEXT: [[inA:%\d+]] = OpLoad %uint %in_var_A
  28. // CHECK-NEXT: [[inAbool:%\d+]] = OpINotEqual %bool [[inA]] %uint_0
  29. // CHECK-NEXT: [[inB:%\d+]] = OpLoad %v2uint %in_var_B
  30. // CHECK-NEXT: [[inC:%\d+]] = OpLoad %mat2v3float %in_var_C
  31. // CHECK-NEXT: [[inS:%\d+]] = OpCompositeConstruct %S [[inAbool]] [[inB]] [[inC]]
  32. // CHECK-NEXT: [[inD:%\d+]] = OpLoad %int %in_var_D
  33. // CHECK-NEXT: [[inE:%\d+]] = OpLoad %v2uint %in_var_E
  34. // CHECK-NEXT: [[inEbool:%\d+]] = OpINotEqual %v2bool [[inE]] [[v2uint0]]
  35. // CHECK-NEXT: [[inT:%\d+]] = OpCompositeConstruct %T [[inS]] [[inD]] [[inEbool]]
  36. // CHECK-NEXT: OpStore %param_var_input [[inT]]
  37. // CHECK-NEXT: [[ret:%\d+]] = OpFunctionCall %T %src_main %param_var_input
  38. // CHECK-NEXT: [[outS:%\d+]] = OpCompositeExtract %S [[ret]] 0
  39. // CHECK-NEXT: [[outA:%\d+]] = OpCompositeExtract %bool [[outS]] 0
  40. // CHECK-NEXT: [[outAuint:%\d+]] = OpSelect %uint [[outA]] %uint_1 %uint_0
  41. // CHECK-NEXT: OpStore %out_var_A [[outAuint]]
  42. // CHECK-NEXT: [[outB:%\d+]] = OpCompositeExtract %v2uint [[outS]] 1
  43. // CHECK-NEXT: OpStore %out_var_B [[outB]]
  44. // CHECK-NEXT: [[outC:%\d+]] = OpCompositeExtract %mat2v3float [[outS]] 2
  45. // CHECK-NEXT: OpStore %out_var_C [[outC]]
  46. // CHECK-NEXT: [[outD:%\d+]] = OpCompositeExtract %int [[ret]] 1
  47. // CHECK-NEXT: OpStore %out_var_D [[outD]]
  48. // CHECK-NEXT: [[outE:%\d+]] = OpCompositeExtract %v2bool [[ret]] 2
  49. // CHECK-NEXT: [[outEuint:%\d+]] = OpSelect %v2uint [[outE]] [[v2uint1]] [[v2uint0]]
  50. // CHECK-NEXT: OpStore %out_var_E [[outEuint]]
  51. // CHECK-NEXT: OpReturn
  52. // CHECK-NEXT: OpFunctionEnd
  53. T main(T input) {
  54. return input;
  55. }