nv2a: Improve handling of SET_POINT_SIZE

This commit is contained in:
Erik Abair
2025-11-28 15:17:11 -07:00
committed by GitHub
parent 7ebabd852a
commit aa496f863f
4 changed files with 15 additions and 6 deletions
+1 -1
View File
@@ -1049,7 +1049,7 @@
# define NV097_SET_TEXGEN_Q 0x000003CC
# define NV097_SET_TEXTURE_MATRIX_ENABLE 0x00000420
# define NV097_SET_POINT_SIZE 0x0000043C
# define NV097_SET_POINT_SIZE_V 0x000001FF
# define NV097_SET_POINT_SIZE_V_MAX 0x1FF
# define NV097_SET_PROJECTION_MATRIX 0x00000440
# define NV097_SET_MODEL_VIEW_MATRIX 0x00000480
# define NV097_SET_INVERSE_MODEL_VIEW_MATRIX 0x00000580
+2 -1
View File
@@ -500,7 +500,8 @@ GLSL_DEFINE(materialEmissionColor, GLSL_LTCTXA(NV_IGRAPH_XF_LTCTXA_CM_COL) ".xyz
" oPts.x = clamp(oPts.x * pointParams[3] + pointParams[7], ptMinSize, ptMaxSize) * %d;\n",
state->surface_scale_factor);
} else {
mstring_append_fmt(body, " oPts.x = %f * %d;\n", state->point_size,
mstring_append_fmt(body, " oPts.x = %f * %d;\n",
MAX(1.f, state->point_size),
state->surface_scale_factor);
}
}
+7 -3
View File
@@ -130,9 +130,7 @@ void pgraph_glsl_set_vsh_state(PGRAPHState *pg, VshState *vsh)
vsh->point_params_enable = GET_MASK(pgraph_reg_r(pg, NV_PGRAPH_CSV0_D),
NV_PGRAPH_CSV0_D_POINTPARAMSENABLE);
vsh->point_size = GET_MASK(pgraph_reg_r(pg, NV_PGRAPH_POINTSIZE),
NV097_SET_POINT_SIZE_V) /
8.0f;
vsh->point_size = pgraph_reg_r(pg, NV_PGRAPH_POINTSIZE) / 8.0f;
if (vsh->point_params_enable) {
for (int i = 0; i < 8; i++) {
vsh->point_params[i] = pg->point_params[i];
@@ -306,6 +304,12 @@ MString *pgraph_glsl_gen_vsh(const VshState *state, GenVshGlslOptions opts)
pgraph_glsl_gen_vsh_prog(
VSH_VERSION_XVS, (uint32_t *)state->programmable.program_data,
state->programmable.program_length, header, body);
if (!state->point_params_enable) {
mstring_append_fmt(body, " oPts.x = %f * %d;\n",
state->point_size <= 0.f ? 1.f :
state->point_size,
state->surface_scale_factor);
}
}
if (!state->fog_enable) {
+5 -1
View File
@@ -1729,7 +1729,11 @@ DEF_METHOD_INC(NV097, SET_TEXTURE_MATRIX_ENABLE)
DEF_METHOD(NV097, SET_POINT_SIZE)
{
PG_SET_MASK(NV_PGRAPH_POINTSIZE, NV097_SET_POINT_SIZE_V, parameter);
if (parameter > NV097_SET_POINT_SIZE_V_MAX) {
return;
}
pgraph_reg_w(pg, NV_PGRAPH_POINTSIZE, parameter);
}
DEF_METHOD_INC(NV097, SET_PROJECTION_MATRIX)