wined3d: Remove the no longer used Y correction variable.

This commit is contained in:
Elizabeth Figura 2024-03-15 19:28:33 -05:00 committed by Alexandre Julliard
parent d1ce00e429
commit ba1ddc62ef
4 changed files with 9 additions and 46 deletions

View file

@ -3607,7 +3607,6 @@ void context_state_fb(struct wined3d_context *context, const struct wined3d_stat
wined3d_context_gl_apply_draw_buffers(context_gl, rt_mask);
*cur_mask = rt_mask;
}
context->constant_update_mask |= WINED3D_SHADER_CONST_PS_Y_CORR;
}
static void wined3d_context_gl_map_stage(struct wined3d_context_gl *context_gl, unsigned int stage, unsigned int unit)

View file

@ -227,7 +227,6 @@ struct glsl_ps_program
GLint fog_end_location;
GLint fog_scale_location;
GLint alpha_test_ref_location;
GLint ycorrection_location;
GLint np2_fixup_location;
GLint color_key_location;
const struct ps_np2fixup_info *np2_fixup_info;
@ -1918,20 +1917,6 @@ static void shader_glsl_load_constants(struct shader_glsl_priv *priv,
checkGLcall("bump env uniforms");
}
if (update_mask & WINED3D_SHADER_CONST_PS_Y_CORR)
{
const struct wined3d_vec4 correction_params =
{
/* Position is relative to the framebuffer, not the viewport. */
0.0f,
1.0f,
0.0f,
0.0f,
};
GL_EXTCALL(glUniform4fv(prog->ps.ycorrection_location, 1, &correction_params.x));
}
if (update_mask & WINED3D_SHADER_CONST_PS_NP2_FIXUP)
shader_glsl_load_np2fixup_constants(&prog->ps, gl_info, state);
if (update_mask & WINED3D_SHADER_CONST_FFP_COLOR_KEY)
@ -4236,9 +4221,6 @@ static void shader_glsl_pow(const struct wined3d_shader_instruction *ins)
/* Map the opcode 1-to-1 to the GL code (arg->dst = instruction(src0, src1, ...) */
static void shader_glsl_map2gl(const struct wined3d_shader_instruction *ins)
{
const struct shader_glsl_ctx_priv *priv = ins->ctx->backend_data;
bool y_correction = ins->ctx->reg_maps->shader_version.type == WINED3D_SHADER_TYPE_PIXEL
? priv->cur_ps_args->y_correction : false;
struct wined3d_string_buffer *buffer = ins->ctx->buffer;
struct glsl_src_param src_param;
const char *instruction;
@ -4255,9 +4237,9 @@ static void shader_glsl_map2gl(const struct wined3d_shader_instruction *ins)
case WINED3DSIH_DSX: instruction = "dFdx"; break;
case WINED3DSIH_DSX_COARSE: instruction = "dFdxCoarse"; break;
case WINED3DSIH_DSX_FINE: instruction = "dFdxFine"; break;
case WINED3DSIH_DSY: instruction = y_correction ? "ycorrection.y * dFdy" : "dFdy"; break;
case WINED3DSIH_DSY_COARSE: instruction = y_correction ? "ycorrection.y * dFdyCoarse" : "dFdyCoarse"; break;
case WINED3DSIH_DSY_FINE: instruction = y_correction ? "ycorrection.y * dFdyFine" : "dFdyFine"; break;
case WINED3DSIH_DSY: instruction = "dFdy"; break;
case WINED3DSIH_DSY_COARSE: instruction = "dFdyCoarse"; break;
case WINED3DSIH_DSY_FINE: instruction = "dFdyFine"; break;
case WINED3DSIH_FIRSTBIT_HI: instruction = "findMSB"; break;
case WINED3DSIH_FIRSTBIT_LO: instruction = "findLSB"; break;
case WINED3DSIH_FIRSTBIT_SHI: instruction = "findMSB"; break;
@ -8019,20 +8001,12 @@ static GLuint shader_glsl_generate_fragment_shader(const struct wined3d_context_
shader_glsl_append_imm_vec(buffer, &wined3d_srgb_const[1].x, 4, gl_info);
shader_addline(buffer, ";\n");
}
if (reg_maps->vpos && !gl_info->supported[ARB_FRAGMENT_COORD_CONVENTIONS])
{
++extra_constants_needed;
shader_addline(buffer, "uniform vec4 ycorrection;\n");
}
if (reg_maps->vpos)
{
if (gl_info->supported[ARB_FRAGMENT_COORD_CONVENTIONS])
{
if (context_gl->c.d3d_info->wined3d_creation_flags & WINED3D_PIXEL_CENTER_INTEGER)
shader_addline(buffer, "layout(%spixel_center_integer) in vec4 gl_FragCoord;\n",
args->y_correction ? "origin_upper_left, " : "");
else if (args->y_correction)
shader_addline(buffer, "layout(origin_upper_left) in vec4 gl_FragCoord;\n");
shader_addline(buffer, "layout(pixel_center_integer) in vec4 gl_FragCoord;\n");
}
shader_addline(buffer, "vec4 vpos;\n");
}
@ -8123,14 +8097,11 @@ static GLuint shader_glsl_generate_fragment_shader(const struct wined3d_context_
* on drivers that returns integer values. */
if (reg_maps->vpos)
{
if (gl_info->supported[ARB_FRAGMENT_COORD_CONVENTIONS])
shader_addline(buffer, "vpos = gl_FragCoord;\n");
else if (context_gl->c.d3d_info->wined3d_creation_flags & WINED3D_PIXEL_CENTER_INTEGER)
shader_addline(buffer,
"vpos = floor(vec4(0, ycorrection[0], 0, 0) + gl_FragCoord * vec4(1, ycorrection[1], 1, 1));\n");
if (!gl_info->supported[ARB_FRAGMENT_COORD_CONVENTIONS]
&& (context_gl->c.d3d_info->wined3d_creation_flags & WINED3D_PIXEL_CENTER_INTEGER))
shader_addline(buffer, "vpos = floor(gl_FragCoord);\n");
else
shader_addline(buffer,
"vpos = vec4(0, ycorrection[0], 0, 0) + gl_FragCoord * vec4(1, ycorrection[1], 1, 1);\n");
shader_addline(buffer, "vpos = gl_FragCoord;\n");
}
if (reg_maps->shader_version.major < 3 || args->vp_mode != WINED3D_VP_MODE_SHADER)
@ -10342,7 +10313,6 @@ static void shader_glsl_init_ps_uniform_locations(const struct wined3d_gl_info *
ps->alpha_test_ref_location = GL_EXTCALL(glGetUniformLocation(program_id, "alpha_test_ref"));
ps->np2_fixup_location = GL_EXTCALL(glGetUniformLocation(program_id, "ps_samplerNP2Fixup"));
ps->ycorrection_location = GL_EXTCALL(glGetUniformLocation(program_id, "ycorrection"));
ps->color_key_location = GL_EXTCALL(glGetUniformLocation(program_id, "color_key"));
string_buffer_release(&priv->string_buffers, name);
@ -10862,8 +10832,6 @@ static void set_glsl_shader_program(const struct wined3d_context_gl *context_gl,
entry->constant_update_mask |= WINED3D_SHADER_CONST_PS_I;
if (pshader->reg_maps.boolean_constants)
entry->constant_update_mask |= WINED3D_SHADER_CONST_PS_B;
if (entry->ps.ycorrection_location != -1)
entry->constant_update_mask |= WINED3D_SHADER_CONST_PS_Y_CORR;
shader_glsl_load_program_resources(context_gl, priv, program_id, pshader);
shader_glsl_load_images(gl_info, priv, program_id, &pshader->reg_maps);

View file

@ -3054,8 +3054,6 @@ void find_ps_compile_args(const struct wined3d_state *state, const struct wined3
if (d3d_info->emulated_flatshading)
args->flatshading = state->render_states[WINED3D_RS_SHADEMODE] == WINED3D_SHADE_FLAT;
args->y_correction = 0;
for (i = 0; i < ARRAY_SIZE(state->fb.render_targets); ++i)
{
struct wined3d_rendertarget_view *rtv = state->fb.render_targets[i];

View file

@ -523,7 +523,6 @@ enum wined3d_shader_resource_type
#define WINED3D_SHADER_CONST_PS_BUMP_ENV 0x00000200
#define WINED3D_SHADER_CONST_PS_FOG 0x00000400
#define WINED3D_SHADER_CONST_PS_ALPHA_TEST 0x00000800
#define WINED3D_SHADER_CONST_PS_Y_CORR 0x00001000
#define WINED3D_SHADER_CONST_PS_NP2_FIXUP 0x00002000
#define WINED3D_SHADER_CONST_FFP_MODELVIEW 0x00004000
#define WINED3D_SHADER_CONST_FFP_VERTEXBLEND 0x00008000
@ -1499,10 +1498,9 @@ struct ps_compile_args
DWORD pointsprite : 1;
DWORD flatshading : 1;
DWORD alpha_test_func : 3;
DWORD y_correction : 1;
DWORD rt_alpha_swizzle : 8; /* WINED3D_MAX_RENDER_TARGETS, 8 */
DWORD dual_source_blend : 1;
DWORD padding : 17;
DWORD padding : 18;
};
enum fog_src_type