Commit 360a7741 by Nicolas Capens Committed by Nicolas Capens

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/13889Tested-by: 's avatarNicolas Capens <nicolascapens@google.com> Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com>
parent c09073f9
...@@ -1891,7 +1891,6 @@ namespace glsl ...@@ -1891,7 +1891,6 @@ namespace glsl
instruction->dst.type = registerType(dst); instruction->dst.type = registerType(dst);
instruction->dst.index = registerIndex(dst) + dstIndex; instruction->dst.index = registerIndex(dst) + dstIndex;
instruction->dst.mask = writeMask(dst); instruction->dst.mask = writeMask(dst);
instruction->dst.integer = (dst->getBasicType() == EbtInt);
} }
if(src0) if(src0)
......
...@@ -339,21 +339,6 @@ namespace sw ...@@ -339,21 +339,6 @@ namespace sw
if(dst.type != Shader::PARAMETER_VOID && dst.type != Shader::PARAMETER_LABEL && opcode != Shader::OPCODE_TEXKILL && opcode != Shader::OPCODE_NOP) 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.saturate)
{ {
if(dst.x) d.x = Max(d.x, Float4(0.0f)); if(dst.x) d.x = Max(d.x, Float4(0.0f));
......
...@@ -317,11 +317,6 @@ namespace sw ...@@ -317,11 +317,6 @@ namespace sw
std::string modifierString; std::string modifierString;
if(integer)
{
modifierString += "_int";
}
if(saturate) if(saturate)
{ {
modifierString += "_sat"; modifierString += "_sat";
......
...@@ -456,7 +456,7 @@ namespace sw ...@@ -456,7 +456,7 @@ namespace sw
}; };
}; };
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 @@ namespace sw ...@@ -464,7 +464,6 @@ namespace sw
std::string shiftString() const; std::string shiftString() const;
std::string maskString() const; std::string maskString() const;
bool integer : 1;
bool saturate : 1; bool saturate : 1;
bool partialPrecision : 1; bool partialPrecision : 1;
bool centroid : 1; bool centroid : 1;
......
...@@ -345,21 +345,6 @@ namespace sw ...@@ -345,21 +345,6 @@ namespace sw
if(dst.type != Shader::PARAMETER_VOID && dst.type != Shader::PARAMETER_LABEL && opcode != Shader::OPCODE_NOP) 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.saturate)
{ {
if(dst.x) d.x = Max(d.x, Float4(0.0f)); if(dst.x) d.x = Max(d.x, Float4(0.0f));
......
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