diff options
author | Aapo Tahkola <[email protected]> | 2006-03-22 21:29:27 +0000 |
---|---|---|
committer | Aapo Tahkola <[email protected]> | 2006-03-22 21:29:27 +0000 |
commit | 4fafe6390bff5c746b3e46116d1fcada887bf3df (patch) | |
tree | 30aebe8493c1f9bce207b708a9cf4bd589c3dd1a | |
parent | 6fc864b9e6f98041479ca7cf1d8226985312a2de (diff) |
implement arl and enable hw nv_vp.
-rw-r--r-- | src/mesa/drivers/dri/r300/r300_reg.h | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/r300/r300_vertexprog.c | 22 | ||||
-rw-r--r-- | src/mesa/drivers/dri/r300/vertex_shader.h | 1 |
3 files changed, 17 insertions, 8 deletions
diff --git a/src/mesa/drivers/dri/r300/r300_reg.h b/src/mesa/drivers/dri/r300/r300_reg.h index 59d0eda3f48..c78462af2ed 100644 --- a/src/mesa/drivers/dri/r300/r300_reg.h +++ b/src/mesa/drivers/dri/r300/r300_reg.h @@ -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) diff --git a/src/mesa/drivers/dri/r300/r300_vertexprog.c b/src/mesa/drivers/dri/r300/r300_vertexprog.c index 2f45625d6a8..f794c9aa67a 100644 --- a/src/mesa/drivers/dri/r300/r300_vertexprog.c +++ b/src/mesa/drivers/dri/r300/r300_vertexprog.c @@ -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; } diff --git a/src/mesa/drivers/dri/r300/vertex_shader.h b/src/mesa/drivers/dri/r300/vertex_shader.h index 6293915bff5..f8267b7a2f5 100644 --- a/src/mesa/drivers/dri/r300/vertex_shader.h +++ b/src/mesa/drivers/dri/r300/vertex_shader.h @@ -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 |