Commit 7d9adef3 authored by Ian Romanick's avatar Ian Romanick

mesa: Enable GL_EXT_separate_shader_objects for OpenGL ES

Signed-off-by: 's avatarIan Romanick <ian.d.romanick@intel.com>
Reviewed-by: 's avatarEric Anholt <eric@anholt.net>
parent 507b875c
......@@ -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)
......
......@@ -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),
};
......
......@@ -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;
......
......@@ -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) {
......
......@@ -218,6 +218,7 @@ static const struct extension extension_table[] = {
{ "GL_EXT_provoking_vertex", o(EXT_provoking_vertex), GL, 2009 },
{ "GL_EXT_rescale_normal", o(dummy_true), GLL, 1997 },
{ "GL_EXT_secondary_color", o(dummy_true), GLL, 1999 },
{ "GL_EXT_separate_shader_objects", o(dummy_true), ES2, 2013 },
{ "GL_EXT_separate_specular_color", o(dummy_true), GLL, 1997 },
{ "GL_EXT_shader_integer_mix", o(EXT_shader_integer_mix), GL | ES3, 2013 },
{ "GL_EXT_shadow_funcs", o(ARB_shadow), GLL, 2002 },
......
......@@ -1303,6 +1303,43 @@ const struct function gles2_functions_possible[] = {
{ "glGetProgramBinaryOES", 20, -1 },
{ "glProgramBinaryOES", 20, -1 },
/* GL_EXT_separate_shader_objects - Also part of OpenGL ES 3.1. */
{ "glProgramParameteriEXT", 20, -1 },
{ "glUseProgramStagesEXT", 20, -1 },
{ "glActiveShaderProgramEXT", 20, -1 },
{ "glCreateShaderProgramvEXT", 20, -1 },
{ "glBindProgramPipelineEXT", 20, -1 },
{ "glDeleteProgramPipelinesEXT", 20, -1 },
{ "glGenProgramPipelinesEXT", 20, -1 },
{ "glIsProgramPipelineEXT", 20, -1 },
{ "glGetProgramPipelineivEXT", 20, -1 },
{ "glProgramUniform1iEXT", 20, -1 },
{ "glProgramUniform1ivEXT", 20, -1 },
{ "glProgramUniform1fEXT", 20, -1 },
{ "glProgramUniform1fvEXT", 20, -1 },
{ "glProgramUniform2iEXT", 20, -1 },
{ "glProgramUniform2ivEXT", 20, -1 },
{ "glProgramUniform2fEXT", 20, -1 },
{ "glProgramUniform2fvEXT", 20, -1 },
{ "glProgramUniform3iEXT", 20, -1 },
{ "glProgramUniform3ivEXT", 20, -1 },
{ "glProgramUniform3fEXT", 20, -1 },
{ "glProgramUniform3fvEXT", 20, -1 },
{ "glProgramUniform4iEXT", 20, -1 },
{ "glProgramUniform4ivEXT", 20, -1 },
{ "glProgramUniform4fEXT", 20, -1 },
{ "glProgramUniform4fvEXT", 20, -1 },
{ "glProgramUniformMatrix2fvEXT", 20, -1 },
{ "glProgramUniformMatrix3fvEXT", 20, -1 },
{ "glProgramUniformMatrix4fvEXT", 20, -1 },
{ "glProgramUniformMatrix2x3fvEXT", 20, -1 },
{ "glProgramUniformMatrix3x2fvEXT", 20, -1 },
{ "glProgramUniformMatrix2x4fvEXT", 20, -1 },
{ "glProgramUniformMatrix4x2fvEXT", 20, -1 },
{ "glProgramUniformMatrix3x4fvEXT", 20, -1 },
{ "glProgramUniformMatrix4x3fvEXT", 20, -1 },
{ "glValidateProgramPipelineEXT", 20, -1 },
{ "glGetProgramPipelineInfoLogEXT", 20, -1 },
{ NULL, 0, -1 }
};
......@@ -1386,7 +1423,7 @@ const struct function gles3_functions_possible[] = {
// { "glMapBufferRange", 30, -1 },
{ "glPauseTransformFeedback", 30, -1 },
// glProgramBinary aliases glProgramBinaryOES in GLES 2
{ "glProgramParameteri", 30, -1 },
// glProgramParameteri aliases glProgramParameteriEXT in GLES 2
// We check for the aliased -NV version in GLES 2
// { "glReadBuffer", 30, -1 },
{ "glRenderbufferStorageMultisample", 30, -1 },
......@@ -1426,5 +1463,16 @@ const struct function gles3_functions_possible[] = {
{ "glVertexAttribI4uiv", 30, -1 },
{ "glVertexAttribIPointer", 30, -1 },
{ "glWaitSync", 30, -1 },
/* GL_EXT_separate_shader_objects - Also part of OpenGL ES 3.1. */
{ "glProgramUniform1uiEXT", 30, -1 },
{ "glProgramUniform1uivEXT", 30, -1 },
{ "glProgramUniform2uiEXT", 30, -1 },
{ "glProgramUniform2uivEXT", 30, -1 },
{ "glProgramUniform3uiEXT", 30, -1 },
{ "glProgramUniform3uivEXT", 30, -1 },
{ "glProgramUniform4uiEXT", 30, -1 },
{ "glProgramUniform4uivEXT", 30, -1 },
{ NULL, 0, -1 }
};
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