diff options
author | Tony-LunarG <tony@lunarg.com> | 2022-02-25 09:31:17 -0700 |
---|---|---|
committer | Tony Barbour <tony@lunarg.com> | 2022-03-07 16:25:48 -0700 |
commit | 463bae3d083c6447c32fc25871df7516023a4d27 (patch) | |
tree | 63cb1c7a68924650d592c9d0f87d439e0e85124d | |
parent | 89749bc34ed08444bc79fa645be2a2d8eea001bb (diff) | |
download | Vulkan-ValidationLayers-463bae3d083c6447c32fc25871df7516023a4d27.tar.gz Vulkan-ValidationLayers-463bae3d083c6447c32fc25871df7516023a4d27.tar.bz2 Vulkan-ValidationLayers-463bae3d083c6447c32fc25871df7516023a4d27.zip |
gpu: Handle NULL renderpass
-rw-r--r-- | layers/gpu_validation.cpp | 22 | ||||
-rw-r--r-- | layers/gpu_validation.h | 1 |
2 files changed, 18 insertions, 5 deletions
diff --git a/layers/gpu_validation.cpp b/layers/gpu_validation.cpp index 915d321ff..6737b732f 100644 --- a/layers/gpu_validation.cpp +++ b/layers/gpu_validation.cpp @@ -1967,10 +1967,19 @@ void GpuAssisted::AllocatePreDrawValidationResources(GpuAssistedDeviceMemoryBloc pre_draw_validation_state.globals_created = true; } + + VkPipeline pipeline = VK_NULL_HANDLE; VkRenderPass render_pass = state.pipeline_state->rp_state->renderPass(); - assert(render_pass != VK_NULL_HANDLE); - auto pipeline = pre_draw_validation_state.renderpass_to_pipeline.find(render_pass); - if (pipeline == pre_draw_validation_state.renderpass_to_pipeline.end()) { + if (render_pass != VK_NULL_HANDLE) { + auto pipeentry = pre_draw_validation_state.renderpass_to_pipeline.find(render_pass); + if (pipeentry != pre_draw_validation_state.renderpass_to_pipeline.end()) { + pipeline = pipeentry->second; + } + } else { + // Dynamic Rendering + pipeline = pre_draw_validation_state.dyn_rendering_pipeline; + } + if (pipeline == VK_NULL_HANDLE) { auto pipeline_stage_ci = LvlInitStruct<VkPipelineShaderStageCreateInfo>(); pipeline_stage_ci.stage = VK_SHADER_STAGE_VERTEX_BIT; pipeline_stage_ci.module = pre_draw_validation_state.validation_shader_module; @@ -2002,9 +2011,12 @@ void GpuAssisted::AllocatePreDrawValidationResources(GpuAssistedDeviceMemoryBloc } *pPipeline = new_pipeline; - pre_draw_validation_state.renderpass_to_pipeline[render_pass] = new_pipeline; + if (render_pass != VK_NULL_HANDLE) + pre_draw_validation_state.renderpass_to_pipeline[render_pass] = new_pipeline; + else + pre_draw_validation_state.dyn_rendering_pipeline = new_pipeline; } else { - *pPipeline = pipeline->second; + *pPipeline = pipeline; } result = desc_set_manager->GetDescriptorSet(&resources.desc_pool, pre_draw_validation_state.validation_ds_layout, diff --git a/layers/gpu_validation.h b/layers/gpu_validation.h index 612f08c80..1efa541c1 100644 --- a/layers/gpu_validation.h +++ b/layers/gpu_validation.h @@ -111,6 +111,7 @@ struct GpuAssistedPreDrawValidationState { VkShaderModule validation_shader_module = VK_NULL_HANDLE; VkDescriptorSetLayout validation_ds_layout = VK_NULL_HANDLE; VkPipelineLayout validation_pipeline_layout = VK_NULL_HANDLE; + VkPipeline dyn_rendering_pipeline = VK_NULL_HANDLE; layer_data::unordered_map <VkRenderPass, VkPipeline> renderpass_to_pipeline; }; |