Commit b6540806 by Alexis Hetu Committed by Alexis Hétu

Fix decorations bleeding to following block members

Block members were getting decorations applied from all previous block members. For example, in this case: in InterfaceBlock { layout(location = 0) in vec4 in_color_smooth; layout(location = 1) in flat vec4 in_color_flat; layout(location = 2) in noperspective vec4 in_color_noperspective; layout(location = 3) in centroid vec4 in_color_centroid; } - the member at location 2 would get decorated with both flat and noperspective - the member at location 3 would get decorated with both flat, noperspective and centroid I added a local variable for the member decorations in order to not bleed information between block members. Bug: b/163600604 Change-Id: I6b79609f19ae2f2f48909af929f798a48b4cde34 Tests: dEQP-VK.draw.multiple_interpolation.structured.* Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/47649 Presubmit-Ready: Alexis Hétu <sugoi@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com> Tested-by: 's avatarAlexis Hétu <sugoi@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com>
parent 13f04d59
......@@ -1018,8 +1018,9 @@ int SpirvShader::VisitInterfaceInner(Type::ID id, Decorations d, const Interface
// iterate over members, which may themselves have Location/Component decorations
for(auto i = 0u; i < obj.definition.wordCount() - 2; i++)
{
ApplyDecorationsForIdMember(&d, id, i);
d.Location = VisitInterfaceInner(obj.definition.word(i + 2), d, f);
Decorations dMember = d;
ApplyDecorationsForIdMember(&dMember, id, i);
d.Location = VisitInterfaceInner(obj.definition.word(i + 2), dMember, f);
d.Component = 0; // Implicit locations always have component=0
}
return d.Location;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment