summaryrefslogtreecommitdiffstats
path: root/gfx/angle/src/compiler/translator/TranslatorHLSL.cpp
diff options
context:
space:
mode:
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