summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Airlie <airlied@nx6125b.(none)>2007-06-21 14:20:33 +1000
committerDave Airlie <airlied@nx6125b.(none)>2007-06-21 14:20:33 +1000
commitd1be4ab80fc266ba6792ef1151d4bdf804cff92a (patch)
treeb2d0c6d3941e687716fa7b2094eba8b89ba1aacc
parent025efae411a8146a9766aa863d7baee13c2c79aa (diff)
fix up vertex emission before state change
-rw-r--r--src/mesa/drivers/dri/r300/r300_state.h7
-rw-r--r--src/mesa/drivers/dri/r300/r300_swtcl.c23
2 files changed, 11 insertions, 19 deletions
diff --git a/src/mesa/drivers/dri/r300/r300_state.h b/src/mesa/drivers/dri/r300/r300_state.h
index 21a49b7f361..365f7ecd0c6 100644
--- a/src/mesa/drivers/dri/r300/r300_state.h
+++ b/src/mesa/drivers/dri/r300/r300_state.h
@@ -37,8 +37,15 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "r300_context.h"
+#define R300_NEWPRIM( rmesa ) \
+ do { \
+ if ( rmesa->dma.flush ) \
+ rmesa->dma.flush( rmesa ); \
+ } while (0)
+
#define R300_STATECHANGE(r300, atom) \
do { \
+ R300_NEWPRIM(r300); \
r300->hw.atom.dirty = GL_TRUE; \
r300->hw.is_dirty = GL_TRUE; \
} while(0)
diff --git a/src/mesa/drivers/dri/r300/r300_swtcl.c b/src/mesa/drivers/dri/r300/r300_swtcl.c
index 1eb485f7389..ab85be37f03 100644
--- a/src/mesa/drivers/dri/r300/r300_swtcl.c
+++ b/src/mesa/drivers/dri/r300/r300_swtcl.c
@@ -57,12 +57,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "r300_emit.h"
#include "r300_mem.h"
-#define R300_NEWPRIM( rmesa ) \
- do { \
- if ( rmesa->dma.flush ) \
- rmesa->dma.flush( rmesa ); \
- } while (0)
-
static void flush_last_swtcl_prim( r300ContextPtr rmesa );
@@ -215,7 +209,7 @@ static void r300SetVertexFormat( GLcontext *ctx )
int vap_vte_cntl = 0;
int offset = 0;
int vte = 0;
- GLuint inputs[VERT_ATTRIB_MAX];
+ GLint inputs[VERT_ATTRIB_MAX];
GLint tab[VERT_ATTRIB_MAX];
int swizzle[VERT_ATTRIB_MAX][4];
GLuint i, nr;
@@ -256,10 +250,7 @@ static void r300SetVertexFormat( GLcontext *ctx )
}
rmesa->swtcl.coloroffset = offset;
- if (_mesa_little_endian())
- EMIT_ATTR( _TNL_ATTRIB_COLOR0, EMIT_4F );
- else
- EMIT_ATTR( _TNL_ATTRIB_COLOR0, EMIT_4F );
+ EMIT_ATTR( _TNL_ATTRIB_COLOR0, EMIT_4F );
InputsRead |= 1 << VERT_ATTRIB_COLOR0;
OutputsWritten |= 1 << VERT_RESULT_COL0;
@@ -292,8 +283,6 @@ static void r300SetVertexFormat( GLcontext *ctx )
for (i = 0; i < ctx->Const.MaxTextureUnits; i++) {
if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_TEX(i) )) {
- GLuint sz = VB->TexCoordPtr[i]->size;
-
InputsRead |= 1 << (VERT_ATTRIB_TEX0 + i);
OutputsWritten |= 1 << (VERT_RESULT_TEX0 + i);
EMIT_ATTR( _TNL_ATTRIB_TEX0+i, EMIT_4F );
@@ -327,8 +316,8 @@ static void r300SetVertexFormat( GLcontext *ctx )
}
for (i = 0; i < nr; i++) {
- int ci, fix, found = 0;
-
+ int ci;
+
swizzle[i][0] = SWIZZLE_ZERO;
swizzle[i][1] = SWIZZLE_ZERO;
swizzle[i][2] = SWIZZLE_ZERO;
@@ -811,16 +800,12 @@ void r300EmitVertexAOS(r300ContextPtr rmesa, GLuint vertex_size, GLuint offset)
{
int cmd_reserved = 0;
int cmd_written = 0;
- int vte;
- int route0;
drm_radeon_cmd_header_t *cmd = NULL;
if (RADEON_DEBUG & DEBUG_VERTS)
fprintf(stderr, "%s: vertex_size %d, offset 0x%x \n",
__FUNCTION__, vertex_size, offset);
- /* emit vte */
-
start_packet3(CP_PACKET3(R300_PACKET3_3D_LOAD_VBPNTR, 2), 2);
e32(1);
e32(vertex_size | (vertex_size << 8));