diff options
author | Ian Romanick <[email protected]> | 2014-03-26 13:11:44 -0700 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2014-05-02 07:20:10 -0700 |
commit | 7d9adef3409583ef480d6f25014188d38e261a1e (patch) | |
tree | 3899526aab35aabd477421370c18b11b06bdddef /src/glsl | |
parent | 507b875cf50ce1743403a084f5bc5f5fac0ca22e (diff) |
mesa: Enable GL_EXT_separate_shader_objects for OpenGL ES
Signed-off-by: Ian Romanick <[email protected]>
Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/glsl')
-rw-r--r-- | src/glsl/glcpp/glcpp-parse.y | 1 | ||||
-rw-r--r-- | src/glsl/glsl_parser_extras.cpp | 1 | ||||
-rw-r--r-- | src/glsl/glsl_parser_extras.h | 8 | ||||
-rw-r--r-- | src/glsl/linker.cpp | 3 |
4 files changed, 9 insertions, 4 deletions
diff --git a/src/glsl/glcpp/glcpp-parse.y b/src/glsl/glcpp/glcpp-parse.y index 412d571e6eb..98875837cdd 100644 --- a/src/glsl/glcpp/glcpp-parse.y +++ b/src/glsl/glcpp/glcpp-parse.y @@ -2062,6 +2062,7 @@ _glcpp_parser_handle_version_declaration(glcpp_parser_t *parser, intmax_t versio /* Add pre-defined macros. */ if (parser->is_gles) { add_builtin_define(parser, "GL_ES", 1); + add_builtin_define(parser, "GL_EXT_separate_shader_objects", 1); if (extensions != NULL) { if (extensions->OES_EGL_image_external) diff --git a/src/glsl/glsl_parser_extras.cpp b/src/glsl/glsl_parser_extras.cpp index d7352a7d66d..1e619265c9e 100644 --- a/src/glsl/glsl_parser_extras.cpp +++ b/src/glsl/glsl_parser_extras.cpp @@ -550,6 +550,7 @@ static const _mesa_glsl_extension _mesa_glsl_supported_extensions[] = { EXT(AMD_shader_stencil_export, true, false, ARB_shader_stencil_export), EXT(AMD_shader_trinary_minmax, true, false, dummy_true), EXT(AMD_vertex_shader_layer, true, false, AMD_vertex_shader_layer), + EXT(EXT_separate_shader_objects, false, true, dummy_true), EXT(EXT_shader_integer_mix, true, true, EXT_shader_integer_mix), EXT(EXT_texture_array, true, false, EXT_texture_array), }; diff --git a/src/glsl/glsl_parser_extras.h b/src/glsl/glsl_parser_extras.h index 725ee62ab21..0416a9c7252 100644 --- a/src/glsl/glsl_parser_extras.h +++ b/src/glsl/glsl_parser_extras.h @@ -140,8 +140,7 @@ struct _mesa_glsl_parse_state { { if (!this->has_separate_shader_objects()) { const char *const requirement = this->es_shader - ? "GL_EXT_separate_shader_objects (not supported by this " - "implementation)" + ? "GL_EXT_separate_shader_objects extension" : "GL_ARB_separate_shader_objects extension or GLSL 420"; _mesa_glsl_error(locp, this, "%s explicit location requires %s", @@ -164,7 +163,8 @@ struct _mesa_glsl_parse_state { bool has_separate_shader_objects() const { - return ARB_separate_shader_objects_enable || is_version(410, 0); + return ARB_separate_shader_objects_enable || is_version(410, 0) + || EXT_separate_shader_objects_enable; } void process_version_directive(YYLTYPE *locp, int version, @@ -424,6 +424,8 @@ struct _mesa_glsl_parse_state { bool AMD_shader_trinary_minmax_warn; bool AMD_vertex_shader_layer_enable; bool AMD_vertex_shader_layer_warn; + bool EXT_separate_shader_objects_enable; + bool EXT_separate_shader_objects_warn; bool EXT_shader_integer_mix_enable; bool EXT_shader_integer_mix_warn; bool EXT_texture_array_enable; diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp index fbc03587765..7ec1e5a34f3 100644 --- a/src/glsl/linker.cpp +++ b/src/glsl/linker.cpp @@ -2607,7 +2607,8 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog) * fragment shader) is absent. So, the extension shouldn't change the * behavior specified in GLSL specification. */ - if (!prog->InternalSeparateShader && ctx->API == API_OPENGLES2) { + if (!prog->InternalSeparateShader && !prog->SeparateShader + && ctx->API == API_OPENGLES2) { if (prog->_LinkedShaders[MESA_SHADER_VERTEX] == NULL) { linker_error(prog, "program lacks a vertex shader\n"); } else if (prog->_LinkedShaders[MESA_SHADER_FRAGMENT] == NULL) { |