Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions impeller/entity/contents/atlas_contents.cc
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ bool AtlasTextureContents::Render(const ContentContext& renderer,
}

Command cmd;
cmd.label = "AtlasTexture";
DEBUG_COMMAND_INFO(cmd, "AtlasTexture");

auto& host_buffer = pass.GetTransientsBuffer();

Expand Down Expand Up @@ -418,7 +418,7 @@ bool AtlasColorContents::Render(const ContentContext& renderer,
}

Command cmd;
cmd.label = "AtlasColors";
DEBUG_COMMAND_INFO(cmd, "AtlasColors");

auto& host_buffer = pass.GetTransientsBuffer();

Expand Down
2 changes: 1 addition & 1 deletion impeller/entity/contents/checkerboard_contents.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ bool CheckerboardContents::Render(const ContentContext& renderer,
using FS = CheckerboardPipeline::FragmentShader;

Command cmd;
cmd.label = "Checkerboard";
DEBUG_COMMAND_INFO(cmd, "Checkerboard");

auto options = OptionsFromPass(pass);
options.blend_mode = BlendMode::kSourceOver;
Expand Down
8 changes: 4 additions & 4 deletions impeller/entity/contents/clip_contents.cc
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ bool ClipContents::Render(const ContentContext& renderer,

if (clip_op_ == Entity::ClipOperation::kDifference) {
{
cmd.label = "Difference Clip (Increment)";
DEBUG_COMMAND_INFO(cmd, "Difference Clip (Increment)");

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

{
cmd.label = "Difference Clip (Punch)";
DEBUG_COMMAND_INFO(cmd, "Difference Clip (Punch)");

cmd.stencil_reference = entity.GetStencilDepth() + 1;
options.stencil_compare = CompareFunction::kEqual;
options.stencil_operation = StencilOperation::kDecrementClamp;
}
} else {
cmd.label = "Intersect Clip";
DEBUG_COMMAND_INFO(cmd, "Intersect Clip");
options.stencil_compare = CompareFunction::kEqual;
options.stencil_operation = StencilOperation::kIncrementClamp;
}
Expand Down Expand Up @@ -179,7 +179,7 @@ bool ClipRestoreContents::Render(const ContentContext& renderer,
using VS = ClipPipeline::VertexShader;

Command cmd;
cmd.label = "Restore Clip";
DEBUG_COMMAND_INFO(cmd, "Restore Clip");
auto options = OptionsFromPass(pass);
options.blend_mode = BlendMode::kDestination;
options.stencil_compare = CompareFunction::kLess;
Expand Down
4 changes: 2 additions & 2 deletions impeller/entity/contents/conical_gradient_contents.cc
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ bool ConicalGradientContents::RenderSSBO(const ContentContext& renderer,
frame_info.matrix = GetInverseEffectTransform();

Command cmd;
cmd.label = "ConicalGradientSSBOFill";
DEBUG_COMMAND_INFO(cmd, "ConicalGradientSSBOFill");
cmd.stencil_reference = entity.GetStencilDepth();

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

Command cmd;
cmd.label = "ConicalGradientFill";
DEBUG_COMMAND_INFO(cmd, "ConicalGradientFill");
cmd.stencil_reference = entity.GetStencilDepth();

auto options = OptionsFromPassAndEntity(pass, entity);
Expand Down
16 changes: 8 additions & 8 deletions impeller/entity/contents/filters/blend_filter_contents.cc
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ static std::optional<Entity> AdvancedBlend(
std::invoke(pipeline_proc, renderer, options);

Command cmd;
cmd.label =
SPrintF("Advanced Blend Filter (%s)", BlendModeToString(blend_mode));
DEBUG_COMMAND_INFO(cmd, SPrintF("Advanced Blend Filter (%s)",
BlendModeToString(blend_mode)));
cmd.BindVertices(vtx_buffer);
cmd.pipeline = std::move(pipeline);

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

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

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

Command cmd;
cmd.label =
SPrintF("Pipeline Blend Filter (%s)", BlendModeToString(blend_mode));
DEBUG_COMMAND_INFO(cmd, SPrintF("Pipeline Blend Filter (%s)",
BlendModeToString(blend_mode)));
auto options = OptionsFromPass(pass);

auto add_blend_command = [&](std::optional<Snapshot> input) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ std::optional<Entity> BorderMaskBlurFilterContents::RenderFilter(
auto vtx_buffer = vtx_builder.CreateVertexBuffer(host_buffer);

Command cmd;
cmd.label = "Border Mask Blur Filter";
DEBUG_COMMAND_INFO(cmd, "Border Mask Blur Filter");
auto options = OptionsFromPassAndEntity(pass, entity);

cmd.pipeline = renderer.GetBorderMaskBlurPipeline(options);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ std::optional<Entity> ColorMatrixFilterContents::RenderFilter(
const ContentContext& renderer,
const Entity& entity, RenderPass& pass) -> bool {
Command cmd;
cmd.label = "Color Matrix Filter";
DEBUG_COMMAND_INFO(cmd, "Color Matrix Filter");
cmd.stencil_reference = entity.GetStencilDepth();

auto options = OptionsFromPassAndEntity(pass, entity);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,8 @@ std::optional<Entity> DirectionalGaussianBlurFilterContents::RenderFilter(
Point(input_snapshot->GetCoverage().value().size);

Command cmd;
cmd.label = SPrintF("Gaussian Blur Filter (Radius=%.2f)",
transformed_blur_radius_length);
DEBUG_COMMAND_INFO(cmd, SPrintF("Gaussian Blur Filter (Radius=%.2f)",
transformed_blur_radius_length));
cmd.BindVertices(vtx_buffer);

auto options = OptionsFromPass(pass);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ std::optional<Entity> LinearToSrgbFilterContents::RenderFilter(
const ContentContext& renderer,
const Entity& entity, RenderPass& pass) -> bool {
Command cmd;
cmd.label = "Linear to sRGB Filter";
DEBUG_COMMAND_INFO(cmd, "Linear to sRGB Filter");
cmd.stencil_reference = entity.GetStencilDepth();

auto options = OptionsFromPassAndEntity(pass, entity);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ std::optional<Entity> DirectionalMorphologyFilterContents::RenderFilter(
Point(transformed_texture_width, transformed_texture_height);

Command cmd;
cmd.label = "Morphology Filter";
DEBUG_COMMAND_INFO(cmd, "Morphology Filter");
auto options = OptionsFromPass(pass);
options.blend_mode = BlendMode::kSource;
cmd.pipeline = renderer.GetMorphologyFilterPipeline(options);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ std::optional<Entity> SrgbToLinearFilterContents::RenderFilter(
const ContentContext& renderer,
const Entity& entity, RenderPass& pass) -> bool {
Command cmd;
cmd.label = "sRGB to Linear Filter";
DEBUG_COMMAND_INFO(cmd, "sRGB to Linear Filter");
cmd.stencil_reference = entity.GetStencilDepth();

auto options = OptionsFromPassAndEntity(pass, entity);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ std::optional<Entity> YUVToRGBFilterContents::RenderFilter(
const ContentContext& renderer,
const Entity& entity, RenderPass& pass) -> bool {
Command cmd;
cmd.label = "YUV to RGB Filter";
DEBUG_COMMAND_INFO(cmd, "YUV to RGB Filter");
cmd.stencil_reference = entity.GetStencilDepth();

auto options = OptionsFromPassAndEntity(pass, entity);
Expand Down
2 changes: 1 addition & 1 deletion impeller/entity/contents/framebuffer_blend_contents.cc
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ bool FramebufferBlendContents::Render(const ContentContext& renderer,
options.blend_mode = BlendMode::kSource;

Command cmd;
cmd.label = "Framebuffer Advanced Blend Filter";
DEBUG_COMMAND_INFO(cmd, "Framebuffer Advanced Blend Filter");
cmd.BindVertices(vtx_buffer);
cmd.stencil_reference = entity.GetStencilDepth();

Expand Down
4 changes: 2 additions & 2 deletions impeller/entity/contents/linear_gradient_contents.cc
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ bool LinearGradientContents::RenderTexture(const ContentContext& renderer,
frame_info.matrix = GetInverseEffectTransform();

Command cmd;
cmd.label = "LinearGradientFill";
DEBUG_COMMAND_INFO(cmd, "LinearGradientFill");
cmd.stencil_reference = entity.GetStencilDepth();

auto options = OptionsFromPassAndEntity(pass, entity);
Expand Down Expand Up @@ -161,7 +161,7 @@ bool LinearGradientContents::RenderSSBO(const ContentContext& renderer,
frame_info.matrix = GetInverseEffectTransform();

Command cmd;
cmd.label = "LinearGradientSSBOFill";
DEBUG_COMMAND_INFO(cmd, "LinearGradientSSBOFill");
cmd.stencil_reference = entity.GetStencilDepth();

auto geometry_result =
Expand Down
4 changes: 2 additions & 2 deletions impeller/entity/contents/radial_gradient_contents.cc
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ bool RadialGradientContents::RenderSSBO(const ContentContext& renderer,
frame_info.matrix = GetInverseEffectTransform();

Command cmd;
cmd.label = "RadialGradientSSBOFill";
DEBUG_COMMAND_INFO(cmd, "RadialGradientSSBOFill");
cmd.stencil_reference = entity.GetStencilDepth();

auto geometry_result =
Expand Down Expand Up @@ -159,7 +159,7 @@ bool RadialGradientContents::RenderTexture(const ContentContext& renderer,
frame_info.matrix = GetInverseEffectTransform();

Command cmd;
cmd.label = "RadialGradientFill";
DEBUG_COMMAND_INFO(cmd, "RadialGradientFill");
cmd.stencil_reference = entity.GetStencilDepth();

auto options = OptionsFromPassAndEntity(pass, entity);
Expand Down
2 changes: 1 addition & 1 deletion impeller/entity/contents/runtime_effect_contents.cc
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ bool RuntimeEffectContents::Render(const ContentContext& renderer,
}

Command cmd;
cmd.label = "RuntimeEffectContents";
DEBUG_COMMAND_INFO(cmd, "RuntimeEffectContents");
cmd.pipeline = pipeline;
cmd.stencil_reference = entity.GetStencilDepth();
cmd.BindVertices(geometry_result.vertex_buffer);
Expand Down
2 changes: 1 addition & 1 deletion impeller/entity/contents/solid_color_contents.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ bool SolidColorContents::Render(const ContentContext& renderer,
using VS = SolidFillPipeline::VertexShader;

Command cmd;
cmd.label = "Solid Fill";
DEBUG_COMMAND_INFO(cmd, "Solid Fill");
cmd.stencil_reference = entity.GetStencilDepth();

auto geometry_result =
Expand Down
2 changes: 1 addition & 1 deletion impeller/entity/contents/solid_rrect_blur_contents.cc
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ bool SolidRRectBlurContents::Render(const ContentContext& renderer,
}

Command cmd;
cmd.label = "RRect Shadow";
DEBUG_COMMAND_INFO(cmd, "RRect Shadow");
auto opts = OptionsFromPassAndEntity(pass, entity);
opts.primitive_type = PrimitiveType::kTriangle;
cmd.pipeline = renderer.GetRRectBlurPipeline(opts);
Expand Down
4 changes: 2 additions & 2 deletions impeller/entity/contents/sweep_gradient_contents.cc
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ bool SweepGradientContents::RenderSSBO(const ContentContext& renderer,
frame_info.matrix = GetInverseEffectTransform();

Command cmd;
cmd.label = "SweepGradientSSBOFill";
DEBUG_COMMAND_INFO(cmd, "SweepGradientSSBOFill");
cmd.stencil_reference = entity.GetStencilDepth();
auto geometry_result =
GetGeometry()->GetPositionBuffer(renderer, entity, pass);
Expand Down Expand Up @@ -166,7 +166,7 @@ bool SweepGradientContents::RenderTexture(const ContentContext& renderer,
frame_info.matrix = GetInverseEffectTransform();

Command cmd;
cmd.label = "SweepGradientFill";
DEBUG_COMMAND_INFO(cmd, "SweepGradientFill");
cmd.stencil_reference = entity.GetStencilDepth();

auto options = OptionsFromPassAndEntity(pass, entity);
Expand Down
2 changes: 1 addition & 1 deletion impeller/entity/contents/text_contents.cc
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ bool TextContents::Render(const ContentContext& renderer,

// Information shared by all glyph draw calls.
Command cmd;
cmd.label = "TextFrame";
DEBUG_COMMAND_INFO(cmd, "TextFrame");
auto opts = OptionsFromPassAndEntity(pass, entity);
opts.primitive_type = PrimitiveType::kTriangle;
if (type == GlyphAtlas::Type::kAlphaBitmap) {
Expand Down
7 changes: 4 additions & 3 deletions impeller/entity/contents/texture_contents.cc
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,10 @@ bool TextureContents::Render(const ContentContext& renderer,
frame_info.alpha = GetOpacity();

Command cmd;
cmd.label = "Texture Fill";
if (!label_.empty()) {
cmd.label += ": " + label_;
if (label_.empty()) {
DEBUG_COMMAND_INFO(cmd, "Texture Fill");
} else {
DEBUG_COMMAND_INFO(cmd, "Texture Fill: " + label_);
}

auto pipeline_options = OptionsFromPassAndEntity(pass, entity);
Expand Down
7 changes: 6 additions & 1 deletion impeller/entity/contents/tiled_texture_contents.cc
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,12 @@ bool TiledTextureContents::Render(const ContentContext& renderer,
frame_info.alpha = GetOpacityFactor();

Command cmd;
cmd.label = uses_emulated_tile_mode ? "TiledTextureFill" : "TextureFill";
if (uses_emulated_tile_mode) {
DEBUG_COMMAND_INFO(cmd, "TiledTextureFill");
} else {
DEBUG_COMMAND_INFO(cmd, "TextureFill");
}

cmd.stencil_reference = entity.GetStencilDepth();

auto options = OptionsFromPassAndEntity(pass, entity);
Expand Down
4 changes: 2 additions & 2 deletions impeller/entity/contents/vertices_contents.cc
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ bool VerticesUVContents::Render(const ContentContext& renderer,
}

Command cmd;
cmd.label = "VerticesUV";
DEBUG_COMMAND_INFO(cmd, "VerticesUV");
auto& host_buffer = pass.GetTransientsBuffer();
auto geometry = parent_.GetGeometry();

Expand Down Expand Up @@ -178,7 +178,7 @@ bool VerticesColorContents::Render(const ContentContext& renderer,
using FS = GeometryColorPipeline::FragmentShader;

Command cmd;
cmd.label = "VerticesColors";
DEBUG_COMMAND_INFO(cmd, "VerticesColors");
auto& host_buffer = pass.GetTransientsBuffer();
auto geometry = parent_.GetGeometry();

Expand Down
3 changes: 2 additions & 1 deletion impeller/entity/entity_unittests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
#include "impeller/geometry/sigma.h"
#include "impeller/playground/playground.h"
#include "impeller/playground/widgets.h"
#include "impeller/renderer/command.h"
#include "impeller/renderer/render_pass.h"
#include "impeller/renderer/vertex_buffer_builder.h"
#include "impeller/runtime_stage/runtime_stage.h"
Expand Down Expand Up @@ -868,7 +869,7 @@ TEST_P(EntityTest, BlendingModeOptions) {
}

Command cmd;
cmd.label = "Blended Rectangle";
DEBUG_COMMAND_INFO(cmd, "Blended Rectangle");
auto options = OptionsFromPass(pass);
options.blend_mode = blend_mode;
options.primitive_type = PrimitiveType::kTriangle;
Expand Down
4 changes: 2 additions & 2 deletions impeller/entity/geometry/point_field_geometry.cc
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ GeometryResult PointFieldGeometry::GetPositionBufferGPU(
{
using PS = PointsComputeShader;
ComputeCommand cmd;
cmd.label = "Points Geometry";
DEBUG_COMMAND_INFO(cmd, "Points Geometry");
cmd.pipeline = renderer.GetPointComputePipeline();

PS::FrameInfo frame_info;
Expand Down Expand Up @@ -201,7 +201,7 @@ GeometryResult PointFieldGeometry::GetPositionBufferGPU(
using UV = UvComputeShader;

ComputeCommand cmd;
cmd.label = "UV Geometry";
DEBUG_COMMAND_INFO(cmd, "UV Geometry");
cmd.pipeline = renderer.GetUvComputePipeline();

UV::FrameInfo frame_info;
Expand Down
5 changes: 3 additions & 2 deletions impeller/playground/imgui/imgui_impl_impeller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,9 @@ void ImGui_ImplImpeller_RenderDrawData(ImDrawData* draw_data,
}

impeller::Command cmd;
cmd.label = impeller::SPrintF("ImGui draw list %d (command %d)",
draw_list_i, cmd_i);
DEBUG_COMMAND_INFO(cmd,
impeller::SPrintF("ImGui draw list %d (command %d)",
draw_list_i, cmd_i));

cmd.viewport = viewport;
cmd.scissor = impeller::IRect(clip_rect);
Expand Down
2 changes: 2 additions & 0 deletions impeller/renderer/backend/gles/render_pass_gles.cc
Original file line number Diff line number Diff line change
Expand Up @@ -244,13 +244,15 @@ struct RenderPassData {
return false;
}

#ifdef IMPELLER_DEBUG
fml::ScopedCleanupClosure pop_cmd_debug_marker(
[&gl]() { gl.PopDebugGroup(); });
if (!command.label.empty()) {
gl.PushDebugGroup(command.label);
} else {
pop_cmd_debug_marker.Release();
}
#endif // IMPELLER_DEBUG

const auto& pipeline = PipelineGLES::Cast(*command.pipeline);

Expand Down
Loading