wined3d: Assign 9_x feature levels more accurately.

Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Matteo Bruni 2019-05-20 18:49:49 +02:00 committed by Alexandre Julliard
parent 386f372f05
commit 851be63037
6 changed files with 28 additions and 18 deletions

View File

@ -4443,8 +4443,8 @@ HRESULT device_init(struct d3d9_device *device, struct d3d9 *parent, struct wine
static const enum wined3d_feature_level feature_levels[] =
{
WINED3D_FEATURE_LEVEL_9_SM3,
WINED3D_FEATURE_LEVEL_9_SM2,
WINED3D_FEATURE_LEVEL_9_3,
WINED3D_FEATURE_LEVEL_9_2,
WINED3D_FEATURE_LEVEL_9_1,
WINED3D_FEATURE_LEVEL_8,
WINED3D_FEATURE_LEVEL_7,

View File

@ -1241,7 +1241,8 @@ static enum wined3d_pci_vendor wined3d_guess_card_vendor(const char *gl_vendor_s
}
static enum wined3d_feature_level feature_level_from_caps(const struct wined3d_gl_info *gl_info,
const struct shader_caps *shader_caps, const struct fragment_caps *fragment_caps)
const struct wined3d_d3d_limits *d3d_limits, const struct shader_caps *shader_caps,
const struct fragment_caps *fragment_caps)
{
unsigned int shader_model;
@ -1267,10 +1268,18 @@ static enum wined3d_feature_level feature_level_from_caps(const struct wined3d_g
}
}
if (shader_model >= 3)
return WINED3D_FEATURE_LEVEL_9_SM3;
if (shader_model >= 3 && d3d_limits->texture_size >= 4096 && d3d_limits->max_rt_count >= 4)
return WINED3D_FEATURE_LEVEL_9_3;
if (shader_model >= 2)
return WINED3D_FEATURE_LEVEL_9_SM2;
{
if (gl_info->supported[ARB_OCCLUSION_QUERY]
&& gl_info->supported[ARB_TEXTURE_MIRROR_CLAMP_TO_EDGE]
&& gl_info->supported[EXT_BLEND_EQUATION_SEPARATE]
&& gl_info->supported[EXT_BLEND_FUNC_SEPARATE])
return WINED3D_FEATURE_LEVEL_9_2;
return WINED3D_FEATURE_LEVEL_9_1;
}
if (shader_model >= 1)
return WINED3D_FEATURE_LEVEL_8;
@ -3722,7 +3731,6 @@ static BOOL wined3d_adapter_init_gl_caps(struct wined3d_adapter *adapter,
d3d_info->limits.ffp_textures = fragment_caps.MaxSimultaneousTextures;
d3d_info->shader_color_key = !!(fragment_caps.wined3d_caps & WINED3D_FRAGMENT_CAP_COLOR_KEY);
d3d_info->wined3d_creation_flags = wined3d_creation_flags;
d3d_info->feature_level = feature_level_from_caps(gl_info, &shader_caps, &fragment_caps);
d3d_info->texture_npot = !!gl_info->supported[ARB_TEXTURE_NON_POWER_OF_TWO];
d3d_info->texture_npot_conditional = gl_info->supported[WINED3D_GL_NORMALIZED_TEXRECT]
@ -3737,6 +3745,8 @@ static BOOL wined3d_adapter_init_gl_caps(struct wined3d_adapter *adapter,
else
d3d_info->multisample_draw_location = WINED3D_LOCATION_RB_MULTISAMPLE;
d3d_info->feature_level = feature_level_from_caps(gl_info, &d3d_info->limits, &shader_caps, &fragment_caps);
TRACE("Max texture stages: %u.\n", d3d_info->limits.ffp_blend_stages);
if (!d3d_info->shader_color_key)

View File

@ -691,8 +691,8 @@ enum wined3d_pci_device wined3d_gpu_from_feature_level(enum wined3d_pci_vendor *
{WINED3D_FEATURE_LEVEL_6, CARD_NVIDIA_RIVA_TNT},
{WINED3D_FEATURE_LEVEL_7, CARD_NVIDIA_GEFORCE},
{WINED3D_FEATURE_LEVEL_8, CARD_NVIDIA_GEFORCE3},
{WINED3D_FEATURE_LEVEL_9_SM2, CARD_NVIDIA_GEFORCEFX_5800},
{WINED3D_FEATURE_LEVEL_9_SM3, CARD_NVIDIA_GEFORCE_6800},
{WINED3D_FEATURE_LEVEL_9_2, CARD_NVIDIA_GEFORCEFX_5800},
{WINED3D_FEATURE_LEVEL_9_3, CARD_NVIDIA_GEFORCE_6800},
{WINED3D_FEATURE_LEVEL_10, CARD_NVIDIA_GEFORCE_8800GTX},
{WINED3D_FEATURE_LEVEL_11, CARD_NVIDIA_GEFORCE_GTX470},
{WINED3D_FEATURE_LEVEL_NONE},
@ -702,8 +702,8 @@ enum wined3d_pci_device wined3d_gpu_from_feature_level(enum wined3d_pci_vendor *
{WINED3D_FEATURE_LEVEL_5, CARD_AMD_RAGE_128PRO},
{WINED3D_FEATURE_LEVEL_7, CARD_AMD_RADEON_7200},
{WINED3D_FEATURE_LEVEL_8, CARD_AMD_RADEON_8500},
{WINED3D_FEATURE_LEVEL_9_SM2, CARD_AMD_RADEON_9500},
{WINED3D_FEATURE_LEVEL_9_SM3, CARD_AMD_RADEON_X1600},
{WINED3D_FEATURE_LEVEL_9_1, CARD_AMD_RADEON_9500},
{WINED3D_FEATURE_LEVEL_9_3, CARD_AMD_RADEON_X1600},
{WINED3D_FEATURE_LEVEL_10, CARD_AMD_RADEON_HD2900},
{WINED3D_FEATURE_LEVEL_11, CARD_AMD_RADEON_HD5600},
{WINED3D_FEATURE_LEVEL_NONE},
@ -712,7 +712,7 @@ enum wined3d_pci_device wined3d_gpu_from_feature_level(enum wined3d_pci_vendor *
{
{WINED3D_FEATURE_LEVEL_5, CARD_INTEL_845G},
{WINED3D_FEATURE_LEVEL_8, CARD_INTEL_915G},
{WINED3D_FEATURE_LEVEL_9_SM3, CARD_INTEL_945G},
{WINED3D_FEATURE_LEVEL_9_3, CARD_INTEL_945G},
{WINED3D_FEATURE_LEVEL_10, CARD_INTEL_G45},
{WINED3D_FEATURE_LEVEL_11, CARD_INTEL_IVBD},
{WINED3D_FEATURE_LEVEL_NONE},

View File

@ -3311,9 +3311,9 @@ static unsigned int shader_max_version_from_feature_level(enum wined3d_feature_l
case WINED3D_FEATURE_LEVEL_10_1:
case WINED3D_FEATURE_LEVEL_10:
return 4;
case WINED3D_FEATURE_LEVEL_9_SM3:
case WINED3D_FEATURE_LEVEL_9_3:
return 3;
case WINED3D_FEATURE_LEVEL_9_SM2:
case WINED3D_FEATURE_LEVEL_9_2:
case WINED3D_FEATURE_LEVEL_9_1:
return 2;
default:

View File

@ -6573,8 +6573,8 @@ const char *wined3d_debug_feature_level(enum wined3d_feature_level level)
LEVEL_TO_STR(WINED3D_FEATURE_LEVEL_7);
LEVEL_TO_STR(WINED3D_FEATURE_LEVEL_8);
LEVEL_TO_STR(WINED3D_FEATURE_LEVEL_9_1);
LEVEL_TO_STR(WINED3D_FEATURE_LEVEL_9_SM2);
LEVEL_TO_STR(WINED3D_FEATURE_LEVEL_9_SM3);
LEVEL_TO_STR(WINED3D_FEATURE_LEVEL_9_2);
LEVEL_TO_STR(WINED3D_FEATURE_LEVEL_9_3);
LEVEL_TO_STR(WINED3D_FEATURE_LEVEL_10);
LEVEL_TO_STR(WINED3D_FEATURE_LEVEL_10_1);
LEVEL_TO_STR(WINED3D_FEATURE_LEVEL_11);

View File

@ -96,8 +96,8 @@ enum wined3d_feature_level
WINED3D_FEATURE_LEVEL_7 = 0x7000,
WINED3D_FEATURE_LEVEL_8 = 0x8000,
WINED3D_FEATURE_LEVEL_9_1 = 0x9100,
WINED3D_FEATURE_LEVEL_9_SM2 = 0x9200,
WINED3D_FEATURE_LEVEL_9_SM3 = 0x9300,
WINED3D_FEATURE_LEVEL_9_2 = 0x9200,
WINED3D_FEATURE_LEVEL_9_3 = 0x9300,
WINED3D_FEATURE_LEVEL_10 = 0xa000,
WINED3D_FEATURE_LEVEL_10_1 = 0xa100,
WINED3D_FEATURE_LEVEL_11 = 0xb000,