Update render pass checks for new VUID (#2055)

This commit is contained in:
Rua 2022-10-30 10:37:34 +01:00 committed by GitHub
parent bb971bc5c5
commit bdcb79609e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 117 deletions

View File

@ -317,8 +317,7 @@ fn main() {
depth_range: 0.0..1.0,
};
let command_buffer_allocator =
StandardCommandBufferAllocator::new(device.clone(), Default::default());
let command_buffer_allocator = StandardCommandBufferAllocator::new(device, Default::default());
let buf = CpuAccessibleBuffer::from_iter(
&memory_allocator,

View File

@ -920,127 +920,30 @@ impl RenderPass {
}
if src_subpass == dst_subpass {
let src_stages_non_framebuffer = PipelineStages {
early_fragment_tests: false,
fragment_shader: false,
late_fragment_tests: false,
color_attachment_output: false,
..src_stages
};
let dst_stages_non_framebuffer = PipelineStages {
early_fragment_tests: false,
fragment_shader: false,
late_fragment_tests: false,
color_attachment_output: false,
..dst_stages
let framebuffer_stages = PipelineStages {
early_fragment_tests: true,
fragment_shader: true,
late_fragment_tests: true,
color_attachment_output: true,
..PipelineStages::empty()
};
if !src_stages_non_framebuffer.is_empty()
|| !dst_stages_non_framebuffer.is_empty()
// VUID-VkSubpassDependency2-srcSubpass-06810
if src_stages.intersects(&framebuffer_stages)
&& !(dst_stages - framebuffer_stages).is_empty()
{
let src_latest_stage = if src_stages.all_graphics {
13
} else {
let PipelineStages {
draw_indirect,
//index_input,
//vertex_attribute_input,
vertex_shader,
tessellation_control_shader,
tessellation_evaluation_shader,
geometry_shader,
//transform_feedback,
//fragment_shading_rate_attachment,
early_fragment_tests,
fragment_shader,
late_fragment_tests,
color_attachment_output,
..
} = src_stages;
#[allow(clippy::identity_op)]
[
draw_indirect as u8 * 1,
// index_input as u8 * 2,
// vertex_attribute_input as u8 * 3,
vertex_shader as u8 * 4,
tessellation_control_shader as u8 * 5,
tessellation_evaluation_shader as u8 * 6,
geometry_shader as u8 * 7,
// transform_feedback as u8 * 8,
// fragment_shading_rate_attachment as u8 * 9,
early_fragment_tests as u8 * 10,
fragment_shader as u8 * 11,
late_fragment_tests as u8 * 12,
color_attachment_output as u8 * 13,
]
.into_iter()
.max()
.unwrap()
};
let dst_earliest_stage = if dst_stages.all_graphics {
1
} else {
let PipelineStages {
draw_indirect,
//index_input,
//vertex_attribute_input,
vertex_shader,
tessellation_control_shader,
tessellation_evaluation_shader,
geometry_shader,
//transform_feedback,
//fragment_shading_rate_attachment,
early_fragment_tests,
fragment_shader,
late_fragment_tests,
color_attachment_output,
..
} = dst_stages;
#[allow(clippy::identity_op)]
[
draw_indirect as u8 * 1,
// index_input as u8 * 2,
// vertex_attribute_input as u8 * 3,
vertex_shader as u8 * 4,
tessellation_control_shader as u8 * 5,
tessellation_evaluation_shader as u8 * 6,
geometry_shader as u8 * 7,
// transform_feedback as u8 * 8,
// fragment_shading_rate_attachment as u8 * 9,
early_fragment_tests as u8 * 10,
fragment_shader as u8 * 11,
late_fragment_tests as u8 * 12,
color_attachment_output as u8 * 13,
]
.into_iter()
.min()
.unwrap()
};
// VUID-VkSubpassDependency2-srcSubpass-03087
if src_latest_stage > dst_earliest_stage {
return Err(
RenderPassCreationError::DependencySelfDependencySourceStageAfterDestinationStage {
dependency: dependency_num,
},
);
}
return Err(
RenderPassCreationError::DependencySelfDependencySourceStageAfterDestinationStage {
dependency: dependency_num,
},
);
}
let src_has_framebuffer_stage = src_stages.fragment_shader
|| src_stages.early_fragment_tests
|| src_stages.late_fragment_tests
|| src_stages.color_attachment_output;
let dst_has_framebuffer_stage = dst_stages.fragment_shader
|| dst_stages.early_fragment_tests
|| dst_stages.late_fragment_tests
|| dst_stages.color_attachment_output;
// VUID-VkSubpassDependency2-srcSubpass-02245
if src_has_framebuffer_stage && dst_has_framebuffer_stage && !by_region {
if src_stages.intersects(&framebuffer_stages)
&& dst_stages.intersects(&framebuffer_stages)
&& !by_region
{
return Err(
RenderPassCreationError::DependencySelfDependencyFramebufferStagesWithoutByRegion {
dependency: dependency_num,