Guest User

Compute shader example

a guest
Feb 16th, 2018
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.90 KB | None | 0 0
  1. OpCapability Shader
  2. OpCapability ImageQuery
  3. OpCapability StorageImageReadWithoutFormat
  4. OpCapability StorageImageWriteWithoutFormat
  5. %1 = OpExtInstImport "GLSL.std.450"
  6. OpMemoryModel Logical GLSL450
  7. OpEntryPoint GLCompute %main "main" %vThreadId
  8. OpExecutionMode %main LocalSize 32 16 1
  9. OpName %s0 "s0"
  10. OpName %t0 "t0"
  11. OpName %t0_bound "t0_bound"
  12. OpName %u0 "u0"
  13. OpName %u0_bound "u0_bound"
  14. OpName %vThreadId "vThreadId"
  15. OpName %main "main"
  16. OpDecorate %s0 DescriptorSet 0
  17. OpDecorate %s0 Binding 824
  18. OpDecorate %t0 DescriptorSet 0
  19. OpDecorate %t0 Binding 840
  20. OpDecorate %t0_bound SpecId 840
  21. OpDecorate %u0 DescriptorSet 0
  22. OpDecorate %u0 Binding 968
  23. OpDecorate %u0_bound SpecId 968
  24. OpDecorate %vThreadId BuiltIn GlobalInvocationId
  25. %void = OpTypeVoid
  26. %5 = OpTypeFunction %void
  27. %7 = OpTypeSampler
  28. %_ptr_UniformConstant_7 = OpTypePointer UniformConstant %7
  29. %float = OpTypeFloat 32
  30. %11 = OpTypeImage %float 2D 0 0 0 1 Unknown
  31. %_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11
  32. %bool = OpTypeBool
  33. %t0_bound = OpSpecConstantTrue %bool
  34. %16 = OpTypeImage %float 2D 1 0 0 1 Unknown
  35. %17 = OpTypeImage %float 2D 0 0 0 2 Unknown
  36. %_ptr_UniformConstant_17 = OpTypePointer UniformConstant %17
  37. %u0_bound = OpSpecConstantTrue %bool
  38. %uint = OpTypeInt 32 0
  39. %v3uint = OpTypeVector %uint 3
  40. %_ptr_Input_v3uint = OpTypePointer Input %v3uint
  41. %v4float = OpTypeVector %float 4
  42. %_ptr_Private_v4float = OpTypePointer Private %v4float
  43. %uint_0 = OpConstant %uint 0
  44. %int = OpTypeInt 32 1
  45. %v2uint = OpTypeVector %uint 2
  46. %uint_0_0 = OpConstant %uint 0
  47. %v4uint = OpTypeVector %uint 4
  48. %v2float = OpTypeVector %float 2
  49. %uint_3212836864 = OpConstant %uint 3212836864
  50. %66 = OpTypeSampledImage %11
  51. %v3float = OpTypeVector %float 3
  52. %v2int = OpTypeVector %int 2
  53. %s0 = OpVariable %_ptr_UniformConstant_7 UniformConstant
  54. %t0 = OpVariable %_ptr_UniformConstant_11 UniformConstant
  55. %u0 = OpVariable %_ptr_UniformConstant_17 UniformConstant
  56. %vThreadId = OpVariable %_ptr_Input_v3uint Input
  57. %r0 = OpVariable %_ptr_Private_v4float Private
  58. %cs_main = OpFunction %void None %5
  59. %6 = OpLabel
  60. %30 = OpBitcast %int %uint_0
  61. %31 = OpLoad %17 %u0
  62. %33 = OpImageQuerySizeLod %v2uint %31 %30
  63. %34 = OpLoad %17 %u0
  64. %35 = OpImageQueryLevels %uint %34
  65. %38 = OpCompositeConstruct %v4uint %33 %uint_0_0 %35
  66. %39 = OpVectorShuffle %v2uint %38 %38 0 1
  67. %41 = OpBitcast %v2float %39
  68. %42 = OpLoad %v4float %r0
  69. %43 = OpVectorShuffle %v4float %42 %41 4 5 2 3
  70. OpStore %r0 %43
  71. %44 = OpLoad %v4float %r0
  72. %45 = OpVectorShuffle %v2float %44 %44 0 1
  73. %46 = OpBitcast %v2uint %45
  74. %47 = OpConvertUToF %v2float %46
  75. %48 = OpLoad %v4float %r0
  76. %49 = OpVectorShuffle %v4float %48 %47 4 5 2 3
  77. OpStore %r0 %49
  78. %50 = OpLoad %v3uint %vThreadId
  79. %51 = OpVectorShuffle %v2uint %50 %50 0 1
  80. %52 = OpConvertUToF %v2float %51
  81. %53 = OpLoad %v4float %r0
  82. %54 = OpVectorShuffle %v4float %53 %52 0 1 4 5
  83. OpStore %r0 %54
  84. %55 = OpLoad %v4float %r0
  85. %56 = OpVectorShuffle %v2float %55 %55 2 3
  86. %57 = OpLoad %v4float %r0
  87. %58 = OpVectorShuffle %v2float %57 %57 0 1
  88. %59 = OpFDiv %v2float %56 %58
  89. %60 = OpLoad %v4float %r0
  90. %61 = OpVectorShuffle %v4float %60 %59 4 5 2 3
  91. OpStore %r0 %61
  92. %62 = OpLoad %v4float %r0
  93. %63 = OpVectorShuffle %v2float %62 %62 0 1
  94. %65 = OpBitcast %float %uint_3212836864
  95. %67 = OpLoad %7 %s0
  96. %68 = OpLoad %11 %t0
  97. %69 = OpSampledImage %66 %68 %67
  98. %70 = OpImageSampleExplicitLod %v4float %69 %63 Lod %65
  99. %72 = OpVectorShuffle %v3float %70 %70 0 1 2
  100. %73 = OpLoad %v4float %r0
  101. %74 = OpVectorShuffle %v4float %73 %72 4 5 6 3
  102. OpStore %r0 %74
  103. %75 = OpLoad %v3uint %vThreadId
  104. %76 = OpVectorShuffle %v2uint %75 %75 0 1
  105. %78 = OpBitcast %v2int %76
  106. %79 = OpLoad %v4float %r0
  107. %80 = OpVectorShuffle %v4float %79 %79 0 1 2 0
  108. %81 = OpLoad %17 %u0
  109. OpImageWrite %81 %78 %80
  110. OpReturn
  111. OpFunctionEnd
  112. %main = OpFunction %void None %5
  113. %82 = OpLabel
  114. %83 = OpFunctionCall %void %cs_main
  115. OpReturn
  116. OpFunctionEnd
Advertisement
Add Comment
Please, Sign In to add comment