summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/uniforms.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main/uniforms.h')
-rw-r--r--src/mesa/main/uniforms.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/mesa/main/uniforms.h b/src/mesa/main/uniforms.h
index d718b0f12e3..14fe26d5fde 100644
--- a/src/mesa/main/uniforms.h
+++ b/src/mesa/main/uniforms.h
@@ -272,7 +272,9 @@ static inline GLint
_mesa_uniform_merge_location_offset(const struct gl_shader_program *prog,
unsigned base_location, unsigned offset)
{
- return (base_location << 16) | offset;
+ assert(prog->UniformLocationBaseScale >= 0);
+ assert(offset < prog->UniformLocationBaseScale);
+ return (base_location * prog->UniformLocationBaseScale) + offset;
}
/**
@@ -283,8 +285,8 @@ _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;
}
/*@}*/