Henri Verbeet : wined3d: Completely initialize "correction_params" in shader_glsl_load_constants() (Valgrind).
Alexandre Julliard
julliard at wine.codeweavers.com
Tue Apr 21 09:57:27 CDT 2015
Module: wine
Branch: master
Commit: de1450788b99f8976b1c49b74d352f6a24bb2cde
URL: http://source.winehq.org/git/wine.git/?a=commit;h=de1450788b99f8976b1c49b74d352f6a24bb2cde
Author: Henri Verbeet <hverbeet at codeweavers.com>
Date: Tue Apr 21 12:25:52 2015 +0200
wined3d: Completely initialize "correction_params" in shader_glsl_load_constants() (Valgrind).
Leaving the last two elements uninitialized is mostly harmless since the
shader doesn't actually use them, but the driver might try to do some kind of
analysis on them.
---
dlls/wined3d/glsl_shader.c | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c
index b1a0f85..84fc1a2 100644
--- a/dlls/wined3d/glsl_shader.c
+++ b/dlls/wined3d/glsl_shader.c
@@ -944,17 +944,15 @@ static void shader_glsl_load_constants(void *shader_priv, struct wined3d_context
if (update_mask & WINED3D_SHADER_CONST_PS_Y_CORR)
{
- float correction_params[4];
-
- if (context->render_offscreen)
+ float correction_params[] =
{
- correction_params[0] = 0.0f;
- correction_params[1] = 1.0f;
- } else {
/* position is window relative, not viewport relative */
- correction_params[0] = (float) context->current_rt->resource.height;
- correction_params[1] = -1.0f;
- }
+ context->render_offscreen ? 0.0f : (float)context->current_rt->resource.height,
+ context->render_offscreen ? 1.0f : -1.0f,
+ 0.0f,
+ 0.0f,
+ };
+
GL_EXTCALL(glUniform4fv(prog->ps.ycorrection_location, 1, correction_params));
}
More information about the wine-cvs
mailing list