mesa: plug in stubs for glBindFragDataLocation(), glGetFragDataLocation()
authorBrian Paul <brianp@vmware.com>
Fri, 29 Oct 2010 03:17:41 +0000 (21:17 -0600)
committerBrian Paul <brianp@vmware.com>
Fri, 29 Oct 2010 03:17:41 +0000 (21:17 -0600)
src/mesa/main/shaderapi.c
src/mesa/main/shaderapi.h

index e6c7f7aa3f8515721ce445c6eacd8bc408b757f8..622285debb3edc982cb49348b0baf1a21c30ca72 100644 (file)
@@ -404,6 +404,14 @@ bind_attrib_location(struct gl_context *ctx, GLuint program, GLuint index,
 }
 
 
+static void
+bind_frag_data_location(struct gl_context *ctx, GLuint program,
+                        GLuint colorNumber, const GLchar *name)
+{
+   _mesa_problem(ctx, "bind_frag_data_location() not implemented yet");
+}
+
+
 static GLuint
 create_shader(struct gl_context *ctx, GLenum type)
 {
@@ -605,6 +613,16 @@ get_attached_shaders(struct gl_context *ctx, GLuint program, GLsizei maxCount,
 }
 
 
+static GLint
+get_frag_data_location(struct gl_context *ctx, GLuint program,
+                       const GLchar *name)
+{
+   _mesa_problem(ctx, "get_frag_data_location() not implemented yet");
+   return -1;
+}
+
+
+
 /**
  * glGetHandleARB() - return ID/name of currently bound shader program.
  */
@@ -1185,6 +1203,16 @@ _mesa_BindAttribLocationARB(GLhandleARB program, GLuint index,
 }
 
 
+/* GL_EXT_gpu_shader4, GL3 */
+void GLAPIENTRY
+_mesa_BindFragDataLocation(GLuint program, GLuint colorNumber,
+                           const GLchar *name)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   bind_frag_data_location(ctx, program, colorNumber, name);
+}
+
+
 void GLAPIENTRY
 _mesa_CompileShaderARB(GLhandleARB shaderObj)
 {
@@ -1315,6 +1343,16 @@ _mesa_GetAttribLocationARB(GLhandleARB program, const GLcharARB * name)
 }
 
 
+/* GL_EXT_gpu_shader4, GL3 */
+GLint GLAPIENTRY
+_mesa_GetFragDataLocation(GLuint program, const GLchar *name)
+{
+   GET_CURRENT_CONTEXT(ctx);
+   return get_frag_data_location(ctx, program, name);
+}
+
+
+
 void GLAPIENTRY
 _mesa_GetInfoLogARB(GLhandleARB object, GLsizei maxLength, GLsizei * length,
                     GLcharARB * infoLog)
@@ -1842,6 +1880,11 @@ _mesa_init_shader_dispatch(struct _glapi_table *exec)
    SET_UseShaderProgramEXT(exec, _mesa_UseShaderProgramEXT);
    SET_ActiveProgramEXT(exec, _mesa_ActiveProgramEXT);
    SET_CreateShaderProgramEXT(exec, _mesa_CreateShaderProgramEXT);
+
+   /* GL_EXT_gpu_shader4 / GL 3.0 */
+   SET_BindFragDataLocationEXT(exec, _mesa_BindFragDataLocation);
+   SET_GetFragDataLocationEXT(exec, _mesa_GetFragDataLocation);
+
 #endif /* FEATURE_GL */
 }
 
index de67a9929efab30c33eea45713bdf0f631fd39af..db316ab6a75c3d447fb3459d9806c9567ce9c45d 100644 (file)
@@ -68,6 +68,9 @@ _mesa_DetachObjectARB(GLhandleARB, GLhandleARB);
 extern void GLAPIENTRY
 _mesa_GetAttachedObjectsARB(GLhandleARB, GLsizei, GLsizei *, GLhandleARB *);
 
+extern GLint GLAPIENTRY
+_mesa_GetFragDataLocation(GLuint program, const GLchar *name);
+
 extern GLhandleARB GLAPIENTRY
 _mesa_GetHandleARB(GLenum pname);
 
@@ -105,6 +108,10 @@ _mesa_ValidateProgramARB(GLhandleARB);
 extern void GLAPIENTRY
 _mesa_BindAttribLocationARB(GLhandleARB, GLuint, const GLcharARB *);
 
+extern void GLAPIENTRY
+_mesa_BindFragDataLocation(GLuint program, GLuint colorNumber,
+                           const GLchar *name);
+
 extern void GLAPIENTRY
 _mesa_GetActiveAttribARB(GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *,
                          GLenum *, GLcharARB *);