[PATCH 4/6] wined3d: Use d3d_level_from_gl_info in match_dx10_capable
Stefan Dösinger
stefan at codeweavers.com
Tue May 14 16:46:03 CDT 2013
---
dlls/wined3d/directx.c | 53 ++++++++++++++++++++++----------------------------
1 file changed, 23 insertions(+), 30 deletions(-)
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index 3ef5eeb..9814010 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -480,6 +480,28 @@ static BOOL test_arb_vs_offset_limit(const struct wined3d_gl_info *gl_info)
return ret;
}
+static UINT d3d_level_from_gl_info(const struct wined3d_gl_info *gl_info)
+{
+ UINT level = 0;
+
+ if (gl_info->supported[ARB_MULTITEXTURE])
+ level = 6;
+ if (gl_info->supported[ARB_TEXTURE_COMPRESSION]
+ && gl_info->supported[ARB_TEXTURE_CUBE_MAP]
+ && gl_info->supported[ARB_TEXTURE_ENV_DOT3])
+ level = 7;
+ if (level == 7 && gl_info->supported[ARB_MULTISAMPLE]
+ && gl_info->supported[ARB_TEXTURE_BORDER_CLAMP])
+ level = 8;
+ if (level == 8 && gl_info->supported[ARB_FRAGMENT_PROGRAM]
+ && gl_info->supported[ARB_VERTEX_SHADER])
+ level = 9;
+ if (level == 9 && gl_info->supported[EXT_GPU_SHADER4])
+ level = 10;
+
+ return level;
+}
+
static BOOL match_amd_r300_to_500(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)
{
@@ -613,14 +635,7 @@ static BOOL match_apple_nonr500ati(const struct wined3d_gl_info *gl_info, const
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)
{
- /* DX9 cards support 40 single float varyings in hardware, most drivers report 32. ATI misreports
- * 44 varyings. So assume that if we have more than 44 varyings we have a dx10 card.
- * This detection is for the gl_ClipPos varying quirk. If a d3d9 card really supports more than 44
- * varyings and we subtract one in dx9 shaders its not going to hurt us because the dx9 limit is
- * hardcoded
- *
- * dx10 cards usually have 64 varyings */
- return gl_info->limits.glsl_varyings > 44;
+ return d3d_level_from_gl_info(gl_info) >= 10;
}
static BOOL match_not_dx10_capable(const struct wined3d_gl_info *gl_info, const char *gl_renderer,
@@ -1528,28 +1543,6 @@ static enum wined3d_pci_vendor wined3d_guess_card_vendor(const char *gl_vendor_s
return HW_VENDOR_NVIDIA;
}
-static UINT d3d_level_from_gl_info(const struct wined3d_gl_info *gl_info)
-{
- UINT level = 0;
-
- if (gl_info->supported[ARB_MULTITEXTURE])
- level = 6;
- if (gl_info->supported[ARB_TEXTURE_COMPRESSION]
- && gl_info->supported[ARB_TEXTURE_CUBE_MAP]
- && gl_info->supported[ARB_TEXTURE_ENV_DOT3])
- level = 7;
- if (level == 7 && gl_info->supported[ARB_MULTISAMPLE]
- && gl_info->supported[ARB_TEXTURE_BORDER_CLAMP])
- level = 8;
- if (level == 8 && gl_info->supported[ARB_FRAGMENT_PROGRAM]
- && gl_info->supported[ARB_VERTEX_SHADER])
- level = 9;
- if (level == 9 && gl_info->supported[EXT_GPU_SHADER4])
- level = 10;
-
- return level;
-}
-
static enum wined3d_pci_device select_card_nvidia_binary(const struct wined3d_gl_info *gl_info,
const char *gl_renderer)
{
--
1.8.1.5
More information about the wine-patches
mailing list