Commit c98186ac by Nicolas Capens

Fix support for variable number of render targets.

Bug 19353282 Change-Id: I4e99589477de32bb8004feec673e1dbddb675047 Reviewed-on: https://swiftshader-review.googlesource.com/5144Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com> Tested-by: 's avatarNicolas Capens <capn@google.com> Reviewed-by: 's avatarNicolas Capens <capn@google.com>
parent b663f717
......@@ -91,7 +91,7 @@ namespace sw
MAX_CLIP_PLANES = 6,
MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS = 64,
MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS = 64,
RENDERTARGETS = 4,
RENDERTARGETS = 8,
};
}
......
......@@ -72,7 +72,6 @@ namespace es2
setPointSize(1.0f);
setPointSizeMin(0.125f);
setPointSizeMax(8192.0f);
setColorWriteMask(0, 0x0000000F);
setBlendOperation(BLENDOP_ADD);
scissorEnable = false;
setSlopeDepthBias(0.0f);
......@@ -81,9 +80,6 @@ namespace es2
setStencilZFailOperationCCW(OPERATION_KEEP);
setStencilPassOperationCCW(OPERATION_KEEP);
setStencilCompareCCW(STENCIL_ALWAYS);
setColorWriteMask(1, 0x0000000F);
setColorWriteMask(2, 0x0000000F);
setColorWriteMask(3, 0x0000000F);
setBlendConstant(0xFFFFFFFF);
setWriteSRGB(false);
setDepthBias(0.0f);
......
......@@ -272,10 +272,11 @@ namespace sw
cullMode = CULL_CLOCKWISE;
alphaReference = 0.0f;
colorWriteMask[0] = 0x0000000F;
colorWriteMask[1] = 0x0000000F;
colorWriteMask[2] = 0x0000000F;
colorWriteMask[3] = 0x0000000F;
for(int i = 0; i < RENDERTARGETS; i++)
{
colorWriteMask[i] = 0x0000000F;
}
ambientMaterialSource = MATERIAL_MATERIAL;
diffuseMaterialSource = MATERIAL_COLOR1;
......
......@@ -518,7 +518,7 @@ namespace sw
bool pointScaleEnable;
float lineWidth;
int colorWriteMask[4]; // RGBA
int colorWriteMask[RENDERTARGETS]; // RGBA
bool writeSRGB;
unsigned int sampleMask;
unsigned int multiSampleMask;
......
......@@ -959,13 +959,9 @@ namespace sw
state.logicalOperation = context->colorLogicOp();
state.colorWriteMask = (context->colorWriteActive(0) << 0) |
(context->colorWriteActive(1) << 4) |
(context->colorWriteActive(2) << 8) |
(context->colorWriteActive(3) << 12);
for(int i = 0; i < RENDERTARGETS; i++)
{
state.colorWriteMask |= context->colorWriteActive(i) << (4 * i);
state.targetFormat[i] = context->renderTargetInternalFormat(i);
}
......
......@@ -71,8 +71,8 @@ namespace sw
BlendFactor sourceBlendFactorAlpha : BITS(BLEND_LAST);
BlendFactor destBlendFactorAlpha : BITS(BLEND_LAST);
BlendOperation blendOperationAlpha : BITS(BLENDOP_LAST);
unsigned int colorWriteMask : 16; // (four times four component bit mask)
unsigned int colorWriteMask : RENDERTARGETS * 4; // Four component bit masks
Format targetFormat[RENDERTARGETS];
bool writeSRGB : 1;
unsigned int multiSample : 3;
......
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