Module: wine
Branch: master
Commit: c425bbccab4e9cacd7e35b9b862186c290e9e851
URL: http://source.winehq.org/git/wine.git/?a=commit;h=c425bbccab4e9cacd7e35b9b8…
Author: Stefan Dösinger <stefan(a)codeweavers.com>
Date: Tue Aug 12 17:18:25 2008 -0500
wined3d: Set the texture wrap default with the NP2 emulation properly.
---
dlls/wined3d/texture.c | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index 5dc9821..35dfcae 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -227,6 +227,20 @@ static HRESULT WINAPI IWineD3DTextureImpl_BindTexture(IWineD3DTexture *iface) {
for (i = 0; i < This->baseTexture.levels; ++i) {
IWineD3DSurface_SetGlTextureDesc(This->surfaces[i], This->baseTexture.textureName, IWineD3DTexture_GetTextureDimensions(iface));
}
+ /* Conditinal non power of two textures use a different clamping default. If we're using the GL_WINE_normalized_texrect
+ * partial driver emulation, we're dealing with a GL_TEXTURE_2D texture which has the address mode set to repeat - something
+ * that prevents us from hitting the accelerated codepath. Thus manually set the GL state
+ */
+ if(IWineD3DBaseTexture_IsCondNP2(iface)) {
+ ENTER_GL();
+ glTexParameteri(IWineD3DTexture_GetTextureDimensions(iface), GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+ checkGLcall("glTexParameteri(dimension, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE)");
+ glTexParameteri(IWineD3DTexture_GetTextureDimensions(iface), GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+ checkGLcall("glTexParameteri(dimension, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE)");
+ LEAVE_GL();
+ This->baseTexture.states[WINED3DTEXSTA_ADDRESSU] = WINED3DTADDRESS_CLAMP;
+ This->baseTexture.states[WINED3DTEXSTA_ADDRESSV] = WINED3DTADDRESS_CLAMP;
+ }
}
return hr;
Module: wine
Branch: master
Commit: ec94c2ea99763d5dc4805d2da981828120ad8ba6
URL: http://source.winehq.org/git/wine.git/?a=commit;h=ec94c2ea99763d5dc4805d2da…
Author: Stefan Dösinger <stefan(a)codeweavers.com>
Date: Tue Aug 12 12:46:54 2008 -0500
wined3d: Don't enable texture dimensions with shaders.
ARB and GLSL don't need that. If a shader backend like atifs or nvts
need it in the future, the shader backend should deal with that rather
than the ffp pipeline.
---
dlls/wined3d/state.c | 13 +------------
1 files changed, 1 insertions(+), 12 deletions(-)
diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index 84be28b..5b92420 100644
--- a/dlls/wined3d/state.c
+++ b/dlls/wined3d/state.c
@@ -3528,18 +3528,7 @@ static void sampler(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DCont
checkGLcall("glTexEnvi(GL_TEXTURE_LOD_BIAS_EXT, ...)");
}
- if (stateblock->wineD3DDevice->ps_selected_mode != SHADER_NONE && stateblock->pixelShader &&
- ((IWineD3DPixelShaderImpl *)stateblock->pixelShader)->baseShader.function) {
- /* Using a pixel shader? Verify the sampler types */
-
- /* Make sure that the texture dimensions are enabled. I don't have to disable the other
- * dimensions because the shader knows from which texture type to sample from. For the sake of
- * debugging all dimensions could be enabled and a texture with some ugly pink bound to the unused
- * dimensions. This should make wrong sampling sources visible :-)
- */
- glEnable(stateblock->textureDimensions[sampler]);
- checkGLcall("glEnable(stateblock->textureDimensions[sampler])");
- } else if(sampler < stateblock->lowest_disabled_stage) {
+ if(!use_ps(stateblock->wineD3DDevice) && sampler < stateblock->lowest_disabled_stage) {
if(stateblock->renderState[WINED3DRS_COLORKEYENABLE] && sampler == 0) {
/* If color keying is enabled update the alpha test, it depends on the existence
* of a color key in stage 0
Module: wine
Branch: master
Commit: 77204574d19b1969ca0810c7522e6bee5a0c4026
URL: http://source.winehq.org/git/wine.git/?a=commit;h=77204574d19b1969ca0810c75…
Author: Stefan Dösinger <stefan(a)codeweavers.com>
Date: Thu Aug 14 16:47:19 2008 -0500
wined3d: Prefer aux buffer matches over alpha matches.
Half Life 2 uses D3DFMT_X8R8G8B8 for the back buffer, but macos
supports aux buffers only on D3DFMT_A8R8G8B8. I think having aux
buffers is more important right now than having a precise alpha
match.
---
dlls/wined3d/context.c | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index 68ec2a7..739ddb2 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -129,17 +129,19 @@ static int WineD3D_ChoosePixelFormat(IWineD3DDeviceImpl *This, HDC hdc, WINED3DF
BOOL exact_alpha;
BOOL exact_color;
} matches[] = {
- /* First, try without aux buffers - this is the most common cause
- * for not finding a pixel format. Also some drivers(the open source ones)
+ /* First, try without alpha match buffers. MacOS supports aux buffers only
+ * on A8R8G8B8, and we prefer better offscreen rendering over an alpha match.
+ * Then try without aux buffers - this is the most common cause for not
+ * finding a pixel format. Also some drivers(the open source ones)
* only offer 32 bit ARB pixel formats. First try without an exact alpha
* match, then try without an exact alpha and color match.
*/
- { TRUE, TRUE, TRUE },
{ FALSE, TRUE, TRUE },
- { TRUE, FALSE, TRUE },
- { TRUE, FALSE, FALSE },
+ { TRUE, TRUE, TRUE },
{ FALSE, FALSE, TRUE },
{ FALSE, FALSE, FALSE },
+ { TRUE, FALSE, TRUE },
+ { TRUE, FALSE, FALSE },
};
int i = 0;