Hi, 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 b/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 Marek
_______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev