-
Don't let shaders negate samplers · 39f0247aSean Risser authored
Prior to this change, the OpenGL compiler accepted all "non-struct" "non-array" types for unary operations (++, --, and -). This ignored the existence of sampler objects. If someone tried to negate a sampler, then the compiler would tell the assembler to negate a non- numerical type. This change makes it so the GSL compiler only accepts unary operations on numerical types (including vectors and matrices). Also added a unittest that makes sure we gracefully fail to compile bad unary operations. Bug chromium:910883 Change-Id: Ia69056b31664900c3126cab42ecb8603d1a5d7db Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/32448Tested-by:
Sean Risser <srisser@google.com> Presubmit-Ready: Sean Risser <srisser@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com>
39f0247a
×