aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/radeon/radeon_maos_verts.c
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2003-11-24 15:21:14 +0000
committerKeith Whitwell <[email protected]>2003-11-24 15:21:14 +0000
commit57c9814b9e87924696df4c741861c29d4236d1eb (patch)
tree63c9139693032c681fad3e7b50d743b762e0a64d /src/mesa/drivers/dri/radeon/radeon_maos_verts.c
parent5b5cf9cb8b3f540365e3da8e4a70f6a5040a1c6c (diff)
Import vtx-0-2-branch
Diffstat (limited to 'src/mesa/drivers/dri/radeon/radeon_maos_verts.c')
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_maos_verts.c38
1 files changed, 36 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/radeon/radeon_maos_verts.c b/src/mesa/drivers/dri/radeon/radeon_maos_verts.c
index b32fd624fa3..5e63e6e880f 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 );