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

Commit 9ee3221

Browse files
[Impeller] align SSBOs to 16 bytes to fix iOS shader validation issue. (#39654)
* [Impeller] align SSBOs to 16 bytes to fix iOS shader validation issue. * use DefaultUniformAlignment
1 parent 4a90fbc commit 9ee3221

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

impeller/entity/contents/linear_gradient_contents.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,9 @@ bool LinearGradientContents::RenderSSBO(const ContentContext& renderer,
134134
auto colors = CreateGradientColors(colors_, stops_);
135135

136136
gradient_info.colors_length = colors.size();
137-
auto color_buffer = host_buffer.Emplace(
138-
colors.data(), colors.size() * sizeof(StopData), alignof(StopData));
137+
auto color_buffer =
138+
host_buffer.Emplace(colors.data(), colors.size() * sizeof(StopData),
139+
DefaultUniformAlignment());
139140

140141
VS::FrameInfo frame_info;
141142
frame_info.mvp = Matrix::MakeOrthographic(pass.GetRenderTargetSize()) *

impeller/entity/contents/radial_gradient_contents.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,9 @@ bool RadialGradientContents::RenderSSBO(const ContentContext& renderer,
7070
auto colors = CreateGradientColors(colors_, stops_);
7171

7272
gradient_info.colors_length = colors.size();
73-
auto color_buffer = host_buffer.Emplace(
74-
colors.data(), colors.size() * sizeof(StopData), alignof(StopData));
73+
auto color_buffer =
74+
host_buffer.Emplace(colors.data(), colors.size() * sizeof(StopData),
75+
DefaultUniformAlignment());
7576

7677
VS::FrameInfo frame_info;
7778
frame_info.mvp = Matrix::MakeOrthographic(pass.GetRenderTargetSize()) *

impeller/entity/contents/sweep_gradient_contents.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,9 @@ bool SweepGradientContents::RenderSSBO(const ContentContext& renderer,
7676
auto colors = CreateGradientColors(colors_, stops_);
7777

7878
gradient_info.colors_length = colors.size();
79-
auto color_buffer = host_buffer.Emplace(
80-
colors.data(), colors.size() * sizeof(StopData), alignof(StopData));
79+
auto color_buffer =
80+
host_buffer.Emplace(colors.data(), colors.size() * sizeof(StopData),
81+
DefaultUniformAlignment());
8182

8283
VS::FrameInfo frame_info;
8384
frame_info.mvp = Matrix::MakeOrthographic(pass.GetRenderTargetSize()) *

0 commit comments

Comments
 (0)