aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/program/program.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2013-11-18 09:29:58 +0100
committermarha <marha@users.sourceforge.net>2013-11-18 09:29:58 +0100
commit72ba71645132923bb8e0b93f7683aef8bc485aa2 (patch)
treebaeaeff7e7ce5bf65f056625b435b8d55d4a04fa /mesalib/src/mesa/program/program.c
parent4d64875593956234795d9947ac1d225e5b110f0f (diff)
parent7c20de6c7fb53ed404d4df0d975328318810ce01 (diff)
downloadvcxsrv-72ba71645132923bb8e0b93f7683aef8bc485aa2.tar.gz
vcxsrv-72ba71645132923bb8e0b93f7683aef8bc485aa2.tar.bz2
vcxsrv-72ba71645132923bb8e0b93f7683aef8bc485aa2.zip
Merge remote-tracking branch 'origin/released'
* origin/released: libXext mesa xkeyboard-config pixman 18 nov 2013 Conflicts: libXext/src/eat.h
Diffstat (limited to 'mesalib/src/mesa/program/program.c')
-rw-r--r--mesalib/src/mesa/program/program.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/mesalib/src/mesa/program/program.c b/mesalib/src/mesa/program/program.c
index a102ec17a..01f8c6f11 100644
--- a/mesalib/src/mesa/program/program.c
+++ b/mesalib/src/mesa/program/program.c
@@ -349,6 +349,7 @@ _mesa_delete_program(struct gl_context *ctx, struct gl_program *prog)
return;
free(prog->String);
+ free(prog->LocalParams);
if (prog->Instructions) {
_mesa_free_instructions(prog->Instructions, prog->NumInstructions);
@@ -477,7 +478,16 @@ _mesa_clone_program(struct gl_context *ctx, const struct gl_program *prog)
if (prog->Parameters)
clone->Parameters = _mesa_clone_parameter_list(prog->Parameters);
- memcpy(clone->LocalParams, prog->LocalParams, sizeof(clone->LocalParams));
+ if (prog->LocalParams) {
+ clone->LocalParams = malloc(MAX_PROGRAM_LOCAL_PARAMS *
+ sizeof(float[4]));
+ if (!clone->LocalParams) {
+ _mesa_reference_program(ctx, &clone, NULL);
+ return NULL;
+ }
+ memcpy(clone->LocalParams, prog->LocalParams,
+ MAX_PROGRAM_LOCAL_PARAMS * sizeof(float[4]));
+ }
clone->IndirectRegisterFiles = prog->IndirectRegisterFiles;
clone->NumInstructions = prog->NumInstructions;
clone->NumTemporaries = prog->NumTemporaries;
@@ -909,12 +919,6 @@ _mesa_valid_register_index(const struct gl_context *ctx,
case PROGRAM_TEMPORARY:
return index >= 0 && index < (GLint) c->MaxTemps;
- case PROGRAM_ENV_PARAM:
- return index >= 0 && index < (GLint) c->MaxEnvParams;
-
- case PROGRAM_LOCAL_PARAM:
- return index >= 0 && index < (GLint) c->MaxLocalParams;
-
case PROGRAM_UNIFORM:
case PROGRAM_STATE_VAR:
/* aka constant buffer */