mesa: make _mesa_validate_sync() non-static
[mesa.git] / src / mesa / main / uniforms.h
index 77c24319b9a24cb36361f0a1fe006656fd529c0d..92239176e941b1f696379b96383ee11106fe1a19 100644 (file)
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
  */
 
 
@@ -39,37 +40,37 @@ struct gl_program;
 struct _glapi_table;
 
 void GLAPIENTRY
-_mesa_Uniform1fARB(GLint, GLfloat);
+_mesa_Uniform1f(GLint, GLfloat);
 void GLAPIENTRY
-_mesa_Uniform2fARB(GLint, GLfloat, GLfloat);
+_mesa_Uniform2f(GLint, GLfloat, GLfloat);
 void GLAPIENTRY
-_mesa_Uniform3fARB(GLint, GLfloat, GLfloat, GLfloat);
+_mesa_Uniform3f(GLint, GLfloat, GLfloat, GLfloat);
 void GLAPIENTRY
-_mesa_Uniform4fARB(GLint, GLfloat, GLfloat, GLfloat, GLfloat);
+_mesa_Uniform4f(GLint, GLfloat, GLfloat, GLfloat, GLfloat);
 void GLAPIENTRY
-_mesa_Uniform1iARB(GLint, GLint);
+_mesa_Uniform1i(GLint, GLint);
 void GLAPIENTRY
-_mesa_Uniform2iARB(GLint, GLint, GLint);
+_mesa_Uniform2i(GLint, GLint, GLint);
 void GLAPIENTRY
-_mesa_Uniform3iARB(GLint, GLint, GLint, GLint);
+_mesa_Uniform3i(GLint, GLint, GLint, GLint);
 void GLAPIENTRY
-_mesa_Uniform4iARB(GLint, GLint, GLint, GLint, GLint);
+_mesa_Uniform4i(GLint, GLint, GLint, GLint, GLint);
 void GLAPIENTRY
-_mesa_Uniform1fvARB(GLint, GLsizei, const GLfloat *);
+_mesa_Uniform1fv(GLint, GLsizei, const GLfloat *);
 void GLAPIENTRY
-_mesa_Uniform2fvARB(GLint, GLsizei, const GLfloat *);
+_mesa_Uniform2fv(GLint, GLsizei, const GLfloat *);
 void GLAPIENTRY
-_mesa_Uniform3fvARB(GLint, GLsizei, const GLfloat *);
+_mesa_Uniform3fv(GLint, GLsizei, const GLfloat *);
 void GLAPIENTRY
-_mesa_Uniform4fvARB(GLint, GLsizei, const GLfloat *);
+_mesa_Uniform4fv(GLint, GLsizei, const GLfloat *);
 void GLAPIENTRY
-_mesa_Uniform1ivARB(GLint, GLsizei, const GLint *);
+_mesa_Uniform1iv(GLint, GLsizei, const GLint *);
 void GLAPIENTRY
-_mesa_Uniform2ivARB(GLint, GLsizei, const GLint *);
+_mesa_Uniform2iv(GLint, GLsizei, const GLint *);
 void GLAPIENTRY
-_mesa_Uniform3ivARB(GLint, GLsizei, const GLint *);
+_mesa_Uniform3iv(GLint, GLsizei, const GLint *);
 void GLAPIENTRY
-_mesa_Uniform4ivARB(GLint, GLsizei, const GLint *);
+_mesa_Uniform4iv(GLint, GLsizei, const GLint *);
 void GLAPIENTRY
 _mesa_Uniform1ui(GLint location, GLuint v0);
 void GLAPIENTRY
@@ -87,11 +88,11 @@ _mesa_Uniform3uiv(GLint location, GLsizei count, const GLuint *value);
 void GLAPIENTRY
 _mesa_Uniform4uiv(GLint location, GLsizei count, const GLuint *value);
 void GLAPIENTRY
-_mesa_UniformMatrix2fvARB(GLint, GLsizei, GLboolean, const GLfloat *);
+_mesa_UniformMatrix2fv(GLint, GLsizei, GLboolean, const GLfloat *);
 void GLAPIENTRY
-_mesa_UniformMatrix3fvARB(GLint, GLsizei, GLboolean, const GLfloat *);
+_mesa_UniformMatrix3fv(GLint, GLsizei, GLboolean, const GLfloat *);
 void GLAPIENTRY
