Module: wine Branch: master Commit: 812a31482149116e4d3332791d4bd42ba641791c URL: http://source.winehq.org/git/wine.git/?a=commit;h=812a31482149116e4d3332791d...
Author: Henri Verbeet hverbeet@codeweavers.com Date: Thu Aug 4 19:53:31 2011 +0200
wined3d: Get rid of the fglrx point sprite hack.
Fglrx 9.3 is well over 2 years old at this point. I'd strongly encourage anyone still affected by this to upgrade to the r300g driver.
---
dlls/wined3d/context.c | 11 ++++++--- dlls/wined3d/directx.c | 41 ---------------------------------------- dlls/wined3d/state.c | 13 ------------ dlls/wined3d/wined3d_private.h | 1 - 4 files changed, 7 insertions(+), 59 deletions(-)
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c index 620a89b..ac252d8 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -1522,11 +1522,14 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain, GL_EXTCALL(glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, strlen(dummy_program), dummy_program)); }
- for (s = 0; s < gl_info->limits.point_sprite_units; ++s) + if (gl_info->supported[ARB_POINT_SPRITE]) { - GL_EXTCALL(glActiveTextureARB(GL_TEXTURE0_ARB + s)); - glTexEnvi(GL_POINT_SPRITE_ARB, GL_COORD_REPLACE_ARB, GL_TRUE); - checkGLcall("glTexEnvi(GL_POINT_SPRITE_ARB, GL_COORD_REPLACE_ARB, GL_TRUE)"); + for (s = 0; s < gl_info->limits.textures; ++s) + { + GL_EXTCALL(glActiveTextureARB(GL_TEXTURE0_ARB + s)); + glTexEnvi(GL_POINT_SPRITE_ARB, GL_COORD_REPLACE_ARB, GL_TRUE); + checkGLcall("glTexEnvi(GL_POINT_SPRITE_ARB, GL_COORD_REPLACE_ARB, GL_TRUE)"); + } }
if (gl_info->supported[ARB_PROVOKING_VERTEX]) diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index a93895e..cdf3c11 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -596,13 +596,6 @@ static BOOL match_apple_nonr500ati(const struct wined3d_gl_info *gl_info, const return TRUE; }
-static BOOL match_fglrx(const struct wined3d_gl_info *gl_info, const char *gl_renderer, - enum wined3d_gl_vendor gl_vendor, enum wined3d_pci_vendor card_vendor, enum wined3d_pci_device device) -{ - return gl_vendor == GL_VENDOR_FGLRX; - -} - static BOOL match_dx10_capable(const struct wined3d_gl_info *gl_info, const char *gl_renderer, enum wined3d_gl_vendor gl_vendor, enum wined3d_pci_vendor card_vendor, enum wined3d_pci_device device) { @@ -801,27 +794,6 @@ static void quirk_apple_glsl_constants(struct wined3d_gl_info *gl_info) gl_info->reserved_glsl_constants = max(gl_info->reserved_glsl_constants, 12); }
-/* fglrx crashes with a very bad kernel panic if GL_POINT_SPRITE_ARB is set to GL_COORD_REPLACE_ARB - * on more than one texture unit. This means that the d3d9 visual point size test will cause a - * kernel panic on any machine running fglrx 9.3(latest that supports r300 to r500 cards). This - * quirk only enables point sprites on the first texture unit. This keeps point sprites working in - * most games, but avoids the crash - * - * A more sophisticated way would be to find all units that need texture coordinates and enable - * point sprites for one if only one is found, and software emulate point sprites in drawStridedSlow - * if more than one unit needs texture coordinates(This requires software ffp and vertex shaders though) - * - * Note that disabling the extension entirely does not gain predictability because there is no point - * sprite capability flag in d3d, so the potential rendering bugs are the same if we disable the extension. */ -static void quirk_one_point_sprite(struct wined3d_gl_info *gl_info) -{ - if (gl_info->supported[ARB_POINT_SPRITE]) - { - TRACE("Limiting point sprites to one texture unit.\n"); - gl_info->limits.point_sprite_units = 1; - } -} - static void quirk_amd_dx9(struct wined3d_gl_info *gl_info) { quirk_arb_constants(gl_info); @@ -963,11 +935,6 @@ static const struct driver_quirk quirk_table[] = "Init texcoord .w for Apple ATI >= r600 GPU driver" }, { - match_fglrx, - quirk_one_point_sprite, - "Fglrx point sprite crash workaround" - }, - { match_dx10_capable, quirk_clip_varying, "Reserved varying for gl_ClipPos" @@ -2625,14 +2592,6 @@ static BOOL wined3d_adapter_init_gl_caps(struct wined3d_adapter *adapter) /* GL_ARB_half_float_vertex is a subset of GL_NV_half_float. */ gl_info->supported[ARB_HALF_FLOAT_VERTEX] = TRUE; } - if (gl_info->supported[ARB_POINT_SPRITE]) - { - gl_info->limits.point_sprite_units = gl_info->limits.textures; - } - else - { - gl_info->limits.point_sprite_units = 0; - } checkGLcall("extension detection");
LEAVE_GL(); diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index c3dd7ff..b3c1270 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -1594,21 +1594,8 @@ static void state_pointsprite_w(struct wined3d_context *context, const struct wi
static void state_pointsprite(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { - const struct wined3d_gl_info *gl_info = context->gl_info; - if (state->render_states[WINED3DRS_POINTSPRITEENABLE]) { - static BOOL warned; - - if (gl_info->limits.point_sprite_units < gl_info->limits.textures && !warned) - { - if (use_ps(state) || state->lowest_disabled_stage > gl_info->limits.point_sprite_units) - { - FIXME("The app uses point sprite texture coordinates on more units than supported by the driver\n"); - warned = TRUE; - } - } - glEnable(GL_POINT_SPRITE_ARB); checkGLcall("glEnable(GL_POINT_SPRITE_ARB)"); } else { diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index d340049..129c156 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -1445,7 +1445,6 @@ struct wined3d_gl_limits UINT texture3d_size; float pointsize_max; float pointsize_min; - UINT point_sprite_units; UINT blends; UINT anisotropy; float shininess;