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 1 commit
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
Prev Previous commit
Next Next commit
Merge branch 'main' of github.com:flutter/engine into compute_uv_vert…
…ex_stage
  • Loading branch information
jonahwilliams committed Apr 19, 2024
commit a25544989e3eb30f41d47f6189a26db61637ea96
3 changes: 0 additions & 3 deletions impeller/entity/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ impeller_shaders("entity_shaders") {
"shaders/gradients/sweep_gradient_fill.frag",
"shaders/texture_fill.frag",
"shaders/texture_fill.vert",
"shaders/texture_fill_external.frag",
"shaders/texture_fill_strict_src.frag",
"shaders/texture_uv_fill.vert",
"shaders/tiled_texture_fill.frag",
"shaders/tiled_texture_fill_external.frag",
"shaders/texture_fill_strict_src.frag",
Expand Down
18 changes: 18 additions & 0 deletions impeller/entity/contents/content_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ using SweepGradientSSBOFillPipeline =
using RRectBlurPipeline =
RenderPipelineHandle<RrectBlurVertexShader, RrectBlurFragmentShader>;
using TexturePipeline =
<<<<<<< HEAD
RenderPipelineT<TextureUvFillVertexShader, TextureFillFragmentShader>;
using TextureStrictSrcPipeline =
RenderPipelineT<TextureUvFillVertexShader,
Expand All @@ -133,6 +134,17 @@ using PositionUVPipeline =
RenderPipelineT<TextureFillVertexShader, TiledTextureFillFragmentShader>;
using TiledTexturePipeline =
RenderPipelineT<TextureUvFillVertexShader, TiledTextureFillFragmentShader>;
=======
RenderPipelineHandle<TextureFillVertexShader, TextureFillFragmentShader>;
using TextureStrictSrcPipeline =
RenderPipelineHandle<TextureFillVertexShader,
TextureFillStrictSrcFragmentShader>;
using PositionUVPipeline = RenderPipelineHandle<TextureFillVertexShader,
TiledTextureFillFragmentShader>;
using TiledTexturePipeline =
RenderPipelineHandle<TextureFillVertexShader,
TiledTextureFillFragmentShader>;
>>>>>>> 55670b71eb00fbe80601b7227f68c1df4cae827b
using KernelDecalPipeline =
RenderPipelineHandle<KernelVertexShader, KernelDecalFragmentShader>;
using KernelPipeline =
Expand Down Expand Up @@ -255,13 +267,19 @@ using PointsComputeShaderPipeline = ComputePipelineBuilder<PointsComputeShader>;
using UvComputeShaderPipeline = ComputePipelineBuilder<UvComputeShader>;

#ifdef IMPELLER_ENABLE_OPENGLES
<<<<<<< HEAD
using TextureExternalPipeline =
RenderPipelineT<TextureUvFillVertexShader,
TextureFillExternalFragmentShader>;

using TiledTextureExternalPipeline =
RenderPipelineT<TextureUvFillVertexShader,
TiledTextureFillExternalFragmentShader>;
=======
using TiledTextureExternalPipeline =
RenderPipelineHandle<TextureFillVertexShader,
TiledTextureFillExternalFragmentShader>;
>>>>>>> 55670b71eb00fbe80601b7227f68c1df4cae827b
#endif // IMPELLER_ENABLE_OPENGLES

// A struct used to isolate command buffer storage from the content
Expand Down
10 changes: 7 additions & 3 deletions impeller/entity/contents/texture_contents.cc
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,13 @@ bool TextureContents::Render(const ContentContext& renderer,
texture_->GetTextureDescriptor().type == TextureType::kTextureExternalOES;

auto source_rect = capture.AddRect("Source rect", source_rect_);
<<<<<<< HEAD
=======
auto texture_coords =
Rect::MakeSize(texture_->GetSize()).Project(source_rect);

VertexBufferBuilder<VS::PerVertexData> vertex_builder;
>>>>>>> 55670b71eb00fbe80601b7227f68c1df4cae827b
auto destination_rect =
capture.AddRect("Destination rect", destination_rect_);

Expand All @@ -142,9 +149,6 @@ bool TextureContents::Render(const ContentContext& renderer,
VS::FrameInfo frame_info;
frame_info.mvp = entity.GetShaderTransform(pass);
frame_info.texture_sampler_y_coord_scale = texture_->GetYCoordScale();
frame_info.alpha = capture.AddScalar("Alpha", GetOpacity());
// TODO: src/dst rect.
frame_info.uv_transform = destination_rect_.GetNormalizingTransform();

#ifdef IMPELLER_DEBUG
if (label_.empty()) {
Expand Down
3 changes: 3 additions & 0 deletions impeller/entity/contents/tiled_texture_contents.cc
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,13 @@ bool TiledTextureContents::Render(const ContentContext& renderer,

VS::FrameInfo frame_info;
frame_info.texture_sampler_y_coord_scale = texture_->GetYCoordScale();
<<<<<<< HEAD
frame_info.alpha = GetOpacityFactor();
frame_info.uv_transform =
Rect::MakeSize(texture_size).GetNormalizingTransform() *
GetInverseEffectTransform();
=======
>>>>>>> 55670b71eb00fbe80601b7227f68c1df4cae827b

PipelineBuilderMethod pipeline_method;

Expand Down
13 changes: 0 additions & 13 deletions impeller/geometry/geometry_benchmarks.cc
Original file line number Diff line number Diff line change
Expand Up @@ -126,30 +126,17 @@ static void BM_Convex(benchmark::State& state, Args&&... args) {
MAKE_STROKE_BENCHMARK_CAPTURE(path, Square, Bevel, false, uvname, uvtype); \
MAKE_STROKE_BENCHMARK_CAPTURE(path, Round, Bevel, false, uvname, uvtype)

#define MAKE_STROKE_BENCHMARK_CAPTURE_UVS(path) \
MAKE_STROKE_BENCHMARK_CAPTURE_CAPS_JOINS(path, , UVMode::kNoUV); \
MAKE_STROKE_BENCHMARK_CAPTURE_CAPS_JOINS(path, _uv, UVMode::kUVRectTx); \
MAKE_STROKE_BENCHMARK_CAPTURE_CAPS_JOINS(path, _uvNoTx, UVMode::kUVRect)

BENCHMARK_CAPTURE(BM_Polyline, cubic_polyline, CreateCubic(true), false);
BENCHMARK_CAPTURE(BM_Polyline,
unclosed_cubic_polyline,
CreateCubic(false),
false);
BENCHMARK_CAPTURE(BM_Polyline,
unclosed_cubic_polyline_tess,
CreateCubic(false),
true);

BENCHMARK_CAPTURE(BM_Polyline, quad_polyline, CreateQuadratic(true), false);
BENCHMARK_CAPTURE(BM_Polyline,
unclosed_quad_polyline,
CreateQuadratic(false),
false);
BENCHMARK_CAPTURE(BM_Polyline,
unclosed_quad_polyline_tess,
CreateQuadratic(false),
true);

BENCHMARK_CAPTURE(BM_Convex, rrect_convex, CreateRRect(), true);
MAKE_STROKE_BENCHMARK_CAPTURE(RRect, Butt, Bevel, , , );
Expand Down
8 changes: 2 additions & 6 deletions impeller/geometry/path_component.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@
namespace impeller {

VertexWriter::VertexWriter(std::vector<Point>& points,
std::vector<uint16_t>& indices,
std::optional<Matrix> uv_transform)
: points_(points), indices_(indices), uv_transform_(uv_transform) {}
std::vector<uint16_t>& indices)
: points_(points), indices_(indices) {}

void VertexWriter::EndContour() {
if (points_.size() == 0u || contour_start_ == points_.size() - 1) {
Expand Down Expand Up @@ -66,9 +65,6 @@ void VertexWriter::EndContour() {

void VertexWriter::Write(Point point) {
points_.emplace_back(point);
if (uv_transform_.has_value()) {
points_.emplace_back(*uv_transform_ * point);
}
}

/*
Expand Down
4 changes: 1 addition & 3 deletions impeller/geometry/path_component.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ namespace impeller {
class VertexWriter {
public:
explicit VertexWriter(std::vector<Point>& points,
std::vector<uint16_t>& indices,
std::optional<Matrix> uv_transform);
std::vector<uint16_t>& indices);

~VertexWriter() = default;

Expand All @@ -35,7 +34,6 @@ class VertexWriter {
size_t contour_start_ = 0u;
std::vector<Point>& points_;
std::vector<uint16_t>& indices_;
std::optional<Matrix> uv_transform_;
};

struct LinearPathComponent {
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.