aboutsummaryrefslogtreecommitdiff
path: root/layers/core_validation.h
diff options
context:
space:
mode:
authorTobin Ehlis <tobine@google.com>2016-03-28 11:18:19 -0600
committerMark Lobodzinski <mark@lunarg.com>2016-03-29 17:11:11 -0600
commit098ec63bdb640195fe01e22778954a34b4ffe4bb (patch)
tree999aa65ce4bb9dc9d742d89d5defffc4998bf21f /layers/core_validation.h
parent14287499aaa790038a243e56132cc7d73fb4d90d (diff)
downloadusermoji-098ec63bdb640195fe01e22778954a34b4ffe4bb.tar.xz
layers: GH195 Fix core_validation dynamic state checks
Overhauled validation of dynamic state based on latest details in the VkPipelineDynamicStateCreateInfo section of the spec. Because some of the state checks need to be predicated on different pipeline state, removed the previous flag-based system for check predication and made it more clear and explicit exactly which pipeline states were gating each dynamic state check with "if" clauses in validate_draw_state_flags(). The biggest change here is for blend constants, which was the focus of the referenced GH195. For this case, added blendConstantsEnabled bool to PIPELINE_NODE and enable it by loop through all attachments to identify if any have blendEnable set and use the blend constant in any of their blendFactors. Also updated all the tests that were affected by this change. Change-Id: Iaba5d28986c83547575be1ff70b9ae7602435417
Diffstat (limited to 'layers/core_validation.h')
-rw-r--r--layers/core_validation.h32
1 files changed, 16 insertions, 16 deletions
diff --git a/layers/core_validation.h b/layers/core_validation.h
index a157b43b..31132a93 100644
--- a/layers/core_validation.h
+++ b/layers/core_validation.h
@@ -424,11 +424,12 @@ typedef struct _PIPELINE_NODE {
std::vector<VkVertexInputBindingDescription> vertexBindingDescriptions;
std::vector<VkVertexInputAttributeDescription> vertexAttributeDescriptions;
std::vector<VkPipelineColorBlendAttachmentState> attachments;
+ bool blendConstantsEnabled; // Blend constants enabled for any attachments
// Default constructor
_PIPELINE_NODE()
: pipeline{}, graphicsPipelineCI{}, vertexInputCI{}, iaStateCI{}, tessStateCI{}, vpStateCI{}, rsStateCI{}, msStateCI{},
cbStateCI{}, dsStateCI{}, dynStateCI{}, vsCI{}, tcsCI{}, tesCI{}, gsCI{}, fsCI{}, computePipelineCI{}, active_shaders(0),
- active_slots(), vertexBindingDescriptions(), vertexAttributeDescriptions(), attachments() {}
+ active_slots(), vertexBindingDescriptions(), vertexAttributeDescriptions(), attachments(), blendConstantsEnabled(false) {}
} PIPELINE_NODE;
class BASE_NODE {
@@ -723,21 +724,20 @@ typedef enum _CB_STATE {
// CB Status -- used to track status of various bindings on cmd buffer objects
typedef VkFlags CBStatusFlags;
typedef enum _CBStatusFlagBits {
- CBSTATUS_NONE = 0x00000000, // No status is set
- CBSTATUS_VIEWPORT_SET = 0x00000001, // Viewport has been set
- CBSTATUS_LINE_WIDTH_SET = 0x00000002, // Line width has been set
- CBSTATUS_DEPTH_BIAS_SET = 0x00000004, // Depth bias has been set
- CBSTATUS_COLOR_BLEND_WRITE_ENABLE = 0x00000008, // PSO w/ CB Enable set has been set
- CBSTATUS_BLEND_SET = 0x00000010, // Blend state object has been set
- CBSTATUS_DEPTH_WRITE_ENABLE = 0x00000020, // PSO w/ Depth Enable set has been set
- CBSTATUS_STENCIL_TEST_ENABLE = 0x00000040, // PSO w/ Stencil Enable set has been set
- CBSTATUS_DEPTH_BOUNDS_SET = 0x00000080, // Depth bounds state object has been set
- CBSTATUS_STENCIL_READ_MASK_SET = 0x00000100, // Stencil read mask has been set
- CBSTATUS_STENCIL_WRITE_MASK_SET = 0x00000200, // Stencil write mask has been set
- CBSTATUS_STENCIL_REFERENCE_SET = 0x00000400, // Stencil reference has been set
- CBSTATUS_INDEX_BUFFER_BOUND = 0x00000800, // Index buffer has been set
- CBSTATUS_SCISSOR_SET = 0x00001000, // Scissor has been set
- CBSTATUS_ALL = 0x00001FFF, // All dynamic state set
+ // clang-format off
+ CBSTATUS_NONE = 0x00000000, // No status is set
+ CBSTATUS_VIEWPORT_SET = 0x00000001, // Viewport has been set
+ CBSTATUS_LINE_WIDTH_SET = 0x00000002, // Line width has been set
+ CBSTATUS_DEPTH_BIAS_SET = 0x00000004, // Depth bias has been set
+ CBSTATUS_BLEND_CONSTANTS_SET = 0x00000008, // Blend constants state has been set
+ CBSTATUS_DEPTH_BOUNDS_SET = 0x00000010, // Depth bounds state object has been set
+ CBSTATUS_STENCIL_READ_MASK_SET = 0x00000020, // Stencil read mask has been set
+ CBSTATUS_STENCIL_WRITE_MASK_SET = 0x00000040, // Stencil write mask has been set
+ CBSTATUS_STENCIL_REFERENCE_SET = 0x00000080, // Stencil reference has been set
+ CBSTATUS_INDEX_BUFFER_BOUND = 0x00000100, // Index buffer has been set
+ CBSTATUS_SCISSOR_SET = 0x00000200, // Scissor has been set
+ CBSTATUS_ALL = 0x000003FF, // All dynamic state set
+ // clang-format on
} CBStatusFlagBits;
typedef struct stencil_data {