summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r300/r300_state.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2010-04-11 08:28:39 +0200
committerMarek Olšák <[email protected]>2010-04-11 10:15:50 +0200
commit146879284c6b844f35afe3a3ef3330726afbe8ac (patch)
tree92c54f39089b1dcc54d7b5916778c07e60c08472 /src/gallium/drivers/r300/r300_state.c
parent08afcaa56e187cdd137a5c6581c265c1a0fc8d18 (diff)
r300g: revisit some assertions and fix potential failures
* Turn some assertions to error messages. * At most 16 vertex elements can be set, others are ignored. * Rasterize at most 8 vertex-shader generic outputs, others are ignored. This includes fog and WPOS. * Unknown shader semantic names are ignored.
Diffstat (limited to 'src/gallium/drivers/r300/r300_state.c')
-rw-r--r--src/gallium/drivers/r300/r300_state.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c
index 95ce1a9600d..6e69155068b 100644
--- a/src/gallium/drivers/r300/r300_state.c
+++ b/src/gallium/drivers/r300/r300_state.c
@@ -1128,10 +1128,9 @@ static void r300_set_vertex_buffers(struct pipe_context* pipe,
if (buffers[i].buffer) {
if (buffers[i].stride % 4 != 0) {
// XXX Shouldn't we align the buffer?
- fprintf(stderr, "r300_set_vertex_buffers: "
+ fprintf(stderr, "r300: set_vertex_buffers: "
"Unaligned buffer stride %i isn't supported.\n",
buffers[i].stride);
- assert(0);
abort();
}
}
@@ -1193,7 +1192,11 @@ static void r300_vertex_psc(struct r300_vertex_element_state *velems)
enum pipe_format format;
unsigned i;
- assert(velems->count <= 16);
+ if (velems->count > 16) {
+ fprintf(stderr, "r300: More than 16 vertex elements are not supported,"
+ " requested %i, using 16.\n", velems->count);
+ velems->count = 16;
+ }
/* Vertex shaders have no semantics on their inputs,
* so PSC should just route stuff based on the vertex elements,