summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/arbprogram.c
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2016-11-05 22:35:41 +1100
committerTimothy Arceri <[email protected]>2016-11-17 12:52:24 +1100
commit0ad69e6b51b06c483db37c3b7eeb1da1a95d0629 (patch)
treef45eba45b62e2f5b933349463b368c040fec88a6 /src/mesa/main/arbprogram.c
parent9c9589f1e22568a16194e04bb5be6333ac202393 (diff)
mesa: make use of ralloc when creating ARB asm gl_program fields
This will allow us to move the ARB asm fields in gl_program into a union as we will be able call ralloc_free() on the entire struct when destroying the context. In this change we switch over to using ralloc for the Instructions, String and LocalParams fields of gl_program. Reviewed-by: Emil Velikov <[email protected]>
Diffstat (limited to 'src/mesa/main/arbprogram.c')
-rw-r--r--src/mesa/main/arbprogram.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mesa/main/arbprogram.c b/src/mesa/main/arbprogram.c
index 9c7622ad5e5..8b25699b6bf 100644
--- a/src/mesa/main/arbprogram.c
+++ b/src/mesa/main/arbprogram.c
@@ -275,7 +275,9 @@ get_local_param_pointer(struct gl_context *ctx, const char *func,
}
if (!prog->LocalParams) {
- prog->LocalParams = calloc(maxParams, sizeof(float[4]));
+ prog->LocalParams = rzalloc_array_size(prog, sizeof(float[4]),
+ maxParams);
+
if (!prog->LocalParams)
return GL_FALSE;
}