swr: flatshading makes color outputs flat, it doesn't affect others
authorIlia Mirkin <imirkin@alum.mit.edu>
Mon, 21 Nov 2016 00:48:38 +0000 (19:48 -0500)
committerIlia Mirkin <imirkin@alum.mit.edu>
Wed, 23 Nov 2016 01:27:20 +0000 (20:27 -0500)
We were previously not marking the "regular" flat outputs as flat when
flatshading was enabled.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Tim Rowley <timothy.o.rowley@intel.com>
src/gallium/drivers/swr/swr_state.cpp

index b0cbc21964ed33f9307c18c9ddfa421633df6471..41193795ce1c7251c3e712b8305f90ca01e3e073 100644 (file)
@@ -1501,10 +1501,8 @@ swr_update_derived(struct pipe_context *pipe,
       (ctx->rasterizer->sprite_coord_enable ? 1 : 0);
    for (unsigned i = 0; i < backendState.numAttributes; i++)
       backendState.numComponents[i] = 4;
-   backendState.constantInterpolationMask =
-      ctx->rasterizer->flatshade ?
-      ctx->fs->flatConstantMask :
-      ctx->fs->constantMask;
+   backendState.constantInterpolationMask = ctx->fs->constantMask |
+      (ctx->rasterizer->flatshade ? ctx->fs->flatConstantMask : 0);
    backendState.pointSpriteTexCoordMask = ctx->fs->pointSpriteMask;
 
    SwrSetBackendState(ctx->swrContext, &backendState);