aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/shader/program.c
diff options
context:
space:
mode:
authorRoland Scheidegger <[email protected]>2005-09-02 01:11:53 +0000
committerRoland Scheidegger <[email protected]>2005-09-02 01:11:53 +0000
commitf519a770d074dac9e188e3b450c828510506c46d (patch)
tree8f89a04e53a288412a6ac2fdb973ffd423c31ba1 /src/mesa/shader/program.c
parentb252e0f47f0bd5b4a086eabb5cc2d4f9cd61a785 (diff)
add error checking to the GL_ATI_FRAGMENT_SHADER entrypoints. Fix bug with scope of ati fragment shader constants. Fix issues with specifying color/alpha instructions not pair-wise. Change internal representation of the shader (to better fit how the extension works, should make driver implementations simpler, and saves some memory). (still doesn't work correctly with doom3 and swrast, but not worse than before)
Diffstat (limited to 'src/mesa/shader/program.c')
-rw-r--r--src/mesa/shader/program.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/mesa/shader/program.c b/src/mesa/shader/program.c
index 0ccc741dd0c..e7211981366 100644
--- a/src/mesa/shader/program.c
+++ b/src/mesa/shader/program.c
@@ -40,6 +40,7 @@
#include "nvfragprog.h"
#include "nvvertparse.h"
#include "nvvertprog.h"
+#include "atifragshader.h"
/**********************************************************************/
@@ -324,8 +325,13 @@ _mesa_delete_program(GLcontext *ctx, struct program *prog)
}
else if (prog->Target == GL_FRAGMENT_SHADER_ATI) {
struct ati_fragment_shader *atifs = (struct ati_fragment_shader *)prog;
- if (atifs->Instructions)
- _mesa_free(atifs->Instructions);
+ GLuint i;
+ for (i = 0; i < MAX_NUM_PASSES_ATI; i++) {
+ if (atifs->Instructions[i])
+ _mesa_free(atifs->Instructions[i]);
+ if (atifs->SetupInst[i])
+ _mesa_free(atifs->SetupInst[i]);
+ }
}
_mesa_free(prog);