Module: wine
Branch: master
Commit: f0f32912a6863246827be997fdb848077a3ca7c6
URL: http://source.winehq.org/git/wine.git/?a=commit;h=f0f32912a6863246827be997f…
Author: Stefan Dösinger <stefan(a)codeweavers.com>
Date: Wed Aug 13 14:32:48 2008 -0500
wined3d: Make sure the pixel shader is compiled.
If we're heading out of the pixelshader handler early, and a pixel
shader is in use, the pixel shader may not be compiled. The vertex
shader handler then checks if the pixel shader is dirty, and calls the
shader backend to apply the shader if it isn't. Thus, in the case of
GLSL, the shader code could attempt to link an uncompiled shader into
the program. This isn't much of a problem because when the fog is
applied, the pixel shader is compiled and the program re-linked.
---
dlls/wined3d/arb_program_shader.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c
index e553828..bc8d3b3 100644
--- a/dlls/wined3d/arb_program_shader.c
+++ b/dlls/wined3d/arb_program_shader.c
@@ -2776,7 +2776,12 @@ static void fragment_prog_arbfp(DWORD state, IWineD3DStateBlockImpl *stateblock,
struct arbfp_ffp_desc *desc;
unsigned int i;
- if(isStateDirty(context, STATE_RENDER(WINED3DRS_FOGENABLE))) return;
+ if(isStateDirty(context, STATE_RENDER(WINED3DRS_FOGENABLE))) {
+ if(use_pshader) {
+ IWineD3DPixelShader_CompileShader(stateblock->pixelShader);
+ }
+ return;
+ }
if(use_pshader) {
IWineD3DPixelShader_CompileShader(stateblock->pixelShader);
Module: wine
Branch: master
Commit: 5b77a2f90b3710f8ad5e03938d698bef43c94629
URL: http://source.winehq.org/git/wine.git/?a=commit;h=5b77a2f90b3710f8ad5e03938…
Author: Stefan Dösinger <stefan(a)codeweavers.com>
Date: Wed Aug 13 12:55:53 2008 -0500
wined3d: Override the default filter of conditional np2 textures.
---
dlls/wined3d/texture.c | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index 35dfcae..bd83541 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -229,17 +229,25 @@ static HRESULT WINAPI IWineD3DTextureImpl_BindTexture(IWineD3DTexture *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
+ * that prevents us from hitting the accelerated codepath. Thus manually set the GL state. The same applies to filtering.
+ * Even if the texture has only one mip level, the default LINEAR_MIPMAP_LINEAR filter causes a SW fallback on macos.
*/
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)");
+ checkGLcall("glTexParameteri(dimension, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE)");
+ glTexParameteri(IWineD3DTexture_GetTextureDimensions(iface), GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+ checkGLcall("glTexParameteri(dimension, GL_TEXTURE_MIN_FILTER, GL_NEAREST)");
+ glTexParameteri(IWineD3DTexture_GetTextureDimensions(iface), GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+ checkGLcall("glTexParameteri(dimension, GL_TEXTURE_MAG_FILTER, GL_NEAREST)");
LEAVE_GL();
This->baseTexture.states[WINED3DTEXSTA_ADDRESSU] = WINED3DTADDRESS_CLAMP;
This->baseTexture.states[WINED3DTEXSTA_ADDRESSV] = WINED3DTADDRESS_CLAMP;
+ This->baseTexture.states[WINED3DTEXSTA_MAGFILTER] = WINED3DTEXF_POINT;
+ This->baseTexture.states[WINED3DTEXSTA_MINFILTER] = WINED3DTEXF_POINT;
+ This->baseTexture.states[WINED3DTEXSTA_MIPFILTER] = WINED3DTEXF_NONE;
}
}