OPCODE_TEXPARAMETER_I,
OPCODE_TEXPARAMETER_UI,
- /* GL_EXT_separate_shader_objects */
- OPCODE_ACTIVE_PROGRAM_EXT,
- OPCODE_USE_SHADER_PROGRAM_EXT,
-
/* GL_ARB_instanced_arrays */
OPCODE_VERTEX_ATTRIB_DIVISOR,
}
}
-static void GLAPIENTRY
-save_UseShaderProgramEXT(GLenum type, GLuint program)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_USE_SHADER_PROGRAM_EXT, 2);
- if (n) {
- n[1].ui = type;
- n[2].ui = program;
- }
- if (ctx->ExecuteFlag) {
- CALL_UseShaderProgramEXT(ctx->Exec, (type, program));
- }
-}
-
-static void GLAPIENTRY
-save_ActiveProgramEXT(GLuint program)
-{
- GET_CURRENT_CONTEXT(ctx);
- Node *n;
- ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = alloc_instruction(ctx, OPCODE_ACTIVE_PROGRAM_EXT, 1);
- if (n) {
- n[1].ui = program;
- }
- if (ctx->ExecuteFlag) {
- CALL_ActiveProgramEXT(ctx->Exec, (program));
- }
-}
-
/** GL_EXT_texture_integer */
static void GLAPIENTRY
save_ClearColorIi(GLint red, GLint green, GLint blue, GLint alpha)
case OPCODE_USE_PROGRAM:
CALL_UseProgram(ctx->Exec, (n[1].ui));
break;
- case OPCODE_USE_SHADER_PROGRAM_EXT:
- CALL_UseShaderProgramEXT(ctx->Exec, (n[1].ui, n[2].ui));
- break;
- case OPCODE_ACTIVE_PROGRAM_EXT:
- CALL_ActiveProgramEXT(ctx->Exec, (n[1].ui));
- break;
case OPCODE_UNIFORM_1F:
CALL_Uniform1f(ctx->Exec, (n[1].i, n[2].f));
break;
SET_TexParameterIiv(table, save_TexParameterIiv);
SET_TexParameterIuiv(table, save_TexParameterIuiv);
- /* 377. GL_EXT_separate_shader_objects */
- SET_UseShaderProgramEXT(table, save_UseShaderProgramEXT);
- SET_ActiveProgramEXT(table, save_ActiveProgramEXT);
-
/* GL_ARB_color_buffer_float */
SET_ClampColor(table, save_ClampColorARB);
{ "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(EXT_separate_shader_objects), GLL, 2008 },
{ "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 },
ctx->Extensions.ARB_occlusion_query = GL_TRUE;
ctx->Extensions.ARB_occlusion_query2 = GL_TRUE;
ctx->Extensions.ARB_point_sprite = GL_TRUE;
- ctx->Extensions.EXT_separate_shader_objects = GL_TRUE;
ctx->Extensions.ARB_shadow = GL_TRUE;
ctx->Extensions.ARB_texture_border_clamp = GL_TRUE;
ctx->Extensions.ARB_texture_cube_map = GL_TRUE;
/**
* Set/replace shader source code. A helper function used by
- * glShaderSource[ARB] and glCreateShaderProgramEXT.
+ * glShaderSource[ARB].
*/
static void
shader_source(struct gl_context *ctx, GLuint shader, const GLchar *source)
shProg = NULL;
}
- /* The "Dependencies on EXT_separate_shader_objects" section of the
- * ARB_separate_shader_object spec says:
+ /* The ARB_separate_shader_object spec says:
*
* "The executable code for an individual shader stage is taken from
* the current program for that stage. If there is a current program
- * object for any shader stage or for uniform updates established by
- * UseProgram, UseShaderProgramEXT, or ActiveProgramEXT, the current
- * program for that stage (if any) is considered current. Otherwise,
- * if there is a bound program pipeline object ..."
+ * object established by UseProgram, that program is considered current
+ * for all stages. Otherwise, if there is a bound program pipeline
+ * object (section 2.14.PPO), the program bound to the appropriate
+ * stage of the pipeline object is considered current."
*/
if (program) {
/* Attach shader state to the binding point */
}
-/**
- * For GL_EXT_separate_shader_objects
- */
-void GLAPIENTRY
-_mesa_UseShaderProgramEXT(GLenum type, GLuint program)
-{
- GET_CURRENT_CONTEXT(ctx);
- struct gl_shader_program *shProg = NULL;
-
- if (!_mesa_validate_shader_target(ctx, type)) {
- _mesa_error(ctx, GL_INVALID_ENUM, "glUseShaderProgramEXT(type)");
- return;
- }
-
- if (_mesa_is_xfb_active_and_unpaused(ctx)) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glUseShaderProgramEXT(transform feedback is active)");
- return;
- }
-
- if (program) {
- shProg = _mesa_lookup_shader_program_err(ctx, program,
- "glUseShaderProgramEXT");
- if (shProg == NULL)
- return;
-
- if (!shProg->LinkStatus) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glUseShaderProgramEXT(program not linked)");
- return;
- }
- }
-
- /* The "Dependencies on EXT_separate_shader_objects" section of the
- * ARB_separate_shader_object spec says:
- *
- * "The executable code for an individual shader stage is taken from
- * the current program for that stage. If there is a current program
- * object for any shader stage or for uniform updates established by
- * UseProgram, UseShaderProgramEXT, or ActiveProgramEXT, the current
- * program for that stage (if any) is considered current. Otherwise,
- * if there is a bound program pipeline object ..."
- */
- if (program) {
- /* Attach shader state to the binding point */
- _mesa_reference_pipeline_object(ctx, &ctx->_Shader, &ctx->Shader);
- /* Update the program */
- _mesa_use_shader_program(ctx, type, shProg, ctx->_Shader);
- } else {
- /* Must be done first: detach the progam */
- _mesa_use_shader_program(ctx, type, shProg, ctx->_Shader);
-
- /* Nothing remains current */
- if (!ctx->Shader.CurrentProgram[MESA_SHADER_VERTEX] &&
- !ctx->Shader.CurrentProgram[MESA_SHADER_GEOMETRY] &&
- !ctx->Shader.CurrentProgram[MESA_SHADER_FRAGMENT] &&
- !ctx->Shader.ActiveProgram) {
-
- /* Unattach shader_state binding point */
- _mesa_reference_pipeline_object(ctx, &ctx->_Shader,
- ctx->Pipeline.Default);
-
- /* If a pipeline was bound, rebind it */
- if (ctx->Pipeline.Current) {
- _mesa_BindProgramPipeline(ctx->Pipeline.Current->Name);
- }
- }
- }
-}
-
-
-/**
- * For GL_EXT_separate_shader_objects
- */
-void GLAPIENTRY
-_mesa_ActiveProgramEXT(GLuint program)
-{
- GET_CURRENT_CONTEXT(ctx);
- struct gl_shader_program *shProg = (program != 0)
- ? _mesa_lookup_shader_program_err(ctx, program, "glActiveProgramEXT")
- : NULL;
-
- /* The "Dependencies on EXT_separate_shader_objects" section of the
- * ARB_separate_shader_object spec says:
- *
- * "The executable code for an individual shader stage is taken from
- * the current program for that stage. If there is a current program
- * object for any shader stage or for uniform updates established by
- * UseProgram, UseShaderProgramEXT, or ActiveProgramEXT, the current
- * program for that stage (if any) is considered current. Otherwise,
- * if there is a bound program pipeline object ..."
- */
- if (shProg != NULL) {
- /* Attach shader state to the binding point */
- _mesa_reference_pipeline_object(ctx, &ctx->_Shader, &ctx->Shader);
- _mesa_active_program(ctx, shProg, "glActiveProgramEXT");
- } else {
- /* Must be done first: unset the current active progam */
- _mesa_active_program(ctx, shProg, "glActiveProgramEXT");
-
- /* Nothing remains current */
- if (!ctx->Shader.CurrentProgram[MESA_SHADER_VERTEX] &&
- !ctx->Shader.CurrentProgram[MESA_SHADER_GEOMETRY] &&
- !ctx->Shader.CurrentProgram[MESA_SHADER_FRAGMENT] &&
- !ctx->Shader.ActiveProgram) {
-
- /* Unattach shader_state binding point */
- _mesa_reference_pipeline_object(ctx, &ctx->_Shader, ctx->Pipeline.Default);
- /* If a pipeline was bound, rebind it */
- if (ctx->Pipeline.Current) {
- _mesa_BindProgramPipeline(ctx->Pipeline.Current->Name);
- }
- }
- }
-
- return;
-}
-
static GLuint
_mesa_create_shader_program(struct gl_context* ctx, GLboolean separate,
GLenum type, GLsizei count, const GLchar* const *strings)
}
}
-
-/**
- * For GL_EXT_separate_shader_objects
- */
-GLuint GLAPIENTRY
-_mesa_CreateShaderProgramEXT(GLenum type, const GLchar *string)
-{
- GET_CURRENT_CONTEXT(ctx);
-
- return _mesa_create_shader_program(ctx, GL_FALSE, type, 1, &string);
-}
-
/**
* ARB_separate_shader_objects: Compile & Link Program
- *
- * Basically the same as _mesa_CreateShaderProgramEXT but with support of
- * multiple strings and sets the SeparateShader flag to true.
*/
GLuint GLAPIENTRY
_mesa_CreateShaderProgramv(GLenum type, GLsizei count,