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

Commit f249919

Browse files
authored
Revert "[Impeller] Uniquely label offscreen resources (#39987)" (#39993)
Revert "[Impeller] Uniquely label offscreen resources"
1 parent 8c9a358 commit f249919

11 files changed

+28
-28
lines changed

impeller/entity/contents/content_context.cc

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
#include <memory>
88
#include <sstream>
99

10-
#include "impeller/base/strings.h"
1110
#include "impeller/entity/entity.h"
1211
#include "impeller/renderer/command_buffer.h"
1312
#include "impeller/renderer/formats.h"
@@ -309,7 +308,6 @@ bool ContentContext::IsValid() const {
309308
}
310309

311310
std::shared_ptr<Texture> ContentContext::MakeSubpass(
312-
const std::string& label,
313311
ISize texture_size,
314312
const SubpassCallback& subpass_callback,
315313
bool msaa_enabled) const {
@@ -319,11 +317,11 @@ std::shared_ptr<Texture> ContentContext::MakeSubpass(
319317
if (context->GetDeviceCapabilities().SupportsOffscreenMSAA() &&
320318
msaa_enabled) {
321319
subpass_target = RenderTarget::CreateOffscreenMSAA(
322-
*context, texture_size, SPrintF("%s Offscreen", label.c_str()),
320+
*context, texture_size, "Contents Offscreen MSAA",
323321
RenderTarget::kDefaultColorAttachmentConfigMSAA, std::nullopt);
324322
} else {
325323
subpass_target = RenderTarget::CreateOffscreen(
326-
*context, texture_size, SPrintF("%s Offscreen", label.c_str()),
324+
*context, texture_size, "Contents Offscreen",
327325
RenderTarget::kDefaultColorAttachmentConfig, std::nullopt);
328326
}
329327
auto subpass_texture = subpass_target.GetRenderTargetTexture();
@@ -332,7 +330,7 @@ std::shared_ptr<Texture> ContentContext::MakeSubpass(
332330
}
333331

334332
auto sub_command_buffer = context->CreateCommandBuffer();
335-
sub_command_buffer->SetLabel(SPrintF("%s CommandBuffer", label.c_str()));
333+
sub_command_buffer->SetLabel("Offscreen Contents Command Buffer");
336334
if (!sub_command_buffer) {
337335
return nullptr;
338336
}
@@ -341,7 +339,7 @@ std::shared_ptr<Texture> ContentContext::MakeSubpass(
341339
if (!sub_renderpass) {
342340
return nullptr;
343341
}
344-
sub_renderpass->SetLabel(SPrintF("%s RenderPass", label.c_str()));
342+
sub_renderpass->SetLabel("OffscreenContentsPass");
345343

346344
if (!subpass_callback(*this, *sub_renderpass)) {
347345
return nullptr;

impeller/entity/contents/content_context.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -603,8 +603,7 @@ class ContentContext {
603603

604604
/// @brief Creates a new texture of size `texture_size` and calls
605605
/// `subpass_callback` with a `RenderPass` for drawing to the texture.
606-
std::shared_ptr<Texture> MakeSubpass(const std::string& label,
607-
ISize texture_size,
606+
std::shared_ptr<Texture> MakeSubpass(ISize texture_size,
608607
const SubpassCallback& subpass_callback,
609608
bool msaa_enabled = true) const;
610609

impeller/entity/contents/contents.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
#include <optional>
77

88
#include "fml/logging.h"
9-
#include "impeller/base/strings.h"
109
#include "impeller/entity/contents/content_context.h"
1110
#include "impeller/entity/contents/texture_contents.h"
1211
#include "impeller/renderer/command_buffer.h"
@@ -83,7 +82,7 @@ std::optional<Snapshot> Contents::RenderToSnapshot(
8382
}
8483

8584
auto texture = renderer.MakeSubpass(
86-
"Snapshot", ISize::Ceil(coverage->size),
85+
ISize::Ceil(coverage->size),
8786
[&contents = *this, &entity, &coverage](const ContentContext& renderer,
8887
RenderPass& pass) -> bool {
8988
Entity sub_entity;

impeller/entity/contents/filters/blend_filter_contents.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,11 @@ static std::optional<Entity> AdvancedBlend(
150150
return true;
151151
};
152152

153-
auto out_texture = renderer.MakeSubpass("Advanced Blend Filter",
154-
ISize(coverage.size), callback);
153+
auto out_texture = renderer.MakeSubpass(ISize(coverage.size), callback);
155154
if (!out_texture) {
156155
return std::nullopt;
157156
}
157+
out_texture->SetLabel("Advanced Blend Filter Texture");
158158

159159
return Contents::EntityFromSnapshot(
160160
Snapshot{.texture = out_texture,
@@ -274,11 +274,11 @@ static std::optional<Entity> PipelineBlend(
274274
return true;
275275
};
276276

277-
auto out_texture = renderer.MakeSubpass("Pipeline Blend Filter",
278-
ISize(coverage.size), callback);
277+
auto out_texture = renderer.MakeSubpass(ISize(coverage.size), callback);
279278
if (!out_texture) {
280279
return std::nullopt;
281280
}
281+
out_texture->SetLabel("Pipeline Blend Filter Texture");
282282

283283
return Contents::EntityFromSnapshot(
284284
Snapshot{.texture = out_texture,

impeller/entity/contents/filters/border_mask_blur_filter_contents.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,11 @@ std::optional<Entity> BorderMaskBlurFilterContents::RenderFilter(
122122
return pass.AddCommand(std::move(cmd));
123123
};
124124

125-
auto out_texture = renderer.MakeSubpass("Border Mask Blur Filter",
126-
ISize(coverage.size), callback);
125+
auto out_texture = renderer.MakeSubpass(ISize(coverage.size), callback);
127126
if (!out_texture) {
128127
return std::nullopt;
129128
}
129+
out_texture->SetLabel("BorderMaskBlurFilter Texture");
130130

131131
return Contents::EntityFromSnapshot(
132132
Snapshot{.texture = out_texture,

impeller/entity/contents/filters/color_matrix_filter_contents.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,12 @@ std::optional<Entity> ColorMatrixFilterContents::RenderFilter(
9797
return pass.AddCommand(std::move(cmd));
9898
};
9999

100-
auto out_texture = renderer.MakeSubpass(
101-
"Color Matrix Filter", input_snapshot->texture->GetSize(), callback);
100+
auto out_texture =
101+
renderer.MakeSubpass(input_snapshot->texture->GetSize(), callback);
102102
if (!out_texture) {
103103
return std::nullopt;
104104
}
105+
out_texture->SetLabel("ColorMatrixFilter Texture");
105106

106107
return Contents::EntityFromSnapshot(
107108
Snapshot{.texture = out_texture,

impeller/entity/contents/filters/gaussian_blur_filter_contents.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,12 +276,12 @@ std::optional<Entity> DirectionalGaussianBlurFilterContents::RenderFilter(
276276
Vector2 scaled_size = pass_texture_rect.size * scale;
277277
ISize floored_size = ISize(scaled_size.x, scaled_size.y);
278278

279-
auto out_texture = renderer.MakeSubpass("Directional Gaussian Blur Filter",
280-
floored_size, callback);
279+
auto out_texture = renderer.MakeSubpass(floored_size, callback);
281280

282281
if (!out_texture) {
283282
return std::nullopt;
284283
}
284+
out_texture->SetLabel("DirectionalGaussianBlurFilter Texture");
285285

286286
SamplerDescriptor sampler_desc;
287287
sampler_desc.min_filter = MinMagFilter::kLinear;

impeller/entity/contents/filters/linear_to_srgb_filter_contents.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,12 @@ std::optional<Entity> LinearToSrgbFilterContents::RenderFilter(
7474
return pass.AddCommand(std::move(cmd));
7575
};
7676

77-
auto out_texture = renderer.MakeSubpass(
78-
"Linear to sRGB Filter", input_snapshot->texture->GetSize(), callback);
77+
auto out_texture =
78+
renderer.MakeSubpass(input_snapshot->texture->GetSize(), callback);
7979
if (!out_texture) {
8080
return std::nullopt;
8181
}
82+
out_texture->SetLabel("LinearToSrgb Texture");
8283

8384
return Contents::EntityFromSnapshot(
8485
Snapshot{.texture = out_texture,

impeller/entity/contents/filters/morphology_filter_contents.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,11 @@ std::optional<Entity> DirectionalMorphologyFilterContents::RenderFilter(
132132
return pass.AddCommand(cmd);
133133
};
134134

135-
auto out_texture = renderer.MakeSubpass("Directional Morphology Filter",
136-
ISize(coverage.size), callback);
135+
auto out_texture = renderer.MakeSubpass(ISize(coverage.size), callback);
137136
if (!out_texture) {
138137
return std::nullopt;
139138
}
139+
out_texture->SetLabel("DirectionalMorphologyFilter Texture");
140140

141141
SamplerDescriptor sampler_desc;
142142
sampler_desc.min_filter = MinMagFilter::kLinear;

impeller/entity/contents/filters/srgb_to_linear_filter_contents.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,12 @@ std::optional<Entity> SrgbToLinearFilterContents::RenderFilter(
7474
return pass.AddCommand(std::move(cmd));
7575
};
7676

77-
auto out_texture = renderer.MakeSubpass(
78-
"sRGB to Linear Filter", input_snapshot->texture->GetSize(), callback);
77+
auto out_texture =
78+
renderer.MakeSubpass(input_snapshot->texture->GetSize(), callback);
7979
if (!out_texture) {
8080
return std::nullopt;
8181
}
82+
out_texture->SetLabel("SrgbToLinear Texture");
8283

8384
return Contents::EntityFromSnapshot(
8485
Snapshot{.texture = out_texture,

0 commit comments

Comments
 (0)