[Mesa-dev] [PATCH 2/3] mesa: add gl_constants::AllowMappedBuffersDuringExecution
Marek Olšák
maraeo at gmail.com
Mon May 15 14:41:36 UTC 2017
From: Marek Olšák <marek.olsak at amd.com>
for skipping mapped-buffer checking in every GL draw call
---
src/mesa/main/mtypes.h | 3 +++
src/mesa/state_tracker/st_extensions.c | 3 +++
2 files changed, 6 insertions(+)
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 28d3d948..efc6920 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -3901,20 +3901,23 @@ struct gl_constants
* other builtin variables. */
/** GL_OES_primitive_bounding_box */
bool NoPrimitiveBoundingBoxOutput;
/** GL_ARB_sparse_buffer */
GLuint SparseBufferPageSize;
/** Used as an input for sha1 generation in the on-disk shader cache */
unsigned char *dri_config_options_sha1;
+
+ /** When drivers are OK with mapped buffers during draw and other calls. */
+ bool AllowMappedBuffersDuringExecution;
};
/**
* Enable flag for each OpenGL extension. Different device drivers will
* enable different extensions at runtime.
*/
struct gl_extensions
{
GLboolean dummy; /* don't remove this! */
diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c
index fffc0ef..2fa7ba7 100644
--- a/src/mesa/state_tracker/st_extensions.c
+++ b/src/mesa/state_tracker/st_extensions.c
@@ -456,20 +456,23 @@ void st_init_limits(struct pipe_screen *screen,
* in practicality.
*/
c->MaxFramebufferLayers =
screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS);
c->MaxWindowRectangles =
screen->get_param(screen, PIPE_CAP_MAX_WINDOW_RECTANGLES);
c->SparseBufferPageSize =
screen->get_param(screen, PIPE_CAP_SPARSE_BUFFER_PAGE_SIZE);
+
+ c->AllowMappedBuffersDuringExecution =
+ screen->get_param(screen, PIPE_CAP_ALLOW_MAPPED_BUFFERS_DURING_EXECUTION);
}
/**
* Given a member \c x of struct gl_extensions, return offset of
* \c x in bytes.
*/
#define o(x) offsetof(struct gl_extensions, x)
--
2.7.4
More information about the mesa-dev
mailing list