radeonsi: test polygon mode enablement accurately
authorMarek Olšák <marek.olsak@amd.com>
Tue, 7 Jan 2020 02:27:25 +0000 (21:27 -0500)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 8 Jan 2020 20:48:43 +0000 (15:48 -0500)
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
src/gallium/drivers/radeonsi/si_state.c

index 37b618ccb46c9a7d21000b34e38e2582f1e8cf34..24714576f00f6ad8294bae72be6bf1606354ef11 100644 (file)
@@ -919,8 +919,10 @@ static void *si_create_rs_state(struct pipe_context *ctx,
        rs->flatshade_first = state->flatshade_first;
        rs->sprite_coord_enable = state->sprite_coord_enable;
        rs->rasterizer_discard = state->rasterizer_discard;
-       rs->polygon_mode_enabled = state->fill_front != PIPE_POLYGON_MODE_FILL ||
-                                  state->fill_back != PIPE_POLYGON_MODE_FILL;
+       rs->polygon_mode_enabled = (state->fill_front != PIPE_POLYGON_MODE_FILL &&
+                                   !(state->cull_face & PIPE_FACE_FRONT)) ||
+                                  (state->fill_back != PIPE_POLYGON_MODE_FILL &&
+                                   !(state->cull_face & PIPE_FACE_BACK));
        rs->pa_sc_line_stipple = state->line_stipple_enable ?
                                S_028A0C_LINE_PATTERN(state->line_stipple_pattern) |
                                S_028A0C_REPEAT_COUNT(state->line_stipple_factor) : 0;