Minor PixelRoutine cleanup

- Removed redundant parameters from fogBlend()
- Moved computation registers and color output
  registers from PixelRoutine to PixelProgram.
- Made many PixelRoutine member functions
  private rather than protected when possible.

Change-Id: I748333626d993c0d46b369991d74bc3a22c972c2
Reviewed-on: https://swiftshader-review.googlesource.com/3850
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Alexis Hétu <sugoi@google.com>
diff --git a/src/Shader/PixelRoutine.hpp b/src/Shader/PixelRoutine.hpp
index f86105e..38fb3a4 100644
--- a/src/Shader/PixelRoutine.hpp
+++ b/src/Shader/PixelRoutine.hpp
@@ -37,11 +37,9 @@
 			Float4 w;    // Used as is
 			Float4 rhw;  // Reciprocal w
 
-			RegisterArray<4096> rf; // Computation registers
-			RegisterArray<10> vf;   // Varying registers
+			RegisterArray<10> v;   // Varying registers
 
-			// Outputs
-			Vector4f oC[4];
+			// Depth output
 			Float4 oDepth;
 		};
 
@@ -56,41 +54,46 @@
 
 		virtual void quad(QuadRasterizer::Registers &r, Pointer<Byte> cBuffer[4], Pointer<Byte> &zBuffer, Pointer<Byte> &sBuffer, Int cMask[4], Int &x, Int &y);
 
+		void alphaTest(Registers &r, Int &aMask, Short4 &alpha);
+		void alphaToCoverage(Registers &r, Int cMask[4], Float4 &alpha);
+		void fogBlend(Registers &r, Vector4f &c0, Float4 &fog);
+		void pixelFog(Registers &r, Float4 &visibility);
+
+		// Raster operations
+		void alphaBlend(Registers &r, int index, Pointer<Byte> &cBuffer, Vector4s &current, Int &x);
+		void logicOperation(Registers &r, int index, Pointer<Byte> &cBuffer, Vector4s &current, Int &x);
+		void writeColor(Registers &r, int index, Pointer<Byte> &cBuffer, Int &i, Vector4s &current, Int &sMask, Int &zMask, Int &cMask);
+		void alphaBlend(Registers &r, int index, Pointer<Byte> &cBuffer, Vector4f &oC, Int &x);
+		void writeColor(Registers &r, int index, Pointer<Byte> &cBuffer, Int &i, Vector4f &oC, Int &sMask, Int &zMask, Int &cMask);
+
+		UShort4 convertFixed16(Float4 &cf, bool saturate = true);
+		void linearToSRGB12_16(Registers &r, Vector4s &c);
+
+		SamplerCore *sampler[TEXTURE_IMAGE_UNITS];
+
+	private:
 		Float4 interpolateCentroid(Float4 &x, Float4 &y, Float4 &rhw, Pointer<Byte> planeEquation, bool flat, bool perspective);
 		void stencilTest(Registers &r, Pointer<Byte> &sBuffer, int q, Int &x, Int &sMask, Int &cMask);
 		void stencilTest(Registers &r, Byte8 &value, StencilCompareMode stencilCompareMode, bool CCW);
 		void stencilOperation(Registers &r, Byte8 &newValue, Byte8 &bufferValue, StencilOperation stencilPassOperation, StencilOperation stencilZFailOperation, StencilOperation stencilFailOperation, bool CCW, Int &zMask, Int &sMask);
 		void stencilOperation(Registers &r, Byte8 &output, Byte8 &bufferValue, StencilOperation operation, bool CCW);
 		Bool depthTest(Registers &r, Pointer<Byte> &zBuffer, int q, Int &x, Float4 &z, Int &sMask, Int &zMask, Int &cMask);
-		void alphaTest(Registers &r, Int &aMask, Short4 &alpha);
-		void alphaToCoverage(Registers &r, Int cMask[4], Float4 &alpha);
-		void fogBlend(Registers &r, Vector4f &c0, Float4 &fog, Float4 &z, Float4 &rhw);
-		void pixelFog(Registers &r, Float4 &visibility, Float4 &z, Float4 &rhw);
 
 		// Raster operations
 		void blendFactor(Registers &r, const Vector4s &blendFactor, const Vector4s &current, const Vector4s &pixel, BlendFactor blendFactorActive);
 		void blendFactorAlpha(Registers &r, const Vector4s &blendFactor, const Vector4s &current, const Vector4s &pixel, BlendFactor blendFactorAlphaActive);
 		void readPixel(Registers &r, int index, Pointer<Byte> &cBuffer, Int &x, Vector4s &pixel);
-		void alphaBlend(Registers &r, int index, Pointer<Byte> &cBuffer, Vector4s &current, Int &x);
-		void logicOperation(Registers &r, int index, Pointer<Byte> &cBuffer, Vector4s &current, Int &x);
-		void writeColor(Registers &r, int index, Pointer<Byte> &cBuffer, Int &i, Vector4s &current, Int &sMask, Int &zMask, Int &cMask);
 		void blendFactor(Registers &r, const Vector4f &blendFactor, const Vector4f &oC, const Vector4f &pixel, BlendFactor blendFactorActive);
 		void blendFactorAlpha(Registers &r, const Vector4f &blendFactor, const Vector4f &oC, const Vector4f &pixel, BlendFactor blendFactorAlphaActive);
-		void alphaBlend(Registers &r, int index, Pointer<Byte> &cBuffer, Vector4f &oC, Int &x);
-		void writeColor(Registers &r, int index, Pointer<Byte> &cBuffer, Int &i, Vector4f &oC, Int &sMask, Int &zMask, Int &cMask);
 		void writeStencil(Registers &r, Pointer<Byte> &sBuffer, int q, Int &x, Int &sMask, Int &zMask, Int &cMask);
 		void writeDepth(Registers &r, Pointer<Byte> &zBuffer, int q, Int &x, Float4 &z, Int &zMask);
 
-		UShort4 convertFixed16(Float4 &cf, bool saturate = true);
 		void sRGBtoLinear16_12_16(Registers &r, Vector4s &c);
 		void sRGBtoLinear12_16(Registers &r, Vector4s &c);
 		void linearToSRGB16_12_16(Registers &r, Vector4s &c);
-		void linearToSRGB12_16(Registers &r, Vector4s &c);
 		Float4 sRGBtoLinear(const Float4 &x);
 
 		bool colorUsed();
-
-		SamplerCore *sampler[TEXTURE_IMAGE_UNITS];
 	};
 }