[Mesa-dev] Gallium proposal: add a user pointer in pipe_resource

Marek Olšák maraeo at gmail.com
Sat Jan 29 15:12:57 PST 2011


I am proposing to add a pointer to a user buffer in pipe_resource. There are
two reasons for this:

1) I would like to have a way to query outside of a driver whether a buffer
is a user buffer. Simply comparing the pointer with NULL would do the trick.

2) I would like to efficiently obtain a pointer to a user buffer outside of
a driver without going through the sequence of functions get_transfer,
transfer_map, transfer_unmap, and transfer_destroy.

This will allow to move more driver-specific code to auxiliary/util.

diff --git a/src/gallium/include/pipe/p_state.h
index 574a7a8..e2b0b8a 100644
--- a/src/gallium/include/pipe/p_state.h
+++ b/src/gallium/include/pipe/p_state.h
@@ -365,6 +365,8 @@ struct pipe_resource

    unsigned bind;            /**< bitmask of PIPE_BIND_x */
    unsigned flags;           /**< bitmask of PIPE_RESOURCE_FLAG_x */
+   void *user_ptr;           /**< pointer from user_buffer_create */

 struct pipe_stream_output_state

Please comment.

Best regards
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20110130/7234f115/attachment.html>

More information about the mesa-dev mailing list