summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/i965/brw_draw_upload.c
diff options
context:
space:
mode:
authorRoland Scheidegger <sroland@vmware.com>2010-02-17 16:44:38 +0100
committerRoland Scheidegger <sroland@vmware.com>2010-02-17 16:44:38 +0100
commit464a72dd4154f314e08c9d0c4d07417e2bf255f0 (patch)
tree182319c2a6a98b69c54bccb6c699b3f1090e352b /src/gallium/drivers/i965/brw_draw_upload.c
parentc2ad9e380121d43f8ac066b590f9929a56bd1b0f (diff)
gallium: remove redundant nr_components field from pipe_vertex_element
This is a property of the associated src_format pipe format. Hence use util_format_get_nr_components to query this when necessary instead.
Diffstat (limited to 'src/gallium/drivers/i965/brw_draw_upload.c')
-rw-r--r--src/gallium/drivers/i965/brw_draw_upload.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gallium/drivers/i965/brw_draw_upload.c b/src/gallium/drivers/i965/brw_draw_upload.c
index d59261557b..9eafdd4085 100644
--- a/src/gallium/drivers/i965/brw_draw_upload.c
+++ b/src/gallium/drivers/i965/brw_draw_upload.c
@@ -30,6 +30,7 @@
#include "util/u_upload_mgr.h"
#include "util/u_math.h"
+#include "util/u_format.h"
#include "brw_draw.h"
#include "brw_defines.h"
@@ -352,13 +353,15 @@ static int brw_emit_vertex_elements(struct brw_context *brw)
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];
+ unsigned nr_components = util_format_get_nr_components(input->src_format);
+
uint32_t format = brw_translate_surface_format( input->src_format );
uint32_t comp0 = BRW_VE1_COMPONENT_STORE_SRC;
uint32_t comp1 = BRW_VE1_COMPONENT_STORE_SRC;
uint32_t comp2 = BRW_VE1_COMPONENT_STORE_SRC;
uint32_t comp3 = BRW_VE1_COMPONENT_STORE_SRC;
- switch (input->nr_components) {
+ switch (nr_components) {
case 0: comp0 = BRW_VE1_COMPONENT_STORE_0;
case 1: comp1 = BRW_VE1_COMPONENT_STORE_0;
case 2: comp2 = BRW_VE1_COMPONENT_STORE_0;