nv2a: Scale point sprites by surface scaling factor

This commit is contained in:
Matt Borgerson 2021-07-20 03:00:27 -07:00 committed by mborgerson
parent 52c670141a
commit 5778854dbd
3 changed files with 9 additions and 3 deletions

View File

@ -3845,6 +3845,8 @@ static void pgraph_bind_shaders(PGRAPHState *pg)
ShaderState state;
memset(&state, 0, sizeof(ShaderState));
state.surface_scale_factor = pg->surface_scale_factor;
state.compressed_attrs = pg->compressed_attrs;
/* register combiner stuff */

View File

@ -663,10 +663,12 @@ GLSL_DEFINE(materialEmissionColor, GLSL_LTCTXA(NV_IGRAPH_XF_LTCTXA_CM_COL) ".xyz
" oPts.x = 1/sqrt(%f + %f*d_e + %f*d_e*d_e) + %f;\n",
state.point_params[0], state.point_params[1], state.point_params[2],
state.point_params[6]);
mstring_append_fmt(body, " oPts.x = min(oPts.x*%f + %f, 64.0);\n",
state.point_params[3], state.point_params[7]);
mstring_append_fmt(body, " oPts.x = min(oPts.x*%f + %f, 64.0) * %d;\n",
state.point_params[3], state.point_params[7],
state.surface_scale_factor);
} else {
mstring_append_fmt(body, " oPts.x = %f;\n", state.point_size);
mstring_append_fmt(body, " oPts.x = %f * %d;\n", state.point_size,
state.surface_scale_factor);
}
mstring_append(body, " vtx.inv_w = 1.0 / oPos.w;\n");

View File

@ -55,6 +55,8 @@ enum MaterialColorSource {
};
typedef struct ShaderState {
unsigned int surface_scale_factor;
PshState psh;
uint16_t compressed_attrs;