implement arl and enable hw nv_vp.
authorAapo Tahkola <aet@rasterburn.org>
Wed, 22 Mar 2006 21:29:27 +0000 (21:29 +0000)
committerAapo Tahkola <aet@rasterburn.org>
Wed, 22 Mar 2006 21:29:27 +0000 (21:29 +0000)
src/mesa/drivers/dri/r300/r300_reg.h
src/mesa/drivers/dri/r300/r300_vertexprog.c
src/mesa/drivers/dri/r300/vertex_shader.h

index 59d0eda3f48f93e416bfe078a279b66ebc2eaa96..c78462af2ed3014bbdd53060f1a34fd22ff1281c 100644 (file)
@@ -1328,6 +1328,7 @@ I am fairly certain that they are correct unless stated otherwise in comments.
 #define R300_VPI_OUT_OP_SGE                     (9 << 0)
 #define R300_VPI_OUT_OP_SLT                     (10 << 0)
 #define R300_VPI_OUT_OP_UNK12                   (12 << 0) /* Used in GL_POINT_DISTANCE_ATTENUATION_ARB, vector(scalar, vector) */
+#define R300_VPI_OUT_OP_ARL                     (13 << 0)
 #define R300_VPI_OUT_OP_EXP                     (65 << 0)
 #define R300_VPI_OUT_OP_LOG                     (66 << 0)
 #define R300_VPI_OUT_OP_UNK67                   (67 << 0) /* Used in fog computations, scalar(scalar) */
@@ -1342,6 +1343,7 @@ I am fairly certain that they are correct unless stated otherwise in comments.
 #define R300_VPI_OUT_OP_UNK129                  (129 << 0) /* all temps, vector(scalar, vector, vector) */
 
 #define R300_VPI_OUT_REG_CLASS_TEMPORARY        (0 << 8)
+#define R300_VPI_OUT_REG_CLASS_ADDR             (1 << 8)
 #define R300_VPI_OUT_REG_CLASS_RESULT           (2 << 8)
 #define R300_VPI_OUT_REG_CLASS_MASK             (31 << 8)
 
index 2f45625d6a835c79500de028d98292a0a274bc69..f794c9aa67ab94b7022047175fe4a470af612ee2 100644 (file)
@@ -152,6 +152,8 @@ static unsigned long t_dst_class(enum register_file file)
                        return VSF_OUT_CLASS_TMP;
                case PROGRAM_OUTPUT:
                        return VSF_OUT_CLASS_RESULT;
+               case PROGRAM_ADDRESS:
+                       return VSF_OUT_CLASS_ADDR;
                /*      
                case PROGRAM_INPUT:
                case PROGRAM_LOCAL_PARAM:
@@ -176,7 +178,10 @@ static unsigned long t_dst_index(struct r300_vertex_program *vp, struct prog_dst
                        WARN_ONCE("Unknown output %d\n", dst->Index);
                        return 10;
                }
+       }else if(dst->File == PROGRAM_ADDRESS) {
+               assert(dst->Index == 0);
        }
+       
        return dst->Index;
 }
 
@@ -271,7 +276,7 @@ static unsigned long t_src(struct r300_vertex_program *vp, struct prog_src_regis
                                t_swizzle(GET_SWZ(src->Swizzle, 2)),
                                t_swizzle(GET_SWZ(src->Swizzle, 3)),
                                t_src_class(src->File),
-                               src->NegateBase ? VSF_FLAG_ALL : VSF_FLAG_NONE);
+                               src->NegateBase ? VSF_FLAG_ALL : VSF_FLAG_NONE) | (src->RelAddr << 4);
 }
 
 static unsigned long t_src_scalar(struct r300_vertex_program *vp, struct prog_src_register *src)
@@ -606,6 +611,14 @@ void r300_translate_vertex_shader(struct r300_vertex_program *vp)
                
                /* These ops need special handling. */
                switch(vpi->Opcode){
+               case OPCODE_ARL:
+                       o_inst->op=MAKE_VSF_OP(R300_VPI_OUT_OP_ARL, t_dst_index(vp, &vpi->DstReg),
+                                       t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File));
+                       o_inst->src1=t_src_scalar(vp, &src[0]);
+                       o_inst->src2=ZERO_SRC_0;
+                       o_inst->src3=ZERO_SRC_0;
+                       goto next;
+                       
                case OPCODE_POW:
                        o_inst->op=MAKE_VSF_OP(R300_VPI_OUT_OP_POW, t_dst_index(vp, &vpi->DstReg),
                                        t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File));
@@ -899,10 +912,6 @@ void r300_translate_vertex_shader(struct r300_vertex_program *vp)
                
                        goto next;
 
-               case OPCODE_ARL:
-                       WARN_ONCE("ARL not implemented yet!\n");
-                       goto next;
-                       
                case OPCODE_RCC:
                        fprintf(stderr, "Dont know how to handle op %d yet\n", vpi->Opcode);
                        exit(-1);
@@ -982,8 +991,5 @@ void r300_translate_vertex_shader(struct r300_vertex_program *vp)
        for(i=0; i < vp->program.length; i++)
                fprintf(stderr, "%08x\n", vp->program.body.d[i]);
 #endif
-       
-       if (mesa_vp->IsNVProgram)
-               vp->native = GL_FALSE;
 }
 
index 6293915bff5e90b456855d4cfb8754d22195ee94..f8267b7a2f53140f4b0d6d2cb5202820b1231474 100644 (file)
@@ -19,6 +19,7 @@ typedef struct {
 #define VSF_FLAG_NONE  0
 
 #define VSF_OUT_CLASS_TMP      0
+#define VSF_OUT_CLASS_ADDR     1
 #define VSF_OUT_CLASS_RESULT   2