mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-22 02:40:11 +01:00
mesa: add Const.BufferCreateMapUnsynchronizedThreadSafe & MESA_MAP_THREAD_SAFE
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4758>
This commit is contained in:
parent
19eb89b0f3
commit
b8223244c3
4 changed files with 14 additions and 0 deletions
|
|
@ -70,6 +70,9 @@ struct _mesa_index_buffer;
|
|||
*/
|
||||
#define MESA_MAP_NOWAIT_BIT 0x4000
|
||||
|
||||
/* Mapping a buffer is allowed from any thread. */
|
||||
#define MESA_MAP_THREAD_SAFE_BIT 0x8000
|
||||
|
||||
|
||||
/**
|
||||
* Device driver function table.
|
||||
|
|
|
|||
|
|
@ -4126,6 +4126,12 @@ struct gl_constants
|
|||
/** When drivers are OK with mapped buffers during draw and other calls. */
|
||||
bool AllowMappedBuffersDuringExecution;
|
||||
|
||||
/**
|
||||
* Whether buffer creation, unsynchronized mapping, unmapping, and
|
||||
* deletion is thread-safe.
|
||||
*/
|
||||
bool BufferCreateMapUnsynchronizedThreadSafe;
|
||||
|
||||
/** GL_ARB_get_program_binary */
|
||||
GLuint NumProgramBinaryFormats;
|
||||
|
||||
|
|
|
|||
|
|
@ -494,6 +494,8 @@ st_access_flags_to_transfer_flags(GLbitfield access, bool wholeBuffer)
|
|||
|
||||
if (access & MESA_MAP_NOWAIT_BIT)
|
||||
flags |= PIPE_TRANSFER_DONTBLOCK;
|
||||
if (access & MESA_MAP_THREAD_SAFE_BIT)
|
||||
flags |= PIPE_TRANSFER_THREAD_SAFE;
|
||||
|
||||
return flags;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -556,6 +556,9 @@ void st_init_limits(struct pipe_screen *screen,
|
|||
c->AllowMappedBuffersDuringExecution =
|
||||
screen->get_param(screen, PIPE_CAP_ALLOW_MAPPED_BUFFERS_DURING_EXECUTION);
|
||||
|
||||
c->BufferCreateMapUnsynchronizedThreadSafe =
|
||||
screen->get_param(screen, PIPE_CAP_MAP_UNSYNCHRONIZED_THREAD_SAFE);
|
||||
|
||||
c->UseSTD430AsDefaultPacking =
|
||||
screen->get_param(screen, PIPE_CAP_LOAD_CONSTBUF);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue