Module: wine
Branch: master
Commit: 39877a2ad2365c5ff28ab20d8aa428241d4d8217
URL: http://source.winehq.org/git/wine.git/?a=commit;h=39877a2ad2365c5ff28ab20d8…
Author: Stefan Dösinger <stefan(a)codeweavers.com>
Date: Tue Apr 14 20:33:15 2009 +0200
wined3d: Reserve additional GLSL constants on some drivers.
Some drivers apparently need private constants, or don't have an efficient
immval packing. For example, MacOS seems to need 1 float for each different
relative addressing offset. fglrx has the same issue, although it is more
efficient in general
Previously this worked on most drivers because the 16 + 4 reserved int and
bool constants kept the problem hidden. Now that we are more aggressive with
uniforms we have to keep free room for some drivers.
---
dlls/wined3d/directx.c | 18 +++++++++++++++++-
dlls/wined3d/wined3d_gl.h | 1 +
2 files changed, 18 insertions(+), 1 deletions(-)
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index e7a74d4..50443e2 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -4041,6 +4041,16 @@ static void quirk_arb_constants(WineD3D_GL_Info *gl_info) {
gl_info->ps_glsl_constantsF = gl_info->ps_arb_constantsF;
}
+static void quirk_apple_glsl_constants(WineD3D_GL_Info *gl_info) {
+ quirk_arb_constants(gl_info);
+ /* MacOS needs uniforms for relative addressing offsets. This can accumulate to quite a few uniforms.
+ * Beyond that the general uniform isn't optimal, so reserve a number of uniforms. 12 vec4's should
+ * allow 48 different offsets or other helper immediate values
+ */
+ TRACE_(d3d_caps)("Reserving 12 GLSL constants for compiler private use\n");
+ gl_info->reserved_glsl_constants = max(gl_info->reserved_glsl_constants, 12);
+}
+
static void quirk_ati_dx9(WineD3D_GL_Info *gl_info) {
quirk_arb_constants(gl_info);
@@ -4059,6 +4069,12 @@ static void quirk_ati_dx9(WineD3D_GL_Info *gl_info) {
TRACE("GL_ARB_texture_non_power_of_two advertised on R500 or earlier card, removing\n");
gl_info->supported[ARB_TEXTURE_NON_POWER_OF_TWO] = FALSE;
gl_info->supported[WINE_NORMALIZED_TEXRECT] = TRUE;
+
+ /* fglrx has the same structural issues as the one described in quirk_apple_glsl_constants, although
+ * it is generally more efficient. Reserve just 8 constants
+ */
+ TRACE_(d3d_caps)("Reserving 8 GLSL constants for compiler private use\n");
+ gl_info->reserved_glsl_constants = max(gl_info->reserved_glsl_constants, 8);
}
static void quirk_no_np2(WineD3D_GL_Info *gl_info) {
@@ -4116,7 +4132,7 @@ struct driver_quirk quirk_table[] = {
*/
{
match_apple,
- quirk_arb_constants,
+ quirk_apple_glsl_constants,
"Apple GLSL uniform override"
},
{
diff --git a/dlls/wined3d/wined3d_gl.h b/dlls/wined3d/wined3d_gl.h
index 2cf4e3f..763ed69 100644
--- a/dlls/wined3d/wined3d_gl.h
+++ b/dlls/wined3d/wined3d_gl.h
@@ -3951,6 +3951,7 @@ typedef struct _WineD3D_GL_Info {
BOOL arb_vs_offset_limit;
BOOL set_texcoord_w;
+ DWORD reserved_glsl_constants;
BOOL supported[OPENGL_SUPPORTED_EXT_END + 1];
Module: wine
Branch: master
Commit: 78d26a659d14b050c90b1393580bc0d13b36e7e5
URL: http://source.winehq.org/git/wine.git/?a=commit;h=78d26a659d14b050c90b13935…
Author: Stefan Dösinger <stefan(a)codeweavers.com>
Date: Tue Apr 14 20:24:26 2009 +0200
wined3d: Move the remaining quirks into the quirk table.
---
dlls/wined3d/directx.c | 159 ++++++++++++++++++++++++++++--------------------
1 files changed, 93 insertions(+), 66 deletions(-)
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index 6d3531a..e7a74d4 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -4014,6 +4014,26 @@ static BOOL match_apple(WineD3D_GL_Info *gl_info) {
return implementation_is_apple(gl_info);
}
+static BOOL match_geforce5(WineD3D_GL_Info *gl_info) {
+ if(gl_info->gl_vendor == VENDOR_NVIDIA) {
+ if(gl_info->gl_card == CARD_NVIDIA_GEFORCEFX_5800 || gl_info->gl_card == CARD_NVIDIA_GEFORCEFX_5600) {
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+
+static BOOL match_apple_intel(WineD3D_GL_Info *gl_info) {
+ return gl_info->gl_vendor == VENDOR_INTEL && implementation_is_apple(gl_info);
+}
+
+static BOOL match_apple_nonr500ati(WineD3D_GL_Info *gl_info) {
+ if(!implementation_is_apple(gl_info)) return FALSE;
+ if(gl_info->gl_vendor != VENDOR_ATI) return FALSE;
+ if(gl_info->gl_card == CARD_ATI_RADEON_X1600) return FALSE;
+ return TRUE;
+}
+
static void quirk_arb_constants(WineD3D_GL_Info *gl_info) {
TRACE_(d3d_caps)("Using ARB vs constant limit(=%u) for GLSL\n", gl_info->vs_arb_constantsF);
gl_info->vs_glsl_constantsF = gl_info->vs_arb_constantsF;
@@ -4021,57 +4041,8 @@ static void quirk_arb_constants(WineD3D_GL_Info *gl_info) {
gl_info->ps_glsl_constantsF = gl_info->ps_arb_constantsF;
}
-struct driver_quirk quirk_table[] = {
- {
- match_ati_r300_to_500,
- quirk_arb_constants,
- "ATI GLSL constant quirk"
- },
- /* MacOS advertises more GLSL vertex shader uniforms than supported by the hardware, and if more are
- * used it falls back to software. While the compiler can detect if the shader uses all declared
- * uniforms, the optimization fails if the shader uses relative addressing. So any GLSL shader
- * using relative addressing falls back to software.
- *
- * ARB vp gives the correct amount of uniforms, so use it instead of GLSL
- */
- {
- match_apple,
- quirk_arb_constants,
- "Apple GLSL uniform override"
- }
-};
-
-static void fixup_extensions(WineD3D_GL_Info *gl_info) {
- unsigned int i;
- BOOL apple = implementation_is_apple(gl_info);
-
- for(i = 0; i < (sizeof(quirk_table) / sizeof(*quirk_table)); i++) {
- if(!quirk_table[i].match(gl_info)) continue;
- TRACE_(d3d_caps)("Applying driver quirk \"%s\"\n", quirk_table[i].description);
- quirk_table[i].apply(gl_info);
- }
-
- if(apple) {
- /* The Intel GPUs on MacOS set the .w register of texcoords to 0.0 by default, which causes problems
- * with fixed function fragment processing. Ideally this flag should be detected with a test shader
- * and OpenGL feedback mode, but some GL implementations (MacOS ATI at least, probably all MacOS ones)
- * do not like vertex shaders in feedback mode and return an error, even though it should be valid
- * according to the spec.
- *
- * We don't want to enable this on all cards, as it adds an extra instruction per texcoord used. This
- * makes the shader slower and eats instruction slots which should be available to the d3d app.
- *
- * ATI Radeon HD 2xxx cards on MacOS have the issue. Instead of checking for the buggy cards, blacklist
- * all radeon cards on Macs and whitelist the good ones. That way we're prepared for the future. If
- * this workaround is activated on cards that do not need it, it won't break things, just affect
- * performance negatively.
- */
- if(gl_info->gl_vendor == VENDOR_INTEL ||
- (gl_info->gl_vendor == VENDOR_ATI && gl_info->gl_card != CARD_ATI_RADEON_X1600)) {
- TRACE("Enabling vertex texture coord fixes in vertex shaders\n");
- gl_info->set_texcoord_w = TRUE;
- }
- }
+static void quirk_ati_dx9(WineD3D_GL_Info *gl_info) {
+ quirk_arb_constants(gl_info);
/* MacOS advertises GL_ARB_texture_non_power_of_two on ATI r500 and earlier cards, although
* these cards only support GL_ARB_texture_rectangle(D3DPTEXTURECAPS_NONPOW2CONDITIONAL).
@@ -4085,16 +4056,12 @@ static void fixup_extensions(WineD3D_GL_Info *gl_info) {
* has this extension promoted to core. The extension loading code sets this extension supported
* due to that, so this code works on fglrx as well.
*/
- if(gl_info->supported[ARB_TEXTURE_NON_POWER_OF_TWO] && gl_info->gl_vendor == VENDOR_ATI) {
- if(gl_info->gl_card == CARD_ATI_RADEON_X700 || gl_info->gl_card == CARD_ATI_RADEON_X1600 ||
- gl_info->gl_card == CARD_ATI_RADEON_9500 || gl_info->gl_card == CARD_ATI_RADEON_8500 ||
- gl_info->gl_card == CARD_ATI_RADEON_7200 || gl_info->gl_card == CARD_ATI_RAGE_128PRO) {
- TRACE("GL_ARB_texture_non_power_of_two advertised on R500 or earlier card, removing\n");
- gl_info->supported[ARB_TEXTURE_NON_POWER_OF_TWO] = FALSE;
- gl_info->supported[WINE_NORMALIZED_TEXRECT] = TRUE;
- }
- }
+ TRACE("GL_ARB_texture_non_power_of_two advertised on R500 or earlier card, removing\n");
+ gl_info->supported[ARB_TEXTURE_NON_POWER_OF_TWO] = FALSE;
+ gl_info->supported[WINE_NORMALIZED_TEXRECT] = TRUE;
+}
+static void quirk_no_np2(WineD3D_GL_Info *gl_info) {
/* The nVidia GeForceFX series reports OpenGL 2.0 capabilities with the latest drivers versions, but
* doesn't explicitly advertise the ARB_tex_npot extension in the GL extension string.
* This usually means that ARB_tex_npot is supported in hardware as long as the application is staying
@@ -4110,12 +4077,72 @@ static void fixup_extensions(WineD3D_GL_Info *gl_info) {
* post-processing effects in the game "Max Payne 2").
* The behaviour can be verified through a simple test app attached in bugreport #14724.
*/
- if(gl_info->supported[ARB_TEXTURE_NON_POWER_OF_TWO] && gl_info->gl_vendor == VENDOR_NVIDIA) {
- if(gl_info->gl_card == CARD_NVIDIA_GEFORCEFX_5800 || gl_info->gl_card == CARD_NVIDIA_GEFORCEFX_5600) {
- TRACE("GL_ARB_texture_non_power_of_two advertised through OpenGL 2.0 on NV FX card, removing\n");
- gl_info->supported[ARB_TEXTURE_NON_POWER_OF_TWO] = FALSE;
- gl_info->supported[ARB_TEXTURE_RECTANGLE] = TRUE;
- }
+ TRACE("GL_ARB_texture_non_power_of_two advertised through OpenGL 2.0 on NV FX card, removing\n");
+ gl_info->supported[ARB_TEXTURE_NON_POWER_OF_TWO] = FALSE;
+ gl_info->supported[ARB_TEXTURE_RECTANGLE] = TRUE;
+}
+
+static void quirk_texcoord_w(WineD3D_GL_Info *gl_info) {
+ /* The Intel GPUs on MacOS set the .w register of texcoords to 0.0 by default, which causes problems
+ * with fixed function fragment processing. Ideally this flag should be detected with a test shader
+ * and OpenGL feedback mode, but some GL implementations (MacOS ATI at least, probably all MacOS ones)
+ * do not like vertex shaders in feedback mode and return an error, even though it should be valid
+ * according to the spec.
+ *
+ * We don't want to enable this on all cards, as it adds an extra instruction per texcoord used. This
+ * makes the shader slower and eats instruction slots which should be available to the d3d app.
+ *
+ * ATI Radeon HD 2xxx cards on MacOS have the issue. Instead of checking for the buggy cards, blacklist
+ * all radeon cards on Macs and whitelist the good ones. That way we're prepared for the future. If
+ * this workaround is activated on cards that do not need it, it won't break things, just affect
+ * performance negatively.
+ */
+ TRACE("Enabling vertex texture coord fixes in vertex shaders\n");
+ gl_info->set_texcoord_w = TRUE;
+}
+
+struct driver_quirk quirk_table[] = {
+ {
+ match_ati_r300_to_500,
+ quirk_ati_dx9,
+ "ATI GLSL constant and normalized texrect quirk"
+ },
+ /* MacOS advertises more GLSL vertex shader uniforms than supported by the hardware, and if more are
+ * used it falls back to software. While the compiler can detect if the shader uses all declared
+ * uniforms, the optimization fails if the shader uses relative addressing. So any GLSL shader
+ * using relative addressing falls back to software.
+ *
+ * ARB vp gives the correct amount of uniforms, so use it instead of GLSL
+ */
+ {
+ match_apple,
+ quirk_arb_constants,
+ "Apple GLSL uniform override"
+ },
+ {
+ match_geforce5,
+ quirk_no_np2,
+ "Geforce 5 NP2 disable"
+ },
+ {
+ match_apple_intel,
+ quirk_texcoord_w,
+ "Init texcoord .w for Apple Intel GPU driver"
+ },
+ {
+ match_apple_nonr500ati,
+ quirk_texcoord_w,
+ "Init texcoord .w for Apple ATI >= r600 GPU driver"
+ }
+};
+
+static void fixup_extensions(WineD3D_GL_Info *gl_info) {
+ unsigned int i;
+
+ for(i = 0; i < (sizeof(quirk_table) / sizeof(*quirk_table)); i++) {
+ if(!quirk_table[i].match(gl_info)) continue;
+ TRACE_(d3d_caps)("Applying driver quirk \"%s\"\n", quirk_table[i].description);
+ quirk_table[i].apply(gl_info);
}
/* Find out if PBOs work as they are supposed to */
Module: wine
Branch: master
Commit: 50e91f8d84f847d7102587481f200a6c52f956fc
URL: http://source.winehq.org/git/wine.git/?a=commit;h=50e91f8d84f847d7102587481…
Author: Stefan Dösinger <stefan(a)codeweavers.com>
Date: Tue Apr 14 20:13:11 2009 +0200
wined3d: Move the generic mac glsl uniform fixup to the quirk table.
---
dlls/wined3d/directx.c | 31 ++++++++++++++++---------------
1 files changed, 16 insertions(+), 15 deletions(-)
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index 260d579..6d3531a 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -4010,6 +4010,10 @@ static BOOL match_ati_r300_to_500(WineD3D_GL_Info *gl_info) {
return FALSE;
}
+static BOOL match_apple(WineD3D_GL_Info *gl_info) {
+ return implementation_is_apple(gl_info);
+}
+
static void quirk_arb_constants(WineD3D_GL_Info *gl_info) {
TRACE_(d3d_caps)("Using ARB vs constant limit(=%u) for GLSL\n", gl_info->vs_arb_constantsF);
gl_info->vs_glsl_constantsF = gl_info->vs_arb_constantsF;
@@ -4022,6 +4026,18 @@ struct driver_quirk quirk_table[] = {
match_ati_r300_to_500,
quirk_arb_constants,
"ATI GLSL constant quirk"
+ },
+ /* MacOS advertises more GLSL vertex shader uniforms than supported by the hardware, and if more are
+ * used it falls back to software. While the compiler can detect if the shader uses all declared
+ * uniforms, the optimization fails if the shader uses relative addressing. So any GLSL shader
+ * using relative addressing falls back to software.
+ *
+ * ARB vp gives the correct amount of uniforms, so use it instead of GLSL
+ */
+ {
+ match_apple,
+ quirk_arb_constants,
+ "Apple GLSL uniform override"
}
};
@@ -4036,21 +4052,6 @@ static void fixup_extensions(WineD3D_GL_Info *gl_info) {
}
if(apple) {
- /* MacOS advertises more GLSL vertex shader uniforms than supported by the hardware, and if more are
- * used it falls back to software. While the compiler can detect if the shader uses all declared
- * uniforms, the optimization fails if the shader uses relative addressing. So any GLSL shader
- * using relative addressing falls back to software.
- *
- * ARB vp gives the correct amount of uniforms, so use it instead of GLSL
- */
- if(gl_info->vs_glsl_constantsF <= gl_info->vs_arb_constantsF) {
- FIXME("GLSL doesn't advertise more vertex shader uniforms than ARB. Driver fixup outdated?\n");
- } else {
- TRACE("Driver claims %u GLSL vs uniforms, replacing with %u ARB vp uniforms\n",
- gl_info->vs_glsl_constantsF, gl_info->vs_arb_constantsF);
- gl_info->vs_glsl_constantsF = gl_info->vs_arb_constantsF;
- }
-
/* The Intel GPUs on MacOS set the .w register of texcoords to 0.0 by default, which causes problems
* with fixed function fragment processing. Ideally this flag should be detected with a test shader
* and OpenGL feedback mode, but some GL implementations (MacOS ATI at least, probably all MacOS ones)
Module: wine
Branch: master
Commit: 55cd3433ac956fd7b04da6443745fd238042323f
URL: http://source.winehq.org/git/wine.git/?a=commit;h=55cd3433ac956fd7b04da6443…
Author: Francois Gouget <fgouget(a)free.fr>
Date: Mon Apr 20 15:08:13 2009 +0200
winapi: trampoline is not used so remove it.
---
tools/winapi/trampoline | 35 -----------------------------------
1 files changed, 0 insertions(+), 35 deletions(-)
diff --git a/tools/winapi/trampoline b/tools/winapi/trampoline
deleted file mode 100755
index 0117316..0000000
--- a/tools/winapi/trampoline
+++ /dev/null
@@ -1,35 +0,0 @@
-#! /usr/bin/perl -w
-#
-# Copyright 1999, 2000, 2001 Patrik Stridvall
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
-#
-
-use strict;
-
-require Cwd;
-
-my $tool = $0;
-$tool =~ s%^(?:.*?/)?([^/]+)$%$1%;
-
-$_ = Cwd::cwd();
-while($_) {
- my $file = "$_/tools/winapi/$tool";
- if(-e $file) {
- exec("$file @ARGV");
- }
- s%/[^/]*$%%;
-}
-print STDERR "$0: $tool: can't link to command\n";