mesa/st: always inject a 1.0 pointsize for vertex stages

since 1.0 is used in nearly every case, drivers requiring this exporting
can avoid potential shader variants by adding a 1.0 export to the base
shader variant and the only using the ubo upload when pointsize is explicitly
set for wide point functionality

drivers can then be responsible for removing unused pointsize exports
as needed (or desired)

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15699>
This commit is contained in:
Mike Blumenkrantz 2022-03-30 09:24:03 -04:00
parent 3aa449ff72
commit d773055d92

View file

@ -337,27 +337,10 @@ st_nir_preprocess(struct st_context *st, struct gl_program *prog,
}
prog->skip_pointsize_xfb = !(nir->info.outputs_written & VARYING_BIT_PSIZ);
if (st->lower_point_size && _mesa_is_gles(st->ctx) && prog->skip_pointsize_xfb &&
(stage == MESA_SHADER_TESS_EVAL || stage == MESA_SHADER_GEOMETRY) &&
if (st->lower_point_size && prog->skip_pointsize_xfb &&
stage < MESA_SHADER_FRAGMENT && stage != MESA_SHADER_TESS_CTRL &&
st_can_add_pointsize_to_program(st, prog)) {
struct gl_shader *sh = NULL;
for (unsigned i = 0; i < shader_program->NumShaders; i++) {
if (shader_program->Shaders[i]->Stage == nir->info.stage) {
sh = shader_program->Shaders[i];
break;
}
}
assert(sh);
bool add_point_size = false;
if (nir->info.stage == MESA_SHADER_TESS_EVAL) {
if (!sh->OES_tessellation_point_size_enable)
add_point_size = true;
} else {
if (!sh->OES_geometry_point_size_enable)
add_point_size = true;
}
if (add_point_size)
NIR_PASS_V(nir, st_nir_add_point_size);
NIR_PASS_V(nir, st_nir_add_point_size);
}
/* ES has strict SSO validation rules for shader IO matching so we can't