Module: wine
Branch: master
Commit: bf73d23d950ab5f185f4a875f48809b2b857e74e
URL: http://source.winehq.org/git/wine.git/?a=commit;h=bf73d23d950ab5f185f4a875f…
Author: Roderick Colenbrander <thunderbird2k(a)gmail.com>
Date: Wed Apr 14 14:19:19 2010 +0200
wined3d: Separate detection of D3D10+ and D3D9 Nvidia GPUs.
---
dlls/wined3d/directx.c | 15 +++++++++++----
dlls/wined3d/wined3d_private.h | 1 +
2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index 67b2bd2..6498859 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -1251,10 +1251,7 @@ static enum wined3d_pci_vendor wined3d_guess_card_vendor(const char *gl_vendor_s
static enum wined3d_pci_device select_card_nvidia_binary(const struct wined3d_gl_info *gl_info,
const char *gl_renderer, unsigned int *vidmem)
{
- /* Both the GeforceFX, 6xxx and 7xxx series support D3D9. The last two types have more
- * shader capabilities, so we use the shader capabilities to distinguish between FX and 6xxx/7xxx.
- */
- if (WINE_D3D9_CAPABLE(gl_info) && gl_info->supported[NV_VERTEX_PROGRAM3])
+ if (WINE_D3D10_CAPABLE(gl_info))
{
/* Geforce 200 - highend */
if (strstr(gl_renderer, "GTX 280")
@@ -1360,6 +1357,16 @@ static enum wined3d_pci_device select_card_nvidia_binary(const struct wined3d_gl
return CARD_NVIDIA_GEFORCE_8300GS;
}
+ /* Geforce8-compatible fall back if the GPU is not in the list yet */
+ *vidmem = 128;
+ return CARD_NVIDIA_GEFORCE_8300GS;
+ }
+
+ /* Both the GeforceFX, 6xxx and 7xxx series support D3D9. The last two types have more
+ * shader capabilities, so we use the shader capabilities to distinguish between FX and 6xxx/7xxx.
+ */
+ if (WINE_D3D9_CAPABLE(gl_info) && gl_info->supported[NV_VERTEX_PROGRAM3])
+ {
/* Geforce7 - highend */
if (strstr(gl_renderer, "7800")
|| strstr(gl_renderer, "7900")
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 981f580..00d4c48 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -1234,6 +1234,7 @@ void context_surface_update(struct wined3d_context *context, IWineD3DSurfaceImpl
#define WINE_D3D7_CAPABLE(gl_info) (gl_info->supported[ARB_TEXTURE_COMPRESSION] && gl_info->supported[ARB_TEXTURE_CUBE_MAP] && gl_info->supported[ARB_TEXTURE_ENV_DOT3])
#define WINE_D3D8_CAPABLE(gl_info) WINE_D3D7_CAPABLE(gl_info) && (gl_info->supported[ARB_MULTISAMPLE] && gl_info->supported[ARB_TEXTURE_BORDER_CLAMP])
#define WINE_D3D9_CAPABLE(gl_info) WINE_D3D8_CAPABLE(gl_info) && (gl_info->supported[ARB_FRAGMENT_PROGRAM] && gl_info->supported[ARB_VERTEX_SHADER])
+#define WINE_D3D10_CAPABLE(gl_info) WINE_D3D9_CAPABLE(gl_info) && (gl_info->supported[EXT_GPU_SHADER4])
/*****************************************************************************
* Internal representation of a light