diff options
author | Tilman Sauerbeck <tilman@code-monkey.de> | 2010-10-23 13:33:22 +0200 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-10-24 12:56:35 +1000 |
commit | f4a2c62af56ce10e43688e8283f8defeb05cef1a (patch) | |
tree | 6c841fc57aaf1b05f58f9ad372433d91063f942b /src/gallium/drivers/r600/r600_asm.c | |
parent | ccb9be105602edaaff196046e324c8cb4a12fe0a (diff) |
r600g: Also clear bc data when we're destroying a shader.
[airlied: remove unused vars]
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'src/gallium/drivers/r600/r600_asm.c')
-rw-r--r-- | src/gallium/drivers/r600/r600_asm.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/gallium/drivers/r600/r600_asm.c b/src/gallium/drivers/r600/r600_asm.c index d13da0ef63..a71d95ff1d 100644 --- a/src/gallium/drivers/r600/r600_asm.c +++ b/src/gallium/drivers/r600/r600_asm.c @@ -871,3 +871,39 @@ int r600_bc_build(struct r600_bc *bc) } return 0; } + +void r600_bc_clear(struct r600_bc *bc) +{ + struct r600_bc_cf *cf, *next_cf; + + free(bc->bytecode); + bc->bytecode = NULL; + + LIST_FOR_EACH_ENTRY_SAFE(cf, next_cf, &bc->cf, list) { + struct r600_bc_alu *alu, *next_alu; + struct r600_bc_tex *tex, *next_tex; + struct r600_bc_tex *vtx, *next_vtx; + + LIST_FOR_EACH_ENTRY_SAFE(alu, next_alu, &cf->alu, list) { + free(alu); + } + + LIST_INITHEAD(&cf->alu); + + LIST_FOR_EACH_ENTRY_SAFE(tex, next_tex, &cf->tex, list) { + free(tex); + } + + LIST_INITHEAD(&cf->tex); + + LIST_FOR_EACH_ENTRY_SAFE(vtx, next_vtx, &cf->vtx, list) { + free(vtx); + } + + LIST_INITHEAD(&cf->vtx); + + free(cf); + } + + LIST_INITHEAD(&cf->list); +} |