From: Nicolas Capens Date: Wed, 20 Jan 2016 22:09:28 +0000 (-0500) Subject: Move loop register usage to relative addressing. X-Git-Tag: android-x86-7.1-r1~687 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=907700d11aff5aebfbe7d003a236500109c73d49;p=android-x86%2Fexternal-swiftshader.git Move loop register usage to relative addressing. Bug 22652760 Change-Id: I50c6935bac91f586953b0dd2abd0d2a859468ee1 Reviewed-on: https://swiftshader-review.googlesource.com/4579 Tested-by: Nicolas Capens Reviewed-by: Alexis Hétu Reviewed-by: Nicolas Capens --- diff --git a/src/Shader/PixelProgram.cpp b/src/Shader/PixelProgram.cpp index 12a99c8c1..9fec0b3e5 100644 --- a/src/Shader/PixelProgram.cpp +++ b/src/Shader/PixelProgram.cpp @@ -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; diff --git a/src/Shader/VertexProgram.cpp b/src/Shader/VertexProgram.cpp index a19cca604..a6126dbd9 100644 --- a/src/Shader/VertexProgram.cpp +++ b/src/Shader/VertexProgram.cpp @@ -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;