diff options
author | Zack Rusin <zackr@vmware.com> | 2013-05-02 23:38:28 -0400 |
---|---|---|
committer | Zack Rusin <zackr@vmware.com> | 2013-05-03 07:07:33 -0400 |
commit | a232afdbfbaac156e981f55b8bdeb305026cde84 (patch) | |
tree | 89708448d7c35a30ebb99628501066c7032539b5 /src/gallium/include/pipe/p_state.h | |
parent | 8490d21cbe9cce4ceb5c1908b42672f5160fd013 (diff) | |
download | external_mesa3d-a232afdbfbaac156e981f55b8bdeb305026cde84.zip external_mesa3d-a232afdbfbaac156e981f55b8bdeb305026cde84.tar.gz external_mesa3d-a232afdbfbaac156e981f55b8bdeb305026cde84.tar.bz2 |
draw/pt: adjust overflow calculations
gallium lies. buffer_size is not actually buffer_size but available
size, which is 'buffer_size - buffer_offset' so by adding buffer
offset we'd incorrectly compute overflow.
Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Diffstat (limited to 'src/gallium/include/pipe/p_state.h')
-rw-r--r-- | src/gallium/include/pipe/p_state.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gallium/include/pipe/p_state.h b/src/gallium/include/pipe/p_state.h index 28249d2..262078d 100644 --- a/src/gallium/include/pipe/p_state.h +++ b/src/gallium/include/pipe/p_state.h @@ -465,6 +465,13 @@ struct pipe_constant_buffer { * have been written. The internal offset can be stored on the device * and the CPU actually doesn't have to query it. * + * Note that the buffer_size variable is actually specifying the available + * space in the buffer, not the size of the attached buffer. + * In other words in majority of cases buffer_size would simply be + * 'buffer->width0 - buffer_offset', so buffer_size refers to the size + * of the buffer left, after accounting for buffer offset, for stream output + * to write to. + * * Use PIPE_QUERY_SO_STATISTICS to know how many primitives have * actually been written. */ |