[PATCH] WineD3D: Initialize the texture op function properly=0A=
Stefan Doesinger
stefan at codeweavers.com
Fri Aug 1 11:47:24 CDT 2008
=0A=
Initializes a few unused, but still hashed members in the D3DTOP_DISABLE=0A=
case, and makes sure the padding doesn't add malicious randomness.=0A=
---=0A=
dlls/wined3d/utils.c | 3 +++=0A=
dlls/wined3d/wined3d_private.h | 3 ++-=0A=
2 files changed, 5 insertions(+), 1 deletions(-)=0A=
=0A=
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c=0A=
index a9fc780..98f7eef 100644=0A=
--- a/dlls/wined3d/utils.c=0A=
+++ b/dlls/wined3d/utils.c=0A=
@@ -1792,6 +1792,7 @@ void gen_ffp_op(IWineD3DStateBlockImpl =
*stateblock, struct ffp_settings *setting=0A=
=0A=
for(i =3D 0; i < GL_LIMITS(texture_stages); i++) {=0A=
IWineD3DBaseTextureImpl *texture;=0A=
+ settings->op[i].padding =3D 0;=0A=
if(stateblock->textureState[i][WINED3DTSS_COLOROP] =3D=3D =
WINED3DTOP_DISABLE) {=0A=
settings->op[i].cop =3D WINED3DTOP_DISABLE;=0A=
settings->op[i].aop =3D WINED3DTOP_DISABLE;=0A=
@@ -1800,6 +1801,8 @@ void gen_ffp_op(IWineD3DStateBlockImpl =
*stateblock, struct ffp_settings *setting=0A=
settings->op[i].aarg0 =3D settings->op[i].aarg1 =3D =
settings->op[i].aarg2 =3D 0x3F;=0A=
settings->op[i].color_correction =3D WINED3DFMT_UNKNOWN;=0A=
settings->op[i].dst =3D resultreg;=0A=
+ settings->op[i].tex_type =3D tex_1d;=0A=
+ settings->op[i].projected =3D proj_none;=0A=
i++;=0A=
break;=0A=
}=0A=
diff --git a/dlls/wined3d/wined3d_private.h =
b/dlls/wined3d/wined3d_private.h=0A=
index 7ba6617..453c92a 100644=0A=
--- a/dlls/wined3d/wined3d_private.h=0A=
+++ b/dlls/wined3d/wined3d_private.h=0A=
@@ -745,9 +745,10 @@ struct texture_stage_op=0A=
unsigned cop : 5, aop : 5;=0A=
unsigned carg1 : 6, carg2 : 6, carg0 : 6;=0A=
unsigned tex_type : 3;=0A=
- unsigned dst : 1;=0A=
+ unsigned dst : 1; /* Total of =
32 bits */=0A=
unsigned aarg1 : 6, aarg2 : 6, aarg0 : 6;=0A=
unsigned projected : 2;=0A=
+ unsigned padding : 12; /* Total of =
64 bits */=0A=
WINED3DFORMAT color_correction;=0A=
};=0A=
=0A=
-- =0A=
1.5.4.5=0A=
=0A=
------=_NextPart_000_0001_01C8F507.54194EA0--
More information about the wine-patches
mailing list