ForwardSubpass.pass 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. {
  2. "Type": "JsonSerialization",
  3. "Version": 1,
  4. "ClassName": "PassAsset",
  5. "ClassData": {
  6. "PassTemplate": {
  7. "Name": "ForwardSubpassExampleTemplate",
  8. "PassClass": "RasterPass",
  9. "Slots": [
  10. // Inputs...
  11. {
  12. "Name": "BRDFTextureInput",
  13. "ShaderInputName": "m_brdfMap",
  14. "SlotType": "Input",
  15. "ScopeAttachmentUsage": "Shader"
  16. },
  17. // Outputs...
  18. {
  19. "Name": "DepthOutput",
  20. "SlotType": "Output",
  21. "ScopeAttachmentUsage": "DepthStencil",
  22. // Specifying the AspectFlags is very important
  23. // when using Subpasses because it avoids Validation errors.
  24. "ImageViewDesc": {
  25. "AspectFlags": [
  26. "Depth"
  27. ]
  28. },
  29. "LoadStoreAction": {
  30. "ClearValue": {
  31. "Type": "DepthStencil"
  32. },
  33. "LoadAction": "Clear",
  34. "LoadActionStencil": "DontCare",
  35. // The depth buffer won't be used after the two subpasses are completed.
  36. // For efficiency's sake do not Store.
  37. "StoreAction": "DontCare",
  38. "StoreActionStencil": "DontCare"
  39. }
  40. },
  41. {
  42. "Name": "LightingOutput",
  43. "SlotType": "Output",
  44. "ScopeAttachmentUsage": "RenderTarget",
  45. "LoadStoreAction": {
  46. "ClearValue": {
  47. "Value": [
  48. 0.0,
  49. 0.0,
  50. 0.0,
  51. 0.0
  52. ]
  53. },
  54. "LoadAction": "Clear",
  55. "StoreAction": "Store"
  56. }
  57. }
  58. ],
  59. "ImageAttachments": [
  60. {
  61. "Name": "DepthAttachment",
  62. "SizeSource": {
  63. "Source": {
  64. "Pass": "Parent",
  65. "Attachment": "PipelineOutput"
  66. }
  67. },
  68. "ImageDescriptor": {
  69. "Format": "D32_FLOAT_S8X24_UINT",
  70. "SharedQueueMask": "Graphics"
  71. }
  72. },
  73. {
  74. "Name": "BRDFTexture",
  75. "Lifetime": "Imported",
  76. "AssetRef": {
  77. "FilePath": "Textures/BRDFTexture.attimage"
  78. }
  79. }
  80. ],
  81. "Connections": [
  82. {
  83. "LocalSlot": "DepthOutput",
  84. "AttachmentRef": {
  85. "Pass": "This",
  86. "Attachment": "DepthAttachment"
  87. }
  88. },
  89. {
  90. "LocalSlot": "LightingOutput",
  91. "AttachmentRef": {
  92. "Pass": "Parent",
  93. "Attachment": "PipelineOutput"
  94. }
  95. },
  96. {
  97. "LocalSlot": "BRDFTextureInput",
  98. "AttachmentRef": {
  99. "Pass": "This",
  100. "Attachment": "BRDFTexture"
  101. }
  102. }
  103. ]
  104. }
  105. }
  106. }