r300: add hw accelerated support for different vertex data formats
[mesa.git] / src / mesa / drivers / dri / r300 / r500_fragprog_emit.c
index 4631235f0d3eae07d3ddecf79edfcbeb39c7a1f4..30f4514897eaece9df2a2bdb5080f1544d6135bd 100644 (file)
@@ -49,8 +49,8 @@
 
 
 #define PROG_CODE \
-       struct r500_fragment_program_compiler *c = (struct r500_fragment_program_compiler*)data; \
-       struct r500_fragment_program_code *code = c->code
+       struct r300_fragment_program_compiler *c = (struct r300_fragment_program_compiler*)data; \
+       struct r500_fragment_program_code *code = &c->code->r500
 
 #define error(fmt, args...) do {                       \
                fprintf(stderr, "%s::%s(): " fmt "\n",  \
@@ -72,7 +72,7 @@ static GLboolean emit_const(void *data, GLuint file, GLuint idx, GLuint *hwindex
        }
 
        if (*hwindex >= code->const_nr) {
-               if (*hwindex >= PFS_NUM_CONST_REGS) {
+               if (*hwindex >= R500_PFS_NUM_CONST_REGS) {
                        error("Out of hw constants!\n");
                        return GL_FALSE;
                }
@@ -299,9 +299,9 @@ static const struct radeon_pair_handler pair_handler = {
        .MaxHwTemps = 128
 };
 
-GLboolean r500FragmentProgramEmit(struct r500_fragment_program_compiler *compiler)
+GLboolean r500BuildFragmentProgramHwCode(struct r300_fragment_program_compiler *compiler)
 {
-       struct r500_fragment_program_code *code = compiler->code;
+       struct r500_fragment_program_code *code = &compiler->code->r500;
 
        _mesa_bzero(code, sizeof(*code));
        code->max_temp_idx = 1;