[Impeller] sort all vertex inputs by location. (flutter/engine#42664)
Fixes https://github.com/flutter/flutter/issues/128283 Why doesn't this happen elsewhere? might depend on how spirv compiles shaders or the order they run in. Long term fix is https://github.com/flutter/engine/pull/42628 which computes all offset data in the compiler 
This commit is contained in:
@@ -17,6 +17,14 @@ bool VertexDescriptor::SetStageInputs(
|
||||
for (size_t i = 0; i < count; i++) {
|
||||
inputs_.emplace_back(*stage_inputs[i]);
|
||||
}
|
||||
// TODO(jonahwilliams): vulkan shader stage needed sorting too. Remove once
|
||||
// autogenerated headers include offset information.
|
||||
// See: https://github.com/flutter/flutter/issues/116168
|
||||
auto compare_locations = [](ShaderStageIOSlot a, ShaderStageIOSlot b) {
|
||||
return a.location < b.location;
|
||||
};
|
||||
std::sort(inputs_.begin(), inputs_.end(), compare_locations);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user