MultiGPUPipeline.pass 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. {
  2. "Type": "JsonSerialization",
  3. "Version": 1,
  4. "ClassName": "PassAsset",
  5. "ClassData": {
  6. "PassTemplate": {
  7. "Name": "MultiGPUPipeline",
  8. "PassClass": "ParentPass",
  9. "Slots": [
  10. {
  11. "Name": "PipelineOutput",
  12. "SlotType": "InputOutput",
  13. "ScopeAttachmentUsage": "RenderTarget"
  14. }
  15. ],
  16. "ImageAttachments": [
  17. {
  18. "Name": "TriangleAttachment1",
  19. "SizeSource": {
  20. "Source": {
  21. "Pass": "This",
  22. "Attachment": "PipelineOutput"
  23. },
  24. "Multipliers": {
  25. "WidthMultiplier": 0.5
  26. }
  27. },
  28. "ImageDescriptor": {
  29. "Format": "R8G8B8A8_UNORM"
  30. }
  31. },
  32. {
  33. "Name": "TriangleAttachment2",
  34. "SizeSource": {
  35. "Source": {
  36. "Pass": "This",
  37. "Attachment": "PipelineOutput"
  38. },
  39. "Multipliers": {
  40. "WidthMultiplier": 0.5
  41. }
  42. },
  43. "ImageDescriptor": {
  44. "Format": "R8G8B8A8_UNORM"
  45. }
  46. }
  47. ],
  48. "PassRequests": [
  49. {
  50. "Name": "TrianglePass1",
  51. "TemplateName": "MultiGPUTrianglePassTemplate",
  52. "Connections": [
  53. {
  54. "LocalSlot": "Output",
  55. "AttachmentRef": {
  56. "Pass": "Parent",
  57. "Attachment": "TriangleAttachment1"
  58. }
  59. }
  60. ],
  61. "PassData": {
  62. "$type": "FullscreenTrianglePassData",
  63. "ShaderAsset": {
  64. "FilePath": "Shaders/MultiGPURPIExample/Triangle.shader"
  65. },
  66. "ShaderDataMappings": {
  67. "Matrix4x4Mappings": [
  68. {
  69. "Name": "m_objectMatrix",
  70. "Value": [
  71. 2.0,
  72. 0.0,
  73. 0.0,
  74. 0.0,
  75. 0.0,
  76. 1.0,
  77. 0.0,
  78. 0.0,
  79. 0.0,
  80. 0.0,
  81. 1.0,
  82. 0.0,
  83. 1.0,
  84. 0.0,
  85. 0.0,
  86. 1.0
  87. ]
  88. }
  89. ]
  90. }
  91. }
  92. },
  93. {
  94. "Name": "TrianglePass2",
  95. "TemplateName": "MultiGPUTrianglePassTemplate",
  96. "Connections": [
  97. {
  98. "LocalSlot": "Output",
  99. "AttachmentRef": {
  100. "Pass": "Parent",
  101. "Attachment": "TriangleAttachment2"
  102. }
  103. }
  104. ],
  105. "PassData": {
  106. "$type": "FullscreenTrianglePassData",
  107. "ShaderAsset": {
  108. "FilePath": "Shaders/MultiGPURPIExample/Triangle.shader"
  109. },
  110. "DeviceIndex": 1,
  111. "ShaderDataMappings": {
  112. "Matrix4x4Mappings": [
  113. {
  114. "Name": "m_objectMatrix",
  115. "Value": [
  116. 2.0,
  117. 0.0,
  118. 0.0,
  119. 0.0,
  120. 0.0,
  121. 1.0,
  122. 0.0,
  123. 0.0,
  124. 0.0,
  125. 0.0,
  126. 1.0,
  127. 0.0,
  128. -1.0,
  129. 0.0,
  130. 0.0,
  131. 1.0
  132. ]
  133. }
  134. ]
  135. }
  136. }
  137. },
  138. {
  139. "Name": "CopyPass",
  140. "TemplateName": "CopyPassTemplate",
  141. "Connections": [
  142. {
  143. "LocalSlot": "Input",
  144. "AttachmentRef": {
  145. "Pass": "TrianglePass2",
  146. "Attachment": "Output"
  147. }
  148. }
  149. ],
  150. "PassData": {
  151. "$type": "CopyPassData",
  152. "DestinationDeviceIndex": 0,
  153. "SourceDeviceIndex": 1
  154. }
  155. },
  156. {
  157. "Name": "CompositePass",
  158. "TemplateName": "MultiGPUCompositePassTemplate",
  159. "Connections": [
  160. {
  161. "LocalSlot": "Input1",
  162. "AttachmentRef": {
  163. "Pass": "TrianglePass1",
  164. "Attachment": "Output"
  165. }
  166. },
  167. {
  168. "LocalSlot": "Input2",
  169. "AttachmentRef": {
  170. "Pass": "CopyPass",
  171. "Attachment": "Output"
  172. }
  173. }
  174. ],
  175. "PassData": {
  176. "$type": "FullscreenTrianglePassData",
  177. "ShaderAsset": {
  178. "FilePath": "Shaders/MultiGPURPIExample/Composite.shader"
  179. }
  180. }
  181. },
  182. {
  183. "Name": "ImGuiPass",
  184. "TemplateName": "ImGuiPassTemplate",
  185. "Enabled": true,
  186. "Connections": [
  187. {
  188. "LocalSlot": "InputOutput",
  189. "AttachmentRef": {
  190. "Pass": "CompositePass",
  191. "Attachment": "Output"
  192. }
  193. }
  194. ],
  195. "PassData": {
  196. "$type": "ImGuiPassData",
  197. "IsDefaultImGui": true
  198. }
  199. },
  200. {
  201. "Name": "CopyToSwapChain",
  202. "TemplateName": "FullscreenCopyTemplate",
  203. "Connections": [
  204. {
  205. "LocalSlot": "Input",
  206. "AttachmentRef": {
  207. "Pass": "ImGuiPass",
  208. "Attachment": "InputOutput"
  209. }
  210. },
  211. {
  212. "LocalSlot": "Output",
  213. "AttachmentRef": {
  214. "Pass": "Parent",
  215. "Attachment": "PipelineOutput"
  216. }
  217. }
  218. ]
  219. }
  220. ]
  221. }
  222. }
  223. }