Commit 9dcefbcb by Nicolas Capens

Make Reactor destination variables non-const.

Bug swiftshader:27 Change-Id: I53e2e4858b10d810f649907fda98dc7863752551 Reviewed-on: https://swiftshader-review.googlesource.com/8090Reviewed-by: 's avatarNicolas Capens <capn@google.com> Tested-by: 's avatarNicolas Capens <capn@google.com>
parent b5bdd27f
......@@ -29,10 +29,10 @@ namespace sw
virtual ~Rasterizer() {};
protected:
const Pointer<Byte> primitive;
const Int count;
const Int cluster;
const Pointer<Byte> data;
Pointer<Byte> primitive;
Int count;
Int cluster;
Pointer<Byte> data;
};
}
......
......@@ -868,7 +868,7 @@ namespace sw
}
}
void PixelRoutine::blendFactor(const Vector4s &blendFactor, const Vector4s &current, const Vector4s &pixel, BlendFactor blendFactorActive)
void PixelRoutine::blendFactor(Vector4s &blendFactor, const Vector4s &current, const Vector4s &pixel, BlendFactor blendFactorActive)
{
switch(blendFactorActive)
{
......@@ -949,7 +949,7 @@ namespace sw
}
}
void PixelRoutine::blendFactorAlpha(const Vector4s &blendFactor, const Vector4s &current, const Vector4s &pixel, BlendFactor blendFactorAlphaActive)
void PixelRoutine::blendFactorAlpha(Vector4s &blendFactor, const Vector4s &current, const Vector4s &pixel, BlendFactor blendFactorAlphaActive)
{
switch(blendFactorAlphaActive)
{
......@@ -1899,7 +1899,7 @@ namespace sw
}
}
void PixelRoutine::blendFactor(const Vector4f &blendFactor, const Vector4f &oC, const Vector4f &pixel, BlendFactor blendFactorActive)
void PixelRoutine::blendFactor(Vector4f &blendFactor, const Vector4f &oC, const Vector4f &pixel, BlendFactor blendFactorActive)
{
switch(blendFactorActive)
{
......@@ -1970,7 +1970,7 @@ namespace sw
}
}
void PixelRoutine::blendFactorAlpha(const Vector4f &blendFactor, const Vector4f &oC, const Vector4f &pixel, BlendFactor blendFactorAlphaActive)
void PixelRoutine::blendFactorAlpha(Vector4f &blendFactor, const Vector4f &oC, const Vector4f &pixel, BlendFactor blendFactorAlphaActive)
{
switch(blendFactorAlphaActive)
{
......
......@@ -76,11 +76,11 @@ namespace sw
Bool depthTest(Pointer<Byte> &zBuffer, int q, Int &x, Float4 &z, Int &sMask, Int &zMask, Int &cMask);
// Raster operations
void blendFactor(const Vector4s &blendFactor, const Vector4s &current, const Vector4s &pixel, BlendFactor blendFactorActive);
void blendFactorAlpha(const Vector4s &blendFactor, const Vector4s &current, const Vector4s &pixel, BlendFactor blendFactorAlphaActive);
void blendFactor(Vector4s &blendFactor, const Vector4s &current, const Vector4s &pixel, BlendFactor blendFactorActive);
void blendFactorAlpha(Vector4s &blendFactor, const Vector4s &current, const Vector4s &pixel, BlendFactor blendFactorAlphaActive);
void readPixel(int index, Pointer<Byte> &cBuffer, Int &x, Vector4s &pixel);
void blendFactor(const Vector4f &blendFactor, const Vector4f &oC, const Vector4f &pixel, BlendFactor blendFactorActive);
void blendFactorAlpha(const Vector4f &blendFactor, const Vector4f &oC, const Vector4f &pixel, BlendFactor blendFactorAlphaActive);
void blendFactor(Vector4f &blendFactor, const Vector4f &oC, const Vector4f &pixel, BlendFactor blendFactorActive);
void blendFactorAlpha(Vector4f &blendFactor, const Vector4f &oC, const Vector4f &pixel, BlendFactor blendFactorAlphaActive);
void writeStencil(Pointer<Byte> &sBuffer, int q, Int &x, Int &sMask, Int &zMask, Int &cMask);
void writeDepth(Pointer<Byte> &zBuffer, int q, Int &x, Float4 &z, Int &zMask);
......
......@@ -555,25 +555,23 @@ namespace sw
}
}
void SetupRoutine::edge(Pointer<Byte> &primitive, Pointer<Byte> &data, const Int &X1, const Int &Y1, const Int &X2, const Int &Y2, Int &q)
void SetupRoutine::edge(Pointer<Byte> &primitive, Pointer<Byte> &data, const Int &Xa, const Int &Ya, const Int &Xb, const Int &Yb, Int &q)
{
If(Y1 != Y2)
If(Ya != Yb)
{
Int xMin = *Pointer<Int>(data + OFFSET(DrawData,scissorX0));
Int xMax = *Pointer<Int>(data + OFFSET(DrawData,scissorX1));
Bool swap = Y2 < Y1;
Bool swap = Yb < Ya;
Pointer<Byte> leftEdge = primitive + q * sizeof(Primitive) + OFFSET(Primitive,outline->left);
Pointer<Byte> rightEdge = primitive + q * sizeof(Primitive) + OFFSET(Primitive,outline->right);
Pointer<Byte> edge = IfThenElse(swap, rightEdge, leftEdge);
Int X0 = X1;
Int Y0 = Y1;
X1 = IfThenElse(swap, X2, X1);
X2 = IfThenElse(swap, X0, X2);
Y1 = IfThenElse(swap, Y2, Y1);
Y2 = IfThenElse(swap, Y0, Y2);
Int X1 = IfThenElse(swap, Xb, Xa);
Int X2 = IfThenElse(swap, Xa, Xb);
Int Y1 = IfThenElse(swap, Yb, Ya);
Int Y2 = IfThenElse(swap, Ya, Yb);
Int y1 = Max((Y1 + 0x0000000F) >> 4, *Pointer<Int>(data + OFFSET(DrawData,scissorY0)));
Int y2 = Min((Y2 + 0x0000000F) >> 4, *Pointer<Int>(data + OFFSET(DrawData,scissorY1)));
......
......@@ -34,7 +34,7 @@ namespace sw
private:
void setupGradient(Pointer<Byte> &primitive, Pointer<Byte> &triangle, Float4 &w012, Float4 (&m)[3], Pointer<Byte> &v0, Pointer<Byte> &v1, Pointer<Byte> &v2, int attribute, int planeEquation, bool flatShading, bool sprite, bool perspective, bool wrap, int component);
void edge(Pointer<Byte> &primitive, Pointer<Byte> &data, const Int &X1, const Int &Y1, const Int &X2, const Int &Y2, Int &q);
void edge(Pointer<Byte> &primitive, Pointer<Byte> &data, const Int &Xa, const Int &Ya, const Int &Xb, const Int &Yb, Int &q);
void conditionalRotate1(Bool condition, Pointer<Byte> &v0, Pointer<Byte> &v1, Pointer<Byte> &v2);
void conditionalRotate2(Bool condition, Pointer<Byte> &v0, Pointer<Byte> &v1, Pointer<Byte> &v2);
......
......@@ -29,10 +29,10 @@ namespace sw
virtual ~VertexRoutinePrototype() {};
protected:
const Pointer<Byte> vertex;
const Pointer<Byte> batch;
const Pointer<Byte> task;
const Pointer<Byte> data;
Pointer<Byte> vertex;
Pointer<Byte> batch;
Pointer<Byte> task;
Pointer<Byte> data;
};
class VertexRoutine : public VertexRoutinePrototype
......
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