mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-02 09:30:11 +01:00
iris: only set point sprite overrides if actually using points
Fixes black screen in some FNA games. Cc: <mesa-stable@lists.freedesktop.org> Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3431 Signed-off-by: Yevhenii Kolesnikov <yevhenii.kolesnikov@globallogic.com> Reviewed-by: Nanley Chery <nanley.g.chery@intel.com> Reviewed-by: Tapani Pälli <tapani.palli@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7218>
This commit is contained in:
parent
322a3d4fb0
commit
0c08a66ce5
1 changed files with 33 additions and 4 deletions
|
|
@ -1669,6 +1669,8 @@ struct iris_rasterizer_state {
|
|||
bool multisample;
|
||||
bool force_persample_interp;
|
||||
bool conservative_rasterization;
|
||||
bool fill_mode_point;
|
||||
bool fill_mode_line;
|
||||
bool fill_mode_point_or_line;
|
||||
enum pipe_sprite_coord_mode sprite_coord_mode; /* PIPE_SPRITE_* */
|
||||
uint16_t sprite_coord_enable;
|
||||
|
|
@ -1732,11 +1734,15 @@ iris_create_rasterizer_state(struct pipe_context *ctx,
|
|||
cso->conservative_rasterization =
|
||||
state->conservative_raster_mode == PIPE_CONSERVATIVE_RASTER_POST_SNAP;
|
||||
|
||||
cso->fill_mode_point_or_line =
|
||||
state->fill_front == PIPE_POLYGON_MODE_LINE ||
|
||||
cso->fill_mode_point =
|
||||
state->fill_front == PIPE_POLYGON_MODE_POINT ||
|
||||
state->fill_back == PIPE_POLYGON_MODE_LINE ||
|
||||
state->fill_back == PIPE_POLYGON_MODE_POINT;
|
||||
cso->fill_mode_line =
|
||||
state->fill_front == PIPE_POLYGON_MODE_LINE ||
|
||||
state->fill_back == PIPE_POLYGON_MODE_LINE;
|
||||
cso->fill_mode_point_or_line =
|
||||
cso->fill_mode_point ||
|
||||
cso->fill_mode_line;
|
||||
|
||||
if (state->clip_plane_enable != 0)
|
||||
cso->num_clip_plane_consts = util_logbase2(state->clip_plane_enable) + 1;
|
||||
|
|
@ -4062,6 +4068,28 @@ iris_emit_sbe_swiz(struct iris_batch *batch,
|
|||
}
|
||||
}
|
||||
|
||||
static bool
|
||||
iris_is_drawing_points(const struct iris_context *ice)
|
||||
{
|
||||
const struct iris_rasterizer_state *cso_rast = ice->state.cso_rast;
|
||||
|
||||
if (cso_rast->fill_mode_point) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (ice->shaders.prog[MESA_SHADER_GEOMETRY]) {
|
||||
const struct brw_gs_prog_data *gs_prog_data =
|
||||
(void *) ice->shaders.prog[MESA_SHADER_GEOMETRY]->prog_data;
|
||||
return gs_prog_data->output_topology == _3DPRIM_POINTLIST;
|
||||
} else if (ice->shaders.prog[MESA_SHADER_TESS_EVAL]) {
|
||||
const struct brw_tes_prog_data *tes_data =
|
||||
(void *) ice->shaders.prog[MESA_SHADER_TESS_EVAL]->prog_data;
|
||||
return tes_data->output_topology == BRW_TESS_OUTPUT_TOPOLOGY_POINT;
|
||||
} else {
|
||||
return ice->state.prim_mode == PIPE_PRIM_POINTS;
|
||||
}
|
||||
}
|
||||
|
||||
static unsigned
|
||||
iris_calculate_point_sprite_overrides(const struct brw_wm_prog_data *prog_data,
|
||||
const struct iris_rasterizer_state *cso)
|
||||
|
|
@ -4096,7 +4124,8 @@ iris_emit_sbe(struct iris_batch *batch, const struct iris_context *ice)
|
|||
&urb_read_offset, &urb_read_length);
|
||||
|
||||
unsigned sprite_coord_overrides =
|
||||
iris_calculate_point_sprite_overrides(wm_prog_data, cso_rast);
|
||||
iris_is_drawing_points(ice) ?
|
||||
iris_calculate_point_sprite_overrides(wm_prog_data, cso_rast) : 0;
|
||||
|
||||
iris_emit_cmd(batch, GENX(3DSTATE_SBE), sbe) {
|
||||
sbe.AttributeSwizzleEnable = true;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue