summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nvfx/nvfx_vbo.c
diff options
context:
space:
mode:
authorLuca Barbieri <[email protected]>2010-08-21 23:33:51 +0200
committerLuca Barbieri <[email protected]>2010-08-21 23:45:32 +0200
commit251e48c64a37c4b05f26c96c5a1799c24da6474b (patch)
tree5755980d33d21d0e2284e81311c7d1324ddcff86 /src/gallium/drivers/nvfx/nvfx_vbo.c
parent4a6eb492e86f74434504766ec551130ac6306e6d (diff)
nvfx: fix incorrect assert
Diffstat (limited to 'src/gallium/drivers/nvfx/nvfx_vbo.c')
-rw-r--r--src/gallium/drivers/nvfx/nvfx_vbo.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/gallium/drivers/nvfx/nvfx_vbo.c b/src/gallium/drivers/nvfx/nvfx_vbo.c
index 5d3fb6fb6cb..b1a06654b64 100644
--- a/src/gallium/drivers/nvfx/nvfx_vbo.c
+++ b/src/gallium/drivers/nvfx/nvfx_vbo.c
@@ -427,14 +427,17 @@ nvfx_vtxelts_state_create(struct pipe_context *pipe,
const struct pipe_vertex_element *elements)
{
struct nvfx_vtxelt_state *cso = CALLOC_STRUCT(nvfx_vtxelt_state);
- struct translate_key transkey;
- unsigned per_vertex_size[16];
- unsigned vb_compacted_index[16];
+ struct translate_key transkey;
+ unsigned per_vertex_size[16];
+ unsigned vb_compacted_index[16];
- memset(per_vertex_size, 0, sizeof(per_vertex_size));
-
- assert(num_elements < 16); /* not doing fallbacks yet */
+ if(num_elements > 16)
+ {
+ _debug_printf("Error: application attempted to use %u vertex elements, but only 16 are supported: ignoring the rest\n");
+ num_elements = 16;
+ }
+ memset(per_vertex_size, 0, sizeof(per_vertex_size));
memcpy(cso->pipe, elements, num_elements * sizeof(elements[0]));
cso->num_elements = num_elements;
cso->needs_translate = FALSE;