summaryrefslogtreecommitdiffstats
path: root/gfx/angle/src/compiler/translator/TranslatorHLSL.cpp
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-07-11 23:29:50 +0200
committerwolfbeast <mcwerewolf@gmail.com>2018-07-11 23:31:02 +0200
commit70dd5e7c66b1fe3f82e5b4db2406050baba15f05 (patch)
tree3f012200ef3c934f33db1a4ef2b790fae3141860 /gfx/angle/src/compiler/translator/TranslatorHLSL.cpp
parent3b7ffb477eec078c7036c92c6a51bb5de6de4f28 (diff)
parent8481fa25d246f1968d0a254ee3c6cdd82c60781a (diff)
downloadUXP-70dd5e7c66b1fe3f82e5b4db2406050baba15f05.tar
UXP-70dd5e7c66b1fe3f82e5b4db2406050baba15f05.tar.gz
UXP-70dd5e7c66b1fe3f82e5b4db2406050baba15f05.tar.lz
UXP-70dd5e7c66b1fe3f82e5b4db2406050baba15f05.tar.xz
UXP-70dd5e7c66b1fe3f82e5b4db2406050baba15f05.zip
Merge branch 'ANGLE-rollback'
This resolves #624 Note: Cherry-picked some fixes on top of the ANGLE version that we want to keep.
Diffstat (limited to 'gfx/angle/src/compiler/translator/TranslatorHLSL.cpp')
-rwxr-xr-xgfx/angle/src/compiler/translator/TranslatorHLSL.cpp24
1 files changed, 3 insertions, 21 deletions
diff --git a/gfx/angle/src/compiler/translator/TranslatorHLSL.cpp b/gfx/angle/src/compiler/translator/TranslatorHLSL.cpp
index 7ef1d4e36..6721d8942 100755
--- a/gfx/angle/src/compiler/translator/TranslatorHLSL.cpp
+++ b/gfx/angle/src/compiler/translator/TranslatorHLSL.cpp
@@ -8,7 +8,6 @@
#include "compiler/translator/AddDefaultReturnStatements.h"
#include "compiler/translator/ArrayReturnValueToOutParameter.h"
-#include "compiler/translator/BreakVariableAliasingInInnerLoops.h"
#include "compiler/translator/EmulatePrecision.h"
#include "compiler/translator/ExpandIntegerPowExpressions.h"
#include "compiler/translator/IntermNodePatternMatcher.h"
@@ -16,7 +15,6 @@
#include "compiler/translator/RemoveDynamicIndexing.h"
#include "compiler/translator/RewriteElseBlocks.h"
#include "compiler/translator/RewriteTexelFetchOffset.h"
-#include "compiler/translator/RewriteUnaryMinusOperatorInt.h"
#include "compiler/translator/SeparateArrayInitialization.h"
#include "compiler/translator/SeparateDeclarations.h"
#include "compiler/translator/SeparateExpressionsReturningArrays.h"
@@ -24,15 +22,12 @@
#include "compiler/translator/SplitSequenceOperator.h"
#include "compiler/translator/UnfoldShortCircuitToIf.h"
-namespace sh
-{
-
TranslatorHLSL::TranslatorHLSL(sh::GLenum type, ShShaderSpec spec, ShShaderOutput output)
: TCompiler(type, spec, output)
{
}
-void TranslatorHLSL::translate(TIntermNode *root, ShCompileOptions compileOptions)
+void TranslatorHLSL::translate(TIntermNode *root, int compileOptions)
{
const ShBuiltInResources &resources = getResources();
int numRenderTargets = resources.EXT_draw_buffers ? resources.MaxDrawBuffers : 1;
@@ -80,12 +75,6 @@ void TranslatorHLSL::translate(TIntermNode *root, ShCompileOptions compileOption
sh::RewriteElseBlocks(root, getTemporaryIndex());
}
- // Work around an HLSL compiler frontend aliasing optimization bug.
- // TODO(cwallez) The date is 2016-08-25, Microsoft said the bug would be fixed
- // in the next release of d3dcompiler.dll, it would be nice to detect the DLL
- // version and only apply the workaround if it is too old.
- sh::BreakVariableAliasingInInnerLoops(root);
-
bool precisionEmulation =
getResources().WEBGL_debug_shader_precision && getPragma().debugShaderPrecision;
@@ -105,13 +94,8 @@ void TranslatorHLSL::translate(TIntermNode *root, ShCompileOptions compileOption
if ((compileOptions & SH_REWRITE_TEXELFETCHOFFSET_TO_TEXELFETCH) != 0)
{
- sh::RewriteTexelFetchOffset(root, getSymbolTable(), getShaderVersion());
- }
-
- if (((compileOptions & SH_REWRITE_INTEGER_UNARY_MINUS_OPERATOR) != 0) &&
- getShaderType() == GL_VERTEX_SHADER)
- {
- sh::RewriteUnaryMinusOperatorInt(root);
+ sh::RewriteTexelFetchOffset(root, getTemporaryIndex(), getSymbolTable(),
+ getShaderVersion());
}
sh::OutputHLSL outputHLSL(getShaderType(), getShaderVersion(), getExtensionBehavior(),
@@ -144,5 +128,3 @@ const std::map<std::string, unsigned int> *TranslatorHLSL::getUniformRegisterMap
{
return &mUniformRegisterMap;
}
-
-} // namespace sh