From f2f09abce4c6ac398eb8623ea89ec4419e48e2a4 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Fri, 21 Nov 2003 13:40:19 +0000 Subject: linux-solo compiles as far as the gamma driver, which seems independently broken? --- src/mesa/drivers/dri/radeon/radeon_maos_verts.c | 38 +++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) (limited to 'src/mesa/drivers/dri/radeon/radeon_maos_verts.c') diff --git a/src/mesa/drivers/dri/radeon/radeon_maos_verts.c b/src/mesa/drivers/dri/radeon/radeon_maos_verts.c index 39b1f575074..09e8a355798 100644 --- a/src/mesa/drivers/dri/radeon/radeon_maos_verts.c +++ b/src/mesa/drivers/dri/radeon/radeon_maos_verts.c @@ -40,7 +40,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "array_cache/acache.h" #include "tnl/tnl.h" #include "tnl/t_pipeline.h" -#include "tnl/t_imm_debug.h" #include "radeon_context.h" #include "radeon_state.h" @@ -53,7 +52,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define RADEON_TCL_MAX_SETUP 13 -union emit_union { float f; GLuint ui; radeon_color_t specular; }; +union emit_union { float f; GLuint ui; radeon_color_t rgba; }; static struct { void (*emit)( GLcontext *, GLuint, GLuint, void * ); @@ -308,6 +307,41 @@ void radeonEmitArrays( GLcontext *ctx, GLuint inputs ) setup_tab[i].vertex_size * 4, 4); + /* The vertex code expects Obj to be clean to element 3. To fix + * this, add more vertex code (for obj-2, obj-3) or preferably move + * to maos. + */ + if (VB->ObjPtr->size < 3 || + (VB->ObjPtr->size == 3 && + (setup_tab[i].vertex_format & RADEON_CP_VC_FRMT_W0))) { + + _math_trans_4f( rmesa->tcl.ObjClean.data, + VB->ObjPtr->data, + VB->ObjPtr->stride, + GL_FLOAT, + VB->ObjPtr->size, + 0, + VB->Count ); + + switch (VB->ObjPtr->size) { + case 1: + _mesa_vector4f_clean_elem(&rmesa->tcl.ObjClean, VB->Count, 1); + case 2: + _mesa_vector4f_clean_elem(&rmesa->tcl.ObjClean, VB->Count, 2); + case 3: + if (setup_tab[i].vertex_format & RADEON_CP_VC_FRMT_W0) { + _mesa_vector4f_clean_elem(&rmesa->tcl.ObjClean, VB->Count, 3); + } + case 4: + default: + break; + } + + VB->ObjPtr = &rmesa->tcl.ObjClean; + } + + + setup_tab[i].emit( ctx, 0, VB->Count, rmesa->tcl.indexed_verts.address + rmesa->tcl.indexed_verts.start ); -- cgit v1.2.3