Hash :
d0c03ff4
Author :
Date :
2021-07-22T14:55:51
Vulkan: SPIR-V Gen: Fix lvalues passed to in/inout parameters
In GLSL, these values are semantically copied when passed to a function
as an in or inout parameter. For example in:
bool f(inout vec4 a, inout vec4 b)
{
a = vec4(0);
return all(equal(a, b));
}
var = vec4(1);
bool result = f(var, var);
result is expected to be false. In SPIR-V, every parameter is
semantically passed by "reference".
glslang conservatively uses temporaries to pass to functions. An
optimization in ANGLE didn't create temporaries for unindexed lvalues,
which did not take into account the above fact. This optimization is
limited to out parameters now.
Bug: angleproject:4889
Change-Id: Ie1b4b1cecba847ba63d5810d01d0856823b89ddc
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3046103
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>