mesa/st: also add pointsize to fixedfunction vertex shaders as needed

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-04-04 11:35:21 -04:00
parent d773055d92
commit 2b626af110
3 changed files with 7 additions and 2 deletions

View File

@@ -255,7 +255,7 @@ st_nir_assign_uniform_locations(struct gl_context *ctx,
* - find every gl_Position write
* - store 1.0 to gl_PointSizeMESA after every gl_Position write
*/
static void
void
st_nir_add_point_size(nir_shader *nir)
{
nir_variable *psiz = nir_variable_create(nir, nir_var_shader_out, glsl_float_type(), "gl_PointSizeMESA");

View File

@@ -72,7 +72,8 @@ st_nir_make_passthrough_shader(struct st_context *st,
unsigned *output_locations,
unsigned *interpolation_modes,
unsigned sysval_mask);
void
st_nir_add_point_size(struct nir_shader *nir);
#ifdef __cplusplus
}
#endif

View File

@@ -2104,6 +2104,10 @@ st_program_string_notify( struct gl_context *ctx,
} else if (target == GL_VERTEX_PROGRAM_ARB) {
if (!st_translate_vertex_program(st, prog))
return false;
if (st->lower_point_size && st_can_add_pointsize_to_program(st, prog)) {
prog->skip_pointsize_xfb = true;
NIR_PASS_V(prog->nir, st_nir_add_point_size);
}
} else {
if (!st_translate_common_program(st, prog))
return false;