aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/atifragshader.c
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/mesa/main/atifragshader.c')
-rw-r--r--mesalib/src/mesa/main/atifragshader.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/mesalib/src/mesa/main/atifragshader.c b/mesalib/src/mesa/main/atifragshader.c
index c74c999f8..63608a33f 100644
--- a/mesalib/src/mesa/main/atifragshader.c
+++ b/mesalib/src/mesa/main/atifragshader.c
@@ -83,10 +83,8 @@ _mesa_delete_ati_fragment_shader(struct gl_context *ctx, struct ati_fragment_sha
{
GLuint i;
for (i = 0; i < MAX_NUM_PASSES_ATI; i++) {
- if (s->Instructions[i])
- free(s->Instructions[i]);
- if (s->SetupInst[i])
- free(s->SetupInst[i]);
+ free(s->Instructions[i]);
+ free(s->SetupInst[i]);
}
free(s);
}
@@ -342,21 +340,17 @@ _mesa_BeginFragmentShaderATI(void)
(or, could use the same mem but would need to reinitialize) */
/* no idea if it's allowed to redefine a shader */
for (i = 0; i < MAX_NUM_PASSES_ATI; i++) {
- if (ctx->ATIFragmentShader.Current->Instructions[i])
- free(ctx->ATIFragmentShader.Current->Instructions[i]);
- if (ctx->ATIFragmentShader.Current->SetupInst[i])
- free(ctx->ATIFragmentShader.Current->SetupInst[i]);
+ free(ctx->ATIFragmentShader.Current->Instructions[i]);
+ free(ctx->ATIFragmentShader.Current->SetupInst[i]);
}
/* malloc the instructions here - not sure if the best place but its
a start */
for (i = 0; i < MAX_NUM_PASSES_ATI; i++) {
ctx->ATIFragmentShader.Current->Instructions[i] =
- (struct atifs_instruction *)
calloc(1, sizeof(struct atifs_instruction) *
(MAX_NUM_INSTRUCTIONS_PER_PASS_ATI));
ctx->ATIFragmentShader.Current->SetupInst[i] =
- (struct atifs_setupinst *)
calloc(1, sizeof(struct atifs_setupinst) *
(MAX_NUM_FRAGMENT_REGISTERS_ATI));
}