Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 4f6ea31

Browse files
Reverts "[Impeller] fold memory check into allocator_vk (#51187)" (#51243)
Reverts: #51187 Initiated by: jonahwilliams Reason for reverting: unexpected benchmark regression https://flutter-flutter-perf.skia.org/e/?queries=device_type%3DPixel_7_Pro%26sub_result%3D90th_percentile_frame_rasterizer_time_millis%26sub_result%3D99th_percentile_frame_rasterizer_time_millis%26sub_result%3Daverage_frame_rasterizer_time_millis%26sub_result%3Dworst_frame_rasterizer_time_millis%26test%3Dnew_gallery_impeller__transition_perf&selected=commit%3D396 Original PR Author: jonahwilliams Reviewed By: {matanlurey} This change reverts the following previous change: Various cleanups to Vulkan allocator implementation: 1. Fixes flutter/flutter#137454 2. Fold device transient cap check into allocator. 3. adds debug tracking for total memory usage in MB (a followup change needs to be made to driver to plumb it through) 4. Small cleanups to mock vulkan so an allocator can be created from it. 5. depth/stencil shouldn't be input attachments. Part of flutter/flutter#144617
1 parent c4b9afa commit 4f6ea31

20 files changed

+190
-333
lines changed

ci/licenses_golden/excluded_files

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@
168168
../../../flutter/impeller/playground
169169
../../../flutter/impeller/renderer/backend/gles/test
170170
../../../flutter/impeller/renderer/backend/metal/texture_mtl_unittests.mm
171-
../../../flutter/impeller/renderer/backend/vulkan/allocator_vk_unittests.cc
172171
../../../flutter/impeller/renderer/backend/vulkan/blit_command_vk_unittests.cc
173172
../../../flutter/impeller/renderer/backend/vulkan/command_encoder_vk_unittests.cc
174173
../../../flutter/impeller/renderer/backend/vulkan/command_pool_vk_unittests.cc

impeller/core/allocator.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,6 @@ class Allocator {
4444

4545
virtual ISize GetMaxTextureSizeSupported() const = 0;
4646

47-
/// @brief Write debug memory usage information to the dart timeline in debug
48-
/// and profile modes.
49-
///
50-
/// This is only supported on the Vulkan backend.
51-
virtual void DebugTraceMemoryStatistics() const {};
52-
5347
protected:
5448
Allocator();
5549

impeller/renderer/backend/gles/capabilities_gles.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,10 @@ bool CapabilitiesGLES::SupportsDecalSamplerAddressMode() const {
181181
return supports_decal_sampler_address_mode_;
182182
}
183183

184+
bool CapabilitiesGLES::SupportsDeviceTransientTextures() const {
185+
return false;
186+
}
187+
184188
PixelFormat CapabilitiesGLES::GetDefaultColorFormat() const {
185189
return PixelFormat::kR8G8B8A8UNormInt;
186190
}

impeller/renderer/backend/gles/capabilities_gles.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,9 @@ class CapabilitiesGLES final
107107
// |Capabilities|
108108
bool SupportsDecalSamplerAddressMode() const override;
109109

110+
// |Capabilities|
111+
bool SupportsDeviceTransientTextures() const override;
112+
110113
// |Capabilities|
111114
PixelFormat GetDefaultColorFormat() const override;
112115

impeller/renderer/backend/gles/test/capabilities_unittests.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ TEST(CapabilitiesGLES, CanInitializeWithDefaults) {
2424
EXPECT_FALSE(capabilities->SupportsComputeSubgroups());
2525
EXPECT_FALSE(capabilities->SupportsReadFromResolve());
2626
EXPECT_FALSE(capabilities->SupportsDecalSamplerAddressMode());
27+
EXPECT_FALSE(capabilities->SupportsDeviceTransientTextures());
2728

2829
EXPECT_EQ(capabilities->GetDefaultColorFormat(),
2930
PixelFormat::kR8G8B8A8UNormInt);

impeller/renderer/backend/metal/context_mtl.mm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ static bool DeviceSupportsComputeSubgroups(id<MTLDevice> device) {
6666
.SetSupportsCompute(true)
6767
.SetSupportsComputeSubgroups(DeviceSupportsComputeSubgroups(device))
6868
.SetSupportsReadFromResolve(true)
69+
.SetSupportsDeviceTransientTextures(true)
6970
.SetDefaultGlyphAtlasFormat(PixelFormat::kA8UNormInt)
7071
.Build();
7172
}

impeller/renderer/backend/vulkan/BUILD.gn

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import("../../../tools/impeller.gni")
88
impeller_component("vulkan_unittests") {
99
testonly = true
1010
sources = [
11-
"allocator_vk_unittests.cc",
1211
"blit_command_vk_unittests.cc",
1312
"command_encoder_vk_unittests.cc",
1413
"command_pool_vk_unittests.cc",

0 commit comments

Comments
 (0)