mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 17:30:12 +01:00
radeonsi: clean up and rename gfx10_edgeflags_have_effect
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32257>
This commit is contained in:
parent
5bf1ef94db
commit
d7415d3717
4 changed files with 9 additions and 11 deletions
|
|
@ -1947,7 +1947,7 @@ static void si_lower_ngg(struct si_shader *shader, nir_shader *nir)
|
|||
options.num_vertices_per_primitive = num_vertices ? num_vertices : 3;
|
||||
options.early_prim_export = gfx10_ngg_export_prim_early(shader);
|
||||
options.passthrough = gfx10_is_ngg_passthrough(shader);
|
||||
options.use_edgeflags = gfx10_edgeflags_have_effect(shader);
|
||||
options.use_edgeflags = gfx10_has_variable_edgeflags(shader);
|
||||
options.has_gen_prim_query = options.has_xfb_prim_query =
|
||||
sel->screen->info.gfx_level >= GFX11 && !sel->info.base.vs.blit_sgprs_amd;
|
||||
options.export_primitive_id = key->ge.mono.u.vs_export_prim_id;
|
||||
|
|
|
|||
|
|
@ -1080,6 +1080,8 @@ void gfx9_get_gs_info(struct si_shader_selector *es, struct si_shader_selector *
|
|||
bool gfx10_is_ngg_passthrough(struct si_shader *shader);
|
||||
unsigned si_shader_lshs_vertex_stride(struct si_shader *ls);
|
||||
bool si_should_clear_lds(struct si_screen *sscreen, const struct nir_shader *shader);
|
||||
unsigned si_get_output_prim_simplified(const struct si_shader_selector *sel,
|
||||
const union si_shader_key *key);
|
||||
|
||||
/* Inline helpers. */
|
||||
|
||||
|
|
@ -1117,19 +1119,17 @@ static inline bool si_shader_uses_bindless_images(struct si_shader_selector *sel
|
|||
return selector ? selector->info.uses_bindless_images : false;
|
||||
}
|
||||
|
||||
static inline bool gfx10_edgeflags_have_effect(struct si_shader *shader)
|
||||
static inline bool gfx10_has_variable_edgeflags(struct si_shader *shader)
|
||||
{
|
||||
if (shader->selector->stage == MESA_SHADER_VERTEX &&
|
||||
!shader->selector->info.base.vs.blit_sgprs_amd &&
|
||||
!(shader->key.ge.opt.ngg_culling & SI_NGG_CULL_VS_LINES))
|
||||
return true;
|
||||
unsigned output_prim = si_get_output_prim_simplified(shader->selector, &shader->key);
|
||||
|
||||
return false;
|
||||
return shader->selector->stage == MESA_SHADER_VERTEX &&
|
||||
(output_prim == MESA_PRIM_TRIANGLES || output_prim == MESA_PRIM_UNKNOWN);
|
||||
}
|
||||
|
||||
static inline bool gfx10_ngg_writes_user_edgeflags(struct si_shader *shader)
|
||||
{
|
||||
return gfx10_edgeflags_have_effect(shader) &&
|
||||
return gfx10_has_variable_edgeflags(shader) &&
|
||||
shader->selector->info.writes_edgeflag;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -678,8 +678,6 @@ void si_update_ps_inputs_read_or_disabled(struct si_context *sctx);
|
|||
void si_update_vrs_flat_shading(struct si_context *sctx);
|
||||
unsigned si_get_input_prim(const struct si_shader_selector *gs, const union si_shader_key *key,
|
||||
bool return_unknown);
|
||||
unsigned si_get_output_prim_simplified(const struct si_shader_selector *sel,
|
||||
const union si_shader_key *key);
|
||||
unsigned si_get_num_vertices_per_output_prim(struct si_shader *shader);
|
||||
bool si_update_ngg(struct si_context *sctx);
|
||||
void si_vs_ps_key_update_rast_prim_smooth_stipple(struct si_context *sctx);
|
||||
|
|
|
|||
|
|
@ -1548,7 +1548,7 @@ static void gfx10_shader_ngg(struct si_screen *sscreen, struct si_shader *shader
|
|||
* for the GL_LINE polygon mode to skip rendering lines on inner edges.
|
||||
*/
|
||||
if (gs_info->uses_invocationid ||
|
||||
(gfx10_edgeflags_have_effect(shader) && !gfx10_is_ngg_passthrough(shader)))
|
||||
(gfx10_has_variable_edgeflags(shader) && !gfx10_is_ngg_passthrough(shader)))
|
||||
gs_vgpr_comp_cnt = 3; /* VGPR3 contains InvocationID, edge flags. */
|
||||
else if ((gs_stage == MESA_SHADER_GEOMETRY && gs_info->uses_primid) ||
|
||||
(gs_stage == MESA_SHADER_VERTEX && shader->key.ge.mono.u.vs_export_prim_id))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue