drisw: Move pointer dereferences to after NULL checks.
[mesa.git] / src / mesa / state_tracker / st_atom_shader.c
index 181f88a33486bd1a9704236088173705ea106719..ad151edf3bdc2575dacf75b55573babc3795bd6c 100644 (file)
@@ -37,7 +37,6 @@
 
 #include "main/imports.h"
 #include "main/mtypes.h"
-#include "main/macros.h"
 #include "shader/program.h"
 
 #include "pipe/p_context.h"
@@ -50,7 +49,6 @@
 #include "st_context.h"
 #include "st_atom.h"
 #include "st_program.h"
-#include "st_atom_shader.h"
 
 
 
@@ -61,26 +59,10 @@ static void
 translate_fp(struct st_context *st,
              struct st_fragment_program *stfp)
 {
-   const GLbitfield fragInputsRead = stfp->Base.Base.InputsRead;
-
-   if (!stfp->state.tokens) {
-      GLuint inAttr, numIn = 0;
-
-      for (inAttr = 0; inAttr < FRAG_ATTRIB_MAX; inAttr++) {
-         if (fragInputsRead & (1 << inAttr)) {
-            stfp->input_to_slot[inAttr] = numIn;
-            numIn++;
-         }
-         else {
-            stfp->input_to_slot[inAttr] = -1;
-         }
-      }
-
-      stfp->num_input_slots = numIn;
-
+   if (!stfp->tgsi.tokens) {
       assert(stfp->Base.Base.NumInstructions > 0);
 
-      st_translate_fragment_program(st, stfp, stfp->input_to_slot);
+      st_translate_fragment_program(st, stfp);
    }
 }