summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2009-11-06 09:35:25 +0000
committerKeith Whitwell <[email protected]>2009-11-06 09:38:14 +0000
commitb216f1aa474196661aacbaf29604659172d1a74e (patch)
tree05f87edfb2285054cbc212acf2f2f7541c822ced /src/gallium
parent5a24c66915a555d72a6377e073a732ab9d6be461 (diff)
i965g: use curr.vertex_element state directly
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/i965/brw_context.h5
-rw-r--r--src/gallium/drivers/i965/brw_draw_upload.c13
2 files changed, 7 insertions, 11 deletions
diff --git a/src/gallium/drivers/i965/brw_context.h b/src/gallium/drivers/i965/brw_context.h
index 67fad0d9a57..34799d52114 100644
--- a/src/gallium/drivers/i965/brw_context.h
+++ b/src/gallium/drivers/i965/brw_context.h
@@ -572,12 +572,7 @@ struct brw_context
struct brw_winsys_buffer *bo;
} vb[PIPE_MAX_ATTRIBS];
- struct {
- int dummy;
- } ve[PIPE_MAX_ATTRIBS];
-
unsigned nr_vb; /* currently the same as curr.num_vertex_buffers */
- unsigned nr_ve; /* currently the same as curr.num_vertex_elements */
} vb;
struct {
diff --git a/src/gallium/drivers/i965/brw_draw_upload.c b/src/gallium/drivers/i965/brw_draw_upload.c
index 188605a0c12..f50ce3005da 100644
--- a/src/gallium/drivers/i965/brw_draw_upload.c
+++ b/src/gallium/drivers/i965/brw_draw_upload.c
@@ -317,6 +317,7 @@ static int brw_emit_vertex_buffers( struct brw_context *brw )
static int brw_emit_vertex_elements(struct brw_context *brw)
{
+ GLuint nr = brw->curr.num_vertex_elements;
GLuint i;
brw_emit_query_begin(brw);
@@ -328,7 +329,7 @@ static int brw_emit_vertex_elements(struct brw_context *brw)
* The stale VB state stays in place, but they don't do anything unless
* a VE loads from them.
*/
- if (brw->vb.nr_ve == 0) {
+ if (nr == 0) {
BEGIN_BATCH(3, IGNORE_CLIPRECTS);
OUT_BATCH((CMD_VERTEX_ELEMENT << 16) | 1);
OUT_BATCH((0 << BRW_VE0_INDEX_SHIFT) |
@@ -346,9 +347,9 @@ static int brw_emit_vertex_elements(struct brw_context *brw)
/* Now emit vertex element (VEP) state packets.
*
*/
- BEGIN_BATCH(1 + brw->curr.num_vertex_elements * 2, IGNORE_CLIPRECTS);
- OUT_BATCH((CMD_VERTEX_ELEMENT << 16) | ((1 + brw->vb.nr_ve * 2) - 2));
- for (i = 0; i < brw->vb.nr_ve; i++) {
+ BEGIN_BATCH(1 + nr * 2, IGNORE_CLIPRECTS);
+ OUT_BATCH((CMD_VERTEX_ELEMENT << 16) | ((1 + nr * 2) - 2));
+ for (i = 0; i < nr; i++) {
const struct pipe_vertex_element *input = &brw->curr.vertex_element[i];
uint32_t format = brw_translate_surface_format( input->src_format );
uint32_t comp0 = BRW_VE1_COMPONENT_STORE_SRC;
@@ -364,10 +365,10 @@ static int brw_emit_vertex_elements(struct brw_context *brw)
break;
}
- OUT_BATCH((i << BRW_VE0_INDEX_SHIFT) |
+ OUT_BATCH((input->vertex_buffer_index << BRW_VE0_INDEX_SHIFT) |
BRW_VE0_VALID |
(format << BRW_VE0_FORMAT_SHIFT) |
- (0 << BRW_VE0_SRC_OFFSET_SHIFT));
+ (input->src_offset << BRW_VE0_SRC_OFFSET_SHIFT));
if (BRW_IS_IGDNG(brw))
OUT_BATCH((comp0 << BRW_VE1_COMPONENT_0_SHIFT) |