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 ...@@ -91,7 +91,7 @@ namespace sw
MAX_CLIP_PLANES = 6, MAX_CLIP_PLANES = 6,
MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS = 64, MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS = 64,
MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS = 64, MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS = 64,
RENDERTARGETS = 4, RENDERTARGETS = 8,
}; };
} }
......
...@@ -72,7 +72,6 @@ namespace es2 ...@@ -72,7 +72,6 @@ namespace es2
setPointSize(1.0f); setPointSize(1.0f);
setPointSizeMin(0.125f); setPointSizeMin(0.125f);
setPointSizeMax(8192.0f); setPointSizeMax(8192.0f);
setColorWriteMask(0, 0x0000000F);
setBlendOperation(BLENDOP_ADD); setBlendOperation(BLENDOP_ADD);
scissorEnable = false; scissorEnable = false;
setSlopeDepthBias(0.0f); setSlopeDepthBias(0.0f);
...@@ -81,9 +80,6 @@ namespace es2 ...@@ -81,9 +80,6 @@ namespace es2
setStencilZFailOperationCCW(OPERATION_KEEP); setStencilZFailOperationCCW(OPERATION_KEEP);
setStencilPassOperationCCW(OPERATION_KEEP); setStencilPassOperationCCW(OPERATION_KEEP);
setStencilCompareCCW(STENCIL_ALWAYS); setStencilCompareCCW(STENCIL_ALWAYS);
setColorWriteMask(1, 0x0000000F);
setColorWriteMask(2, 0x0000000F);
setColorWriteMask(3, 0x0000000F);
setBlendConstant(0xFFFFFFFF); setBlendConstant(0xFFFFFFFF);
setWriteSRGB(false); setWriteSRGB(false);
setDepthBias(0.0f); setDepthBias(0.0f);
......
...@@ -272,10 +272,11 @@ namespace sw ...@@ -272,10 +272,11 @@ namespace sw
cullMode = CULL_CLOCKWISE; cullMode = CULL_CLOCKWISE;
alphaReference = 0.0f; alphaReference = 0.0f;
colorWriteMask[0] = 0x0000000F;
colorWriteMask[1] = 0x0000000F; for(int i = 0; i < RENDERTARGETS; i++)
colorWriteMask[2] = 0x0000000F; {
colorWriteMask[3] = 0x0000000F; colorWriteMask[i] = 0x0000000F;
}
ambientMaterialSource = MATERIAL_MATERIAL; ambientMaterialSource = MATERIAL_MATERIAL;
diffuseMaterialSource = MATERIAL_COLOR1; diffuseMaterialSource = MATERIAL_COLOR1;
......
...@@ -518,7 +518,7 @@ namespace sw ...@@ -518,7 +518,7 @@ namespace sw
bool pointScaleEnable; bool pointScaleEnable;
float lineWidth; float lineWidth;
int colorWriteMask[4]; // RGBA int colorWriteMask[RENDERTARGETS]; // RGBA
bool writeSRGB; bool writeSRGB;
unsigned int sampleMask; unsigned int sampleMask;
unsigned int multiSampleMask; unsigned int multiSampleMask;
......
...@@ -959,13 +959,9 @@ namespace sw ...@@ -959,13 +959,9 @@ namespace sw
state.logicalOperation = context->colorLogicOp(); 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++) for(int i = 0; i < RENDERTARGETS; i++)
{ {
state.colorWriteMask |= context->colorWriteActive(i) << (4 * i);
state.targetFormat[i] = context->renderTargetInternalFormat(i); state.targetFormat[i] = context->renderTargetInternalFormat(i);
} }
......
...@@ -72,7 +72,7 @@ namespace sw ...@@ -72,7 +72,7 @@ namespace sw
BlendFactor destBlendFactorAlpha : BITS(BLEND_LAST); BlendFactor destBlendFactorAlpha : BITS(BLEND_LAST);
BlendOperation blendOperationAlpha : BITS(BLENDOP_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]; Format targetFormat[RENDERTARGETS];
bool writeSRGB : 1; bool writeSRGB : 1;
unsigned int multiSample : 3; 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