r300: Do not include r300_fragprog.h from r300_context.h and other cleanups
authorNicolai Haehnle <nhaehnle@gmail.com>
Fri, 13 Jun 2008 20:09:37 +0000 (22:09 +0200)
committerNicolai Haehnle <nhaehnle@gmail.com>
Sat, 14 Jun 2008 02:11:21 +0000 (04:11 +0200)
src/mesa/drivers/dri/r300/r300_context.h
src/mesa/drivers/dri/r300/r300_fragprog.c
src/mesa/drivers/dri/r300/r300_ioctl.c
src/mesa/drivers/dri/r300/r300_render.c
src/mesa/drivers/dri/r300/r300_state.c

index 05efb813e53bf4df87dcf9061887229b41bb6c70..a9b3b061f40c8c3cc6e871ad1f34ff1bbe3f2d8c 100644 (file)
@@ -73,7 +73,6 @@ typedef struct r300_context *r300ContextPtr;
        }
 
 #include "r300_vertprog.h"
-#include "r300_fragprog.h"
 #include "r500_fragprog.h"
 
 /**
index 819615c141b3cdedd705f4a4db8ec883b02ab865..9d7a8c65700605ff3040ceaee1b8cb557ad96f29 100644 (file)
@@ -445,8 +445,8 @@ static int get_hw_temp(struct r300_pfs_compile_state *cs, int slot)
        cs->hwtemps[r].vector_valid = 0;
        cs->hwtemps[r].scalar_valid = 0;
 
-       if (r > fp->code.max_temp_idx)
-               fp->code.max_temp_idx = r;
+       if (r > code->max_temp_idx)
+               code->max_temp_idx = r;
 
        return r;
 }
@@ -1029,11 +1029,11 @@ static void emit_tex(struct r300_pfs_compile_state *cs,
 
                tokens[2] = unit;
                factor_index =
-                       _mesa_add_state_reference(cs->fp->mesa_program.Base.
+                       _mesa_add_state_reference(fp->mesa_program.Base.
                                                Parameters, tokens);
                factorreg =
                        emit_const4fv(cs,
-                               cs->fp->mesa_program.Base.Parameters->
+                               fp->mesa_program.Base.Parameters->
                                ParameterValues[factor_index]);
                tempreg = keep(get_temp_reg(cs));
 
@@ -1264,10 +1264,10 @@ static int find_and_prepare_slot(struct r300_pfs_compile_state *cs,
                                return -1;
                        }
 
-                       fp->code.alu.inst[pos].inst0 = NOP_INST0;
-                       fp->code.alu.inst[pos].inst1 = NOP_INST1;
-                       fp->code.alu.inst[pos].inst2 = NOP_INST2;
-                       fp->code.alu.inst[pos].inst3 = NOP_INST3;
+                       code->alu.inst[pos].inst0 = NOP_INST0;
+                       code->alu.inst[pos].inst1 = NOP_INST1;
+                       code->alu.inst[pos].inst2 = NOP_INST2;
+                       code->alu.inst[pos].inst3 = NOP_INST3;
 
                        cs->nrslots++;
                }
@@ -1518,24 +1518,6 @@ static void emit_arith(struct r300_pfs_compile_state *cs,
        return;
 }
 
-#if 0
-static GLuint get_attrib(struct r300_fragment_program *fp, GLuint attr)
-{
-       struct gl_fragment_program *mp = &fp->mesa_program;
-       GLuint r = undef;
-
-       if (!(mp->Base.InputsRead & (1 << attr))) {
-               ERROR("Attribute %d was not provided!\n", attr);
-               return undef;
-       }
-
-       REG_SET_TYPE(r, REG_TYPE_INPUT);
-       REG_SET_INDEX(r, attr);
-       REG_SET_VALID(r, GL_TRUE);
-       return r;
-}
-#endif
-
 static GLfloat SinCosConsts[2][4] = {
        {
         1.273239545,           // 4/PI
index 6af23300f280a3cc16c4bdeca98fc35e9770672a..71821a01ea0aff53f2898af35c1862953c7788fe 100644 (file)
@@ -54,6 +54,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "r300_vertprog.h"
 #include "radeon_reg.h"
 #include "r300_emit.h"
+#include "r300_fragprog.h"
 
 #include "vblank.h"
 
index fc07105c5604d319dbe90821cd27846e42f14acb..8f74f9d785e0ad5720021eb817a441d071122dd5 100644 (file)
@@ -74,6 +74,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "r300_reg.h"
 #include "r300_tex.h"
 #include "r300_emit.h"
+#include "r300_fragprog.h"
 extern int future_hw_tcl_on;
 
 /**
index 1dcf9e0cab3f5e80525a886268e442111edceb75..e82c3d9681c53bdccc94a55ec43d506a7d6962af 100644 (file)
@@ -60,6 +60,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "r300_state.h"
 #include "r300_reg.h"
 #include "r300_emit.h"
+#include "r300_fragprog.h"
 #include "r300_tex.h"
 
 #include "drirenderbuffer.h"