summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoland Scheidegger <[email protected]>2006-12-14 00:34:44 +0100
committerRoland Scheidegger <[email protected]>2006-12-14 00:34:44 +0100
commit2956a0c8a8395e4d9ae00888aeb88ea5c38b89ad (patch)
tree5bfbebec68d7ab0a7145a4f81de6966da9ee607d
parent6c305c083113075a1f11d5081b8c9dd1b98a7b1e (diff)
submit vertex weights to make World of Warcraft maybe happy (bug 8250)
submit the vertex weights to hw, which will enable broken vertex programs errorneously using them to work. Note however that this will only work if glWeight is used, there is no code in mesa at all to deal with weight vertex array (glWeightPointerARB).
-rw-r--r--src/mesa/drivers/dri/r200/r200_context.h1
-rw-r--r--src/mesa/drivers/dri/r200/r200_maos_arrays.c19
-rw-r--r--src/mesa/drivers/dri/r200/r200_vertprog.c1
3 files changed, 19 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/r200/r200_context.h b/src/mesa/drivers/dri/r200/r200_context.h
index fa38a78e263..44c67b68cbc 100644
--- a/src/mesa/drivers/dri/r200/r200_context.h
+++ b/src/mesa/drivers/dri/r200/r200_context.h
@@ -735,6 +735,7 @@ struct r200_tcl_info {
GLuint *Elts;
struct r200_dma_region indexed_verts;
+ struct r200_dma_region weight;
struct r200_dma_region obj;
struct r200_dma_region rgba;
struct r200_dma_region spec;
diff --git a/src/mesa/drivers/dri/r200/r200_maos_arrays.c b/src/mesa/drivers/dri/r200/r200_maos_arrays.c
index 39c1f68911f..270dc35a46a 100644
--- a/src/mesa/drivers/dri/r200/r200_maos_arrays.c
+++ b/src/mesa/drivers/dri/r200/r200_maos_arrays.c
@@ -423,7 +423,21 @@ void r200EmitArrays( GLcontext *ctx, GLuint inputs )
count );
}
component[nr++] = &rmesa->tcl.generic[geninput];
- vfmt0 |= R200_VTX_W0 | R200_VTX_Z0;
+ vfmt0 |= R200_VTX_W0 | R200_VTX_Z0;
+ }
+
+ if (inputs & VERT_BIT_WEIGHT) {
+ if (!rmesa->tcl.weight.buf)
+ emit_vector( ctx,
+ &rmesa->tcl.weight,
+ (char *)VB->AttribPtr[VERT_ATTRIB_WEIGHT]->data,
+ VB->AttribPtr[VERT_ATTRIB_WEIGHT]->size,
+ VB->AttribPtr[VERT_ATTRIB_WEIGHT]->stride,
+ count);
+
+ assert(VB->AttribPtr[VERT_ATTRIB_WEIGHT]->size <= 4);
+ vfmt0 |= VB->AttribPtr[VERT_ATTRIB_WEIGHT]->size << R200_VTX_WEIGHT_COUNT_SHIFT;
+ component[nr++] = &rmesa->tcl.weight;
}
if (inputs & VERT_BIT_NORMAL) {
@@ -672,6 +686,9 @@ void r200ReleaseArrays( GLcontext *ctx, GLuint newinputs )
if (newinputs & VERT_BIT_POS)
r200ReleaseDmaRegion( rmesa, &rmesa->tcl.obj, __FUNCTION__ );
+ if (newinputs & VERT_BIT_WEIGHT)
+ r200ReleaseDmaRegion( rmesa, &rmesa->tcl.weight, __FUNCTION__ );
+
if (newinputs & VERT_BIT_NORMAL)
r200ReleaseDmaRegion( rmesa, &rmesa->tcl.norm, __FUNCTION__ );
diff --git a/src/mesa/drivers/dri/r200/r200_vertprog.c b/src/mesa/drivers/dri/r200/r200_vertprog.c
index 899e84caa0f..491701b796e 100644
--- a/src/mesa/drivers/dri/r200/r200_vertprog.c
+++ b/src/mesa/drivers/dri/r200/r200_vertprog.c
@@ -503,7 +503,6 @@ static GLboolean r200_translate_vertex_program(GLcontext *ctx, struct r200_verte
array_count++;
}
if (mesa_vp->Base.InputsRead & VERT_BIT_WEIGHT) {
- /* we don't actually handle that later. Then again, we don't have to... */
vp->inputs[VERT_ATTRIB_WEIGHT] = 12;
array_count++;
}