nv2a: Drop some unnecessary comments

This commit is contained in:
Matt Borgerson 2025-06-28 00:08:45 -07:00 committed by mborgerson
parent c88bac1706
commit 45724b34e6
5 changed files with 0 additions and 25 deletions

View File

@ -864,7 +864,6 @@ static MString* psh_convert(struct PixelShader *ps)
" vec2(-1.0, 1.0),vec2(0.0, 1.0),vec2(1.0, 1.0));\n"
);
/* Window Clipping */
MString *clip = mstring_new();
mstring_append_fmt(clip, "/* Window-clip (%slusive) */\n",
ps->state.window_clip_exclusive ? "Exc" : "Inc");
@ -891,7 +890,6 @@ static MString* psh_convert(struct PixelShader *ps)
"}\n");
}
/* Depth clipping */
if (ps->state.depth_clipping) {
if (ps->state.z_perspective) {
mstring_append(
@ -1437,7 +1435,6 @@ MString *pgraph_gen_psh_glsl(const PshState state, GenPshGlslOptions opts)
void pgraph_set_psh_uniform_values(PGRAPHState *pg, const PshUniformLocs locs,
PshUniformValues *values)
{
/* update combiner constants */
if (locs[PshUniform_consts] != -1) {
for (int i = 0; i < 9; i++) {
uint32_t constant[2];
@ -1477,7 +1474,6 @@ void pgraph_set_psh_uniform_values(PGRAPHState *pg, const PshUniformLocs locs,
}
}
/* For each texture stage */
for (int i = 0; i < NV2A_MAX_TEXTURES; i++) {
/* Bump luminance only during stages 1 - 3 */
if (i > 0) {
@ -1568,7 +1564,6 @@ void pgraph_set_psh_uniform_values(PGRAPHState *pg, const PshUniformLocs locs,
values->depthOffset[0] = zbias;
}
/* Clipping regions */
unsigned int max_gl_width = pg->surface_binding_dim.width;
unsigned int max_gl_height = pg->surface_binding_dim.height;
pgraph_apply_scaling_factor(pg, &max_gl_width, &max_gl_height);

View File

@ -35,7 +35,6 @@ void pgraph_gen_vsh_ff_glsl(const VshState *state, MString *header,
{
int i, j;
/* generate vertex shader mimicking fixed function */
mstring_append(header,
"#define position v0\n"
"#define weight v1\n"
@ -111,7 +110,6 @@ GLSL_DEFINE(materialEmissionColor, GLSL_LTCTXA(NV_IGRAPH_XF_LTCTXA_CM_COL) ".xyz
"\n"
);
/* Skinning */
unsigned int count;
bool mix;
switch (state->fixed_function.skinning) {
@ -143,12 +141,10 @@ GLSL_DEFINE(materialEmissionColor, GLSL_LTCTXA(NV_IGRAPH_XF_LTCTXA_CM_COL) ".xyz
"tNormal", "vec4(normal, 0.0)",
"invModelViewMat", "xyz");
/* Normalization */
if (state->fixed_function.normalization) {
mstring_append(body, "tNormal = normalize(tNormal);\n");
}
/* Texgen */
for (i = 0; i < NV2A_MAX_TEXTURES; i++) {
mstring_append_fmt(body, "/* Texgen for stage %d */\n",
i);
@ -213,7 +209,6 @@ GLSL_DEFINE(materialEmissionColor, GLSL_LTCTXA(NV_IGRAPH_XF_LTCTXA_CM_COL) ".xyz
}
}
/* Apply texture matrices */
for (i = 0; i < NV2A_MAX_TEXTURES; i++) {
if (state->fixed_function.texture_matrix_enable[i]) {
mstring_append_fmt(body,
@ -222,7 +217,6 @@ GLSL_DEFINE(materialEmissionColor, GLSL_LTCTXA(NV_IGRAPH_XF_LTCTXA_CM_COL) ".xyz
}
}
/* Lighting */
if (!state->fixed_function.lighting) {
mstring_append(body, " oD0 = diffuse;\n");
mstring_append(body, " oD1 = specular;\n");
@ -417,9 +411,7 @@ GLSL_DEFINE(materialEmissionColor, GLSL_LTCTXA(NV_IGRAPH_XF_LTCTXA_CM_COL) ".xyz
}
}
/* Fog */
if (state->fog_enable) {
/* From: https://www.opengl.org/registry/specs/NV/fog_distance.txt */
switch(state->fixed_function.foggen) {
case FOGGEN_SPEC_ALPHA:

View File

@ -175,8 +175,6 @@ MString *pgraph_gen_vsh_glsl(const VshState *state,
state->programmable.program_length, header, body);
}
/* Fog */
if (state->fog_enable) {
if (!state->is_fixed_function) {
@ -240,7 +238,6 @@ MString *pgraph_gen_vsh_glsl(const VshState *state,
assert(false);
break;
}
/* Calculate absolute for the modes which need it */
switch (state->fog_mode) {
case FOG_MODE_LINEAR_ABS:
case FOG_MODE_EXP_ABS:
@ -264,7 +261,6 @@ MString *pgraph_gen_vsh_glsl(const VshState *state,
mstring_append(body, " oFog = vec4(1.0);\n");
}
/* Set outputs */
mstring_append(body, "\n"
" vtxD0 = clamp(NaNToOne(oD0), 0.0, 1.0);\n"
" vtxB0 = clamp(NaNToOne(oB0), 0.0, 1.0);\n"
@ -405,7 +401,6 @@ void pgraph_set_vsh_uniform_values(PGRAPHState *pg, const VshState *state,
}
if (state->is_fixed_function) {
/* update lighting constants */
if (locs[VshUniform_ltctxa] != -1) {
QEMU_BUILD_BUG_MSG(sizeof(values->ltctxa) != sizeof(pg->ltctxa),
"Uniform value size inconsistency");

View File

@ -52,7 +52,6 @@ enum ConvolutionFilter {
};
typedef struct PshState {
/* fragment shader - register combiner stuff */
uint32_t combiner_control;
uint32_t shader_stage_program;
uint32_t other_stage_input;

View File

@ -59,7 +59,6 @@ static void set_fixed_function_vsh_state(PGRAPHState *pg,
ff->local_eye =
GET_MASK(pgraph_reg_r(pg, NV_PGRAPH_CSV0_C), NV_PGRAPH_CSV0_C_LOCALEYE);
/* color material */
ff->emission_src = (enum MaterialColorSource)GET_MASK(
pgraph_reg_r(pg, NV_PGRAPH_CSV0_C), NV_PGRAPH_CSV0_C_EMISSION);
ff->ambient_src = (enum MaterialColorSource)GET_MASK(
@ -69,12 +68,10 @@ static void set_fixed_function_vsh_state(PGRAPHState *pg,
ff->specular_src = (enum MaterialColorSource)GET_MASK(
pgraph_reg_r(pg, NV_PGRAPH_CSV0_C), NV_PGRAPH_CSV0_C_SPECULAR);
/* Texture matrices */
for (int i = 0; i < 4; i++) {
ff->texture_matrix_enable[i] = pg->texture_matrix_enable[i];
}
/* Texgen */
for (int i = 0; i < 4; i++) {
unsigned int reg = (i < 2) ? NV_PGRAPH_CSV1_A : NV_PGRAPH_CSV1_B;
for (int j = 0; j < 4; j++) {
@ -89,7 +86,6 @@ static void set_fixed_function_vsh_state(PGRAPHState *pg,
}
}
/* Lighting */
ff->lighting =
GET_MASK(pgraph_reg_r(pg, NV_PGRAPH_CSV0_C), NV_PGRAPH_CSV0_C_LIGHTING);
if (ff->lighting) {
@ -170,7 +166,6 @@ static void set_vsh_state(PGRAPHState *pg, VshState *vsh)
NV_PGRAPH_CONTROL_3_SHADEMODE) ==
NV_PGRAPH_CONTROL_3_SHADEMODE_SMOOTH;
/* Fog */
vsh->fog_enable =
pgraph_reg_r(pg, NV_PGRAPH_CONTROL_3) & NV_PGRAPH_CONTROL_3_FOGENABLE;
if (vsh->fog_enable) {
@ -229,7 +224,6 @@ static void set_psh_state(PGRAPHState *pg, PshState *psh)
NV_PGRAPH_ZCOMPRESSOCCLUDE_ZCLAMP_EN) ==
NV_PGRAPH_ZCOMPRESSOCCLUDE_ZCLAMP_EN_CULL;
/* Copy content of enabled combiner stages */
int num_stages = pgraph_reg_r(pg, NV_PGRAPH_COMBINECTL) & 0xFF;
for (int i = 0; i < num_stages; i++) {
psh->rgb_inputs[i] = pgraph_reg_r(pg, NV_PGRAPH_COMBINECOLORI0 + i * 4);