diff options
author | Roland Scheidegger <rscheidegger@gmx.ch> | 2006-06-02 22:47:31 +0000 |
---|---|---|
committer | Roland Scheidegger <rscheidegger@gmx.ch> | 2006-06-02 22:47:31 +0000 |
commit | 98c791b543c4ba86b8bb54488bd872b33b10b1aa (patch) | |
tree | 1ca4402bf5f877c35f78fcc79f3f628d918de487 /src/mesa/drivers/dri/r200/r200_context.h | |
parent | 65ced474536bad23ee204170918f56eb8f8c4bf9 (diff) |
implement arb_vertex_program in hw for r200. Code contains still some hacks, generic attribs cause a fallback, but otherwise it seems to work quite well. Passes all glean vertProg1 tests with the exception of the degnerated LIT case (which is a hw limitation), as well as runs the r200 render path of doom3/quake4 (1.1 patch needed for quake4). The code is heavily borrowed from the r300 driver as vertex programs encoding is almost identical. arb_vertex_program is not yet announced by default and still needs to be enabled via driconf.
Diffstat (limited to 'src/mesa/drivers/dri/r200/r200_context.h')
-rw-r--r-- | src/mesa/drivers/dri/r200/r200_context.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/r200/r200_context.h b/src/mesa/drivers/dri/r200/r200_context.h index 0de131adc1..2ff9b9f32e 100644 --- a/src/mesa/drivers/dri/r200/r200_context.h +++ b/src/mesa/drivers/dri/r200/r200_context.h @@ -46,6 +46,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "mtypes.h" #include "colormac.h" #include "r200_reg.h" +#include "r200_vertprog.h" #define ENABLE_HW_3D_TEXTURE 1 /* XXX this is temporary! */ @@ -94,6 +95,15 @@ typedef void (*r200_point_func)( r200ContextPtr, r200Vertex * ); +struct r200_vertex_program { + struct vertex_program mesa_program; /* Must be first */ + int translated; + VERTEX_SHADER_INSTRUCTION instr[R200_VSF_MAX_INST + 2]; + int pos_end; + int inputs[VERT_ATTRIB_MAX]; + int native; +}; + struct r200_colorbuffer_state { GLuint clear; #if 000 @@ -336,6 +346,34 @@ struct r200_state_atom { #define AFS_IA1 4 /* 2f0c */ #define AFS_STATE_SIZE 33 +#define PVS_CMD_0 0 +#define PVS_CNTL_1 1 +#define PVS_CNTL_2 2 +#define PVS_STATE_SIZE 3 + +/* those are quite big... */ +#define VPI_CMD_0 0 +#define VPI_OPDST_0 1 +#define VPI_SRC0_0 2 +#define VPI_SRC1_0 3 +#define VPI_SRC2_0 4 +#define VPI_OPDST_63 253 +#define VPI_SRC0_63 254 +#define VPI_SRC1_63 255 +#define VPI_SRC2_63 256 +#define VPI_STATE_SIZE 257 + +#define VPP_CMD_0 0 +#define VPP_PARAM0_0 1 +#define VPP_PARAM1_0 2 +#define VPP_PARAM2_0 3 +#define VPP_PARAM3_0 4 +#define VPP_PARAM0_95 381 +#define VPP_PARAM1_95 382 +#define VPP_PARAM2_95 383 +#define VPP_PARAM3_95 384 +#define VPP_STATE_SIZE 385 + #define TCL_CMD_0 0 #define TCL_LIGHT_MODEL_CTL_0 1 #define TCL_LIGHT_MODEL_CTL_1 2 @@ -567,6 +605,9 @@ struct r200_hw_state { struct r200_state_atom glt; struct r200_state_atom prf; struct r200_state_atom afs[2]; + struct r200_state_atom pvs; + struct r200_state_atom vpi[2]; + struct r200_state_atom vpp[2]; struct r200_state_atom atf; struct r200_state_atom spr; @@ -883,6 +924,7 @@ struct r200_context { */ struct r200_hw_state hw; struct r200_state state; + struct r200_vertex_program *curr_vp_hw; /* Texture object bookkeeping */ |