summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngine
diff options
context:
space:
mode:
authorassiduous <assiduous@diligentgraphics.com>2020-07-26 19:56:01 +0000
committerassiduous <assiduous@diligentgraphics.com>2020-08-02 19:21:39 +0000
commitdfa7d46a0cf961d77be6d4a93eba1831935224f7 (patch)
tree66d147416aa6f26584e9c0ee1c703cd075e5457f /Graphics/GraphicsEngine
parentAdded PIPELINE_STAGE_FLAGS and ACCESS_FLAGS (diff)
downloadDiligentCore-dfa7d46a0cf961d77be6d4a93eba1831935224f7.tar.gz
DiligentCore-dfa7d46a0cf961d77be6d4a93eba1831935224f7.zip
Implemented SubpassDependencyDesc struct
Diffstat (limited to 'Graphics/GraphicsEngine')
-rw-r--r--Graphics/GraphicsEngine/interface/GraphicsTypes.h7
-rw-r--r--Graphics/GraphicsEngine/interface/RenderPass.h20
-rw-r--r--Graphics/GraphicsEngine/src/RenderPassBase.cpp23
3 files changed, 47 insertions, 3 deletions
diff --git a/Graphics/GraphicsEngine/interface/GraphicsTypes.h b/Graphics/GraphicsEngine/interface/GraphicsTypes.h
index a0493c54..5fbb5412 100644
--- a/Graphics/GraphicsEngine/interface/GraphicsTypes.h
+++ b/Graphics/GraphicsEngine/interface/GraphicsTypes.h
@@ -1913,6 +1913,9 @@ typedef struct TextureFormatInfoExt TextureFormatInfoExt;
/// enum and only have effect in Vulkan backend.
DILIGENT_TYPED_ENUM(PIPELINE_STAGE_FLAGS, Uint32)
{
+ /// Undefined stage
+ PIPELINE_STAGE_FLAG_UNDEFINED = 0x00000000,
+
/// The top of the pipeline.
PIPELINE_STAGE_FLAG_TOP_OF_PIPE = 0x00000001,
@@ -1934,8 +1937,8 @@ DILIGENT_TYPED_ENUM(PIPELINE_STAGE_FLAGS, Uint32)
/// Geometry shader stage.
PIPELINE_STAGE_FLAG_GEOMETRY_SHADER = 0x00000040,
- /// Fragment shader stage.
- PIPELINE_STAGE_FLAG_FRAGMENT_SHADER = 0x00000080,
+ /// Pixel shader stage.
+ PIPELINE_STAGE_FLAG_PIXEL_SHADER = 0x00000080,
/// The stage of the pipeline where early fragment tests (depth and
/// stencil tests before fragment shading) are performed. This stage
diff --git a/Graphics/GraphicsEngine/interface/RenderPass.h b/Graphics/GraphicsEngine/interface/RenderPass.h
index 0cc37f96..0f12c66d 100644
--- a/Graphics/GraphicsEngine/interface/RenderPass.h
+++ b/Graphics/GraphicsEngine/interface/RenderPass.h
@@ -273,10 +273,28 @@ struct SubpassDesc
typedef struct SubpassDesc SubpassDesc;
+#define SUBPASS_EXTERNAL (~0U)
+
/// Subpass dependency description
struct SubpassDependencyDesc
{
- void* TBD;
+ /// The subpass index of the first subpass in the dependency, or SUBPASS_EXTERNAL.
+ Uint32 SrcSubpass DEFAULT_INITIALIZER(0);
+
+ /// The subpass index of the second subpass in the dependency, or SUBPASS_EXTERNAL.
+ Uint32 DstSubpass DEFAULT_INITIALIZER(0);
+
+ /// A bitmask of PIPELINE_STAGE_FLAGS specifying the source stage mask.
+ PIPELINE_STAGE_FLAGS SrcStageMask DEFAULT_INITIALIZER(PIPELINE_STAGE_FLAG_UNDEFINED);
+
+ /// A bitmask of PIPELINE_STAGE_FLAGS specifying the destination stage mask.
+ PIPELINE_STAGE_FLAGS DstStageMask DEFAULT_INITIALIZER(PIPELINE_STAGE_FLAG_UNDEFINED);
+
+ /// A bitmask of ACCESS_FLAGS specifying a source access mask.
+ ACCESS_FLAGS SrcAccessMask DEFAULT_INITIALIZER(ACCESS_FLAG_NONE);
+
+ /// A bitmask of ACCESS_FLAGS specifying a destination access mask.
+ ACCESS_FLAGS DstAccessMask DEFAULT_INITIALIZER(ACCESS_FLAG_NONE);
};
typedef struct SubpassDependencyDesc SubpassDependencyDesc;
diff --git a/Graphics/GraphicsEngine/src/RenderPassBase.cpp b/Graphics/GraphicsEngine/src/RenderPassBase.cpp
index 782e950f..a77ef404 100644
--- a/Graphics/GraphicsEngine/src/RenderPassBase.cpp
+++ b/Graphics/GraphicsEngine/src/RenderPassBase.cpp
@@ -37,6 +37,15 @@ void ValidateRenderPassDesc(const RenderPassDesc& Desc)
{
#define LOG_RENDER_PASS_ERROR_AND_THROW(...) LOG_ERROR_AND_THROW("Render pass '", (Desc.Name ? Desc.Name : ""), "': ", ##__VA_ARGS__)
+ if (Desc.AttachmentCount != 0 && Desc.pAttachments == nullptr)
+ LOG_RENDER_PASS_ERROR_AND_THROW("The attachment count (", Desc.AttachmentCount, ") is not zero, but pAttachments is null");
+
+ if (Desc.SubpassCount != 0 && Desc.pSubpasses == nullptr)
+ LOG_RENDER_PASS_ERROR_AND_THROW("The subpass count (", Desc.SubpassCount, ") is not zero, but pSubpasses is null");
+
+ if (Desc.DependencyCount != 0 && Desc.pDependencies == nullptr)
+ LOG_RENDER_PASS_ERROR_AND_THROW("The dependency count (", Desc.DependencyCount, ") is not zero, but pDependencies is null");
+
for (Uint32 i = 0; i < Desc.AttachmentCount; ++i)
{
const auto& Attachment = Desc.pAttachments[i];
@@ -114,6 +123,20 @@ void ValidateRenderPassDesc(const RenderPassDesc& Desc)
" is not zero, while pPreserveAttachments is null");
}
}
+
+ for (Uint32 i = 0; i < Desc.DependencyCount; ++i)
+ {
+ const auto& Dependency = Desc.pDependencies[i];
+
+ if (Dependency.SrcStageMask == PIPELINE_STAGE_FLAG_UNDEFINED)
+ {
+ LOG_RENDER_PASS_ERROR_AND_THROW("the source stage mask of subpass dependency ", i, " is undefined");
+ }
+ if (Dependency.DstStageMask == PIPELINE_STAGE_FLAG_UNDEFINED)
+ {
+ LOG_RENDER_PASS_ERROR_AND_THROW("the destination stage mask of subpass dependency ", i, " is undefined");
+ }
+ }
}
} // namespace Diligent