Commit 4c0b1a50 authored by Matteo Bruni's avatar Matteo Bruni Committed by Alexandre Julliard

wined3d: Use GLSL 1.50 on core contexts.

parent a1e718cc
...@@ -297,7 +297,9 @@ static const char *shader_glsl_get_prefix(enum wined3d_shader_type type) ...@@ -297,7 +297,9 @@ static const char *shader_glsl_get_prefix(enum wined3d_shader_type type)
static const char *shader_glsl_get_version(const struct wined3d_gl_info *gl_info, static const char *shader_glsl_get_version(const struct wined3d_gl_info *gl_info,
const struct wined3d_shader_version *version) const struct wined3d_shader_version *version)
{ {
if (gl_info->glsl_version >= MAKEDWORD_VERSION(1, 30) && version->major >= 4) if (!gl_info->supported[WINED3D_GL_LEGACY_CONTEXT])
return "#version 150";
else if (gl_info->glsl_version >= MAKEDWORD_VERSION(1, 30) && version && version->major >= 4)
return "#version 130"; return "#version 130";
else else
return "#version 120"; return "#version 120";
...@@ -5594,8 +5596,7 @@ static GLuint shader_glsl_generate_ffp_vertex_shader(struct wined3d_string_buffe ...@@ -5594,8 +5596,7 @@ static GLuint shader_glsl_generate_ffp_vertex_shader(struct wined3d_string_buffe
string_buffer_clear(buffer); string_buffer_clear(buffer);
shader_addline(buffer, "#version 120\n"); shader_addline(buffer, "%s\n", shader_glsl_get_version(gl_info, NULL));
shader_addline(buffer, "\n");
for (i = 0; i < WINED3D_FFP_ATTRIBS_COUNT; ++i) for (i = 0; i < WINED3D_FFP_ATTRIBS_COUNT; ++i)
{ {
...@@ -6112,7 +6113,7 @@ static GLuint shader_glsl_generate_ffp_fragment_shader(struct shader_glsl_priv * ...@@ -6112,7 +6113,7 @@ static GLuint shader_glsl_generate_ffp_fragment_shader(struct shader_glsl_priv *
} }
lowest_disabled_stage = stage; lowest_disabled_stage = stage;
shader_addline(buffer, "#version 120\n"); shader_addline(buffer, "%s\n", shader_glsl_get_version(gl_info, NULL));
if (gl_info->supported[ARB_TEXTURE_RECTANGLE]) if (gl_info->supported[ARB_TEXTURE_RECTANGLE])
shader_addline(buffer, "#extension GL_ARB_texture_rectangle : enable\n"); shader_addline(buffer, "#extension GL_ARB_texture_rectangle : enable\n");
......
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