diff options
Diffstat (limited to 'src/mesa/drivers/dri/r300/r300_emit.h')
-rw-r--r-- | src/mesa/drivers/dri/r300/r300_emit.h | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/r300/r300_emit.h b/src/mesa/drivers/dri/r300/r300_emit.h index e0c77373ad4..6433944e190 100644 --- a/src/mesa/drivers/dri/r300/r300_emit.h +++ b/src/mesa/drivers/dri/r300/r300_emit.h @@ -202,4 +202,45 @@ cmd=(drm_radeon_cmd_header_t *) r300AllocCmdBuf(rmesa, \ cmd[0].i=cmdcpdelay(count); } +/* fire vertex buffer */ +static void inline fire_AOS(PREFIX int vertex_count, int type) +{ +LOCAL_VARS +check_space(9); + +start_packet3(RADEON_CP_PACKET3_3D_DRAW_VBUF_2, 0); +/* e32(0x840c0024); */ + e32(R300_VAP_VF_CNTL__PRIM_WALK_VERTEX_LIST | (vertex_count<<16) | type); +} + +/* these are followed by the corresponding data */ +#define start_index32_packet(vertex_count, type) \ + {\ + int _vc;\ + _vc=(vertex_count); \ + start_packet3(RADEON_CP_PACKET3_3D_DRAW_INDX_2, _vc); \ + e32(R300_VAP_VF_CNTL__PRIM_WALK_INDICES | (_vc<<16) | type \ + | R300_VAP_VF_CNTL__INDEX_SIZE_32bit); \ + } + +#define start_index16_packet(vertex_count, type) \ + {\ + int _vc, _n;\ + _vc=(vertex_count); \ + _n=(vertex_count+1)>>1; \ + start_packet3(RADEON_CP_PACKET3_3D_DRAW_INDX_2, _n); \ + e32(R300_VAP_VF_CNTL__PRIM_WALK_INDICES | (_vc<<16) | type); \ + } + +/* Interestingly enough this ones needs the call to setup_AOS, even thought + some of the data so setup is not needed and some is not as arbitrary + as when used by DRAW_VBUF_2 or DRAW_INDX_2 */ +#define start_immediate_packet(vertex_count, type, vertex_size) \ + {\ + int _vc; \ + _vc=(vertex_count); \ + start_packet3(RADEON_CP_PACKET3_3D_DRAW_IMMD_2, _vc*(vertex_size)); \ + e32(R300_VAP_VF_CNTL__PRIM_WALK_VERTEX_EMBEDDED | (_vc<<16) | type); \ + } + #endif |