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

Commit 4b27e57

Browse files
author
Jonah Williams
authored
[Impeller] Conditionally set command debug info. (#44274)
If IMPELLER_DEBUG is not defined (release mode), then remove the cmd label strings and additional encoding debug info.
1 parent eced188 commit 4b27e57

37 files changed

+94
-73
lines changed

impeller/entity/contents/atlas_contents.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ bool AtlasTextureContents::Render(const ContentContext& renderer,
330330
}
331331

332332
Command cmd;
333-
cmd.label = "AtlasTexture";
333+
DEBUG_COMMAND_INFO(cmd, "AtlasTexture");
334334

335335
auto& host_buffer = pass.GetTransientsBuffer();
336336

@@ -418,7 +418,7 @@ bool AtlasColorContents::Render(const ContentContext& renderer,
418418
}
419419

420420
Command cmd;
421-
cmd.label = "AtlasColors";
421+
DEBUG_COMMAND_INFO(cmd, "AtlasColors");
422422

423423
auto& host_buffer = pass.GetTransientsBuffer();
424424

impeller/entity/contents/checkerboard_contents.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ bool CheckerboardContents::Render(const ContentContext& renderer,
2626
using FS = CheckerboardPipeline::FragmentShader;
2727

2828
Command cmd;
29-
cmd.label = "Checkerboard";
29+
DEBUG_COMMAND_INFO(cmd, "Checkerboard");
3030

3131
auto options = OptionsFromPass(pass);
3232
options.blend_mode = BlendMode::kSourceOver;

impeller/entity/contents/clip_contents.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ bool ClipContents::Render(const ContentContext& renderer,
9393

9494
if (clip_op_ == Entity::ClipOperation::kDifference) {
9595
{
96-
cmd.label = "Difference Clip (Increment)";
96+
DEBUG_COMMAND_INFO(cmd, "Difference Clip (Increment)");
9797

9898
auto points = Rect(Size(pass.GetRenderTargetSize())).GetPoints();
9999
auto vertices =
@@ -111,14 +111,14 @@ bool ClipContents::Render(const ContentContext& renderer,
111111
}
112112

113113
{
114-
cmd.label = "Difference Clip (Punch)";
114+
DEBUG_COMMAND_INFO(cmd, "Difference Clip (Punch)");
115115

116116
cmd.stencil_reference = entity.GetStencilDepth() + 1;
117117
options.stencil_compare = CompareFunction::kEqual;
118118
options.stencil_operation = StencilOperation::kDecrementClamp;
119119
}
120120
} else {
121-
cmd.label = "Intersect Clip";
121+
DEBUG_COMMAND_INFO(cmd, "Intersect Clip");
122122
options.stencil_compare = CompareFunction::kEqual;
123123
options.stencil_operation = StencilOperation::kIncrementClamp;
124124
}
@@ -179,7 +179,7 @@ bool ClipRestoreContents::Render(const ContentContext& renderer,
179179
using VS = ClipPipeline::VertexShader;
180180

181181
Command cmd;
182-
cmd.label = "Restore Clip";
182+
DEBUG_COMMAND_INFO(cmd, "Restore Clip");
183183
auto options = OptionsFromPass(pass);
184184
options.blend_mode = BlendMode::kDestination;
185185
options.stencil_compare = CompareFunction::kLess;

impeller/entity/contents/conical_gradient_contents.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ bool ConicalGradientContents::RenderSSBO(const ContentContext& renderer,
9999
frame_info.matrix = GetInverseEffectTransform();
100100

101101
Command cmd;
102-
cmd.label = "ConicalGradientSSBOFill";
102+
DEBUG_COMMAND_INFO(cmd, "ConicalGradientSSBOFill");
103103
cmd.stencil_reference = entity.GetStencilDepth();
104104

105105
auto geometry_result =
@@ -167,7 +167,7 @@ bool ConicalGradientContents::RenderTexture(const ContentContext& renderer,
167167
frame_info.matrix = GetInverseEffectTransform();
168168

169169
Command cmd;
170-
cmd.label = "ConicalGradientFill";
170+
DEBUG_COMMAND_INFO(cmd, "ConicalGradientFill");
171171
cmd.stencil_reference = entity.GetStencilDepth();
172172

173173
auto options = OptionsFromPassAndEntity(pass, entity);

impeller/entity/contents/filters/blend_filter_contents.cc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@ static std::optional<Entity> AdvancedBlend(
132132
std::invoke(pipeline_proc, renderer, options);
133133

134134
Command cmd;
135-
cmd.label =
136-
SPrintF("Advanced Blend Filter (%s)", BlendModeToString(blend_mode));
135+
DEBUG_COMMAND_INFO(cmd, SPrintF("Advanced Blend Filter (%s)",
136+
BlendModeToString(blend_mode)));
137137
cmd.BindVertices(vtx_buffer);
138138
cmd.pipeline = std::move(pipeline);
139139

@@ -249,8 +249,8 @@ std::optional<Entity> BlendFilterContents::CreateForegroundAdvancedBlend(
249249
auto vtx_buffer = vtx_builder.CreateVertexBuffer(host_buffer);
250250

251251
Command cmd;
252-
cmd.label = SPrintF("Foreground Advanced Blend Filter (%s)",
253-
BlendModeToString(blend_mode));
252+
DEBUG_COMMAND_INFO(cmd, SPrintF("Foreground Advanced Blend Filter (%s)",
253+
BlendModeToString(blend_mode)));
254254
cmd.BindVertices(vtx_buffer);
255255
cmd.stencil_reference = entity.GetStencilDepth();
256256
auto options = OptionsFromPass(pass);
@@ -435,8 +435,8 @@ std::optional<Entity> BlendFilterContents::CreateForegroundPorterDuffBlend(
435435
auto vtx_buffer = vtx_builder.CreateVertexBuffer(host_buffer);
436436

437437
Command cmd;
438-
cmd.label = SPrintF("Foreground PorterDuff Blend Filter (%s)",
439-
BlendModeToString(blend_mode));
438+
DEBUG_COMMAND_INFO(cmd, SPrintF("Foreground PorterDuff Blend Filter (%s)",
439+
BlendModeToString(blend_mode)));
440440
cmd.BindVertices(vtx_buffer);
441441
cmd.stencil_reference = entity.GetStencilDepth();
442442
auto options = OptionsFromPass(pass);
@@ -531,8 +531,8 @@ static std::optional<Entity> PipelineBlend(
531531
auto& host_buffer = pass.GetTransientsBuffer();
532532

533533
Command cmd;
534-
cmd.label =
535-
SPrintF("Pipeline Blend Filter (%s)", BlendModeToString(blend_mode));
534+
DEBUG_COMMAND_INFO(cmd, SPrintF("Pipeline Blend Filter (%s)",
535+
BlendModeToString(blend_mode)));
536536
auto options = OptionsFromPass(pass);
537537

538538
auto add_blend_command = [&](std::optional<Snapshot> input) {

impeller/entity/contents/filters/border_mask_blur_filter_contents.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ std::optional<Entity> BorderMaskBlurFilterContents::RenderFilter(
109109
auto vtx_buffer = vtx_builder.CreateVertexBuffer(host_buffer);
110110

111111
Command cmd;
112-
cmd.label = "Border Mask Blur Filter";
112+
DEBUG_COMMAND_INFO(cmd, "Border Mask Blur Filter");
113113
auto options = OptionsFromPassAndEntity(pass, entity);
114114

115115
cmd.pipeline = renderer.GetBorderMaskBlurPipeline(options);

impeller/entity/contents/filters/color_matrix_filter_contents.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ std::optional<Entity> ColorMatrixFilterContents::RenderFilter(
5555
const ContentContext& renderer,
5656
const Entity& entity, RenderPass& pass) -> bool {
5757
Command cmd;
58-
cmd.label = "Color Matrix Filter";
58+
DEBUG_COMMAND_INFO(cmd, "Color Matrix Filter");
5959
cmd.stencil_reference = entity.GetStencilDepth();
6060

6161
auto options = OptionsFromPassAndEntity(pass, entity);

impeller/entity/contents/filters/gaussian_blur_filter_contents.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,8 @@ std::optional<Entity> DirectionalGaussianBlurFilterContents::RenderFilter(
228228
Point(input_snapshot->GetCoverage().value().size);
229229

230230
Command cmd;
231-
cmd.label = SPrintF("Gaussian Blur Filter (Radius=%.2f)",
232-
transformed_blur_radius_length);
231+
DEBUG_COMMAND_INFO(cmd, SPrintF("Gaussian Blur Filter (Radius=%.2f)",
232+
transformed_blur_radius_length));
233233
cmd.BindVertices(vtx_buffer);
234234

235235
auto options = OptionsFromPass(pass);

impeller/entity/contents/filters/linear_to_srgb_filter_contents.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ std::optional<Entity> LinearToSrgbFilterContents::RenderFilter(
4646
const ContentContext& renderer,
4747
const Entity& entity, RenderPass& pass) -> bool {
4848
Command cmd;
49-
cmd.label = "Linear to sRGB Filter";
49+
DEBUG_COMMAND_INFO(cmd, "Linear to sRGB Filter");
5050
cmd.stencil_reference = entity.GetStencilDepth();
5151

5252
auto options = OptionsFromPassAndEntity(pass, entity);

impeller/entity/contents/filters/morphology_filter_contents.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ std::optional<Entity> DirectionalMorphologyFilterContents::RenderFilter(
116116
Point(transformed_texture_width, transformed_texture_height);
117117

118118
Command cmd;
119-
cmd.label = "Morphology Filter";
119+
DEBUG_COMMAND_INFO(cmd, "Morphology Filter");
120120
auto options = OptionsFromPass(pass);
121121
options.blend_mode = BlendMode::kSource;
122122
cmd.pipeline = renderer.GetMorphologyFilterPipeline(options);

0 commit comments

Comments
 (0)