D3D11: Work around compiler nested sampling bug.
We can potentially work around a bug in the HLSL compiler by
omitting the const qualifier from some sampling operations.
BUG=angleproject:1923
Change-Id: I8a5d119707721e9c19f06be4ad808f87bfcdbee5
Reviewed-on: https://chromium-review.googlesource.com/454938
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
diff --git a/src/compiler/translator/TextureFunctionHLSL.cpp b/src/compiler/translator/TextureFunctionHLSL.cpp
index 1f3de5f..bc53473 100644
--- a/src/compiler/translator/TextureFunctionHLSL.cpp
+++ b/src/compiler/translator/TextureFunctionHLSL.cpp
@@ -296,7 +296,10 @@
else
{
ASSERT(outputType == SH_HLSL_4_1_OUTPUT);
- out << "const uint samplerIndex";
+ // A bug in the D3D compiler causes some nested sampling operations to fail.
+ // See http://anglebug.com/1923
+ // TODO(jmadill): Reinstate the const keyword when possible.
+ out << /*"const"*/ "uint samplerIndex";
}
}