Commit a622fbf9 authored by Józef Kucia's avatar Józef Kucia Committed by Alexandre Julliard

wined3d: Separate feature level checks from shader model checks.

parent 7837ae20
...@@ -1844,13 +1844,20 @@ static enum wined3d_pci_vendor wined3d_guess_card_vendor(const char *gl_vendor_s ...@@ -1844,13 +1844,20 @@ static enum wined3d_pci_vendor wined3d_guess_card_vendor(const char *gl_vendor_s
return HW_VENDOR_NVIDIA; return HW_VENDOR_NVIDIA;
} }
static enum wined3d_feature_level feature_level_from_caps(const struct shader_caps *shader_caps, static enum wined3d_feature_level feature_level_from_caps(const struct wined3d_gl_info *gl_info,
const struct fragment_caps *fragment_caps) const struct shader_caps *shader_caps, const struct fragment_caps *fragment_caps)
{ {
if (shader_caps->vs_version >= 5) if (gl_info->supported[WINED3D_GL_VERSION_3_2] && gl_info->supported[ARB_SAMPLER_OBJECTS])
{
if (shader_caps->vs_version >= 5
&& gl_info->supported[ARB_DRAW_INDIRECT]
&& gl_info->supported[ARB_TEXTURE_COMPRESSION_BPTC])
return WINED3D_FEATURE_LEVEL_11; return WINED3D_FEATURE_LEVEL_11;
if (shader_caps->vs_version == 4) if (shader_caps->vs_version == 4)
return WINED3D_FEATURE_LEVEL_10; return WINED3D_FEATURE_LEVEL_10;
}
if (shader_caps->vs_version == 3) if (shader_caps->vs_version == 3)
return WINED3D_FEATURE_LEVEL_9_SM3; return WINED3D_FEATURE_LEVEL_9_SM3;
if (shader_caps->vs_version == 2) if (shader_caps->vs_version == 2)
...@@ -4306,7 +4313,7 @@ static BOOL wined3d_adapter_init_gl_caps(struct wined3d_adapter *adapter, ...@@ -4306,7 +4313,7 @@ static BOOL wined3d_adapter_init_gl_caps(struct wined3d_adapter *adapter,
d3d_info->limits.ffp_textures = fragment_caps.MaxSimultaneousTextures; d3d_info->limits.ffp_textures = fragment_caps.MaxSimultaneousTextures;
d3d_info->shader_color_key = fragment_caps.wined3d_caps & WINED3D_FRAGMENT_CAP_COLOR_KEY; d3d_info->shader_color_key = fragment_caps.wined3d_caps & WINED3D_FRAGMENT_CAP_COLOR_KEY;
d3d_info->wined3d_creation_flags = wined3d_creation_flags; d3d_info->wined3d_creation_flags = wined3d_creation_flags;
d3d_info->feature_level = feature_level_from_caps(&shader_caps, &fragment_caps); d3d_info->feature_level = feature_level_from_caps(gl_info, &shader_caps, &fragment_caps);
TRACE("Max texture stages: %u.\n", d3d_info->limits.ffp_blend_stages); TRACE("Max texture stages: %u.\n", d3d_info->limits.ffp_blend_stages);
......
...@@ -11242,8 +11242,6 @@ static void shader_glsl_init_context_state(struct wined3d_context *context) ...@@ -11242,8 +11242,6 @@ static void shader_glsl_init_context_state(struct wined3d_context *context)
static unsigned int shader_glsl_get_shader_model(const struct wined3d_gl_info *gl_info) static unsigned int shader_glsl_get_shader_model(const struct wined3d_gl_info *gl_info)
{ {
BOOL shader_model_4 = gl_info->glsl_version >= MAKEDWORD_VERSION(1, 50) BOOL shader_model_4 = gl_info->glsl_version >= MAKEDWORD_VERSION(1, 50)
&& gl_info->supported[WINED3D_GL_VERSION_3_2]
&& gl_info->supported[ARB_SAMPLER_OBJECTS]
&& gl_info->supported[ARB_SHADER_BIT_ENCODING] && gl_info->supported[ARB_SHADER_BIT_ENCODING]
&& gl_info->supported[ARB_TEXTURE_SWIZZLE]; && gl_info->supported[ARB_TEXTURE_SWIZZLE];
...@@ -11251,14 +11249,12 @@ static unsigned int shader_glsl_get_shader_model(const struct wined3d_gl_info *g ...@@ -11251,14 +11249,12 @@ static unsigned int shader_glsl_get_shader_model(const struct wined3d_gl_info *g
&& gl_info->supported[ARB_COMPUTE_SHADER] && gl_info->supported[ARB_COMPUTE_SHADER]
&& gl_info->supported[ARB_CULL_DISTANCE] && gl_info->supported[ARB_CULL_DISTANCE]
&& gl_info->supported[ARB_DERIVATIVE_CONTROL] && gl_info->supported[ARB_DERIVATIVE_CONTROL]
&& gl_info->supported[ARB_DRAW_INDIRECT]
&& gl_info->supported[ARB_GPU_SHADER5] && gl_info->supported[ARB_GPU_SHADER5]
&& gl_info->supported[ARB_SHADER_ATOMIC_COUNTERS] && gl_info->supported[ARB_SHADER_ATOMIC_COUNTERS]
&& gl_info->supported[ARB_SHADER_IMAGE_LOAD_STORE] && gl_info->supported[ARB_SHADER_IMAGE_LOAD_STORE]
&& gl_info->supported[ARB_SHADER_IMAGE_SIZE] && gl_info->supported[ARB_SHADER_IMAGE_SIZE]
&& gl_info->supported[ARB_SHADING_LANGUAGE_PACKING] && gl_info->supported[ARB_SHADING_LANGUAGE_PACKING]
&& gl_info->supported[ARB_TESSELLATION_SHADER] && gl_info->supported[ARB_TESSELLATION_SHADER]
&& gl_info->supported[ARB_TEXTURE_COMPRESSION_BPTC]
&& gl_info->supported[ARB_TEXTURE_GATHER] && gl_info->supported[ARB_TEXTURE_GATHER]
&& gl_info->supported[ARB_TRANSFORM_FEEDBACK3]) && gl_info->supported[ARB_TRANSFORM_FEEDBACK3])
return 5; return 5;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment