OSDN Git Service

Move loop register usage to relative addressing.
authorNicolas Capens <capn@google.com>
Wed, 20 Jan 2016 22:09:28 +0000 (17:09 -0500)
committerNicolas Capens <capn@google.com>
Mon, 25 Jan 2016 19:43:25 +0000 (19:43 +0000)
Bug 22652760

Change-Id: I50c6935bac91f586953b0dd2abd0d2a859468ee1
Reviewed-on: https://swiftshader-review.googlesource.com/4579
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
src/Shader/PixelProgram.cpp
src/Shader/VertexProgram.cpp

index 12a99c8..9fec0b3 100644 (file)
@@ -754,12 +754,6 @@ namespace sw
                                {
                                        reg = v[i];
                                }
-                               else if(src.rel.type == Shader::PARAMETER_LOOP)
-                               {
-                                       Int aL = this->aL[loopDepth];
-
-                                       reg = v[i + aL];
-                               }
                                else
                                {
                                        Int a = relativeAddress(src);
@@ -947,6 +941,10 @@ namespace sw
 
                        return Extract(c, 0) * var.rel.scale;
                }
+               else if(var.rel.type == Shader::PARAMETER_LOOP)
+               {
+                       return aL[loopDepth];
+               }
                else ASSERT(false);
 
                return 0;
index a19cca6..a6126db 100644 (file)
@@ -401,15 +401,6 @@ namespace sw
                                                                if(dst.z) pDst.z = r.o[dst.index].z;
                                                                if(dst.w) pDst.w = r.o[dst.index].w;
                                                        }
-                                                       else if(dst.rel.type == Shader::PARAMETER_LOOP)
-                                                       {
-                                                               Int aL = r.aL[r.loopDepth];
-
-                                                               if(dst.x) pDst.x = r.o[dst.index + aL].x;
-                                                               if(dst.y) pDst.y = r.o[dst.index + aL].y;
-                                                               if(dst.z) pDst.z = r.o[dst.index + aL].z;
-                                                               if(dst.w) pDst.w = r.o[dst.index + aL].w;
-                                                       }
                                                        else
                                                        {
                                                                Int a = relativeAddress(dst);
@@ -541,15 +532,6 @@ namespace sw
                                                        if(dst.z) r.o[dst.index].z = d.z;
                                                        if(dst.w) r.o[dst.index].w = d.w;
                                                }
-                                               else if(dst.rel.type == Shader::PARAMETER_LOOP)
-                                               {
-                                                       Int aL = r.aL[r.loopDepth];
-
-                                                       if(dst.x) r.o[dst.index + aL].x = d.x;
-                                                       if(dst.y) r.o[dst.index + aL].y = d.y;
-                                                       if(dst.z) r.o[dst.index + aL].z = d.z;
-                                                       if(dst.w) r.o[dst.index + aL].w = d.w;
-                                               }
                                                else
                                                {
                                                        Int a = relativeAddress(dst);
@@ -876,6 +858,10 @@ namespace sw
 
                        return Extract(c, 0) * var.rel.scale;
                }
+               else if(var.rel.type == Shader::PARAMETER_LOOP)
+               {
+                       return r.aL[r.loopDepth];
+               }
                else ASSERT(false);
 
                return 0;