diff options
author | Timothy Arceri <[email protected]> | 2017-03-16 15:28:47 +1100 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2017-03-16 15:33:08 +1100 |
commit | 4a32d473fd6c10451fca813e462abfbe6c876048 (patch) | |
tree | bcb0ddf89b8ec61da3df1aef1f6f905eef31b9b3 /src/mesa/main/marshal.h | |
parent | 643b0fd7e9269280b7ae0fc5c0e75c32597aa120 (diff) |
mesa: fix glthread marshal build issues on platforms without PTHREAD
Diffstat (limited to 'src/mesa/main/marshal.h')
-rw-r--r-- | src/mesa/main/marshal.h | 76 |
1 files changed, 51 insertions, 25 deletions
diff --git a/src/mesa/main/marshal.h b/src/mesa/main/marshal.h index 23b33002e42..1b4fd515050 100644 --- a/src/mesa/main/marshal.h +++ b/src/mesa/main/marshal.h @@ -46,6 +46,7 @@ struct marshal_cmd_base uint16_t cmd_size; }; +#ifdef HAVE_PTHREAD static inline void * _mesa_glthread_allocate_command(struct gl_context *ctx, @@ -66,6 +67,56 @@ _mesa_glthread_allocate_command(struct gl_context *ctx, return cmd_base; } +/** + * Instead of conditionally handling marshaling previously-bound user vertex + * array data in draw calls (deprecated and removed in GL core), we just + * disable threading at the point where the user sets a user vertex array. + */ +static inline bool +_mesa_glthread_is_non_vbo_vertex_attrib_pointer(const struct gl_context *ctx) +{ + struct glthread_state *glthread = ctx->GLThread; + + return ctx->API != API_OPENGL_CORE && !glthread->vertex_array_is_vbo; +} + +/** + * Instead of conditionally handling marshaling immediate index data in draw + * calls (deprecated and removed in GL core), we just disable threading. + */ +static inline bool +_mesa_glthread_is_non_vbo_draw_elements(const struct gl_context *ctx) +{ + struct glthread_state *glthread = ctx->GLThread; + + return ctx->API != API_OPENGL_CORE && !glthread->element_array_is_vbo; +} + +#else + +/* FIXME: dummy functions for non PTHREAD platforms */ +static inline void * +_mesa_glthread_allocate_command(struct gl_context *ctx, + uint16_t cmd_id, + size_t size) +{ + return NULL; +} + +static inline bool +_mesa_glthread_is_non_vbo_vertex_attrib_pointer(const struct gl_context *ctx) +{ + return false; +} + +static inline bool +_mesa_glthread_is_non_vbo_draw_elements(const struct gl_context *ctx) +{ + return false; +} + +#endif + #define DEBUG_MARSHAL_PRINT_CALLS 0 static inline void @@ -133,31 +184,6 @@ _mesa_glthread_is_compat_bind_vertex_array(const struct gl_context *ctx) return ctx->API != API_OPENGL_CORE; } -/** - * Instead of conditionally handling marshaling previously-bound user vertex - * array data in draw calls (deprecated and removed in GL core), we just - * disable threading at the point where the user sets a user vertex array. - */ -static inline bool -_mesa_glthread_is_non_vbo_vertex_attrib_pointer(const struct gl_context *ctx) -{ - struct glthread_state *glthread = ctx->GLThread; - - return ctx->API != API_OPENGL_CORE && !glthread->vertex_array_is_vbo; -} - -/** - * Instead of conditionally handling marshaling immediate index data in draw - * calls (deprecated and removed in GL core), we just disable threading. - */ -static inline bool -_mesa_glthread_is_non_vbo_draw_elements(const struct gl_context *ctx) -{ - struct glthread_state *glthread = ctx->GLThread; - - return ctx->API != API_OPENGL_CORE && !glthread->element_array_is_vbo; -} - struct marshal_cmd_ShaderSource; struct marshal_cmd_Flush; struct marshal_cmd_BindBuffer; |