[Impeller] align SSBOs to 16 bytes to fix iOS shader validation issue. (flutter/engine#39654)

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

* use DefaultUniformAlignment
This commit is contained in:
Jonah Williams 2023-02-16 11:45:34 -08:00 committed by GitHub
parent 6cf3c90e27
commit 83124e9bce
3 changed files with 9 additions and 6 deletions

View File

@ -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()) *

View File

@ -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()) *

View File

@ -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()) *