ForwardSubpass.pass 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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. "StoreActionStencil": "DontCare"
  36. }
  37. },
  38. {
  39. "Name": "LightingOutput",
  40. "SlotType": "Output",
  41. "ScopeAttachmentUsage": "RenderTarget",
  42. "LoadStoreAction": {
  43. "ClearValue": {
  44. "Value": [
  45. 0.0,
  46. 0.0,
  47. 0.0,
  48. 0.0
  49. ]
  50. },
  51. "LoadAction": "Clear",
  52. "StoreAction": "Store"
  53. }
  54. }
  55. ],
  56. "ImageAttachments": [
  57. {
  58. "Name": "DepthAttachment",
  59. "SizeSource": {
  60. "Source": {
  61. "Pass": "Parent",
  62. "Attachment": "PipelineOutput"
  63. }
  64. },
  65. "ImageDescriptor": {
  66. "Format": "D32_FLOAT_S8X24_UINT",
  67. "SharedQueueMask": "Graphics"
  68. }
  69. },
  70. {
  71. "Name": "BRDFTexture",
  72. "Lifetime": "Imported",
  73. "AssetRef": {
  74. "FilePath": "Textures/BRDFTexture.attimage"
  75. }
  76. }
  77. ],
  78. "Connections": [
  79. {
  80. "LocalSlot": "DepthOutput",
  81. "AttachmentRef": {
  82. "Pass": "This",
  83. "Attachment": "DepthAttachment"
  84. }
  85. },
  86. {
  87. "LocalSlot": "LightingOutput",
  88. "AttachmentRef": {
  89. "Pass": "Parent",
  90. "Attachment": "PipelineOutput"
  91. }
  92. },
  93. {
  94. "LocalSlot": "BRDFTextureInput",
  95. "AttachmentRef": {
  96. "Pass": "This",
  97. "Attachment": "BRDFTexture"
  98. }
  99. }
  100. ]
  101. }
  102. }
  103. }