Module: wine
Branch: master
Commit: 3f5936f6f7dc5560e0ad56e25bd0c9c421f0fba4
URL: http://source.winehq.org/git/wine.git/?a=commit;h=3f5936f6f7dc5560e0ad56e25…
Author: Stefan Dösinger <stefan(a)codeweavers.com>
Date: Sun May 31 16:38:05 2009 +0200
wined3d: Don't set unloaded arrays to zero.
This causes memory corruption on MacOS, even if the app does not
reference undeclared arrays. Trying to avoid potential breakage in
broken apps which provoke undefined behavior is pointless if it causes
actual breakage in well-behaved apps (on ill-behaved drivers).
---
dlls/wined3d/state.c | 8 --------
1 files changed, 0 insertions(+), 8 deletions(-)
diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index 1e09385..c468d2b 100644
--- a/dlls/wined3d/state.c
+++ b/dlls/wined3d/state.c
@@ -3828,14 +3828,6 @@ static inline void unload_numbered_array(IWineD3DStateBlockImpl *stateblock, Win
{
GL_EXTCALL(glDisableVertexAttribArrayARB(i));
checkGLcall("glDisableVertexAttribArrayARB(reg)");
- /* Some Windows drivers(NV GF 7) use the latest value that was used when drawing with the now
- * deactivated stream disabled, some other drivers(ATI, NV GF 8) set the undefined values to 0x00.
- * Let's set them to 0x00 to avoid hitting some undefined aspects of OpenGL. All that is really
- * important here is the glDisableVertexAttribArrayARB call above. The test shows that the refrast
- * keeps dereferencing the pointers, which would cause crashes in some games like Half Life 2: Episode Two.
- */
- GL_EXTCALL(glVertexAttrib4NubARB(i, 0, 0, 0, 0));
- checkGLcall("glVertexAttrib4NubARB(i, 0, 0, 0, 0)");
context->numbered_array_mask &= ~(1 << i);
}
Module: wine
Branch: master
Commit: 8e259d9fcdaaa75a9086d0d2e58d71375c61b38c
URL: http://source.winehq.org/git/wine.git/?a=commit;h=8e259d9fcdaaa75a9086d0d2e…
Author: Stefan Dösinger <stefan(a)codeweavers.com>
Date: Fri May 29 23:01:07 2009 +0200
wined3d: A small atifs bump map improvement.
Thanks to Roland Scheidegger from Tungsten Graphics for the suggestion to
replace the 2 movs + dp2add with two MADs, where one can conveniently be
coissued with the other dp2add.
---
dlls/wined3d/ati_fragment_shader.c | 35 +++++++++++++++--------------------
1 files changed, 15 insertions(+), 20 deletions(-)
diff --git a/dlls/wined3d/ati_fragment_shader.c b/dlls/wined3d/ati_fragment_shader.c
index 1baf9ba..1f6f203 100644
--- a/dlls/wined3d/ati_fragment_shader.c
+++ b/dlls/wined3d/ati_fragment_shader.c
@@ -423,13 +423,6 @@ static GLuint gen_ati_shader(const struct texture_stage_op op[MAX_TEXTURES], con
GL_EXTCALL(glPassTexCoordATI(GL_REG_0_ATI + stage + 1,
GL_TEXTURE0_ARB + stage + 1,
swizzle));
-
- /* We need GL_REG_5_ATI as a temporary register to swizzle the bump matrix. So we run into
- * issues if we're bump mapping on stage 4 or 5
- */
- if(stage >= 4) {
- FIXME("Bump mapping in stage %d\n", stage);
- }
}
/* Pass 2: Generate perturbation calculations */
@@ -460,22 +453,24 @@ static GLuint gen_ati_shader(const struct texture_stage_op op[MAX_TEXTURES], con
ATI_FFP_CONST_BUMPMAT(stage), GL_NONE, GL_2X_BIT_ATI | GL_BIAS_BIT_ATI,
GL_REG_0_ATI + stage + 1, GL_RED, GL_NONE);
- /* FIXME: How can I make GL_DOT2_ADD_ATI read the factors from blue and alpha? It defaults to red and green,
- * and it is fairly easy to make it read GL_BLUE or BL_ALPHA, but I can't get an R * B + G * A. So we're wasting
- * one register and two instructions in this pass for a simple swizzling operation.
- * For starters it might be good enough to merge the two movs into one, but even that isn't possible :-(
+ /* Don't use GL_DOT2_ADD_ATI here because we cannot configure it to read the blue and alpha
+ * component of the bump matrix. Instead do this with two MADs:
+ *
+ * coord.a = tex.r * bump.b + coord.g
+ * coord.g = tex.g * bump.a + coord.a
*
- * NOTE: GL_BLUE | GL_ALPHA is not possible. It doesn't throw a compilation error, but an OR operation on the
- * constants doesn't make sense, considering their values.
+ * The first instruction writes to alpha so it can be coissued with the above DOT2_ADD.
+ * coord.a is unused. If the perturbed texture is projected, this was already handled
+ * in the glPassTexCoordATI above.
*/
- wrap_op1(gl_info, GL_MOV_ATI, GL_REG_5_ATI, GL_RED_BIT_ATI, GL_NONE,
- ATI_FFP_CONST_BUMPMAT(stage), GL_BLUE, GL_NONE);
- wrap_op1(gl_info, GL_MOV_ATI, GL_REG_5_ATI, GL_GREEN_BIT_ATI, GL_NONE,
- ATI_FFP_CONST_BUMPMAT(stage), GL_ALPHA, GL_NONE);
- wrap_op3(gl_info, GL_DOT2_ADD_ATI, GL_REG_0_ATI + stage + 1, GL_GREEN_BIT_ATI, GL_NONE,
- GL_REG_0_ATI + stage, GL_NONE, argmodextra_y,
- GL_REG_5_ATI, GL_NONE, GL_2X_BIT_ATI | GL_BIAS_BIT_ATI,
+ wrap_op3(gl_info, GL_MAD_ATI, GL_REG_0_ATI + stage + 1, GL_ALPHA, GL_NONE,
+ GL_REG_0_ATI + stage, GL_RED, argmodextra_y,
+ ATI_FFP_CONST_BUMPMAT(stage), GL_BLUE, GL_NONE,
GL_REG_0_ATI + stage + 1, GL_GREEN, GL_NONE);
+ wrap_op3(gl_info, GL_MAD_ATI, GL_REG_0_ATI + stage + 1, GL_GREEN_BIT_ATI, GL_NONE,
+ GL_REG_0_ATI + stage, GL_GREEN, argmodextra_y,
+ ATI_FFP_CONST_BUMPMAT(stage), GL_ALPHA, GL_NONE,
+ GL_REG_0_ATI + stage + 1, GL_ALPHA, GL_NONE);
}
/* Pass 3: Generate sampling instructions for regular textures */