From a79f5d90162364818c8df8bca79185bea7461ef9 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Thu, 9 Dec 2021 13:55:32 +1000 Subject: [PATCH] mesa/st: rename access flag to transfer flag function MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reviewed-by: Marek Olšák Part-of: --- src/mesa/main/bufferobj.c | 6 +++--- src/mesa/main/bufferobj.h | 3 +++ src/mesa/state_tracker/st_cb_fbo.c | 3 ++- src/mesa/state_tracker/st_cb_texture.c | 2 +- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c index 5bd72fa..89b158b 100644 --- a/src/mesa/main/bufferobj.c +++ b/src/mesa/main/bufferobj.c @@ -413,7 +413,7 @@ bufferobj_data_mem(struct gl_context *ctx, * \param wholeBuffer is the whole buffer being mapped? */ enum pipe_map_flags -st_access_flags_to_transfer_flags(GLbitfield access, bool wholeBuffer) +_mesa_access_flags_to_transfer_flags(GLbitfield access, bool wholeBuffer) { enum pipe_map_flags flags = 0; @@ -476,8 +476,8 @@ _mesa_bufferobj_map_range(struct gl_context *ctx, assert(offset + length <= obj->Size); enum pipe_map_flags transfer_flags = - st_access_flags_to_transfer_flags(access, - offset == 0 && length == obj->Size); + _mesa_access_flags_to_transfer_flags(access, + offset == 0 && length == obj->Size); /* Sometimes games do silly things like MapBufferRange(UNSYNC|DISCARD_RANGE) * In this case, the the UNSYNC is a bit redundant, but the games rely diff --git a/src/mesa/main/bufferobj.h b/src/mesa/main/bufferobj.h index 6357ff2..642e242 100644 --- a/src/mesa/main/bufferobj.h +++ b/src/mesa/main/bufferobj.h @@ -97,6 +97,9 @@ _mesa_bufferobj_alloc(struct gl_context *ctx, GLuint id); void _mesa_bufferobj_release_buffer(struct gl_buffer_object *obj); +enum pipe_map_flags +_mesa_access_flags_to_transfer_flags(GLbitfield access, bool wholeBuffer); + /** Is the given buffer object currently mapped by the GL user? */ static inline GLboolean _mesa_bufferobj_mapped(const struct gl_buffer_object *obj, diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c index 79fbe00..01f6be8 100644 --- a/src/mesa/state_tracker/st_cb_fbo.c +++ b/src/mesa/state_tracker/st_cb_fbo.c @@ -35,6 +35,7 @@ #include "main/context.h" +#include "main/bufferobj.h" #include "main/fbobject.h" #include "main/framebuffer.h" #include "main/glformats.h" @@ -922,7 +923,7 @@ st_MapRenderbuffer(struct gl_context *ctx, GL_MAP_INVALIDATE_RANGE_BIT)) == 0); const enum pipe_map_flags transfer_flags = - st_access_flags_to_transfer_flags(mode, false); + _mesa_access_flags_to_transfer_flags(mode, false); /* Note: y=0=bottom of buffer while y2=0=top of buffer. * 'invert' will be true for window-system buffers and false for diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index 8f75e8f..72d22ca 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -569,7 +569,7 @@ st_MapTextureImage(struct gl_context *ctx, GL_MAP_INVALIDATE_RANGE_BIT)) == 0); const enum pipe_map_flags transfer_flags = - st_access_flags_to_transfer_flags(mode, false); + _mesa_access_flags_to_transfer_flags(mode, false); map = st_texture_image_map(st, stImage, transfer_flags, x, y, slice, w, h, 1, &transfer); -- 2.7.4