empty-struct-interface.vs.hlsl2spv 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. // Run: %dxc -T vs_6_0 -E main
  2. // There is no interface variable for VSIn or VSOut empty structs (See OpEntryPoint below).
  3. struct VSIn {};
  4. struct VSOut {};
  5. VSOut main(VSIn input)
  6. {
  7. VSOut result;
  8. return result;
  9. }
  10. // CHECK-WHOLE-SPIR-V:
  11. // OpCapability Shader
  12. // OpMemoryModel Logical GLSL450
  13. // OpEntryPoint Vertex %main "main" %gl_PerVertexOut
  14. // OpName %bb_entry "bb.entry"
  15. // OpName %src_main "src.main"
  16. // OpName %main "main"
  17. // OpName %type_gl_PerVertex "type.gl_PerVertex"
  18. // OpName %gl_PerVertexOut "gl_PerVertexOut"
  19. // OpName %VSIn "VSIn"
  20. // OpName %param_var_input "param.var.input"
  21. // OpName %input "input"
  22. // OpName %result "result"
  23. // OpMemberDecorate %type_gl_PerVertex 0 BuiltIn Position
  24. // OpMemberDecorate %type_gl_PerVertex 1 BuiltIn PointSize
  25. // OpMemberDecorate %type_gl_PerVertex 2 BuiltIn ClipDistance
  26. // OpMemberDecorate %type_gl_PerVertex 3 BuiltIn CullDistance
  27. // OpDecorate %type_gl_PerVertex Block
  28. // %void = OpTypeVoid
  29. // %3 = OpTypeFunction %void
  30. // %float = OpTypeFloat 32
  31. // %v4float = OpTypeVector %float 4
  32. // %uint = OpTypeInt 32 0
  33. // %uint_1 = OpConstant %uint 1
  34. // %_arr_float_uint_1 = OpTypeArray %float %uint_1
  35. // %type_gl_PerVertex = OpTypeStruct %v4float %float %_arr_float_uint_1 %_arr_float_uint_1
  36. // %_ptr_Output_type_gl_PerVertex = OpTypePointer Output %type_gl_PerVertex
  37. // %VSIn = OpTypeStruct
  38. // %_ptr_Function_VSIn = OpTypePointer Function %VSIn
  39. // %19 = OpTypeFunction %VSIn %_ptr_Function_VSIn
  40. // %gl_PerVertexOut = OpVariable %_ptr_Output_type_gl_PerVertex Output
  41. // %main = OpFunction %void None %3
  42. // %13 = OpLabel
  43. // %param_var_input = OpVariable %_ptr_Function_VSIn Function
  44. // %17 = OpCompositeConstruct %VSIn
  45. // OpStore %param_var_input %17
  46. // %18 = OpFunctionCall %VSIn %src_main %param_var_input
  47. // OpReturn
  48. // OpFunctionEnd
  49. // %src_main = OpFunction %VSIn None %19
  50. // %input = OpFunctionParameter %_ptr_Function_VSIn
  51. // %bb_entry = OpLabel
  52. // %result = OpVariable %_ptr_Function_VSIn Function
  53. // %23 = OpLoad %VSIn %result
  54. // OpReturnValue %23
  55. // OpFunctionEnd