Skip to content

Commit 55670b7

Browse files
author
Jonah Williams
authored
[Impeller] organize texture shaders / delete blend.frag + external_texture_fill (flutter#52137)
* Deletes blend.frag/vert . This was identical to the existing texture_fill shader. * Move alpha to frag info and stop passing as varying. ~~* Deletes strict src rect fragment shader. We should be able to compute the UVs on the CPU, which is trivial since this is only used for rectangular draws.~~ * Deletes external texture fill in favor of tiled texture external fill. The former shader is marginally faster, but we don't use it since we don't correctly check for the right extensions needed for non-emulated sampling modes with external textures on GLES. Easier to just always use emulated tile modes
1 parent a9a6f59 commit 55670b7

19 files changed

Lines changed: 254 additions & 945 deletions

ci/licenses_golden/licenses_flutter

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40372,8 +40372,6 @@ ORIGIN: ../../../flutter/impeller/entity/render_target_cache.cc + ../../../flutt
4037240372
ORIGIN: ../../../flutter/impeller/entity/render_target_cache.h + ../../../flutter/LICENSE
4037340373
ORIGIN: ../../../flutter/impeller/entity/shaders/blending/advanced_blend.frag + ../../../flutter/LICENSE
4037440374
ORIGIN: ../../../flutter/impeller/entity/shaders/blending/advanced_blend.vert + ../../../flutter/LICENSE
40375-
ORIGIN: ../../../flutter/impeller/entity/shaders/blending/blend.frag + ../../../flutter/LICENSE
40376-
ORIGIN: ../../../flutter/impeller/entity/shaders/blending/blend.vert + ../../../flutter/LICENSE
4037740375
ORIGIN: ../../../flutter/impeller/entity/shaders/blending/blend_select.glsl + ../../../flutter/LICENSE
4037840376
ORIGIN: ../../../flutter/impeller/entity/shaders/blending/framebuffer_blend.frag + ../../../flutter/LICENSE
4037940377
ORIGIN: ../../../flutter/impeller/entity/shaders/blending/framebuffer_blend.vert + ../../../flutter/LICENSE
@@ -40418,7 +40416,6 @@ ORIGIN: ../../../flutter/impeller/entity/shaders/solid_fill.frag + ../../../flut
4041840416
ORIGIN: ../../../flutter/impeller/entity/shaders/solid_fill.vert + ../../../flutter/LICENSE
4041940417
ORIGIN: ../../../flutter/impeller/entity/shaders/texture_fill.frag + ../../../flutter/LICENSE
4042040418
ORIGIN: ../../../flutter/impeller/entity/shaders/texture_fill.vert + ../../../flutter/LICENSE
40421-
ORIGIN: ../../../flutter/impeller/entity/shaders/texture_fill_external.frag + ../../../flutter/LICENSE
4042240419
ORIGIN: ../../../flutter/impeller/entity/shaders/texture_fill_strict_src.frag + ../../../flutter/LICENSE
4042340420
ORIGIN: ../../../flutter/impeller/entity/shaders/tiled_texture_fill.frag + ../../../flutter/LICENSE
4042440421
ORIGIN: ../../../flutter/impeller/entity/shaders/tiled_texture_fill_external.frag + ../../../flutter/LICENSE
@@ -43255,8 +43252,6 @@ FILE: ../../../flutter/impeller/entity/render_target_cache.cc
4325543252
FILE: ../../../flutter/impeller/entity/render_target_cache.h
4325643253
FILE: ../../../flutter/impeller/entity/shaders/blending/advanced_blend.frag
4325743254
FILE: ../../../flutter/impeller/entity/shaders/blending/advanced_blend.vert
43258-
FILE: ../../../flutter/impeller/entity/shaders/blending/blend.frag
43259-
FILE: ../../../flutter/impeller/entity/shaders/blending/blend.vert
4326043255
FILE: ../../../flutter/impeller/entity/shaders/blending/blend_select.glsl
4326143256
FILE: ../../../flutter/impeller/entity/shaders/blending/framebuffer_blend.frag
4326243257
FILE: ../../../flutter/impeller/entity/shaders/blending/framebuffer_blend.vert
@@ -43301,7 +43296,6 @@ FILE: ../../../flutter/impeller/entity/shaders/solid_fill.frag
4330143296
FILE: ../../../flutter/impeller/entity/shaders/solid_fill.vert
4330243297
FILE: ../../../flutter/impeller/entity/shaders/texture_fill.frag
4330343298
FILE: ../../../flutter/impeller/entity/shaders/texture_fill.vert
43304-
FILE: ../../../flutter/impeller/entity/shaders/texture_fill_external.frag
4330543299
FILE: ../../../flutter/impeller/entity/shaders/texture_fill_strict_src.frag
4330643300
FILE: ../../../flutter/impeller/entity/shaders/tiled_texture_fill.frag
4330743301
FILE: ../../../flutter/impeller/entity/shaders/tiled_texture_fill_external.frag

impeller/entity/BUILD.gn

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ impeller_shaders("entity_shaders") {
1616
shaders = [
1717
"shaders/blending/advanced_blend.vert",
1818
"shaders/blending/advanced_blend.frag",
19-
"shaders/blending/blend.frag",
20-
"shaders/blending/blend.vert",
2119
"shaders/border_mask_blur.frag",
2220
"shaders/border_mask_blur.vert",
2321
"shaders/clip.frag",
@@ -41,10 +39,9 @@ impeller_shaders("entity_shaders") {
4139
"shaders/gradients/sweep_gradient_fill.frag",
4240
"shaders/texture_fill.frag",
4341
"shaders/texture_fill.vert",
44-
"shaders/texture_fill_external.frag",
45-
"shaders/texture_fill_strict_src.frag",
4642
"shaders/tiled_texture_fill.frag",
4743
"shaders/tiled_texture_fill_external.frag",
44+
"shaders/texture_fill_strict_src.frag",
4845
"shaders/vertices.frag",
4946
"shaders/blending/porter_duff_blend.frag",
5047
"shaders/blending/porter_duff_blend.vert",

impeller/entity/contents/atlas_contents.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,12 +405,16 @@ bool AtlasTextureContents::Render(const ContentContext& renderer,
405405
VS::FrameInfo frame_info;
406406
frame_info.mvp = entity.GetShaderTransform(pass);
407407
frame_info.texture_sampler_y_coord_scale = texture->GetYCoordScale();
408-
frame_info.alpha = alpha_;
409408

410409
auto options = OptionsFromPassAndEntity(pass, entity);
411410
pass.SetPipeline(renderer.GetTexturePipeline(options));
412411
pass.SetVertexBuffer(vertex_builder.CreateVertexBuffer(host_buffer));
413412
VS::BindFrameInfo(pass, host_buffer.EmplaceUniform(frame_info));
413+
414+
FS::FragInfo frag_info;
415+
frag_info.alpha = alpha_;
416+
417+
FS::BindFragInfo(pass, host_buffer.EmplaceUniform(frag_info));
414418
FS::BindTextureSampler(pass, texture,
415419
renderer.GetContext()->GetSamplerLibrary()->GetSampler(
416420
parent_.GetSamplerDescriptor()));

impeller/entity/contents/content_context.cc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,6 @@ ContentContext::ContentContext(
421421
{static_cast<Scalar>(BlendSelectValues::kSoftLight), supports_decal});
422422

423423
rrect_blur_pipelines_.CreateDefault(*context_, options_trianglestrip);
424-
texture_blend_pipelines_.CreateDefault(*context_, options);
425424
texture_strict_src_pipelines_.CreateDefault(*context_, options);
426425
position_uv_pipelines_.CreateDefault(*context_, options);
427426
tiled_texture_pipelines_.CreateDefault(*context_, options);
@@ -448,9 +447,6 @@ ContentContext::ContentContext(
448447
{supports_decal});
449448
// GLES only shader that is unsupported on macOS.
450449
#if defined(IMPELLER_ENABLE_OPENGLES) && !defined(FML_OS_MACOSX)
451-
if (GetContext()->GetBackendType() == Context::BackendType::kOpenGLES) {
452-
texture_external_pipelines_.CreateDefault(*context_, options);
453-
}
454450
if (GetContext()->GetBackendType() == Context::BackendType::kOpenGLES) {
455451
tiled_texture_external_pipelines_.CreateDefault(*context_, options);
456452
}

impeller/entity/contents/content_context.h

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@
2929
#include "impeller/entity/checkerboard.vert.h"
3030
#endif // IMPELLER_DEBUG
3131

32-
#include "impeller/entity/blend.frag.h"
33-
#include "impeller/entity/blend.vert.h"
3432
#include "impeller/entity/border_mask_blur.frag.h"
3533
#include "impeller/entity/border_mask_blur.vert.h"
3634
#include "impeller/entity/clip.frag.h"
@@ -84,7 +82,6 @@
8482
#include "impeller/entity/framebuffer_blend.vert.h"
8583

8684
#ifdef IMPELLER_ENABLE_OPENGLES
87-
#include "impeller/entity/texture_fill_external.frag.h"
8885
#include "impeller/entity/tiled_texture_fill_external.frag.h"
8986
#endif // IMPELLER_ENABLE_OPENGLES
9087

@@ -127,8 +124,6 @@ using SweepGradientSSBOFillPipeline =
127124
SweepGradientSsboFillFragmentShader>;
128125
using RRectBlurPipeline =
129126
RenderPipelineHandle<RrectBlurVertexShader, RrectBlurFragmentShader>;
130-
using BlendPipeline =
131-
RenderPipelineHandle<BlendVertexShader, BlendFragmentShader>;
132127
using TexturePipeline =
133128
RenderPipelineHandle<TextureFillVertexShader, TextureFillFragmentShader>;
134129
using TextureStrictSrcPipeline =
@@ -261,10 +256,6 @@ using PointsComputeShaderPipeline = ComputePipelineBuilder<PointsComputeShader>;
261256
using UvComputeShaderPipeline = ComputePipelineBuilder<UvComputeShader>;
262257

263258
#ifdef IMPELLER_ENABLE_OPENGLES
264-
using TextureExternalPipeline =
265-
RenderPipelineHandle<TextureFillVertexShader,
266-
TextureFillExternalFragmentShader>;
267-
268259
using TiledTextureExternalPipeline =
269260
RenderPipelineHandle<TextureFillVertexShader,
270261
TiledTextureFillExternalFragmentShader>;
@@ -468,11 +459,6 @@ class ContentContext {
468459
return GetPipeline(solid_fill_pipelines_, opts);
469460
}
470461

471-
std::shared_ptr<Pipeline<PipelineDescriptor>> GetBlendPipeline(
472-
ContentContextOptions opts) const {
473-
return GetPipeline(texture_blend_pipelines_, opts);
474-
}
475-
476462
std::shared_ptr<Pipeline<PipelineDescriptor>> GetTexturePipeline(
477463
ContentContextOptions opts) const {
478464
return GetPipeline(texture_pipelines_, opts);
@@ -484,13 +470,6 @@ class ContentContext {
484470
}
485471

486472
#ifdef IMPELLER_ENABLE_OPENGLES
487-
std::shared_ptr<Pipeline<PipelineDescriptor>> GetTextureExternalPipeline(
488-
ContentContextOptions opts) const {
489-
FML_DCHECK(GetContext()->GetBackendType() ==
490-
Context::BackendType::kOpenGLES);
491-
return GetPipeline(texture_external_pipelines_, opts);
492-
}
493-
494473
std::shared_ptr<Pipeline<PipelineDescriptor>> GetTiledTextureExternalPipeline(
495474
ContentContextOptions opts) const {
496475
FML_DCHECK(GetContext()->GetBackendType() ==
@@ -947,11 +926,9 @@ class ContentContext {
947926
mutable Variants<SweepGradientSSBOFillPipeline>
948927
sweep_gradient_ssbo_fill_pipelines_;
949928
mutable Variants<RRectBlurPipeline> rrect_blur_pipelines_;
950-
mutable Variants<BlendPipeline> texture_blend_pipelines_;
951929
mutable Variants<TexturePipeline> texture_pipelines_;
952930
mutable Variants<TextureStrictSrcPipeline> texture_strict_src_pipelines_;
953931
#ifdef IMPELLER_ENABLE_OPENGLES
954-
mutable Variants<TextureExternalPipeline> texture_external_pipelines_;
955932
mutable Variants<TiledTextureExternalPipeline>
956933
tiled_texture_external_pipelines_;
957934
#endif // IMPELLER_ENABLE_OPENGLES

impeller/entity/contents/filters/blend_filter_contents.cc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -505,8 +505,8 @@ static std::optional<Entity> PipelineBlend(
505505
std::optional<Color> foreground_color,
506506
ColorFilterContents::AbsorbOpacity absorb_opacity,
507507
std::optional<Scalar> alpha) {
508-
using VS = BlendPipeline::VertexShader;
509-
using FS = BlendPipeline::FragmentShader;
508+
using VS = TexturePipeline::VertexShader;
509+
using FS = TexturePipeline::FragmentShader;
510510

511511
auto dst_snapshot =
512512
inputs[0]->GetSnapshot("PipelineBlend(Dst)", renderer, entity);
@@ -552,7 +552,7 @@ static std::optional<Entity> PipelineBlend(
552552
const std::unique_ptr<const Sampler>& sampler =
553553
renderer.GetContext()->GetSamplerLibrary()->GetSampler(
554554
input->sampler_descriptor);
555-
FS::BindTextureSamplerSrc(pass, input->texture, sampler);
555+
FS::BindTextureSampler(pass, input->texture, sampler);
556556

557557
auto size = input->texture->GetSize();
558558
VertexBufferBuilder<VS::PerVertexData> vtx_builder;
@@ -572,7 +572,7 @@ static std::optional<Entity> PipelineBlend(
572572
input->texture->GetYCoordScale();
573573

574574
FS::FragInfo frag_info;
575-
frag_info.input_alpha =
575+
frag_info.alpha =
576576
absorb_opacity == ColorFilterContents::AbsorbOpacity::kYes
577577
? input->opacity
578578
: 1.0;
@@ -584,7 +584,7 @@ static std::optional<Entity> PipelineBlend(
584584

585585
// Draw the first texture using kSource.
586586
options.blend_mode = BlendMode::kSource;
587-
pass.SetPipeline(renderer.GetBlendPipeline(options));
587+
pass.SetPipeline(renderer.GetTexturePipeline(options));
588588
if (!add_blend_command(dst_snapshot)) {
589589
return true;
590590
}
@@ -593,7 +593,7 @@ static std::optional<Entity> PipelineBlend(
593593

594594
if (inputs.size() >= 2) {
595595
options.blend_mode = blend_mode;
596-
pass.SetPipeline(renderer.GetBlendPipeline(options));
596+
pass.SetPipeline(renderer.GetTexturePipeline(options));
597597

598598
for (auto texture_i = inputs.begin() + 1; texture_i < inputs.end();
599599
texture_i++) {

impeller/entity/contents/filters/gaussian_blur_filter_contents.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,9 @@ fml::StatusOr<RenderTarget> MakeDownsampleSubpass(
9595
TextureFillVertexShader::FrameInfo frame_info;
9696
frame_info.mvp = Matrix::MakeOrthographic(ISize(1, 1));
9797
frame_info.texture_sampler_y_coord_scale = 1.0;
98-
frame_info.alpha = 1.0;
98+
99+
TextureFillFragmentShader::FragInfo frag_info;
100+
frag_info.alpha = 1.0;
99101

100102
BindVertices<TextureFillVertexShader>(pass, host_buffer,
101103
{
@@ -111,6 +113,8 @@ fml::StatusOr<RenderTarget> MakeDownsampleSubpass(
111113
linear_sampler_descriptor.min_filter = MinMagFilter::kLinear;
112114
TextureFillVertexShader::BindFrameInfo(
113115
pass, host_buffer.EmplaceUniform(frame_info));
116+
TextureFillFragmentShader::BindFragInfo(
117+
pass, host_buffer.EmplaceUniform(frag_info));
114118
TextureFillFragmentShader::BindTextureSampler(
115119
pass, input_texture,
116120
renderer.GetContext()->GetSamplerLibrary()->GetSampler(

impeller/entity/contents/texture_contents.cc

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
#include "impeller/entity/entity.h"
1414
#include "impeller/entity/texture_fill.frag.h"
1515
#include "impeller/entity/texture_fill.vert.h"
16-
#include "impeller/entity/texture_fill_external.frag.h"
16+
#include "impeller/entity/texture_fill_strict_src.frag.h"
17+
#include "impeller/entity/tiled_texture_fill_external.frag.h"
1718
#include "impeller/geometry/constants.h"
1819
#include "impeller/renderer/render_pass.h"
1920
#include "impeller/renderer/vertex_buffer_builder.h"
@@ -113,8 +114,8 @@ bool TextureContents::Render(const ContentContext& renderer,
113114

114115
using VS = TextureFillVertexShader;
115116
using FS = TextureFillFragmentShader;
116-
using FSStrictSrc = TextureFillStrictSrcFragmentShader;
117-
using FSExternal = TextureFillExternalFragmentShader;
117+
using FSExternal = TiledTextureFillExternalFragmentShader;
118+
using FSStrict = TextureFillStrictSrcFragmentShader;
118119

119120
if (destination_rect_.IsEmpty() || source_rect_.IsEmpty() ||
120121
texture_ == nullptr || texture_->GetSize().IsEmpty()) {
@@ -129,7 +130,6 @@ bool TextureContents::Render(const ContentContext& renderer,
129130
Rect::MakeSize(texture_->GetSize()).Project(source_rect);
130131

131132
VertexBufferBuilder<VS::PerVertexData> vertex_builder;
132-
133133
auto destination_rect =
134134
capture.AddRect("Destination rect", destination_rect_);
135135
vertex_builder.AddVertices({
@@ -144,7 +144,6 @@ bool TextureContents::Render(const ContentContext& renderer,
144144
VS::FrameInfo frame_info;
145145
frame_info.mvp = entity.GetShaderTransform(pass);
146146
frame_info.texture_sampler_y_coord_scale = texture_->GetYCoordScale();
147-
frame_info.alpha = capture.AddScalar("Alpha", GetOpacity());
148147

149148
#ifdef IMPELLER_DEBUG
150149
if (label_.empty()) {
@@ -163,7 +162,7 @@ bool TextureContents::Render(const ContentContext& renderer,
163162
std::shared_ptr<Pipeline<PipelineDescriptor>> pipeline;
164163
#ifdef IMPELLER_ENABLE_OPENGLES
165164
if (is_external_texture) {
166-
pipeline = renderer.GetTextureExternalPipeline(pipeline_options);
165+
pipeline = renderer.GetTiledTextureExternalPipeline(pipeline_options);
167166
}
168167
#endif // IMPELLER_ENABLE_OPENGLES
169168

@@ -178,26 +177,46 @@ bool TextureContents::Render(const ContentContext& renderer,
178177

179178
pass.SetVertexBuffer(vertex_builder.CreateVertexBuffer(host_buffer));
180179
VS::BindFrameInfo(pass, host_buffer.EmplaceUniform(frame_info));
180+
181181
if (is_external_texture) {
182+
FSExternal::FragInfo frag_info;
183+
frag_info.x_tile_mode =
184+
static_cast<int>(sampler_descriptor_.width_address_mode);
185+
frag_info.y_tile_mode =
186+
static_cast<int>(sampler_descriptor_.height_address_mode);
187+
frag_info.alpha = capture.AddScalar("Alpha", GetOpacity());
188+
189+
auto sampler_descriptor = sampler_descriptor_;
190+
// OES_EGL_image_external states that only CLAMP_TO_EDGE is valid, so
191+
// we emulate all other tile modes here by remapping the texture
192+
// coordinates.
193+
sampler_descriptor.width_address_mode = SamplerAddressMode::kClampToEdge;
194+
sampler_descriptor.height_address_mode = SamplerAddressMode::kClampToEdge;
195+
196+
FSExternal::BindFragInfo(pass, host_buffer.EmplaceUniform((frag_info)));
182197
FSExternal::BindSAMPLEREXTERNALOESTextureSampler(
183198
pass, texture_,
184199
renderer.GetContext()->GetSamplerLibrary()->GetSampler(
185-
sampler_descriptor_));
200+
sampler_descriptor));
186201
} else if (strict_source_rect_enabled_) {
187202
// For a strict source rect, shrink the texture coordinate range by half a
188203
// texel to ensure that linear filtering does not sample anything outside
189204
// the source rect bounds.
190205
auto strict_texture_coords =
191206
Rect::MakeSize(texture_->GetSize()).Project(source_rect.Expand(-0.5));
192207

193-
FSStrictSrc::FragInfo frag_info;
208+
FSStrict::FragInfo frag_info;
194209
frag_info.source_rect = Vector4(strict_texture_coords.GetLTRB());
195-
FSStrictSrc::BindFragInfo(pass, host_buffer.EmplaceUniform(frag_info));
196-
FSStrictSrc::BindTextureSampler(
210+
frag_info.alpha = capture.AddScalar("Alpha", GetOpacity());
211+
FSStrict::BindFragInfo(pass, host_buffer.EmplaceUniform((frag_info)));
212+
FSStrict::BindTextureSampler(
197213
pass, texture_,
198214
renderer.GetContext()->GetSamplerLibrary()->GetSampler(
199215
sampler_descriptor_));
200216
} else {
217+
FS::FragInfo frag_info;
218+
frag_info.alpha = capture.AddScalar("Alpha", GetOpacity());
219+
FS::BindFragInfo(pass, host_buffer.EmplaceUniform((frag_info)));
201220
FS::BindTextureSampler(
202221
pass, texture_,
203222
renderer.GetContext()->GetSamplerLibrary()->GetSampler(

impeller/entity/contents/tiled_texture_contents.cc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
#include "fml/logging.h"
88
#include "impeller/entity/contents/content_context.h"
9+
#include "impeller/entity/texture_fill.frag.h"
910
#include "impeller/entity/texture_fill.vert.h"
1011
#include "impeller/entity/tiled_texture_fill.frag.h"
1112
#include "impeller/entity/tiled_texture_fill_external.frag.h"
@@ -132,7 +133,6 @@ bool TiledTextureContents::Render(const ContentContext& renderer,
132133

133134
VS::FrameInfo frame_info;
134135
frame_info.texture_sampler_y_coord_scale = texture_->GetYCoordScale();
135-
frame_info.alpha = GetOpacityFactor();
136136

137137
PipelineBuilderMethod pipeline_method;
138138

@@ -170,12 +170,19 @@ bool TiledTextureContents::Render(const ContentContext& renderer,
170170
FSExternal::FragInfo frag_info;
171171
frag_info.x_tile_mode = static_cast<Scalar>(x_tile_mode_);
172172
frag_info.y_tile_mode = static_cast<Scalar>(y_tile_mode_);
173+
frag_info.alpha = GetOpacityFactor();
173174
FSExternal::BindFragInfo(pass, host_buffer.EmplaceUniform(frag_info));
174175
} else if (uses_emulated_tile_mode) {
175176
FS::FragInfo frag_info;
176177
frag_info.x_tile_mode = static_cast<Scalar>(x_tile_mode_);
177178
frag_info.y_tile_mode = static_cast<Scalar>(y_tile_mode_);
179+
frag_info.alpha = GetOpacityFactor();
178180
FS::BindFragInfo(pass, host_buffer.EmplaceUniform(frag_info));
181+
} else {
182+
TextureFillFragmentShader::FragInfo frag_info;
183+
frag_info.alpha = GetOpacityFactor();
184+
TextureFillFragmentShader::BindFragInfo(
185+
pass, host_buffer.EmplaceUniform(frag_info));
179186
}
180187

181188
if (is_external_texture) {

impeller/entity/contents/vertices_contents.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,11 @@ bool VerticesUVContents::Render(const ContentContext& renderer,
169169
frame_info.mvp = geometry_result.transform;
170170
frame_info.texture_sampler_y_coord_scale =
171171
snapshot->texture->GetYCoordScale();
172-
frame_info.alpha = alpha_ * snapshot->opacity;
173172
VS::BindFrameInfo(pass, host_buffer.EmplaceUniform(frame_info));
174173

174+
FS::FragInfo frag_info;
175+
frag_info.alpha = alpha_ * snapshot->opacity;
176+
FS::BindFragInfo(pass, host_buffer.EmplaceUniform(frag_info));
175177
FS::BindTextureSampler(pass, snapshot->texture,
176178
renderer.GetContext()->GetSamplerLibrary()->GetSampler(
177179
snapshot->sampler_descriptor));

0 commit comments

Comments
 (0)