Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Impeller] organize shaders a bit, make filter shaders use same vertex source. #52113

Merged
merged 2 commits into from
Apr 15, 2024
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
35 changes: 16 additions & 19 deletions impeller/entity/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -22,42 +22,39 @@ impeller_shaders("entity_shaders") {
"shaders/border_mask_blur.vert",
"shaders/clip.frag",
"shaders/clip.vert",
"shaders/color_matrix_color_filter.frag",
"shaders/color_matrix_color_filter.vert",
"shaders/conical_gradient_fill.frag",
"shaders/gradients/conical_gradient_fill.frag",
"shaders/gaussian_blur/kernel_decal.frag",
"shaders/gaussian_blur/kernel_nodecal.frag",
"shaders/gaussian_blur/kernel.vert",
"shaders/glyph_atlas.frag",
"shaders/glyph_atlas_color.frag",
"shaders/glyph_atlas.vert",
"shaders/gradient_fill.vert",
"shaders/linear_to_srgb_filter.frag",
"shaders/linear_to_srgb_filter.vert",
"shaders/linear_gradient_fill.frag",
"shaders/morphology_filter.frag",
"shaders/morphology_filter.vert",
"shaders/gradients/gradient_fill.vert",
"shaders/gradients/linear_gradient_fill.frag",
"shaders/position_color.vert",
"shaders/radial_gradient_fill.frag",
"shaders/gradients/radial_gradient_fill.frag",
"shaders/rrect_blur.vert",
"shaders/rrect_blur.frag",
"shaders/runtime_effect.vert",
"shaders/solid_fill.frag",
"shaders/solid_fill.vert",
"shaders/srgb_to_linear_filter.frag",
"shaders/srgb_to_linear_filter.vert",
"shaders/sweep_gradient_fill.frag",
"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/tiled_texture_fill.frag",
"shaders/tiled_texture_fill_external.frag",
"shaders/vertices.frag",
"shaders/yuv_to_rgb_filter.frag",
"shaders/yuv_to_rgb_filter.vert",
"shaders/blending/porter_duff_blend.frag",
"shaders/blending/porter_duff_blend.vert",
"shaders/filters/color_matrix_color_filter.frag",
"shaders/filters/filter.vert",
"shaders/filters/yuv_to_rgb_filter.frag",
"shaders/filters/srgb_to_linear_filter.frag",
"shaders/filters/linear_to_srgb_filter.frag",
"shaders/filters/morphology_filter.frag",
"shaders/filters/morphology_filter.vert",
]

if (impeller_debug) {
Expand All @@ -80,10 +77,10 @@ impeller_shaders("modern_entity_shaders") {
}

shaders = [
"shaders/conical_gradient_ssbo_fill.frag",
"shaders/linear_gradient_ssbo_fill.frag",
"shaders/radial_gradient_ssbo_fill.frag",
"shaders/sweep_gradient_ssbo_fill.frag",
"shaders/gradients/conical_gradient_ssbo_fill.frag",
"shaders/gradients/linear_gradient_ssbo_fill.frag",
"shaders/gradients/radial_gradient_ssbo_fill.frag",
"shaders/gradients/sweep_gradient_ssbo_fill.frag",
"shaders/geometry/points.comp",
"shaders/geometry/uv.comp",
]
Expand Down
18 changes: 5 additions & 13 deletions impeller/entity/contents/content_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,14 @@
#include "impeller/entity/clip.frag.h"
#include "impeller/entity/clip.vert.h"
#include "impeller/entity/color_matrix_color_filter.frag.h"
#include "impeller/entity/color_matrix_color_filter.vert.h"
#include "impeller/entity/conical_gradient_fill.frag.h"
#include "impeller/entity/filter.vert.h"
#include "impeller/entity/glyph_atlas.frag.h"
#include "impeller/entity/glyph_atlas.vert.h"
#include "impeller/entity/glyph_atlas_color.frag.h"
#include "impeller/entity/gradient_fill.vert.h"
#include "impeller/entity/linear_gradient_fill.frag.h"
#include "impeller/entity/linear_to_srgb_filter.frag.h"
#include "impeller/entity/linear_to_srgb_filter.vert.h"
#include "impeller/entity/morphology_filter.frag.h"
#include "impeller/entity/morphology_filter.vert.h"
#include "impeller/entity/points.comp.h"
Expand All @@ -56,7 +55,6 @@
#include "impeller/entity/solid_fill.frag.h"
#include "impeller/entity/solid_fill.vert.h"
#include "impeller/entity/srgb_to_linear_filter.frag.h"
#include "impeller/entity/srgb_to_linear_filter.vert.h"
#include "impeller/entity/sweep_gradient_fill.frag.h"
#include "impeller/entity/texture_fill.frag.h"
#include "impeller/entity/texture_fill.vert.h"
Expand All @@ -65,7 +63,6 @@
#include "impeller/entity/uv.comp.h"
#include "impeller/entity/vertices.frag.h"
#include "impeller/entity/yuv_to_rgb_filter.frag.h"
#include "impeller/entity/yuv_to_rgb_filter.vert.h"

#include "impeller/entity/kernel.vert.h"
#include "impeller/entity/kernel_decal.frag.h"
Expand Down Expand Up @@ -147,28 +144,23 @@ using MorphologyFilterPipeline =
RenderPipelineT<MorphologyFilterVertexShader,
MorphologyFilterFragmentShader>;
using ColorMatrixColorFilterPipeline =
RenderPipelineT<ColorMatrixColorFilterVertexShader,
ColorMatrixColorFilterFragmentShader>;
RenderPipelineT<FilterVertexShader, ColorMatrixColorFilterFragmentShader>;
using LinearToSrgbFilterPipeline =
RenderPipelineT<LinearToSrgbFilterVertexShader,
LinearToSrgbFilterFragmentShader>;
RenderPipelineT<FilterVertexShader, LinearToSrgbFilterFragmentShader>;
using SrgbToLinearFilterPipeline =
RenderPipelineT<SrgbToLinearFilterVertexShader,
SrgbToLinearFilterFragmentShader>;
RenderPipelineT<FilterVertexShader, SrgbToLinearFilterFragmentShader>;
using GlyphAtlasPipeline =
RenderPipelineT<GlyphAtlasVertexShader, GlyphAtlasFragmentShader>;
using GlyphAtlasColorPipeline =
RenderPipelineT<GlyphAtlasVertexShader, GlyphAtlasColorFragmentShader>;
using PorterDuffBlendPipeline =
RenderPipelineT<PorterDuffBlendVertexShader, PorterDuffBlendFragmentShader>;
// Instead of requiring new shaders for clips, the solid fill stages are used
// to redirect writing to the stencil instead of color attachments.
using ClipPipeline = RenderPipelineT<ClipVertexShader, ClipFragmentShader>;

using GeometryColorPipeline =
RenderPipelineT<PositionColorVertexShader, VerticesFragmentShader>;
using YUVToRGBFilterPipeline =
RenderPipelineT<YuvToRgbFilterVertexShader, YuvToRgbFilterFragmentShader>;
RenderPipelineT<FilterVertexShader, YuvToRgbFilterFragmentShader>;

// Advanced blends
using BlendColorPipeline =
Expand Down
22 changes: 0 additions & 22 deletions impeller/entity/shaders/linear_to_srgb_filter.vert

This file was deleted.

22 changes: 0 additions & 22 deletions impeller/entity/shaders/srgb_to_linear_filter.vert

This file was deleted.

22 changes: 0 additions & 22 deletions impeller/entity/shaders/yuv_to_rgb_filter.vert

This file was deleted.