MultiGPUPipeline.pass 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  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. "LocalSlot": "Output",
  151. "AttachmentRef": {
  152. "Pass": "TrianglePass2",
  153. "Attachment": "Output"
  154. }
  155. }
  156. ],
  157. "PassData": {
  158. "$type": "CopyPassData",
  159. "DestinationDeviceIndex": 0,
  160. "SourceDeviceIndex": 1
  161. }
  162. },
  163. {
  164. "Name": "CompositePass",
  165. "TemplateName": "MultiGPUCompositePassTemplate",
  166. "Connections": [
  167. {
  168. "LocalSlot": "Input1",
  169. "AttachmentRef": {
  170. "Pass": "TrianglePass1",
  171. "Attachment": "Output"
  172. }
  173. },
  174. {
  175. "LocalSlot": "Input2",
  176. "AttachmentRef": {
  177. "Pass": "CopyPass",
  178. "Attachment": "Output"
  179. }
  180. }
  181. ],
  182. "PassData": {
  183. "$type": "FullscreenTrianglePassData",
  184. "ShaderAsset": {
  185. "FilePath": "Shaders/MultiGPURPIExample/Composite.shader"
  186. }
  187. }
  188. },
  189. {
  190. "Name": "ImGuiPass",
  191. "TemplateName": "ImGuiPassTemplate",
  192. "Enabled": true,
  193. "Connections": [
  194. {
  195. "LocalSlot": "InputOutput",
  196. "AttachmentRef": {
  197. "Pass": "CompositePass",
  198. "Attachment": "Output"
  199. }
  200. }
  201. ],
  202. "PassData": {
  203. "$type": "ImGuiPassData",
  204. "IsDefaultImGui": true
  205. }
  206. },
  207. {
  208. "Name": "CopyToSwapChain",
  209. "TemplateName": "FullscreenCopyTemplate",
  210. "Connections": [
  211. {
  212. "LocalSlot": "Input",
  213. "AttachmentRef": {
  214. "Pass": "ImGuiPass",
  215. "Attachment": "InputOutput"
  216. }
  217. },
  218. {
  219. "LocalSlot": "Output",
  220. "AttachmentRef": {
  221. "Pass": "Parent",
  222. "Attachment": "PipelineOutput"
  223. }
  224. }
  225. ]
  226. }
  227. ]
  228. }
  229. }
  230. }