[Piglit] [PATCH] vbo-map-unsync: test unsynchronized buffer mapping
Eric Anholt
eric at anholt.net
Fri Nov 9 09:54:03 PST 2012
Brian Paul <brianp at vmware.com> writes:
> ---
> tests/all.tests | 1 +
> tests/general/CMakeLists.gl.txt | 1 +
> tests/general/vbo-map-unsync.c | 173 +++++++++++++++++++++++++++++++++++++++
> 3 files changed, 175 insertions(+), 0 deletions(-)
> create mode 100644 tests/general/vbo-map-unsync.c
>
> diff --git a/tests/all.tests b/tests/all.tests
> index 09b0931..9db1038 100644
> --- a/tests/all.tests
> +++ b/tests/all.tests
> @@ -1245,6 +1245,7 @@ add_plain_test(arb_vertex_buffer_object, 'fdo31934')
> add_plain_test(arb_vertex_buffer_object, 'pos-array')
> add_plain_test(arb_vertex_buffer_object, 'vbo-bufferdata')
> add_plain_test(arb_vertex_buffer_object, 'vbo-map-remap')
> +add_plain_test(arb_vertex_buffer_object, 'vbo-map-unsync')
> add_plain_test(arb_vertex_buffer_object, 'vbo-subdata-sync')
> add_plain_test(arb_vertex_buffer_object, 'vbo-subdata-zero')
Should be concurrent, right?
> +} verts[] =
trailing whitespace here and elsewhere.
> + glMatrixMode(GL_PROJECTION);
> + glLoadIdentity();
> + glOrtho(-1.0, 1.0, -1.0, 1.0, -0.1, 1.0);
> + glMatrixMode(GL_MODELVIEW);
> + glLoadIdentity();
piglit_ortho_projection()?
> + /* Map first half of vertex buffer */
> + verts_map = glMapBufferRange(GL_ARRAY_BUFFER_ARB,
> + 0, sizeof(verts),
> + GL_MAP_WRITE_BIT |
> + GL_MAP_INVALIDATE_BUFFER_BIT |
> + GL_MAP_FLUSH_EXPLICIT_BIT);
> + elems_map = glMapBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB,
> + GL_WRITE_ONLY_ARB);
> +
> + memcpy(verts_map, verts, sizeof(verts));
> + memcpy(elems_map, indices, sizeof(indices));
> + glUnmapBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB);
> + glFlushMappedBufferRange(GL_ARRAY_BUFFER_ARB, 0, sizeof(verts));
> + glUnmapBufferARB(GL_ARRAY_BUFFER_ARB);
It's odd to me to see FlushMappedBufferRange() with the same size as the
mapping -- you could just drop the flush explicit bit and the flush
call. Was some application doing that, or is that just simplification
for the testcase?
I'd like to see flushexplicit mentioned in the test name if possible. I
think of unsynchronized as just the series of mappings on the buffer:
1: (0, size, INVALIDATE_BUFFER)
2: (size, ..., INVALIDATE_RANGE | UNSYNCHRONIZED)
3: (..., ..., INVALIDATE_RANGE | UNSYNCHRONIZED)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20121109/dba8fed6/attachment.pgp>
More information about the Piglit
mailing list