Advertisement
FocusJP

second spv disassembly

Oct 17th, 2022
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.37 KB | None | 0 0
  1. ; SPIR-V
  2. ; Version: 1.0
  3. ; Generator: Khronos; 28
  4. ; Bound: 86
  5. ; Schema: 0
  6. OpCapability Shader
  7. %1 = OpExtInstImport "GLSL.std.450"
  8. OpMemoryModel Logical GLSL450
  9. OpEntryPoint Vertex %vs_main "vs_main" %in_vertex_index %position %uv
  10. OpEntryPoint Fragment %fs_main "fs_main" %position_0 %uv_0 %66
  11. OpExecutionMode %fs_main OriginUpperLeft
  12. OpSource GLSL 450
  13. OpMemberName %VertexOutput 0 "position"
  14. OpMemberName %VertexOutput 1 "uv"
  15. OpName %VertexOutput "VertexOutput"
  16. OpName %out "out"
  17. OpName %in_vertex_index "in_vertex_index"
  18. OpName %position "position"
  19. OpName %uv "uv"
  20. OpName %vs_main "vs_main"
  21. OpName %position_0 "position"
  22. OpName %uv_0 "uv"
  23. OpName %fs_main "fs_main"
  24. OpMemberDecorate %VertexOutput 0 Offset 0
  25. OpMemberDecorate %VertexOutput 1 Offset 16
  26. OpDecorate %in_vertex_index BuiltIn VertexIndex
  27. OpDecorate %position BuiltIn Position
  28. OpDecorate %uv Location 0
  29. OpDecorate %position_0 BuiltIn FragCoord
  30. OpDecorate %uv_0 Location 0
  31. OpDecorate %66 Location 0
  32. %void = OpTypeVoid
  33. %int = OpTypeInt 32 1
  34. %int_1 = OpConstant %int 1
  35. %uint = OpTypeInt 32 0
  36. %uint_1 = OpConstant %uint 1
  37. %int_2 = OpConstant %int 2
  38. %float = OpTypeFloat 32
  39. %float_0 = OpConstant %float 0
  40. %float_1 = OpConstant %float 1
  41. %float_0_5 = OpConstant %float 0.5
  42. %float_100 = OpConstant %float 100
  43. %float_999999 = OpConstant %float 999999
  44. %v4float = OpTypeVector %float 4
  45. %v2float = OpTypeVector %float 2
  46. %VertexOutput = OpTypeStruct %v4float %v2float
  47. %_ptr_Function_VertexOutput = OpTypePointer Function %VertexOutput
  48. %19 = OpConstantNull %VertexOutput
  49. %_ptr_Input_uint = OpTypePointer Input %uint
  50. %in_vertex_index = OpVariable %_ptr_Input_uint Input
  51. %_ptr_Output_v4float = OpTypePointer Output %v4float
  52. %position = OpVariable %_ptr_Output_v4float Output
  53. %_ptr_Output_v2float = OpTypePointer Output %v2float
  54. %uv = OpVariable %_ptr_Output_v2float Output
  55. %29 = OpTypeFunction %void
  56. %_ptr_Function_v4float = OpTypePointer Function %v4float
  57. %uint_0 = OpConstant %uint 0
  58. %_ptr_Function_v2float = OpTypePointer Function %v2float
  59. %_ptr_Output_float = OpTypePointer Output %float
  60. %_ptr_Input_v4float = OpTypePointer Input %v4float
  61. %position_0 = OpVariable %_ptr_Input_v4float Input
  62. %_ptr_Input_v2float = OpTypePointer Input %v2float
  63. %uv_0 = OpVariable %_ptr_Input_v2float Input
  64. %66 = OpVariable %_ptr_Output_v4float Output
  65. %v3float = OpTypeVector %float 3
  66. %bool = OpTypeBool
  67. %vs_main = OpFunction %void None %29
  68. %20 = OpLabel
  69. %out = OpVariable %_ptr_Function_VertexOutput Function %19
  70. %23 = OpLoad %uint %in_vertex_index
  71. OpBranch %30
  72. %30 = OpLabel
  73. %31 = OpBitcast %int %23
  74. %32 = OpISub %int %31 %int_1
  75. %33 = OpConvertSToF %float %32
  76. %34 = OpBitwiseAnd %uint %23 %uint_1
  77. %35 = OpBitcast %int %34
  78. %36 = OpIMul %int %35 %int_2
  79. %37 = OpISub %int %36 %int_1
  80. %38 = OpConvertSToF %float %37
  81. %40 = OpCompositeConstruct %v4float %33 %38 %float_0 %float_1
  82. %42 = OpAccessChain %_ptr_Function_v4float %out %uint_0
  83. OpStore %42 %40
  84. %44 = OpAccessChain %_ptr_Function_v4float %out %uint_0
  85. %45 = OpLoad %v4float %44
  86. %46 = OpVectorShuffle %v2float %45 %45 0 1
  87. %47 = OpCompositeConstruct %v2float %float_1 %float_1
  88. %48 = OpFAdd %v2float %46 %47
  89. %49 = OpVectorTimesScalar %v2float %48 %float_0_5
  90. %50 = OpAccessChain %_ptr_Function_v2float %out %uint_1
  91. OpStore %50 %49
  92. %51 = OpLoad %VertexOutput %out
  93. %52 = OpCompositeExtract %v4float %51 0
  94. OpStore %position %52
  95. %54 = OpAccessChain %_ptr_Output_float %position %uint_1
  96. %55 = OpLoad %float %54
  97. %56 = OpFNegate %float %55
  98. OpStore %54 %56
  99. %57 = OpCompositeExtract %v2float %51 1
  100. OpStore %uv %57
  101. OpReturn
  102. OpFunctionEnd
  103. %fs_main = OpFunction %void None %29
  104. %58 = OpLabel
  105. %62 = OpLoad %v4float %position_0
  106. %65 = OpLoad %v2float %uv_0
  107. %59 = OpCompositeConstruct %VertexOutput %62 %65
  108. OpBranch %68
  109. %68 = OpLabel
  110. %69 = OpCompositeExtract %v2float %59 1
  111. %70 = OpCompositeExtract %float %69 0
  112. %71 = OpFMul %float %70 %float_100
  113. %72 = OpFAdd %float %71 %float_1
  114. %73 = OpExtInst %float %1 Floor %72
  115. %74 = OpFMul %float %73 %float_999999
  116. %75 = OpExtInst %float %1 Floor %71
  117. %76 = OpFAdd %float %75 %float_1
  118. %77 = OpFMul %float %76 %float_999999
  119. %78 = OpFSub %float %77 %74
  120. %81 = OpCompositeConstruct %v3float %78 %78 %78
  121. %83 = OpFOrdNotEqual %bool %74 %77
  122. %84 = OpSelect %float %83 %float_1 %float_0
  123. %85 = OpCompositeConstruct %v4float %81 %84
  124. OpStore %66 %85
  125. OpReturn
  126. OpFunctionEnd
  127.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement