diff options
author | Corbin Simpson <[email protected]> | 2010-01-25 10:52:19 -0800 |
---|---|---|
committer | Corbin Simpson <[email protected]> | 2010-01-25 11:30:38 -0800 |
commit | 72778a9d254f6c9c63d86413936ee7f3e5a6e56e (patch) | |
tree | 2100c79d9d087622f2f7d8a51e44d86f151cc522 /src/gallium/drivers/r300/r300_emit.c | |
parent | 9328f3a670993167d7fb9a590f9e712467e77c7c (diff) |
Revert "r300g,radeong: finish and enable the immediate mode"
This reverts commit 112239e9a66a155d36fe2ad0ab130e6f26eff298.
Diffstat (limited to 'src/gallium/drivers/r300/r300_emit.c')
-rw-r--r-- | src/gallium/drivers/r300/r300_emit.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c index badbf3715c7..36d2c64b587 100644 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@ -772,6 +772,22 @@ void r300_emit_texture(struct r300_context* r300, END_CS; } +static boolean r300_validate_aos(struct r300_context *r300) +{ + struct pipe_vertex_buffer *vbuf = r300->vertex_buffer; + struct pipe_vertex_element *velem = r300->vertex_element; + int i; + + /* Check if formats and strides are aligned to the size of DWORD. */ + for (i = 0; i < r300->vertex_element_count; i++) { + if (vbuf[velem[i].vertex_buffer_index].stride % 4 != 0 || + util_format_get_blocksize(velem[i].src_format) % 4 != 0) { + return FALSE; + } + } + return TRUE; +} + void r300_emit_aos(struct r300_context* r300, unsigned offset) { struct pipe_vertex_buffer *vb1, *vb2, *vbuf = r300->vertex_buffer; @@ -781,6 +797,12 @@ void r300_emit_aos(struct r300_context* r300, unsigned offset) unsigned packet_size = (aos_count * 3 + 1) / 2; CS_LOCALS(r300); + /* XXX Move this checking to a more approriate place. */ + if (!r300_validate_aos(r300)) { + /* XXX We should fallback using Draw. */ + assert(0); + } + BEGIN_CS(2 + packet_size + aos_count * 2); OUT_CS_PKT3(R300_PACKET3_3D_LOAD_VBPNTR, packet_size); OUT_CS(aos_count); |