Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/igl/vulkan/RenderPipelineState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,15 @@ VkPipeline RenderPipelineState::getVkPipeline(
cacheKey.depthBiasEnable = 0;
}

// Normalize renderPassIndex so that format-compatible render passes
// (same formats/samples, different load/store/layout) share one PSO.
// Per Vulkan spec:https://docs.vulkan.org/spec/latest/chapters/renderpass.html#renderpass-compatibility
// render pass compatibility only depends on format, samples,
// and flags -- NOT on loadOp/storeOp/initialLayout/finalLayout.
// This is safe because desc_.targetDesc already pins the format expectations
// for this RenderPipelineState, so all render passes it encounters are compatible.
cacheKey.renderPassIndex = 0;

const auto it = pipelines_.find(cacheKey);

if (it != pipelines_.end()) {
Expand Down
Loading