mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
[Impeller] fix render pass depth descriptor. (flutter/engine#51031)
Depth+stencil should be treated as the same attachment. Adding more than one d/s attachment in the render pass descriptor seems to be confusing swiftshader. @bdero This fixes things for me locally, lets let CI take a spin
This commit is contained in:
parent
98c96670b4
commit
8acca62755
@ -158,15 +158,18 @@ InlinePassContext::RenderPassResult InlinePassContext::GetRenderPass(
|
||||
pass_target_.target_.SetDepthAttachment(depth.value());
|
||||
}
|
||||
|
||||
auto depth = pass_target_.GetRenderTarget().GetDepthAttachment();
|
||||
auto stencil = pass_target_.GetRenderTarget().GetStencilAttachment();
|
||||
if (!stencil.has_value()) {
|
||||
VALIDATION_LOG << "Stencil attachment unexpectedly missing from the "
|
||||
if (!depth.has_value() || !stencil.has_value()) {
|
||||
VALIDATION_LOG << "Stencil/Depth attachment unexpectedly missing from the "
|
||||
"EntityPass render target.";
|
||||
return {};
|
||||
}
|
||||
|
||||
stencil->load_action = LoadAction::kClear;
|
||||
stencil->store_action = StoreAction::kDontCare;
|
||||
depth->load_action = LoadAction::kClear;
|
||||
depth->store_action = StoreAction::kDontCare;
|
||||
pass_target_.target_.SetDepthAttachment(depth);
|
||||
pass_target_.target_.SetStencilAttachment(stencil.value());
|
||||
pass_target_.target_.SetColorAttachment(color0, 0);
|
||||
|
||||
|
||||
@ -600,10 +600,8 @@ void ContextVK::InitializeCommonlyUsedShadersIfNeeded() const {
|
||||
depth->load_action, //
|
||||
depth->store_action //
|
||||
);
|
||||
}
|
||||
|
||||
if (auto stencil = render_target.GetStencilAttachment();
|
||||
stencil.has_value()) {
|
||||
} else if (auto stencil = render_target.GetStencilAttachment();
|
||||
stencil.has_value()) {
|
||||
builder.SetStencilAttachment(
|
||||
stencil->texture->GetTextureDescriptor().format, //
|
||||
stencil->texture->GetTextureDescriptor().sample_count, //
|
||||
|
||||
@ -142,9 +142,7 @@ static vk::UniqueRenderPass CreateCompatRenderPassForPipeline(
|
||||
LoadAction::kDontCare, //
|
||||
StoreAction::kDontCare //
|
||||
);
|
||||
}
|
||||
|
||||
if (desc.HasStencilAttachmentDescriptors()) {
|
||||
} else if (desc.HasStencilAttachmentDescriptors()) {
|
||||
builder.SetStencilAttachment(desc.GetStencilPixelFormat(), //
|
||||
desc.GetSampleCount(), //
|
||||
LoadAction::kDontCare, //
|
||||
|
||||
@ -68,9 +68,7 @@ static std::vector<vk::ClearValue> GetVKClearValues(
|
||||
if (depth.has_value()) {
|
||||
clears.emplace_back(VKClearValueFromDepthStencil(
|
||||
stencil ? stencil->clear_stencil : 0u, depth->clear_depth));
|
||||
}
|
||||
|
||||
if (stencil.has_value()) {
|
||||
} else if (stencil.has_value()) {
|
||||
clears.emplace_back(VKClearValueFromDepthStencil(
|
||||
stencil->clear_stencil, depth ? depth->clear_depth : 0.0f));
|
||||
}
|
||||
@ -116,10 +114,8 @@ SharedHandleVK<vk::RenderPass> RenderPassVK::CreateVKRenderPass(
|
||||
depth->store_action //
|
||||
);
|
||||
TextureVK::Cast(*depth->texture).SetLayout(barrier);
|
||||
}
|
||||
|
||||
if (auto stencil = render_target_.GetStencilAttachment();
|
||||
stencil.has_value()) {
|
||||
} else if (auto stencil = render_target_.GetStencilAttachment();
|
||||
stencil.has_value()) {
|
||||
builder.SetStencilAttachment(
|
||||
stencil->texture->GetTextureDescriptor().format, //
|
||||
stencil->texture->GetTextureDescriptor().sample_count, //
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user