syncval: Skip FS validation w/rasterizerDiscardEnable
Disable hazard detection and state update for fragment shader operations
when rasterDiscardEnable is set.
Change-Id: I1ca2edee0e0a5f6959e6c29cc30e53a25cf2ee9c
diff --git a/layers/synchronization_validation.cpp b/layers/synchronization_validation.cpp
index 784dba0..e3bbe05 100644
--- a/layers/synchronization_validation.cpp
+++ b/layers/synchronization_validation.cpp
@@ -1314,6 +1314,10 @@
using TexelDescriptor = cvdescriptorset::TexelDescriptor;
for (const auto &stage_state : pPipe->stage_state) {
+ if (stage_state.stage_flag == VK_SHADER_STAGE_FRAGMENT_BIT &&
+ pPipe->graphicsPipelineCI.pRasterizationState &&
+ pPipe->graphicsPipelineCI.pRasterizationState->rasterizerDiscardEnable)
+ continue;
for (const auto &set_binding : stage_state.descriptor_uses) {
cvdescriptorset::DescriptorSet *descriptor_set = (*per_sets)[set_binding.first.first].bound_descriptor_set;
cvdescriptorset::DescriptorSetLayout::ConstBindingIterator binding_it(descriptor_set->GetLayout().get(),
@@ -1431,6 +1435,9 @@
using TexelDescriptor = cvdescriptorset::TexelDescriptor;
for (const auto &stage_state : pPipe->stage_state) {
+ if (stage_state.stage_flag == VK_SHADER_STAGE_FRAGMENT_BIT && pPipe->graphicsPipelineCI.pRasterizationState &&
+ pPipe->graphicsPipelineCI.pRasterizationState->rasterizerDiscardEnable)
+ continue;
for (const auto &set_binding : stage_state.descriptor_uses) {
cvdescriptorset::DescriptorSet *descriptor_set = (*per_sets)[set_binding.first.first].bound_descriptor_set;
cvdescriptorset::DescriptorSetLayout::ConstBindingIterator binding_it(descriptor_set->GetLayout().get(),
@@ -1657,7 +1664,8 @@
const VkRect2D &render_area, const char *func_name) const {
bool skip = false;
const auto *pPipe = GetCurrentPipelineFromCommandBuffer(cmd, VK_PIPELINE_BIND_POINT_GRAPHICS);
- if (!pPipe) {
+ if (!pPipe ||
+ (pPipe->graphicsPipelineCI.pRasterizationState && pPipe->graphicsPipelineCI.pRasterizationState->rasterizerDiscardEnable)) {
return skip;
}
const auto &list = pPipe->fragmentShader_writable_output_location_list;
@@ -1699,7 +1707,8 @@
void RenderPassAccessContext::RecordDrawSubpassAttachment(const CMD_BUFFER_STATE &cmd, const VkRect2D &render_area,
const ResourceUsageTag &tag) {
const auto *pPipe = GetCurrentPipelineFromCommandBuffer(cmd, VK_PIPELINE_BIND_POINT_GRAPHICS);
- if (!pPipe) {
+ if (!pPipe ||
+ (pPipe->graphicsPipelineCI.pRasterizationState && pPipe->graphicsPipelineCI.pRasterizationState->rasterizerDiscardEnable)) {
return;
}
const auto &list = pPipe->fragmentShader_writable_output_location_list;