From 5bc0e91ddfb5261ab588ef9df7bd72e90750a692 Mon Sep 17 00:00:00 2001 From: "H. Verbeet" Date: Tue, 26 Sep 2006 20:31:36 +0200 Subject: [PATCH] wined3d: Don't overwrite the position y offset in ARB vertex programs. --- dlls/wined3d/vertexshader.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/dlls/wined3d/vertexshader.c b/dlls/wined3d/vertexshader.c index 2d7ab5872f3..19eb21c5d8a 100644 --- a/dlls/wined3d/vertexshader.c +++ b/dlls/wined3d/vertexshader.c @@ -786,19 +786,20 @@ static VOID IWineD3DVertexShaderImpl_GenerateShader( if (reg_maps->fog) shader_addline(&buffer, "MAX result.fogcoord, TMP_FOG, 0.0;\n"); - shader_addline(&buffer, "MOV result.position, TMP_OUT;\n"); /* Write the final position. * * OpenGL coordinates specify the center of the pixel while d3d coords specify * the corner. The offsets are stored in the 2nd row of the projection matrix, * the x offset in z and the y offset in w. Add them to the resulting position */ - shader_addline(&buffer, "ADD result.position.x, TMP_OUT.x, posFixup.z;\n"); - shader_addline(&buffer, "ADD result.position.y, TMP_OUT.y, posFixup.w;\n"); + shader_addline(&buffer, "ADD TMP_OUT.x, TMP_OUT.x, posFixup.z;\n"); + shader_addline(&buffer, "ADD TMP_OUT.y, TMP_OUT.y, posFixup.w;\n"); /* Account for any inverted textures (render to texture case) by reversing the y coordinate * (this is handled in drawPrim() when it sets the MODELVIEW and PROJECTION matrices) */ - shader_addline(&buffer, "MUL result.position.y, TMP_OUT.y, posFixup.y;\n"); + shader_addline(&buffer, "MUL TMP_OUT.y, TMP_OUT.y, posFixup.y;\n"); + + shader_addline(&buffer, "MOV result.position, TMP_OUT;\n"); shader_addline(&buffer, "END\n\0"); -- 2.11.4.GIT