summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/uniforms.c
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2012-12-14 14:59:11 -0800
committerIan Romanick <[email protected]>2013-01-18 17:35:33 -0800
commit5938c7774ff973612358ca52691c3eb73171e2e7 (patch)
tree36d7b1f119b062ff7e4a45be30134da1c50b3833 /src/mesa/main/uniforms.c
parentf26520146b6763212aca5c4f1f14a32f2824bbb0 (diff)
mesa: Refactor getting a uniform's name to a helper function
We currently have a bug in this code, and I don't want to fix it in two places. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/main/uniforms.c')
-rw-r--r--src/mesa/main/uniforms.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/mesa/main/uniforms.c b/src/mesa/main/uniforms.c
index 77b195edbc3..edb44777f6b 100644
--- a/src/mesa/main/uniforms.c
+++ b/src/mesa/main/uniforms.c
@@ -795,7 +795,15 @@ _mesa_GetActiveUniformName(GLuint program, GLuint uniformIndex,
}
if (uniformName) {
- _mesa_copy_string(uniformName, bufSize, length,
- shProg->UniformStorage[uniformIndex].name);
+ _mesa_get_uniform_name(& shProg->UniformStorage[uniformIndex],
+ bufSize, length, uniformName);
}
}
+
+void
+_mesa_get_uniform_name(const struct gl_uniform_storage *uni,
+ GLsizei maxLength, GLsizei *length,
+ GLchar *nameOut)
+{
+ _mesa_copy_string(nameOut, maxLength, length, uni->name);
+}