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

Commit

Permalink
[Impeller] align SSBOs to 16 bytes to fix iOS shader validation issue. (
Browse files Browse the repository at this point in the history
#39654)

* [Impeller] align SSBOs to 16 bytes to fix iOS shader validation issue.

* use DefaultUniformAlignment
  • Loading branch information
jonahwilliams authored Feb 16, 2023
1 parent 4a90fbc commit 9ee3221
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
5 changes: 3 additions & 2 deletions impeller/entity/contents/linear_gradient_contents.cc
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,9 @@ bool LinearGradientContents::RenderSSBO(const ContentContext& renderer,
auto colors = CreateGradientColors(colors_, stops_);

gradient_info.colors_length = colors.size();
auto color_buffer = host_buffer.Emplace(
colors.data(), colors.size() * sizeof(StopData), alignof(StopData));
auto color_buffer =
host_buffer.Emplace(colors.data(), colors.size() * sizeof(StopData),
DefaultUniformAlignment());

VS::FrameInfo frame_info;
frame_info.mvp = Matrix::MakeOrthographic(pass.GetRenderTargetSize()) *
Expand Down
5 changes: 3 additions & 2 deletions impeller/entity/contents/radial_gradient_contents.cc
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,9 @@ bool RadialGradientContents::RenderSSBO(const ContentContext& renderer,
auto colors = CreateGradientColors(colors_, stops_);

gradient_info.colors_length = colors.size();
auto color_buffer = host_buffer.Emplace(
colors.data(), colors.size() * sizeof(StopData), alignof(StopData));
auto color_buffer =
host_buffer.Emplace(colors.data(), colors.size() * sizeof(StopData),
DefaultUniformAlignment());

VS::FrameInfo frame_info;
frame_info.mvp = Matrix::MakeOrthographic(pass.GetRenderTargetSize()) *
Expand Down
5 changes: 3 additions & 2 deletions impeller/entity/contents/sweep_gradient_contents.cc
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,9 @@ bool SweepGradientContents::RenderSSBO(const ContentContext& renderer,
auto colors = CreateGradientColors(colors_, stops_);

gradient_info.colors_length = colors.size();
auto color_buffer = host_buffer.Emplace(
colors.data(), colors.size() * sizeof(StopData), alignof(StopData));
auto color_buffer =
host_buffer.Emplace(colors.data(), colors.size() * sizeof(StopData),
DefaultUniformAlignment());

VS::FrameInfo frame_info;
frame_info.mvp = Matrix::MakeOrthographic(pass.GetRenderTargetSize()) *
Expand Down

0 comments on commit 9ee3221

Please sign in to comment.