Eliminate integer destination modifier.
The integer modifier was used to emulate integer arithmetic using
floating-point operations, as was allowed/typical for OpenGL ES 2.0
implementations. Now that we support native 32-bit integer types and
we have separate opcodes for integer operations, it is not longer
needed.
Change-Id: I89987534c150d2426ac9f9e1e49b66f9deaee560
Reviewed-on: https://swiftshader-review.googlesource.com/13889
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
diff --git a/src/OpenGL/compiler/OutputASM.cpp b/src/OpenGL/compiler/OutputASM.cpp
index f9a4dbb..2f5a04f 100644
--- a/src/OpenGL/compiler/OutputASM.cpp
+++ b/src/OpenGL/compiler/OutputASM.cpp
@@ -1891,7 +1891,6 @@
instruction->dst.type = registerType(dst);
instruction->dst.index = registerIndex(dst) + dstIndex;
instruction->dst.mask = writeMask(dst);
- instruction->dst.integer = (dst->getBasicType() == EbtInt);
}
if(src0)
diff --git a/src/Shader/PixelProgram.cpp b/src/Shader/PixelProgram.cpp
index 12568c7..4c5c5643 100644
--- a/src/Shader/PixelProgram.cpp
+++ b/src/Shader/PixelProgram.cpp
@@ -339,21 +339,6 @@
if(dst.type != Shader::PARAMETER_VOID && dst.type != Shader::PARAMETER_LABEL && opcode != Shader::OPCODE_TEXKILL && opcode != Shader::OPCODE_NOP)
{
- if(dst.integer)
- {
- switch(opcode)
- {
- case Shader::OPCODE_DIV:
- if(dst.x) d.x = Trunc(d.x);
- if(dst.y) d.y = Trunc(d.y);
- if(dst.z) d.z = Trunc(d.z);
- if(dst.w) d.w = Trunc(d.w);
- break;
- default:
- break; // No truncation to integer required when arguments are integer
- }
- }
-
if(dst.saturate)
{
if(dst.x) d.x = Max(d.x, Float4(0.0f));
diff --git a/src/Shader/Shader.cpp b/src/Shader/Shader.cpp
index f6c9f6f..bf82df8 100644
--- a/src/Shader/Shader.cpp
+++ b/src/Shader/Shader.cpp
@@ -317,11 +317,6 @@
std::string modifierString;
- if(integer)
- {
- modifierString += "_int";
- }
-
if(saturate)
{
modifierString += "_sat";
diff --git a/src/Shader/Shader.hpp b/src/Shader/Shader.hpp
index e5a74d2..a49895b 100644
--- a/src/Shader/Shader.hpp
+++ b/src/Shader/Shader.hpp
@@ -456,7 +456,7 @@
};
};
- DestinationParameter() : mask(0xF), integer(false), saturate(false), partialPrecision(false), centroid(false), shift(0)
+ DestinationParameter() : mask(0xF), saturate(false), partialPrecision(false), centroid(false), shift(0)
{
}
@@ -464,7 +464,6 @@
std::string shiftString() const;
std::string maskString() const;
- bool integer : 1;
bool saturate : 1;
bool partialPrecision : 1;
bool centroid : 1;
diff --git a/src/Shader/VertexProgram.cpp b/src/Shader/VertexProgram.cpp
index e6153b1..d95025c 100644
--- a/src/Shader/VertexProgram.cpp
+++ b/src/Shader/VertexProgram.cpp
@@ -345,21 +345,6 @@
if(dst.type != Shader::PARAMETER_VOID && dst.type != Shader::PARAMETER_LABEL && opcode != Shader::OPCODE_NOP)
{
- if(dst.integer)
- {
- switch(opcode)
- {
- case Shader::OPCODE_DIV:
- if(dst.x) d.x = Trunc(d.x);
- if(dst.y) d.y = Trunc(d.y);
- if(dst.z) d.z = Trunc(d.z);
- if(dst.w) d.w = Trunc(d.w);
- break;
- default:
- break; // No truncation to integer required when arguments are integer
- }
- }
-
if(dst.saturate)
{
if(dst.x) d.x = Max(d.x, Float4(0.0f));