-_mesa_UniformMatrix4fvARB(GLint, GLsizei, GLboolean, const GLfloat *);
+_mesa_UniformMatrix4fv(GLint, GLsizei, GLboolean, const GLfloat *);
 void GLAPIENTRY
 _mesa_UniformMatrix2x3fv(GLint location, GLsizei count, GLboolean transpose,
                          const GLfloat *value);
@@ -113,7 +114,7 @@ _mesa_UniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose,
 void GLAPIENTRY
 _mesa_GetnUniformfvARB(GLhandleARB, GLint, GLsizei, GLfloat *);
 void GLAPIENTRY
-_mesa_GetUniformfvARB(GLhandleARB, GLint, GLfloat *);
+_mesa_GetUniformfv(GLhandleARB, GLint, GLfloat *);
 void GLAPIENTRY
 _mesa_GetnUniformivARB(GLhandleARB, GLint, GLsizei, GLint *);
 void GLAPIENTRY
@@ -127,7 +128,7 @@ _mesa_GetnUniformdvARB(GLhandleARB, GLint, GLsizei, GLdouble *);
 void GLAPIENTRY
 _mesa_GetUniformdv(GLhandleARB, GLint, GLdouble *);
 GLint GLAPIENTRY
-_mesa_GetUniformLocationARB(GLhandleARB, const GLcharARB *);
+_mesa_GetUniformLocation(GLhandleARB, const GLcharARB *);
 GLuint GLAPIENTRY
 _mesa_GetUniformBlockIndex(GLuint program,
                           const GLchar *uniformBlockName);
@@ -156,7 +157,7 @@ _mesa_GetActiveUniformName(GLuint program, GLuint uniformIndex,
                           GLsizei bufSize, GLsizei *length,
                           GLchar *uniformName);
 void GLAPIENTRY
-_mesa_GetActiveUniformARB(GLhandleARB, GLuint, GLsizei, GLsizei *,
+_mesa_GetActiveUniform(GLhandleARB, GLuint, GLsizei, GLsizei *,
                           GLint *, GLenum *, GLcharARB *);
 void GLAPIENTRY
 _mesa_GetActiveUniformsiv(GLuint program,
@@ -165,7 +166,11 @@ _mesa_GetActiveUniformsiv(GLuint program,
                          GLenum pname,
                          GLint *params);
 void GLAPIENTRY
-_mesa_GetUniformivARB(GLhandleARB, GLint, GLint *);
+_mesa_GetUniformiv(GLhandleARB, GLint, GLint *);
+
+long
+_mesa_parse_program_resource_name(const GLchar *name,
+                                  const GLchar **out_base_name_end);
 
 unsigned
 _mesa_get_uniform_location(struct gl_context *ctx, struct gl_shader_program *shProg,
@@ -210,13 +215,14 @@ extern bool
 _mesa_sampler_uniforms_are_valid(const struct gl_shader_program *shProg,
                                 char *errMsg, size_t errMsgLength);
 
-extern void
-_mesa_init_shader_uniform_dispatch(const struct gl_context *ctx,
-                                   struct _glapi_table *exec);
-
 extern const struct gl_program_parameter *
 get_uniform_parameter(struct gl_shader_program *shProg, GLint index);
 
+extern void
+_mesa_get_uniform_name(const struct gl_uniform_storage *uni,
+                       GLsizei maxLength, GLsizei *length,
+                       GLchar *nameOut);
+
 struct gl_builtin_uniform_element {
    const char *field;
    int tokens[STATE_LENGTH];
@@ -263,20 +269,24 @@ struct gl_builtin_uniform_desc {
  * Combine the uniform's base location and the offset
  */
 static inline GLint
-_mesa_uniform_merge_location_offset(unsigned base_location, unsigned offset)
+_mesa_uniform_merge_location_offset(const struct gl_shader_program *prog,
+                                    unsigned base_location, unsigned offset)
 {
-   return (base_location << 16) | offset;
+   assert(prog->UniformLocationBaseScale >= 1);
+   assert(offset < prog->UniformLocationBaseScale);
+   return (base_location * prog->UniformLocationBaseScale) + offset;
 }
 
 /**
  * Separate the uniform base location and parameter offset
  */
 static inline void
-_mesa_uniform_split_location_offset(GLint location, unsigned *base_location,
+_mesa_uniform_split_location_offset(const struct gl_shader_program *prog,
+                                    GLint location, unsigned *base_location,
                                    unsigned *offset)
 {
-   *offset = location & 0xffff;
-   *base_location = location >> 16;
+   *offset = location % prog->UniformLocationBaseScale;
+   *base_location = location / prog->UniformLocationBaseScale;
 }
 /*@}*/