From 360a7741cc91981b9b4416ce4d1b133051b4fc5a Mon Sep 17 00:00:00 2001 From: Nicolas Capens Date: Wed, 15 Nov 2017 13:35:47 -0500 Subject: [PATCH] Eliminate integer destination modifier. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Alexis Hétu Reviewed-by: Nicolas Capens --- src/OpenGL/compiler/OutputASM.cpp | 1 - src/Shader/PixelProgram.cpp | 15 --------------- src/Shader/Shader.cpp | 5 ----- src/Shader/Shader.hpp | 3 +-- src/Shader/VertexProgram.cpp | 15 --------------- 5 files changed, 1 insertion(+), 38 deletions(-) diff --git a/src/OpenGL/compiler/OutputASM.cpp b/src/OpenGL/compiler/OutputASM.cpp index f9a4dbb9f..2f5a04f5f 100644 --- a/src/OpenGL/compiler/OutputASM.cpp +++ b/src/OpenGL/compiler/OutputASM.cpp @@ -1891,7 +1891,6 @@ namespace glsl 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 12568c707..4c5c56434 100644 --- a/src/Shader/PixelProgram.cpp +++ b/src/Shader/PixelProgram.cpp @@ -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.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 f6c9f6f51..bf82df84e 100644 --- a/src/Shader/Shader.cpp +++ b/src/Shader/Shader.cpp @@ -317,11 +317,6 @@ namespace sw std::string modifierString; - if(integer) - { - modifierString += "_int"; - } - if(saturate) { modifierString += "_sat"; diff --git a/src/Shader/Shader.hpp b/src/Shader/Shader.hpp index e5a74d20d..a49895b81 100644 --- a/src/Shader/Shader.hpp +++ b/src/Shader/Shader.hpp @@ -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 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 e6153b134..d95025c17 100644 --- a/src/Shader/VertexProgram.cpp +++ b/src/Shader/VertexProgram.cpp @@ -345,21 +345,6 @@ namespace sw 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)); -- 2.11.0