mesa: make _mesa_validate_sync() non-static
[mesa.git] / src / mesa / main / uniforms.h
index 5ebd5e49a7882545c8a79cf4dab2ff9457603cdf..92239176e941b1f696379b96383ee11106fe1a19 100644 (file)
@@ -269,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;
 }
 /*@}*/