gallium/draw: Fix rasterizer_discard for wide points/lines.

Fixes the rasterizer_discard failures for softpipe, because the wide paths
(which we hit for points in the CTS) were dropping the discard state when
making the no_cull shadow state.

Cc: mesa-stable
Reviewed-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7558>
This commit is contained in:
Eric Anholt
2020-11-11 11:03:57 -08:00
committed by Marge Bot
parent 9edb6e1be0
commit 0b4825c872
7 changed files with 18 additions and 24 deletions

View File

@@ -93,12 +93,6 @@ dEQP-GLES3.functional.rasterization.interpolation.basic.lines_wide,Fail
dEQP-GLES3.functional.rasterization.interpolation.projected.line_loop_wide,Fail
dEQP-GLES3.functional.rasterization.interpolation.projected.line_strip_wide,Fail
dEQP-GLES3.functional.rasterization.interpolation.projected.lines_wide,Fail
dEQP-GLES3.functional.rasterizer_discard.basic.write_depth_points,Fail
dEQP-GLES3.functional.rasterizer_discard.basic.write_stencil_points,Fail
dEQP-GLES3.functional.rasterizer_discard.fbo.write_depth_points,Fail
dEQP-GLES3.functional.rasterizer_discard.fbo.write_stencil_points,Fail
dEQP-GLES3.functional.rasterizer_discard.scissor.write_depth_points,Fail
dEQP-GLES3.functional.rasterizer_discard.scissor.write_stencil_points,Fail
dEQP-GLES3.functional.shaders.derivate.dfdx.fastest.fbo_msaa4.float_highp,Fail
dEQP-GLES3.functional.shaders.derivate.dfdx.fastest.fbo_msaa4.float_mediump,Fail
dEQP-GLES3.functional.shaders.derivate.dfdx.fastest.fbo_msaa4.vec2_highp,Fail
@@ -848,7 +842,6 @@ KHR-GL33.transform_feedback.capture_geometry_interleaved_test,Fail
KHR-GL33.transform_feedback.capture_geometry_separate_test,Fail
KHR-GL33.transform_feedback.capture_vertex_interleaved_test,Fail
KHR-GL33.transform_feedback.capture_vertex_separate_test,Fail
KHR-GL33.transform_feedback.discard_geometry_test,Fail
KHR-GL33.transform_feedback.discard_vertex_test,Fail
KHR-GL33.transform_feedback.draw_xfb_instanced_test,Crash
KHR-GL33.transform_feedback.draw_xfb_stream_instanced_test,Crash

View File

@@ -200,7 +200,7 @@ void draw_new_instance(struct draw_context *draw)
void draw_destroy( struct draw_context *draw )
{
struct pipe_context *pipe;
unsigned i, j;
unsigned i, j, k;
if (!draw)
return;
@@ -211,8 +211,10 @@ void draw_destroy( struct draw_context *draw )
*/
for (i = 0; i < 2; i++) {
for (j = 0; j < 2; j++) {
if (draw->rasterizer_no_cull[i][j]) {
pipe->delete_rasterizer_state(pipe, draw->rasterizer_no_cull[i][j]);
for (k = 0; k < 2; k++) {
if (draw->rasterizer_no_cull[i][j][k]) {
pipe->delete_rasterizer_state(pipe, draw->rasterizer_no_cull[i][j][k]);
}
}
}
}
@@ -1056,26 +1058,26 @@ draw_current_shader_num_written_culldistances(const struct draw_context *draw)
*/
void *
draw_get_rasterizer_no_cull( struct draw_context *draw,
boolean scissor,
boolean flatshade )
const struct pipe_rasterizer_state *base_rast )
{
if (!draw->rasterizer_no_cull[scissor][flatshade]) {
if (!draw->rasterizer_no_cull[base_rast->scissor][base_rast->flatshade][base_rast->rasterizer_discard]) {
/* create now */
struct pipe_context *pipe = draw->pipe;
struct pipe_rasterizer_state rast;
memset(&rast, 0, sizeof(rast));
rast.scissor = scissor;
rast.flatshade = flatshade;
rast.scissor = base_rast->scissor;
rast.flatshade = base_rast->flatshade;
rast.rasterizer_discard = base_rast->rasterizer_discard;
rast.front_ccw = 1;
rast.half_pixel_center = draw->rasterizer->half_pixel_center;
rast.bottom_edge_rule = draw->rasterizer->bottom_edge_rule;
rast.clip_halfz = draw->rasterizer->clip_halfz;
draw->rasterizer_no_cull[scissor][flatshade] =
draw->rasterizer_no_cull[base_rast->scissor][base_rast->flatshade][base_rast->rasterizer_discard] =
pipe->create_rasterizer_state(pipe, &rast);
}
return draw->rasterizer_no_cull[scissor][flatshade];
return draw->rasterizer_no_cull[base_rast->scissor][base_rast->flatshade][base_rast->rasterizer_discard];
}
void

View File

@@ -523,7 +523,7 @@ aaline_first_line(struct draw_stage *stage, struct prim_header *header)
draw->suspend_flushing = TRUE;
/* Disable triangle culling, stippling, unfilled mode etc. */
r = draw_get_rasterizer_no_cull(draw, rast->scissor, rast->flatshade);
r = draw_get_rasterizer_no_cull(draw, rast);
pipe->bind_rasterizer_state(pipe, r);
draw->suspend_flushing = FALSE;

View File

@@ -597,7 +597,7 @@ aapoint_first_point(struct draw_stage *stage, struct prim_header *header)
draw->suspend_flushing = TRUE;
/* Disable triangle culling, stippling, unfilled mode etc. */
r = draw_get_rasterizer_no_cull(draw, rast->scissor, rast->flatshade);
r = draw_get_rasterizer_no_cull(draw, rast);
pipe->bind_rasterizer_state(pipe, r);
draw->suspend_flushing = FALSE;

View File

@@ -147,7 +147,7 @@ static void wideline_first_line( struct draw_stage *stage,
void *r;
/* Disable triangle culling, stippling, unfilled mode etc. */
r = draw_get_rasterizer_no_cull(draw, rast->scissor, rast->flatshade);
r = draw_get_rasterizer_no_cull(draw, rast);
draw->suspend_flushing = TRUE;
pipe->bind_rasterizer_state(pipe, r);
draw->suspend_flushing = FALSE;

View File

@@ -213,7 +213,7 @@ widepoint_first_point(struct draw_stage *stage,
}
/* Disable triangle culling, stippling, unfilled mode etc. */
r = draw_get_rasterizer_no_cull(draw, rast->scissor, rast->flatshade);
r = draw_get_rasterizer_no_cull(draw, rast);
draw->suspend_flushing = TRUE;
pipe->bind_rasterizer_state(pipe, r);
draw->suspend_flushing = FALSE;

View File

@@ -265,7 +265,7 @@ struct draw_context
void *rast_handle;
/** Rasterizer CSOs without culling/stipple/etc */
void *rasterizer_no_cull[2][2];
void *rasterizer_no_cull[2][2][2];
struct pipe_viewport_state viewports[PIPE_MAX_VIEWPORTS];
boolean identity_viewport;
@@ -536,8 +536,7 @@ void draw_do_flush( struct draw_context *draw, unsigned flags );
void *
draw_get_rasterizer_no_cull( struct draw_context *draw,
boolean scissor,
boolean flatshade );
const struct pipe_rasterizer_state *rast );
void
draw_stats_clipper_primitives(struct draw_context *draw,