diff --git a/impeller/entity/entity_pass.cc b/impeller/entity/entity_pass.cc index c6c39a6416f7a..dcfd1418770d3 100644 --- a/impeller/entity/entity_pass.cc +++ b/impeller/entity/entity_pass.cc @@ -333,16 +333,11 @@ bool EntityPass::Render(ContentContext& renderer, .coverage = Rect::MakeSize(root_render_target.GetRenderTargetSize()), .clip_depth = 0}}; - bool supports_onscreen_backdrop_reads = - renderer.GetDeviceCapabilities().SupportsReadFromOnscreenTexture() && - // If the backend doesn't have `SupportsReadFromResolve`, we need to flip - // between two textures when restoring a previous MSAA pass. - renderer.GetDeviceCapabilities().SupportsReadFromResolve(); bool reads_from_onscreen_backdrop = GetTotalPassReads(renderer) > 0; // In this branch path, we need to render everything to an offscreen texture // and then blit the results onto the onscreen texture. If using this branch, // there's no need to set up a stencil attachment on the root render target. - if (!supports_onscreen_backdrop_reads && reads_from_onscreen_backdrop) { + if (reads_from_onscreen_backdrop) { auto offscreen_target = CreateRenderTarget(renderer, root_render_target.GetRenderTargetSize(), GetClearColor(render_target.GetRenderTargetSize())); diff --git a/impeller/renderer/backend/gles/capabilities_gles.cc b/impeller/renderer/backend/gles/capabilities_gles.cc index 9b2251c054f39..c659dad574a07 100644 --- a/impeller/renderer/backend/gles/capabilities_gles.cc +++ b/impeller/renderer/backend/gles/capabilities_gles.cc @@ -169,10 +169,6 @@ bool CapabilitiesGLES::SupportsComputeSubgroups() const { return false; } -bool CapabilitiesGLES::SupportsReadFromOnscreenTexture() const { - return false; -} - bool CapabilitiesGLES::SupportsReadFromResolve() const { return false; } diff --git a/impeller/renderer/backend/gles/capabilities_gles.h b/impeller/renderer/backend/gles/capabilities_gles.h index 47dcaa33f3fb0..921d3a4287cac 100644 --- a/impeller/renderer/backend/gles/capabilities_gles.h +++ b/impeller/renderer/backend/gles/capabilities_gles.h @@ -97,9 +97,6 @@ class CapabilitiesGLES final // |Capabilities| bool SupportsComputeSubgroups() const override; - // |Capabilities| - bool SupportsReadFromOnscreenTexture() const override; - // |Capabilities| bool SupportsReadFromResolve() const override; diff --git a/impeller/renderer/backend/gles/test/capabilities_unittests.cc b/impeller/renderer/backend/gles/test/capabilities_unittests.cc index 5a82cf5b4c9b6..530c5c5e3f057 100644 --- a/impeller/renderer/backend/gles/test/capabilities_unittests.cc +++ b/impeller/renderer/backend/gles/test/capabilities_unittests.cc @@ -22,7 +22,6 @@ TEST(CapabilitiesGLES, CanInitializeWithDefaults) { EXPECT_FALSE(capabilities->SupportsFramebufferFetch()); EXPECT_FALSE(capabilities->SupportsCompute()); EXPECT_FALSE(capabilities->SupportsComputeSubgroups()); - EXPECT_FALSE(capabilities->SupportsReadFromOnscreenTexture()); EXPECT_FALSE(capabilities->SupportsReadFromResolve()); EXPECT_FALSE(capabilities->SupportsDecalSamplerAddressMode()); EXPECT_FALSE(capabilities->SupportsDeviceTransientTextures()); diff --git a/impeller/renderer/backend/metal/context_mtl.mm b/impeller/renderer/backend/metal/context_mtl.mm index 06fd34724685a..9373d3e3a7b35 100644 --- a/impeller/renderer/backend/metal/context_mtl.mm +++ b/impeller/renderer/backend/metal/context_mtl.mm @@ -66,7 +66,6 @@ static bool DeviceSupportsComputeSubgroups(id device) { .SetSupportsCompute(true) .SetSupportsComputeSubgroups(DeviceSupportsComputeSubgroups(device)) .SetSupportsReadFromResolve(true) - .SetSupportsReadFromOnscreenTexture(true) .SetSupportsDeviceTransientTextures(true) .Build(); } diff --git a/impeller/renderer/backend/vulkan/capabilities_vk.cc b/impeller/renderer/backend/vulkan/capabilities_vk.cc index ada7712ad66f7..8af5a31f0b3ca 100644 --- a/impeller/renderer/backend/vulkan/capabilities_vk.cc +++ b/impeller/renderer/backend/vulkan/capabilities_vk.cc @@ -451,11 +451,6 @@ bool CapabilitiesVK::SupportsReadFromResolve() const { return false; } -// |Capabilities| -bool CapabilitiesVK::SupportsReadFromOnscreenTexture() const { - return false; -} - bool CapabilitiesVK::SupportsDecalSamplerAddressMode() const { return true; } diff --git a/impeller/renderer/backend/vulkan/capabilities_vk.h b/impeller/renderer/backend/vulkan/capabilities_vk.h index a768610d9c4ba..f7ffd2232fc7c 100644 --- a/impeller/renderer/backend/vulkan/capabilities_vk.h +++ b/impeller/renderer/backend/vulkan/capabilities_vk.h @@ -85,9 +85,6 @@ class CapabilitiesVK final : public Capabilities, // |Capabilities| bool SupportsReadFromResolve() const override; - // |Capabilities| - bool SupportsReadFromOnscreenTexture() const override; - // |Capabilities| bool SupportsDecalSamplerAddressMode() const override; diff --git a/impeller/renderer/capabilities.cc b/impeller/renderer/capabilities.cc index 80ea8e0f2b384..4dcda955ab954 100644 --- a/impeller/renderer/capabilities.cc +++ b/impeller/renderer/capabilities.cc @@ -49,11 +49,6 @@ class StandardCapabilities final : public Capabilities { return supports_compute_subgroups_; } - // |Capabilities| - bool SupportsReadFromOnscreenTexture() const override { - return supports_read_from_onscreen_texture_; - } - // |Capabilities| bool SupportsReadFromResolve() const override { return supports_read_from_resolve_; @@ -91,7 +86,6 @@ class StandardCapabilities final : public Capabilities { bool supports_framebuffer_fetch, bool supports_compute, bool supports_compute_subgroups, - bool supports_read_from_onscreen_texture, bool supports_read_from_resolve, bool supports_decal_sampler_address_mode, bool supports_device_transient_textures, @@ -105,8 +99,6 @@ class StandardCapabilities final : public Capabilities { supports_framebuffer_fetch_(supports_framebuffer_fetch), supports_compute_(supports_compute), supports_compute_subgroups_(supports_compute_subgroups), - supports_read_from_onscreen_texture_( - supports_read_from_onscreen_texture), supports_read_from_resolve_(supports_read_from_resolve), supports_decal_sampler_address_mode_( supports_decal_sampler_address_mode), @@ -124,7 +116,6 @@ class StandardCapabilities final : public Capabilities { bool supports_framebuffer_fetch_ = false; bool supports_compute_ = false; bool supports_compute_subgroups_ = false; - bool supports_read_from_onscreen_texture_ = false; bool supports_read_from_resolve_ = false; bool supports_decal_sampler_address_mode_ = false; bool supports_device_transient_textures_ = false; @@ -180,18 +171,6 @@ CapabilitiesBuilder& CapabilitiesBuilder::SetSupportsComputeSubgroups( return *this; } -CapabilitiesBuilder& CapabilitiesBuilder::SetSupportsReadFromOnscreenTexture( - bool read_from_onscreen_texture) { - supports_read_from_onscreen_texture_ = read_from_onscreen_texture; - return *this; -} - -CapabilitiesBuilder& CapabilitiesBuilder::SetSupportsReadFromResolve( - bool read_from_resolve) { - supports_read_from_resolve_ = read_from_resolve; - return *this; -} - CapabilitiesBuilder& CapabilitiesBuilder::SetDefaultColorFormat( PixelFormat value) { default_color_format_ = value; @@ -210,6 +189,12 @@ CapabilitiesBuilder& CapabilitiesBuilder::SetDefaultDepthStencilFormat( return *this; } +CapabilitiesBuilder& CapabilitiesBuilder::SetSupportsReadFromResolve( + bool read_from_resolve) { + supports_read_from_resolve_ = read_from_resolve; + return *this; +} + CapabilitiesBuilder& CapabilitiesBuilder::SetSupportsDecalSamplerAddressMode( bool value) { supports_decal_sampler_address_mode_ = value; @@ -231,7 +216,6 @@ std::unique_ptr CapabilitiesBuilder::Build() { supports_framebuffer_fetch_, // supports_compute_, // supports_compute_subgroups_, // - supports_read_from_onscreen_texture_, // supports_read_from_resolve_, // supports_decal_sampler_address_mode_, // supports_device_transient_textures_, // diff --git a/impeller/renderer/capabilities.h b/impeller/renderer/capabilities.h index 99d5986b1fe02..48f12a7d2432d 100644 --- a/impeller/renderer/capabilities.h +++ b/impeller/renderer/capabilities.h @@ -64,10 +64,6 @@ class Capabilities { /// command subgroups. virtual bool SupportsComputeSubgroups() const = 0; - /// @brief Whether the context backend supports binding the on-screen surface - /// texture for shader reading. - virtual bool SupportsReadFromOnscreenTexture() const = 0; - /// @brief Whether the context backend supports binding the current /// `RenderPass` attachments. This is supported if the backend can /// guarantee that attachment textures will not be mutated until the @@ -136,8 +132,6 @@ class CapabilitiesBuilder { CapabilitiesBuilder& SetSupportsComputeSubgroups(bool value); - CapabilitiesBuilder& SetSupportsReadFromOnscreenTexture(bool value); - CapabilitiesBuilder& SetSupportsReadFromResolve(bool value); CapabilitiesBuilder& SetDefaultColorFormat(PixelFormat value); @@ -160,7 +154,6 @@ class CapabilitiesBuilder { bool supports_framebuffer_fetch_ = false; bool supports_compute_ = false; bool supports_compute_subgroups_ = false; - bool supports_read_from_onscreen_texture_ = false; bool supports_read_from_resolve_ = false; bool supports_decal_sampler_address_mode_ = false; bool supports_device_transient_textures_ = false; diff --git a/impeller/renderer/capabilities_unittests.cc b/impeller/renderer/capabilities_unittests.cc index beab9a9a53615..06c9bc3f82282 100644 --- a/impeller/renderer/capabilities_unittests.cc +++ b/impeller/renderer/capabilities_unittests.cc @@ -25,7 +25,6 @@ CAPABILITY_TEST(SupportsTextureToTextureBlits, false); CAPABILITY_TEST(SupportsFramebufferFetch, false); CAPABILITY_TEST(SupportsCompute, false); CAPABILITY_TEST(SupportsComputeSubgroups, false); -CAPABILITY_TEST(SupportsReadFromOnscreenTexture, false); CAPABILITY_TEST(SupportsReadFromResolve, false); CAPABILITY_TEST(SupportsDecalSamplerAddressMode, false); CAPABILITY_TEST(SupportsDeviceTransientTextures, false);