Commit b0accd45 by Yuly Novikov Committed by Commit Bot

Flatten "#pragma STDGL invariant(all)" also for ESSL to ESSL translation

Adreno's driver in Android Oreo follows the spec to the letter, and applies "#pragma STDGL invariant(all)" only to the outputs of a fragment shader, causing InvariantAllBoth test to fail. Since the wording of the spec doesn't match the intended usage of this pragma, ANGLE should flatten it to workaround spec conformant drivers. BUG=angleproject:1293 Change-Id: I9f8ad44adc3b958204b88805dba8c5b7964b3d9f Reviewed-on: https://chromium-review.googlesource.com/860920Reviewed-by: 's avatarKenneth Russell <kbr@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
parent 2cc2a727
...@@ -109,8 +109,16 @@ void TranslatorESSL::translate(TIntermBlock *root, ...@@ -109,8 +109,16 @@ void TranslatorESSL::translate(TIntermBlock *root,
bool TranslatorESSL::shouldFlattenPragmaStdglInvariantAll() bool TranslatorESSL::shouldFlattenPragmaStdglInvariantAll()
{ {
// Not necessary when translating to ESSL. // If following the spec to the letter, we should not flatten this pragma.
return false; // However, the spec's wording means that the pragma applies only to outputs.
// This contradicts the spirit of using the pragma,
// because if the pragma is used in a vertex shader,
// the only way to be able to link it to a fragment shader
// is to manually qualify each of fragment shader's inputs as invariant.
// Which defeats the purpose of this pragma - temporarily make all varyings
// invariant for debugging.
// Thus, we should be non-conformant to spec's letter here and flatten.
return true;
} }
void TranslatorESSL::writeExtensionBehavior(ShCompileOptions compileOptions) void TranslatorESSL::writeExtensionBehavior(ShCompileOptions compileOptions)
......
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