Module: wine Branch: master Commit: 1b335dfaaa8fc2f2a45c5979beecaae84e019ae3 URL: http://source.winehq.org/git/wine.git/?a=commit;h=1b335dfaaa8fc2f2a45c5979be...
Author: Tobias Jakobi liquid.acid@gmx.net Date: Thu Mar 26 03:15:21 2009 +0100
wined3d: Add texrect_fixup bitfield to ps_compile_args struct.
Initialization of the bitfield done in find_ps_compile_args based on the previously introduced pow2Matrix_identity flag.
---
dlls/wined3d/pixelshader.c | 6 ++++++ dlls/wined3d/wined3d_private.h | 6 +++++- 2 files changed, 11 insertions(+), 1 deletions(-)
diff --git a/dlls/wined3d/pixelshader.c b/dlls/wined3d/pixelshader.c index a974ca5..de609a7 100644 --- a/dlls/wined3d/pixelshader.c +++ b/dlls/wined3d/pixelshader.c @@ -460,6 +460,7 @@ void find_ps_compile_args(IWineD3DPixelShaderImpl *shader, IWineD3DStateBlockImp
memset(args, 0, sizeof(*args)); /* FIXME: Make sure all bits are set */ args->srgb_correction = stateblock->renderState[WINED3DRS_SRGBWRITEENABLE] ? 1 : 0; + args->texrect_fixup = 0;
for(i = 0; i < MAX_FRAGMENT_SAMPLERS; i++) { if(shader->baseShader.reg_maps.samplers[i] == 0) continue; @@ -469,6 +470,11 @@ void find_ps_compile_args(IWineD3DPixelShaderImpl *shader, IWineD3DStateBlockImp continue; } args->color_fixup[i] = tex->resource.format_desc->color_fixup; + + /* Flag samplers that need NP2 texcoord fixup. */ + if(!tex->baseTexture.pow2Matrix_identity) { + args->texrect_fixup |= (1 << i); + } } if (shader->baseShader.reg_maps.shader_version >= WINED3DPS_VERSION(3,0)) { diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index abab9dc..8907b0f 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -446,11 +446,15 @@ enum fogmode { */ struct ps_compile_args { struct color_fixup_desc color_fixup[MAX_FRAGMENT_SAMPLERS]; - BOOL srgb_correction; enum vertexprocessing_mode vp_mode; enum fogmode fog; /* Projected textures(ps 1.0-1.3) */ /* Texture types(2D, Cube, 3D) in ps 1.x */ + BOOL srgb_correction; + WORD texrect_fixup; + /* Bitmap for texture rect coord fixups (16 samplers max currently). + D3D9 has a limit of 16 samplers and the fixup is superfluous + in D3D10 (unconditional NP2 support mandatory). */ };
#define MAX_ATTRIBS 16