llvmpipe: consistently deal with post-rast state

There's no good reason why we peek into the rasterization state when
dealing with the point_quad_rasterization state, rather than set it
through lp_setup_set_point_state like other point-state.

Let's fix this up, and get rid of a needless NULL-check per primitive.

This makes the code a bit easier to read as well, and will help once
these conditions gets more complicated later on.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11183>
This commit is contained in:
Erik Faye-Lund 2021-06-09 10:55:44 +02:00
parent 2812f030f1
commit 9fa53d1f50
5 changed files with 9 additions and 5 deletions

View File

@ -600,7 +600,8 @@ lp_setup_set_point_state( struct lp_setup_context *setup,
float point_size,
boolean point_size_per_vertex,
uint sprite_coord_enable,
uint sprite_coord_origin)
uint sprite_coord_origin,
boolean point_quad_rasterization)
{
LP_DBG(DEBUG_SETUP, "%s\n", __FUNCTION__);
@ -608,6 +609,7 @@ lp_setup_set_point_state( struct lp_setup_context *setup,
setup->sprite_coord_enable = sprite_coord_enable;
setup->sprite_coord_origin = sprite_coord_origin;
setup->point_size_per_vertex = point_size_per_vertex;
setup->legacy_points = !point_quad_rasterization;
}
void

View File

@ -90,7 +90,8 @@ lp_setup_set_point_state( struct lp_setup_context *setup,
float point_size,
boolean point_size_per_vertex,
uint sprite_coord_enable,
uint sprite_coord_origin);
uint sprite_coord_origin,
boolean point_quad_rasterization);
void
lp_setup_set_setup_variant( struct lp_setup_context *setup,

View File

@ -100,6 +100,7 @@ struct lp_setup_context
boolean ccw_is_frontface;
boolean scissor_test;
boolean point_size_per_vertex;
boolean legacy_points;
boolean rasterizer_discard;
boolean multisample;
unsigned cullmode;

View File

@ -374,8 +374,7 @@ try_setup_point( struct lp_setup_context *setup,
print_point(setup, v0, size);
/* Bounding rectangle (in pixels) */
if (!lp_context->rasterizer ||
lp_context->rasterizer->point_quad_rasterization) {
if (!setup->legacy_points) {
/*
* Rasterize points as quads.
*/

View File

@ -126,7 +126,8 @@ llvmpipe_bind_rasterizer_state(struct pipe_context *pipe, void *handle)
state->lp_state.point_size,
state->lp_state.point_size_per_vertex,
state->lp_state.sprite_coord_enable,
state->lp_state.sprite_coord_mode);
state->lp_state.sprite_coord_mode,
state->lp_state.point_quad_rasterization);
}
else {
llvmpipe->rasterizer = NULL;