summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nvc0/nvc0_program.c
diff options
context:
space:
mode:
authorChristoph Bumiller <[email protected]>2012-01-11 18:50:15 +0100
committerChristoph Bumiller <[email protected]>2012-01-11 20:26:47 +0100
commitf6b994b3058d1c6cd7c28eef522c08df3d83bea7 (patch)
tree4cccab3923631e35b2208050d434c459f45ac0ce /src/gallium/drivers/nvc0/nvc0_program.c
parent58dc1b28d1ef4d1931c52b079d304f2e1546329d (diff)
nv50,nvc0: zero out program struct on program_destroy
Prevent any state from carrying over to a new translation in cases where we assume that data is still zero from initial calloc (these would require us to do individual zeroing before translation which would be more code).
Diffstat (limited to 'src/gallium/drivers/nvc0/nvc0_program.c')
-rw-r--r--src/gallium/drivers/nvc0/nvc0_program.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gallium/drivers/nvc0/nvc0_program.c b/src/gallium/drivers/nvc0/nvc0_program.c
index 42cd21d9567..813008cd537 100644
--- a/src/gallium/drivers/nvc0/nvc0_program.c
+++ b/src/gallium/drivers/nvc0/nvc0_program.c
@@ -711,6 +711,9 @@ nvc0_program_library_upload(struct nvc0_context *nvc0)
void
nvc0_program_destroy(struct nvc0_context *nvc0, struct nvc0_program *prog)
{
+ const struct pipe_shader_state pipe = prog->pipe;
+ const ubyte type = prog->type;
+
if (prog->res)
nouveau_resource_free(&prog->res);
@@ -726,7 +729,8 @@ nvc0_program_destroy(struct nvc0_context *nvc0, struct nvc0_program *prog)
FREE(prog->tfb);
}
- memset(prog->hdr, 0, sizeof(prog->hdr));
+ memset(prog, 0, sizeof(*prog));
- prog->translated = FALSE;
+ prog->pipe = pipe;
+ prog->type = type;
}