else
audio_drv_list=""
fi
- QEMU_INCLUDES="-I\$(SRC_PATH)/hosts/w32/include $QEMU_INCLUDES"
supported_os="yes"
pie="no"
;;
{
struct vigs_gl_backend *backend = (struct vigs_gl_backend*)user_data;
- backend->DeleteFramebuffers(1, &id);
+ if (id) {
+ backend->DeleteFramebuffers(1, &id);
+ }
}
static GLuint vigs_gl_create_shader(struct vigs_gl_backend *backend,
sfc->ws_sfc->height,
sfc->format);
}
-
- gl_backend->DeleteTextures(3, &gl_sfc->yuv_textures[0]);
+ if (gl_backend != NULL) {
+ if (&gl_sfc->yuv_textures[0] != NULL) {
+ if (gl_sfc->yuv_textures[0] != 0) {
+ gl_backend->DeleteTextures(3, &gl_sfc->yuv_textures[0]);
+ }
+ }
+ }
vigs_surface_cleanup(&gl_sfc->base);
obj-y += yagl_device.o
obj-y += yagl_log.o
+obj-y += yagl_util.o
obj-y += yagl_process.o
obj-y += yagl_thread.o
obj-y += yagl_server.o
{
struct yagl_api *api;
- void (*thread_init)(struct yagl_api_ps */*api_ps*/);
+ void (*thread_init)(struct yagl_thread_state */*ts*/, struct yagl_api_ps */*api_ps*/);
- void (*batch_start)(struct yagl_api_ps */*api_ps*/);
+ void (*batch_start)(struct yagl_thread_state */*ts*/, struct yagl_api_ps */*api_ps*/);
yagl_api_func (*get_func)(struct yagl_api_ps */*api_ps*/,
uint32_t /*func_id*/);
- void (*batch_end)(struct yagl_api_ps */*api_ps*/);
+ void (*batch_end)(struct yagl_thread_state */*ts*/, struct yagl_api_ps */*api_ps*/);
- void (*thread_fini)(struct yagl_api_ps */*api_ps*/);
+ void (*thread_fini)(struct yagl_thread_state */*ts*/, struct yagl_api_ps */*api_ps*/);
- void (*destroy)(struct yagl_api_ps */*api_ps*/);
+ void (*destroy)(struct yagl_thread_state */*ts*/, struct yagl_api_ps */*api_ps*/);
};
void yagl_api_ps_init(struct yagl_api_ps *api_ps,
struct yagl_api
{
- struct yagl_api_ps *(*process_init)(struct yagl_api */*api*/);
+ struct yagl_api_ps *(*process_init)(struct yagl_process_state *ps, struct yagl_api */*api*/);
void (*destroy)(struct yagl_api */*api*/);
};
egl_api_ps->backend = backend;
egl_api_ps->egl_iface = egl_iface;
- yagl_process_register_egl_interface(cur_ts->ps, egl_api_ps->egl_iface);
-
QLIST_INIT(&egl_api_ps->displays);
}
-void yagl_egl_api_ps_cleanup(struct yagl_egl_api_ps *egl_api_ps)
+void yagl_egl_api_ps_cleanup(struct yagl_thread_state *cur_ts,
+ struct yagl_egl_api_ps *egl_api_ps)
{
struct yagl_egl_display *dpy, *next;
QLIST_FOREACH_SAFE(dpy, &egl_api_ps->displays, entry, next) {
QLIST_REMOVE(dpy, entry);
- yagl_egl_display_destroy(dpy);
+ yagl_egl_display_destroy(cur_ts, dpy);
}
assert(QLIST_EMPTY(&egl_api_ps->displays));
-
- yagl_process_unregister_egl_interface(cur_ts->ps);
}
struct yagl_egl_display *yagl_egl_api_ps_display_get(struct yagl_egl_api_ps *egl_api_ps,
return NULL;
}
-struct yagl_egl_display *yagl_egl_api_ps_display_add(struct yagl_egl_api_ps *egl_api_ps,
+struct yagl_egl_display *yagl_egl_api_ps_display_add(struct yagl_thread_state *cur_ts,
+ struct yagl_egl_api_ps *egl_api_ps,
uint32_t display_id)
{
struct yagl_egl_display *dpy;
}
}
- dpy = yagl_egl_display_create(egl_api_ps->backend, display_id);
+ dpy = yagl_egl_display_create(cur_ts, egl_api_ps->backend, display_id);
if (!dpy) {
return NULL;
struct yagl_egl_backend *backend,
struct yagl_egl_interface *egl_iface);
-void yagl_egl_api_ps_cleanup(struct yagl_egl_api_ps *egl_api_ps);
+void yagl_egl_api_ps_cleanup(struct yagl_thread_state *cur_ts,
+ struct yagl_egl_api_ps *egl_api_ps);
struct yagl_egl_display *yagl_egl_api_ps_display_get(struct yagl_egl_api_ps *egl_api_ps,
yagl_host_handle handle);
-struct yagl_egl_display *yagl_egl_api_ps_display_add(struct yagl_egl_api_ps *egl_api_ps,
+struct yagl_egl_display *yagl_egl_api_ps_display_add(struct yagl_thread_state *cur_ts,
+ struct yagl_egl_api_ps *egl_api_ps,
uint32_t display_id);
#endif
#include "yagl_eglb_context.h"
#include "yagl_egl_backend.h"
-void yagl_egl_api_ts_init(struct yagl_egl_api_ts *egl_api_ts,
+void yagl_egl_api_ts_init(struct yagl_thread_state *cur_ts,
+ struct yagl_egl_api_ts *egl_api_ts,
struct yagl_egl_api_ps *api_ps)
{
egl_api_ts->api_ps = api_ps;
yagl_egl_api_ts_reset(egl_api_ts);
}
-void yagl_egl_api_ts_cleanup(struct yagl_egl_api_ts *egl_api_ts)
+void yagl_egl_api_ts_cleanup(struct yagl_thread_state *cur_ts,
+ struct yagl_egl_api_ts *egl_api_ts)
{
if (egl_api_ts->context) {
/*
* Force release current.
*/
- egl_api_ts->backend->release_current(egl_api_ts->backend, true);
+ egl_api_ts->backend->release_current(cur_ts, egl_api_ts->backend, true);
- yagl_egl_context_update_surfaces(egl_api_ts->context, NULL, NULL);
+ yagl_egl_context_update_surfaces(cur_ts, egl_api_ts->context, NULL, NULL);
}
- yagl_egl_api_ts_update_context(egl_api_ts, NULL);
+ yagl_egl_api_ts_update_context(cur_ts, egl_api_ts, NULL);
}
-void yagl_egl_api_ts_update_context(struct yagl_egl_api_ts *egl_api_ts,
+void yagl_egl_api_ts_update_context(struct yagl_thread_state *cur_ts,
+ struct yagl_egl_api_ts *egl_api_ts,
struct yagl_egl_context *ctx)
{
yagl_egl_context_acquire(ctx);
- yagl_egl_context_release(egl_api_ts->context);
+ yagl_egl_context_release(cur_ts, egl_api_ts->context);
egl_api_ts->context = ctx;
}
struct yagl_egl_context *context;
};
-void yagl_egl_api_ts_init(struct yagl_egl_api_ts *egl_api_ts,
+void yagl_egl_api_ts_init(struct yagl_thread_state *cur_ts,
+ struct yagl_egl_api_ts *egl_api_ts,
struct yagl_egl_api_ps *api_ps);
-void yagl_egl_api_ts_cleanup(struct yagl_egl_api_ts *egl_api_ts);
+void yagl_egl_api_ts_cleanup(struct yagl_thread_state *cur_ts,
+ struct yagl_egl_api_ts *egl_api_ts);
-void yagl_egl_api_ts_update_context(struct yagl_egl_api_ts *egl_api_ts,
+void yagl_egl_api_ts_update_context(struct yagl_thread_state *cur_ts,
+ struct yagl_egl_api_ts *egl_api_ts,
struct yagl_egl_context *ctx);
void yagl_egl_api_ts_reset(struct yagl_egl_api_ts *egl_api_ts);
*/
static void yagl_func_eglGetDisplay(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
uint32_t display_id;
EGLint *error;
yagl_host_handle *retval;
yagl_transport_get_in_arg(t, (void**)&error);
yagl_transport_get_in_arg(t, (void**)&retval);
YAGL_LOG_FUNC_ENTER_SPLIT2(eglGetDisplay, uint32_t, void*, display_id, error);
- *retval = yagl_host_eglGetDisplay(display_id, error);
+ *retval = yagl_host_eglGetDisplay(cur_ts, display_id, error);
YAGL_LOG_FUNC_EXIT_SPLIT(yagl_host_handle, *retval);
}
*/
static void yagl_func_eglInitialize(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
yagl_host_handle dpy;
EGLint *major;
EGLint *minor;
yagl_transport_get_in_arg(t, (void**)&error);
yagl_transport_get_in_arg(t, (void**)&retval);
YAGL_LOG_FUNC_ENTER_SPLIT4(eglInitialize, yagl_host_handle, void*, void*, void*, dpy, major, minor, error);
- *retval = yagl_host_eglInitialize(dpy, major, minor, error);
+ *retval = yagl_host_eglInitialize(cur_ts, dpy, major, minor, error);
YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, *retval);
}
*/
static void yagl_func_eglTerminate(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
yagl_host_handle dpy;
EGLint *error;
EGLBoolean *retval;
yagl_transport_get_in_arg(t, (void**)&error);
yagl_transport_get_in_arg(t, (void**)&retval);
YAGL_LOG_FUNC_ENTER_SPLIT2(eglTerminate, yagl_host_handle, void*, dpy, error);
- *retval = yagl_host_eglTerminate(dpy, error);
+ *retval = yagl_host_eglTerminate(cur_ts, dpy, error);
YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, *retval);
}
*/
static void yagl_func_eglGetConfigs(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
yagl_host_handle dpy;
yagl_host_handle *configs;
int32_t configs_maxcount;
yagl_transport_get_in_arg(t, (void**)&retval);
YAGL_LOG_FUNC_ENTER_SPLIT3(eglGetConfigs, yagl_host_handle, void*, void*, dpy, configs, error);
*configs_count = 0;
- *retval = yagl_host_eglGetConfigs(dpy, configs, configs_maxcount, configs_count, error);
+ *retval = yagl_host_eglGetConfigs(cur_ts, dpy, configs, configs_maxcount, configs_count, error);
YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, *retval);
}
*/
static void yagl_func_eglChooseConfig(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
yagl_host_handle dpy;
const EGLint *attrib_list;
int32_t attrib_list_count;
yagl_transport_get_in_arg(t, (void**)&retval);
YAGL_LOG_FUNC_ENTER_SPLIT4(eglChooseConfig, yagl_host_handle, void*, void*, void*, dpy, attrib_list, configs, error);
*configs_count = 0;
- *retval = yagl_host_eglChooseConfig(dpy, attrib_list, attrib_list_count, configs, configs_maxcount, configs_count, error);
+ *retval = yagl_host_eglChooseConfig(cur_ts, dpy, attrib_list, attrib_list_count, configs, configs_maxcount, configs_count, error);
YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, *retval);
}
*/
static void yagl_func_eglGetConfigAttrib(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
yagl_host_handle dpy;
yagl_host_handle config;
EGLint attribute;
yagl_transport_get_in_arg(t, (void**)&error);
yagl_transport_get_in_arg(t, (void**)&retval);
YAGL_LOG_FUNC_ENTER_SPLIT5(eglGetConfigAttrib, yagl_host_handle, yagl_host_handle, EGLint, void*, void*, dpy, config, attribute, value, error);
- *retval = yagl_host_eglGetConfigAttrib(dpy, config, attribute, value, error);
+ *retval = yagl_host_eglGetConfigAttrib(cur_ts, dpy, config, attribute, value, error);
YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, *retval);
}
*/
static void yagl_func_eglDestroySurface(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
yagl_host_handle dpy;
yagl_host_handle surface;
EGLint *error;
yagl_transport_get_in_arg(t, (void**)&error);
yagl_transport_get_in_arg(t, (void**)&retval);
YAGL_LOG_FUNC_ENTER_SPLIT3(eglDestroySurface, yagl_host_handle, yagl_host_handle, void*, dpy, surface, error);
- *retval = yagl_host_eglDestroySurface(dpy, surface, error);
+ *retval = yagl_host_eglDestroySurface(cur_ts, dpy, surface, error);
YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, *retval);
}
*/
static void yagl_func_eglQuerySurface(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
yagl_host_handle dpy;
yagl_host_handle surface;
EGLint attribute;
yagl_transport_get_in_arg(t, (void**)&error);
yagl_transport_get_in_arg(t, (void**)&retval);
YAGL_LOG_FUNC_ENTER_SPLIT5(eglQuerySurface, yagl_host_handle, yagl_host_handle, EGLint, void*, void*, dpy, surface, attribute, value, error);
- *retval = yagl_host_eglQuerySurface(dpy, surface, attribute, value, error);
+ *retval = yagl_host_eglQuerySurface(cur_ts, dpy, surface, attribute, value, error);
YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, *retval);
}
*/
static void yagl_func_eglBindAPI(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
EGLenum api;
api = yagl_transport_get_out_EGLenum(t);
YAGL_LOG_FUNC_ENTER_SPLIT1(eglBindAPI, EGLenum, api);
- (void)yagl_host_eglBindAPI(api);
+ (void)yagl_host_eglBindAPI(cur_ts, api);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_eglWaitClient(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
YAGL_LOG_FUNC_ENTER_SPLIT0(eglWaitClient);
- (void)yagl_host_eglWaitClient();
+ (void)yagl_host_eglWaitClient(t->ts);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_eglReleaseThread(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
EGLint *error;
EGLBoolean *retval;
yagl_transport_get_in_arg(t, (void**)&error);
yagl_transport_get_in_arg(t, (void**)&retval);
YAGL_LOG_FUNC_ENTER_SPLIT1(eglReleaseThread, void*, error);
- *retval = yagl_host_eglReleaseThread(error);
+ *retval = yagl_host_eglReleaseThread(t->ts, error);
YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, *retval);
}
*/
static void yagl_func_eglSurfaceAttrib(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
yagl_host_handle dpy;
yagl_host_handle surface;
EGLint attribute;
yagl_transport_get_in_arg(t, (void**)&error);
yagl_transport_get_in_arg(t, (void**)&retval);
YAGL_LOG_FUNC_ENTER_SPLIT5(eglSurfaceAttrib, yagl_host_handle, yagl_host_handle, EGLint, EGLint, void*, dpy, surface, attribute, value, error);
- *retval = yagl_host_eglSurfaceAttrib(dpy, surface, attribute, value, error);
+ *retval = yagl_host_eglSurfaceAttrib(cur_ts, dpy, surface, attribute, value, error);
YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, *retval);
}
*/
static void yagl_func_eglCreateContext(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
yagl_host_handle dpy;
yagl_host_handle config;
yagl_host_handle share_context;
yagl_transport_get_in_arg(t, (void**)&error);
yagl_transport_get_in_arg(t, (void**)&retval);
YAGL_LOG_FUNC_ENTER_SPLIT5(eglCreateContext, yagl_host_handle, yagl_host_handle, yagl_host_handle, void*, void*, dpy, config, share_context, attrib_list, error);
- *retval = yagl_host_eglCreateContext(dpy, config, share_context, attrib_list, attrib_list_count, error);
+ *retval = yagl_host_eglCreateContext(cur_ts, dpy, config, share_context, attrib_list, attrib_list_count, error);
YAGL_LOG_FUNC_EXIT_SPLIT(yagl_host_handle, *retval);
}
*/
static void yagl_func_eglDestroyContext(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
yagl_host_handle dpy;
yagl_host_handle ctx;
EGLint *error;
yagl_transport_get_in_arg(t, (void**)&error);
yagl_transport_get_in_arg(t, (void**)&retval);
YAGL_LOG_FUNC_ENTER_SPLIT3(eglDestroyContext, yagl_host_handle, yagl_host_handle, void*, dpy, ctx, error);
- *retval = yagl_host_eglDestroyContext(dpy, ctx, error);
+ *retval = yagl_host_eglDestroyContext(cur_ts, dpy, ctx, error);
YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, *retval);
}
*/
static void yagl_func_eglMakeCurrent(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
yagl_host_handle dpy;
yagl_host_handle draw;
yagl_host_handle read;
read = yagl_transport_get_out_yagl_host_handle(t);
ctx = yagl_transport_get_out_yagl_host_handle(t);
YAGL_LOG_FUNC_ENTER_SPLIT4(eglMakeCurrent, yagl_host_handle, yagl_host_handle, yagl_host_handle, yagl_host_handle, dpy, draw, read, ctx);
- (void)yagl_host_eglMakeCurrent(dpy, draw, read, ctx);
+ (void)yagl_host_eglMakeCurrent(cur_ts, dpy, draw, read, ctx);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_eglQueryContext(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
yagl_host_handle dpy;
yagl_host_handle ctx;
EGLint attribute;
yagl_transport_get_in_arg(t, (void**)&error);
yagl_transport_get_in_arg(t, (void**)&retval);
YAGL_LOG_FUNC_ENTER_SPLIT5(eglQueryContext, yagl_host_handle, yagl_host_handle, EGLint, void*, void*, dpy, ctx, attribute, value, error);
- *retval = yagl_host_eglQueryContext(dpy, ctx, attribute, value, error);
+ *retval = yagl_host_eglQueryContext(cur_ts, dpy, ctx, attribute, value, error);
YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, *retval);
}
*/
static void yagl_func_eglSwapBuffers(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
yagl_host_handle dpy;
yagl_host_handle surface;
dpy = yagl_transport_get_out_yagl_host_handle(t);
surface = yagl_transport_get_out_yagl_host_handle(t);
YAGL_LOG_FUNC_ENTER_SPLIT2(eglSwapBuffers, yagl_host_handle, yagl_host_handle, dpy, surface);
- (void)yagl_host_eglSwapBuffers(dpy, surface);
+ (void)yagl_host_eglSwapBuffers(cur_ts, dpy, surface);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_eglCopyBuffers(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
yagl_host_handle dpy;
yagl_host_handle surface;
dpy = yagl_transport_get_out_yagl_host_handle(t);
surface = yagl_transport_get_out_yagl_host_handle(t);
YAGL_LOG_FUNC_ENTER_SPLIT2(eglCopyBuffers, yagl_host_handle, yagl_host_handle, dpy, surface);
- (void)yagl_host_eglCopyBuffers(dpy, surface);
+ (void)yagl_host_eglCopyBuffers(cur_ts, dpy, surface);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_eglCreateWindowSurfaceOffscreenYAGL(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
yagl_host_handle dpy;
yagl_host_handle config;
uint32_t width;
yagl_transport_get_in_arg(t, (void**)&error);
yagl_transport_get_in_arg(t, (void**)&retval);
YAGL_LOG_FUNC_ENTER_SPLIT8(eglCreateWindowSurfaceOffscreenYAGL, yagl_host_handle, yagl_host_handle, uint32_t, uint32_t, uint32_t, target_ulong, void*, void*, dpy, config, width, height, bpp, pixels, attrib_list, error);
- *retval = yagl_host_eglCreateWindowSurfaceOffscreenYAGL(dpy, config, width, height, bpp, pixels, attrib_list, attrib_list_count, error);
+ *retval = yagl_host_eglCreateWindowSurfaceOffscreenYAGL(cur_ts, dpy, config, width, height, bpp, pixels, attrib_list, attrib_list_count, error);
YAGL_LOG_FUNC_EXIT_SPLIT(yagl_host_handle, *retval);
}
*/
static void yagl_func_eglCreatePbufferSurfaceOffscreenYAGL(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
yagl_host_handle dpy;
yagl_host_handle config;
uint32_t width;
yagl_transport_get_in_arg(t, (void**)&error);
yagl_transport_get_in_arg(t, (void**)&retval);
YAGL_LOG_FUNC_ENTER_SPLIT8(eglCreatePbufferSurfaceOffscreenYAGL, yagl_host_handle, yagl_host_handle, uint32_t, uint32_t, uint32_t, target_ulong, void*, void*, dpy, config, width, height, bpp, pixels, attrib_list, error);
- *retval = yagl_host_eglCreatePbufferSurfaceOffscreenYAGL(dpy, config, width, height, bpp, pixels, attrib_list, attrib_list_count, error);
+ *retval = yagl_host_eglCreatePbufferSurfaceOffscreenYAGL(cur_ts, dpy, config, width, height, bpp, pixels, attrib_list, attrib_list_count, error);
YAGL_LOG_FUNC_EXIT_SPLIT(yagl_host_handle, *retval);
}
*/
static void yagl_func_eglCreatePixmapSurfaceOffscreenYAGL(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
yagl_host_handle dpy;
yagl_host_handle config;
uint32_t width;
yagl_transport_get_in_arg(t, (void**)&error);
yagl_transport_get_in_arg(t, (void**)&retval);
YAGL_LOG_FUNC_ENTER_SPLIT8(eglCreatePixmapSurfaceOffscreenYAGL, yagl_host_handle, yagl_host_handle, uint32_t, uint32_t, uint32_t, target_ulong, void*, void*, dpy, config, width, height, bpp, pixels, attrib_list, error);
- *retval = yagl_host_eglCreatePixmapSurfaceOffscreenYAGL(dpy, config, width, height, bpp, pixels, attrib_list, attrib_list_count, error);
+ *retval = yagl_host_eglCreatePixmapSurfaceOffscreenYAGL(cur_ts, dpy, config, width, height, bpp, pixels, attrib_list, attrib_list_count, error);
YAGL_LOG_FUNC_EXIT_SPLIT(yagl_host_handle, *retval);
}
*/
static void yagl_func_eglResizeOffscreenSurfaceYAGL(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
yagl_host_handle dpy;
yagl_host_handle surface;
uint32_t width;
yagl_transport_get_in_arg(t, (void**)&error);
yagl_transport_get_in_arg(t, (void**)&retval);
YAGL_LOG_FUNC_ENTER_SPLIT7(eglResizeOffscreenSurfaceYAGL, yagl_host_handle, yagl_host_handle, uint32_t, uint32_t, uint32_t, target_ulong, void*, dpy, surface, width, height, bpp, pixels, error);
- *retval = yagl_host_eglResizeOffscreenSurfaceYAGL(dpy, surface, width, height, bpp, pixels, error);
+ *retval = yagl_host_eglResizeOffscreenSurfaceYAGL(cur_ts, dpy, surface, width, height, bpp, pixels, error);
YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, *retval);
}
*/
static void yagl_func_eglCreateWindowSurfaceOnscreenYAGL(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
yagl_host_handle dpy;
yagl_host_handle config;
yagl_winsys_id win;
yagl_transport_get_in_arg(t, (void**)&error);
yagl_transport_get_in_arg(t, (void**)&retval);
YAGL_LOG_FUNC_ENTER_SPLIT5(eglCreateWindowSurfaceOnscreenYAGL, yagl_host_handle, yagl_host_handle, yagl_winsys_id, void*, void*, dpy, config, win, attrib_list, error);
- *retval = yagl_host_eglCreateWindowSurfaceOnscreenYAGL(dpy, config, win, attrib_list, attrib_list_count, error);
+ *retval = yagl_host_eglCreateWindowSurfaceOnscreenYAGL(cur_ts, dpy, config, win, attrib_list, attrib_list_count, error);
YAGL_LOG_FUNC_EXIT_SPLIT(yagl_host_handle, *retval);
}
*/
static void yagl_func_eglCreatePbufferSurfaceOnscreenYAGL(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
yagl_host_handle dpy;
yagl_host_handle config;
yagl_winsys_id buffer;
yagl_transport_get_in_arg(t, (void**)&error);
yagl_transport_get_in_arg(t, (void**)&retval);
YAGL_LOG_FUNC_ENTER_SPLIT5(eglCreatePbufferSurfaceOnscreenYAGL, yagl_host_handle, yagl_host_handle, yagl_winsys_id, void*, void*, dpy, config, buffer, attrib_list, error);
- *retval = yagl_host_eglCreatePbufferSurfaceOnscreenYAGL(dpy, config, buffer, attrib_list, attrib_list_count, error);
+ *retval = yagl_host_eglCreatePbufferSurfaceOnscreenYAGL(cur_ts, dpy, config, buffer, attrib_list, attrib_list_count, error);
YAGL_LOG_FUNC_EXIT_SPLIT(yagl_host_handle, *retval);
}
*/
static void yagl_func_eglCreatePixmapSurfaceOnscreenYAGL(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
yagl_host_handle dpy;
yagl_host_handle config;
yagl_winsys_id pixmap;
yagl_transport_get_in_arg(t, (void**)&error);
yagl_transport_get_in_arg(t, (void**)&retval);
YAGL_LOG_FUNC_ENTER_SPLIT5(eglCreatePixmapSurfaceOnscreenYAGL, yagl_host_handle, yagl_host_handle, yagl_winsys_id, void*, void*, dpy, config, pixmap, attrib_list, error);
- *retval = yagl_host_eglCreatePixmapSurfaceOnscreenYAGL(dpy, config, pixmap, attrib_list, attrib_list_count, error);
+ *retval = yagl_host_eglCreatePixmapSurfaceOnscreenYAGL(cur_ts, dpy, config, pixmap, attrib_list, attrib_list_count, error);
YAGL_LOG_FUNC_EXIT_SPLIT(yagl_host_handle, *retval);
}
*/
static void yagl_func_eglInvalidateOnscreenSurfaceYAGL(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
yagl_host_handle dpy;
yagl_host_handle surface;
yagl_winsys_id buffer;
surface = yagl_transport_get_out_yagl_host_handle(t);
buffer = yagl_transport_get_out_yagl_winsys_id(t);
YAGL_LOG_FUNC_ENTER_SPLIT3(eglInvalidateOnscreenSurfaceYAGL, yagl_host_handle, yagl_host_handle, yagl_winsys_id, dpy, surface, buffer);
- (void)yagl_host_eglInvalidateOnscreenSurfaceYAGL(dpy, surface, buffer);
+ (void)yagl_host_eglInvalidateOnscreenSurfaceYAGL(cur_ts, dpy, surface, buffer);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_eglCreateImageYAGL(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
uint32_t texture;
yagl_host_handle dpy;
yagl_winsys_id buffer;
yagl_transport_get_in_arg(t, (void**)&error);
yagl_transport_get_in_arg(t, (void**)&retval);
YAGL_LOG_FUNC_ENTER_SPLIT4(eglCreateImageYAGL, uint32_t, yagl_host_handle, yagl_winsys_id, void*, texture, dpy, buffer, error);
- *retval = yagl_host_eglCreateImageYAGL(texture, dpy, buffer, error);
+ *retval = yagl_host_eglCreateImageYAGL(cur_ts, texture, dpy, buffer, error);
YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, *retval);
}
#include "yagl_thread.h"
#include <EGL/eglext.h>
-static void yagl_egl_config_destroy(struct yagl_ref *ref)
+static void yagl_egl_config_destroy(struct yagl_thread_state *cur_ts, struct yagl_ref *ref)
{
struct yagl_egl_config *cfg = (struct yagl_egl_config*)ref;
}
}
-void yagl_egl_config_release(struct yagl_egl_config *cfg)
+void yagl_egl_config_release(struct yagl_thread_state *cur_ts, struct yagl_egl_config *cfg)
{
if (cfg) {
- yagl_resource_release(&cfg->res);
+ yagl_resource_release(cur_ts, &cfg->res);
}
}
/*
* Passing NULL won't hurt, this is for convenience.
*/
-void yagl_egl_config_release(struct yagl_egl_config *cfg);
+void yagl_egl_config_release(struct yagl_thread_state *cur_ts, struct yagl_egl_config *cfg);
/*
* @}
#include "yagl_eglb_context.h"
#include "yagl_eglb_display.h"
-static void yagl_egl_context_destroy(struct yagl_ref *ref)
+static void yagl_egl_context_destroy(struct yagl_thread_state *cur_ts, struct yagl_ref *ref)
{
struct yagl_egl_context *ctx = (struct yagl_egl_context*)ref;
assert(!ctx->draw);
assert(!ctx->read);
- ctx->backend_ctx->destroy(ctx->backend_ctx);
+ ctx->backend_ctx->destroy(cur_ts, ctx->backend_ctx);
- yagl_egl_config_release(ctx->cfg);
+ yagl_egl_config_release(cur_ts, ctx->cfg);
yagl_resource_cleanup(&ctx->res);
}
struct yagl_egl_context
- *yagl_egl_context_create(struct yagl_egl_display *dpy,
+ *yagl_egl_context_create(struct yagl_thread_state *cur_ts,
+ struct yagl_egl_display *dpy,
struct yagl_egl_config *cfg,
struct yagl_eglb_context *backend_share_ctx,
int version)
struct yagl_eglb_context *backend_ctx;
struct yagl_egl_context *ctx;
- backend_ctx = dpy->backend_dpy->create_context(dpy->backend_dpy,
+ backend_ctx = dpy->backend_dpy->create_context(cur_ts,
+ dpy->backend_dpy,
&cfg->native,
backend_share_ctx,
version);
return ctx;
}
-void yagl_egl_context_update_surfaces(struct yagl_egl_context *ctx,
+void yagl_egl_context_update_surfaces(struct yagl_thread_state *cur_ts,
+ struct yagl_egl_context *ctx,
struct yagl_egl_surface *draw,
struct yagl_egl_surface *read)
{
ctx->draw = draw;
ctx->read = read;
- yagl_egl_surface_release(tmp_draw);
- yagl_egl_surface_release(tmp_read);
+ yagl_egl_surface_release(cur_ts, tmp_draw);
+ yagl_egl_surface_release(cur_ts, tmp_read);
}
void yagl_egl_context_acquire(struct yagl_egl_context *ctx)
}
}
-void yagl_egl_context_release(struct yagl_egl_context *ctx)
+void yagl_egl_context_release(struct yagl_thread_state *cur_ts, struct yagl_egl_context *ctx)
{
if (ctx) {
- yagl_resource_release(&ctx->res);
+ yagl_resource_release(cur_ts, &ctx->res);
}
}
* Takes ownership of 'client_ctx'.
*/
struct yagl_egl_context
- *yagl_egl_context_create(struct yagl_egl_display *dpy,
+ *yagl_egl_context_create(struct yagl_thread_state *cur_ts,
+ struct yagl_egl_display *dpy,
struct yagl_egl_config *cfg,
struct yagl_eglb_context *backend_share_ctx,
int version);
-void yagl_egl_context_update_surfaces(struct yagl_egl_context *ctx,
+void yagl_egl_context_update_surfaces(struct yagl_thread_state *cur_ts,
+ struct yagl_egl_context *ctx,
struct yagl_egl_surface *draw,
struct yagl_egl_surface *read);
/*
* Passing NULL won't hurt, this is for convenience.
*/
-void yagl_egl_context_release(struct yagl_egl_context *ctx);
+void yagl_egl_context_release(struct yagl_thread_state *cur_ts, struct yagl_egl_context *ctx);
/*
* @}
#include "yagl_handle_gen.h"
struct yagl_egl_display
- *yagl_egl_display_create(struct yagl_egl_backend *backend,
+ *yagl_egl_display_create(struct yagl_thread_state *cur_ts,
+ struct yagl_egl_backend *backend,
uint32_t display_id)
{
struct yagl_eglb_display *backend_dpy;
return dpy;
}
-void yagl_egl_display_destroy(struct yagl_egl_display *dpy)
+void yagl_egl_display_destroy(struct yagl_thread_state *cur_ts, struct yagl_egl_display *dpy)
{
- yagl_egl_display_terminate(dpy);
+ yagl_egl_display_terminate(cur_ts, dpy);
- yagl_resource_list_cleanup(&dpy->surfaces);
- yagl_resource_list_cleanup(&dpy->contexts);
- yagl_resource_list_cleanup(&dpy->configs);
+ yagl_resource_list_cleanup(cur_ts, &dpy->surfaces);
+ yagl_resource_list_cleanup(cur_ts, &dpy->contexts);
+ yagl_resource_list_cleanup(cur_ts, &dpy->configs);
dpy->backend_dpy->destroy(dpy->backend_dpy);
g_free(dpy);
}
-void yagl_egl_display_initialize(struct yagl_egl_display *dpy)
+void yagl_egl_display_initialize(struct yagl_thread_state *cur_ts, struct yagl_egl_display *dpy)
{
struct yagl_egl_config **cfgs;
int i, num_configs = 0;
for (i = 0; i < num_configs; ++i) {
yagl_resource_list_add(&dpy->configs, &cfgs[i]->res);
- yagl_egl_config_release(cfgs[i]);
+ yagl_egl_config_release(cur_ts, cfgs[i]);
}
g_free(cfgs);
return ret;
}
-void yagl_egl_display_terminate(struct yagl_egl_display *dpy)
+void yagl_egl_display_terminate(struct yagl_thread_state *cur_ts, struct yagl_egl_display *dpy)
{
struct yagl_resource_list tmp_list;
dpy->initialized = false;
- yagl_resource_list_cleanup(&tmp_list);
+ yagl_resource_list_cleanup(cur_ts, &tmp_list);
}
int32_t yagl_egl_display_get_config_count(struct yagl_egl_display *dpy)
return (struct yagl_egl_context*)yagl_resource_list_acquire(&dpy->contexts, handle);
}
-bool yagl_egl_display_remove_context(struct yagl_egl_display *dpy,
+bool yagl_egl_display_remove_context(struct yagl_thread_state *cur_ts,
+ struct yagl_egl_display *dpy,
yagl_host_handle handle)
{
- return yagl_resource_list_remove(&dpy->contexts, handle);
+ return yagl_resource_list_remove(cur_ts, &dpy->contexts, handle);
}
void yagl_egl_display_add_surface(struct yagl_egl_display *dpy,
return (struct yagl_egl_surface*)yagl_resource_list_acquire(&dpy->surfaces, handle);
}
-bool yagl_egl_display_remove_surface(struct yagl_egl_display *dpy,
+bool yagl_egl_display_remove_surface(struct yagl_thread_state *cur_ts,
+ struct yagl_egl_display *dpy,
yagl_host_handle handle)
{
- return yagl_resource_list_remove(&dpy->surfaces, handle);
+ return yagl_resource_list_remove(cur_ts, &dpy->surfaces, handle);
}
};
struct yagl_egl_display
- *yagl_egl_display_create(struct yagl_egl_backend *backend,
+ *yagl_egl_display_create(struct yagl_thread_state *cur_ts,
+ struct yagl_egl_backend *backend,
uint32_t display_id);
-void yagl_egl_display_destroy(struct yagl_egl_display *dpy);
+void yagl_egl_display_destroy(struct yagl_thread_state *cur_ts,
+ struct yagl_egl_display *dpy);
-void yagl_egl_display_initialize(struct yagl_egl_display *dpy);
+void yagl_egl_display_initialize(struct yagl_thread_state *cur_ts,
+ struct yagl_egl_display *dpy);
bool yagl_egl_display_is_initialized(struct yagl_egl_display *dpy);
-void yagl_egl_display_terminate(struct yagl_egl_display *dpy);
+void yagl_egl_display_terminate(struct yagl_thread_state *cur_ts, struct yagl_egl_display *dpy);
/*
* Configs.
*yagl_egl_display_acquire_context(struct yagl_egl_display *dpy,
yagl_host_handle handle);
-bool yagl_egl_display_remove_context(struct yagl_egl_display *dpy,
+bool yagl_egl_display_remove_context(struct yagl_thread_state *cur_ts,
+ struct yagl_egl_display *dpy,
yagl_host_handle handle);
/*
*yagl_egl_display_acquire_surface(struct yagl_egl_display *dpy,
yagl_host_handle handle);
-bool yagl_egl_display_remove_surface(struct yagl_egl_display *dpy,
+bool yagl_egl_display_remove_surface(struct yagl_thread_state *cur_ts,
+ struct yagl_egl_display *dpy,
yagl_host_handle handle);
/*
#include "yagl_egl_config.h"
#include "yagl_eglb_surface.h"
-static void yagl_egl_surface_destroy(struct yagl_ref *ref)
+static void yagl_egl_surface_destroy(struct yagl_thread_state *cur_ts, struct yagl_ref *ref)
{
struct yagl_egl_surface *sfc = (struct yagl_egl_surface*)ref;
- sfc->backend_sfc->destroy(sfc->backend_sfc);
+ sfc->backend_sfc->destroy(cur_ts, sfc->backend_sfc);
- yagl_egl_config_release(sfc->cfg);
+ yagl_egl_config_release(cur_ts, sfc->cfg);
yagl_resource_cleanup(&sfc->res);
}
}
-void yagl_egl_surface_release(struct yagl_egl_surface *sfc)
+void yagl_egl_surface_release(struct yagl_thread_state *cur_ts, struct yagl_egl_surface *sfc)
{
if (sfc) {
- yagl_resource_release(&sfc->res);
+ yagl_resource_release(cur_ts, &sfc->res);
}
}
/*
* Passing NULL won't hurt, this is for convenience.
*/
-void yagl_egl_surface_release(struct yagl_egl_surface *sfc);
+void yagl_egl_surface_release(struct yagl_thread_state *cur_ts, struct yagl_egl_surface *sfc);
/*
* @}
#include "yagl_eglb_context.h"
#include "yagl_eglb_surface.h"
#include "yagl_log.h"
-#include "yagl_tls.h"
#include "yagl_thread.h"
#include "yagl_process.h"
#include "yagl_object_map.h"
struct yagl_egl_backend *backend;
};
-static YAGL_DEFINE_TLS(struct yagl_egl_api_ts*, egl_api_ts);
-
-static uint32_t yagl_egl_get_ctx_id(struct yagl_egl_interface *iface)
+static uint32_t yagl_egl_get_ctx_id(struct yagl_thread_state *cur_ts, struct yagl_egl_interface *iface)
{
- if (egl_api_ts) {
- return egl_api_ts->context ? egl_api_ts->context->res.handle : 0;
+ if (cur_ts->egl_api_ts) {
+ return cur_ts->egl_api_ts->context ? cur_ts->egl_api_ts->context->res.handle : 0;
} else {
return 0;
}
}
-static void yagl_egl_ensure_ctx(struct yagl_egl_interface *iface, uint32_t ctx_id)
+static void yagl_egl_ensure_ctx(struct yagl_thread_state *cur_ts,
+ struct yagl_egl_interface *iface,
+ uint32_t ctx_id)
{
struct yagl_egl_interface_impl *egl_iface = (struct yagl_egl_interface_impl*)iface;
- uint32_t current_ctx_id = yagl_egl_get_ctx_id(iface);
+ uint32_t current_ctx_id = yagl_egl_get_ctx_id(cur_ts, iface);
if (!current_ctx_id || (ctx_id && (current_ctx_id != ctx_id))) {
- egl_iface->backend->ensure_current(egl_iface->backend);
+ egl_iface->backend->ensure_current(cur_ts, egl_iface->backend);
}
}
-static void yagl_egl_unensure_ctx(struct yagl_egl_interface *iface, uint32_t ctx_id)
+static void yagl_egl_unensure_ctx(struct yagl_thread_state *cur_ts,
+ struct yagl_egl_interface *iface,
+ uint32_t ctx_id)
{
struct yagl_egl_interface_impl *egl_iface = (struct yagl_egl_interface_impl*)iface;
- uint32_t current_ctx_id = yagl_egl_get_ctx_id(iface);
+ uint32_t current_ctx_id = yagl_egl_get_ctx_id(cur_ts, iface);
if (!current_ctx_id || (ctx_id && (current_ctx_id != ctx_id))) {
- egl_iface->backend->unensure_current(egl_iface->backend);
+ egl_iface->backend->unensure_current(cur_ts, egl_iface->backend);
}
}
-static __inline bool yagl_validate_display(yagl_host_handle dpy_,
+static __inline bool yagl_validate_display(struct yagl_thread_state *cur_ts,
+ yagl_host_handle dpy_,
struct yagl_egl_display **dpy,
EGLint *error)
{
YAGL_LOG_FUNC_SET(yagl_validate_display);
- *dpy = yagl_egl_api_ps_display_get(egl_api_ts->api_ps, dpy_);
+ *dpy = yagl_egl_api_ps_display_get(cur_ts->egl_api_ts->api_ps, dpy_);
if (!*dpy) {
YAGL_SET_ERR(EGL_BAD_DISPLAY);
return true;
}
-static __inline bool yagl_validate_config(struct yagl_egl_display *dpy,
+static __inline bool yagl_validate_config(struct yagl_thread_state *cur_ts,
+ struct yagl_egl_display *dpy,
yagl_host_handle cfg_,
struct yagl_egl_config **cfg,
EGLint *error)
return true;
}
-static __inline bool yagl_validate_surface(struct yagl_egl_display *dpy,
+static __inline bool yagl_validate_surface(struct yagl_thread_state *cur_ts,
+ struct yagl_egl_display *dpy,
yagl_host_handle sfc_,
struct yagl_egl_surface **sfc,
EGLint *error)
return true;
}
-static __inline bool yagl_validate_context(struct yagl_egl_display *dpy,
+static __inline bool yagl_validate_context(struct yagl_thread_state *cur_ts,
+ struct yagl_egl_display *dpy,
yagl_host_handle ctx_,
struct yagl_egl_context **ctx,
EGLint *error)
return true;
}
-static bool yagl_egl_release_current_context(struct yagl_egl_display *dpy)
+static bool yagl_egl_release_current_context(struct yagl_thread_state *cur_ts, struct yagl_egl_display *dpy)
{
+ struct yagl_egl_api_ts *egl_api_ts;
+
+ if (!cur_ts) {
+ return false;
+ }
+
+ egl_api_ts = cur_ts->egl_api_ts;
+
if (!egl_api_ts->context) {
return true;
}
- if (!egl_api_ts->backend->release_current(egl_api_ts->backend, false)) {
+ if (!egl_api_ts->backend->release_current(cur_ts, egl_api_ts->backend, false)) {
return false;
}
- yagl_egl_context_update_surfaces(egl_api_ts->context, NULL, NULL);
+ yagl_egl_context_update_surfaces(cur_ts, egl_api_ts->context, NULL, NULL);
- yagl_egl_api_ts_update_context(egl_api_ts, NULL);
+ yagl_egl_api_ts_update_context(cur_ts, egl_api_ts, NULL);
return true;
}
}
}
-static void yagl_host_egl_thread_init(struct yagl_api_ps *api_ps)
+static void yagl_host_egl_thread_init(struct yagl_thread_state *cur_ts, struct yagl_api_ps *api_ps)
{
struct yagl_egl_api_ps *egl_api_ps = (struct yagl_egl_api_ps*)api_ps;
YAGL_LOG_FUNC_ENTER(yagl_host_egl_thread_init, NULL);
- egl_api_ps->backend->thread_init(egl_api_ps->backend);
+ egl_api_ps->backend->thread_init(cur_ts, egl_api_ps->backend);
- egl_api_ts = g_malloc0(sizeof(*egl_api_ts));
+ cur_ts->egl_api_ts = g_malloc0(sizeof(struct yagl_egl_api_ts));
- yagl_egl_api_ts_init(egl_api_ts, egl_api_ps);
-
- cur_ts->egl_api_ts = egl_api_ts;
+ yagl_egl_api_ts_init(cur_ts, cur_ts->egl_api_ts, egl_api_ps);
YAGL_LOG_FUNC_EXIT(NULL);
}
-static void yagl_host_egl_batch_start(struct yagl_api_ps *api_ps)
+static void yagl_host_egl_batch_start(struct yagl_thread_state *cur_ts, struct yagl_api_ps *api_ps)
{
struct yagl_egl_api_ps *egl_api_ps = (struct yagl_egl_api_ps*)api_ps;
- egl_api_ts = cur_ts->egl_api_ts;
-
- egl_api_ps->backend->batch_start(egl_api_ps->backend);
+ egl_api_ps->backend->batch_start(cur_ts, egl_api_ps->backend);
}
-static void yagl_host_egl_batch_end(struct yagl_api_ps *api_ps)
+static void yagl_host_egl_batch_end(struct yagl_thread_state *cur_ts, struct yagl_api_ps *api_ps)
{
struct yagl_egl_api_ps *egl_api_ps = (struct yagl_egl_api_ps*)api_ps;
- egl_api_ps->backend->batch_end(egl_api_ps->backend);
+ egl_api_ps->backend->batch_end(cur_ts, egl_api_ps->backend);
}
-static void yagl_host_egl_thread_fini(struct yagl_api_ps *api_ps)
+static void yagl_host_egl_thread_fini(struct yagl_thread_state *cur_ts, struct yagl_api_ps *api_ps)
{
struct yagl_egl_api_ps *egl_api_ps = (struct yagl_egl_api_ps*)api_ps;
YAGL_LOG_FUNC_ENTER(yagl_host_egl_thread_fini, NULL);
- egl_api_ts = cur_ts->egl_api_ts;
-
- egl_api_ps->backend->batch_start(egl_api_ps->backend);
+ egl_api_ps->backend->batch_start(cur_ts, egl_api_ps->backend);
- yagl_egl_api_ts_cleanup(egl_api_ts);
+ yagl_egl_api_ts_cleanup(cur_ts, cur_ts->egl_api_ts);
- g_free(egl_api_ts);
+ g_free(cur_ts->egl_api_ts);
- egl_api_ts = cur_ts->egl_api_ts = NULL;
+ cur_ts->egl_api_ts = NULL;
- egl_api_ps->backend->batch_end(egl_api_ps->backend);
- egl_api_ps->backend->thread_fini(egl_api_ps->backend);
+ egl_api_ps->backend->batch_end(cur_ts, egl_api_ps->backend);
+ egl_api_ps->backend->thread_fini(cur_ts, egl_api_ps->backend);
YAGL_LOG_FUNC_EXIT(NULL);
}
-static void yagl_host_egl_process_destroy(struct yagl_api_ps *api_ps)
+static void yagl_host_egl_process_destroy(struct yagl_thread_state *cur_ts, struct yagl_api_ps *api_ps)
{
struct yagl_egl_api_ps *egl_api_ps = (struct yagl_egl_api_ps*)api_ps;
YAGL_LOG_FUNC_ENTER(yagl_host_egl_process_destroy, NULL);
- yagl_egl_api_ps_cleanup(egl_api_ps);
+ yagl_egl_api_ps_cleanup(cur_ts, egl_api_ps);
+
+ yagl_process_unregister_egl_interface(cur_ts->ps);
g_free(egl_api_ps->egl_iface);
YAGL_LOG_FUNC_EXIT(NULL);
}
-struct yagl_api_ps *yagl_host_egl_process_init(struct yagl_api *api)
+struct yagl_api_ps *yagl_host_egl_process_init(struct yagl_process_state *ps, struct yagl_api *api)
{
struct yagl_egl_api *egl_api = (struct yagl_egl_api*)api;
struct yagl_egl_interface_impl *egl_iface;
struct yagl_egl_api_ps *egl_api_ps;
+ YAGL_LOG_NO_TS;
YAGL_LOG_FUNC_ENTER(yagl_host_egl_process_init, NULL);
yagl_egl_api_ps_init(egl_api_ps, egl_api->backend, &egl_iface->base);
+ yagl_process_register_egl_interface(ps, egl_api_ps->egl_iface);
+
YAGL_LOG_FUNC_EXIT(NULL);
return &egl_api_ps->base;
}
-yagl_host_handle yagl_host_eglGetDisplay(uint32_t display_id,
+yagl_host_handle yagl_host_eglGetDisplay(struct yagl_thread_state *cur_ts,
+ uint32_t display_id,
EGLint *error)
{
struct yagl_egl_display *dpy;
- dpy = yagl_egl_api_ps_display_add(egl_api_ts->api_ps, display_id);
+ dpy = yagl_egl_api_ps_display_add(cur_ts, cur_ts->egl_api_ts->api_ps, display_id);
return (dpy ? dpy->handle : 0);
}
-EGLBoolean yagl_host_eglInitialize(yagl_host_handle dpy_,
+EGLBoolean yagl_host_eglInitialize(struct yagl_thread_state *cur_ts,
+ yagl_host_handle dpy_,
EGLint *major,
EGLint *minor,
EGLint *error)
YAGL_LOG_FUNC_SET(eglInitialize);
- dpy = yagl_egl_api_ps_display_get(egl_api_ts->api_ps, dpy_);
+ dpy = yagl_egl_api_ps_display_get(cur_ts->egl_api_ts->api_ps, dpy_);
if (!dpy) {
YAGL_SET_ERR(EGL_BAD_DISPLAY);
return EGL_FALSE;
}
- yagl_egl_display_initialize(dpy);
+ yagl_egl_display_initialize(cur_ts, dpy);
if (major) {
*major = YAGL_EGL_VERSION_MAJOR;
return EGL_TRUE;
}
-EGLBoolean yagl_host_eglTerminate(yagl_host_handle dpy_,
+EGLBoolean yagl_host_eglTerminate(struct yagl_thread_state *cur_ts,
+ yagl_host_handle dpy_,
EGLint *error)
{
struct yagl_egl_display *dpy = NULL;
- if (!yagl_validate_display(dpy_, &dpy, error)) {
+ if (!yagl_validate_display(cur_ts, dpy_, &dpy, error)) {
return EGL_FALSE;
}
- yagl_egl_display_terminate(dpy);
+ yagl_egl_display_terminate(cur_ts, dpy);
return EGL_TRUE;
}
-EGLBoolean yagl_host_eglGetConfigs(yagl_host_handle dpy_,
+EGLBoolean yagl_host_eglGetConfigs(struct yagl_thread_state *cur_ts, yagl_host_handle dpy_,
yagl_host_handle *configs, int32_t configs_maxcount, int32_t *configs_count,
EGLint *error)
{
struct yagl_egl_display *dpy = NULL;
- if (!yagl_validate_display(dpy_, &dpy, error)) {
+ if (!yagl_validate_display(cur_ts, dpy_, &dpy, error)) {
return EGL_FALSE;
}
return EGL_TRUE;
}
-EGLBoolean yagl_host_eglChooseConfig(yagl_host_handle dpy_,
+EGLBoolean yagl_host_eglChooseConfig(struct yagl_thread_state *cur_ts, yagl_host_handle dpy_,
const EGLint *attrib_list, int32_t attrib_list_count,
yagl_host_handle *configs, int32_t configs_maxcount, int32_t *configs_count,
EGLint *error)
yagl_egl_native_config_init(&dummy);
- if (!yagl_validate_display(dpy_, &dpy, error)) {
+ if (!yagl_validate_display(cur_ts, dpy_, &dpy, error)) {
goto out;
}
if (cfg) {
handle = cfg->res.handle;
- yagl_egl_config_release(cfg);
+ yagl_egl_config_release(cur_ts, cfg);
}
YAGL_LOG_DEBUG("requesting config with id = %d", config_id);
return res;
}
-EGLBoolean yagl_host_eglGetConfigAttrib(yagl_host_handle dpy_,
+EGLBoolean yagl_host_eglGetConfigAttrib(struct yagl_thread_state *cur_ts,
+ yagl_host_handle dpy_,
yagl_host_handle config_,
EGLint attribute,
EGLint *value,
YAGL_LOG_FUNC_SET(eglGetConfigAttrib);
- if (!yagl_validate_display(dpy_, &dpy, error)) {
+ if (!yagl_validate_display(cur_ts, dpy_, &dpy, error)) {
goto out;
}
- if (!yagl_validate_config(dpy, config_, &config, error)) {
+ if (!yagl_validate_config(cur_ts, dpy, config_, &config, error)) {
goto out;
}
res = EGL_TRUE;
out:
- yagl_egl_config_release(config);
+ yagl_egl_config_release(cur_ts, config);
return res;
}
-EGLBoolean yagl_host_eglDestroySurface(yagl_host_handle dpy_,
+EGLBoolean yagl_host_eglDestroySurface(struct yagl_thread_state *cur_ts,
+ yagl_host_handle dpy_,
yagl_host_handle surface_,
EGLint *error)
{
YAGL_LOG_FUNC_SET(eglDestroySurface);
- if (!yagl_validate_display(dpy_, &dpy, error)) {
+ if (!yagl_validate_display(cur_ts, dpy_, &dpy, error)) {
goto out;
}
- if (!yagl_validate_surface(dpy, surface_, &surface, error)) {
+ if (!yagl_validate_surface(cur_ts, dpy, surface_, &surface, error)) {
goto out;
}
- if (!yagl_egl_display_remove_surface(dpy, surface->res.handle)) {
+ if (!yagl_egl_display_remove_surface(cur_ts, dpy, surface->res.handle)) {
YAGL_SET_ERR(EGL_BAD_SURFACE);
goto out;
}
res = EGL_TRUE;
out:
- yagl_egl_surface_release(surface);
+ yagl_egl_surface_release(cur_ts, surface);
return res;
}
-EGLBoolean yagl_host_eglQuerySurface(yagl_host_handle dpy_,
+EGLBoolean yagl_host_eglQuerySurface(struct yagl_thread_state *cur_ts,
+ yagl_host_handle dpy_,
yagl_host_handle surface_,
EGLint attribute,
EGLint *value,
YAGL_LOG_FUNC_SET(eglQuerySurface);
- if (!yagl_validate_display(dpy_, &dpy, error)) {
+ if (!yagl_validate_display(cur_ts, dpy_, &dpy, error)) {
goto out;
}
- if (!yagl_validate_surface(dpy, surface_, &surface, error)) {
+ if (!yagl_validate_surface(cur_ts, dpy, surface_, &surface, error)) {
goto out;
}
}
break;
default:
- if (!surface->backend_sfc->query(surface->backend_sfc,
+ if (!surface->backend_sfc->query(cur_ts,
+ surface->backend_sfc,
attribute,
&tmp)) {
YAGL_SET_ERR(EGL_BAD_ATTRIBUTE);
res = EGL_TRUE;
out:
- yagl_egl_surface_release(surface);
+ yagl_egl_surface_release(cur_ts, surface);
return res;
}
-void yagl_host_eglBindAPI(EGLenum api)
+void yagl_host_eglBindAPI(struct yagl_thread_state *cur_ts, EGLenum api)
{
- egl_api_ts->api = api;
+ cur_ts->egl_api_ts->api = api;
}
-void yagl_host_eglWaitClient(void)
+void yagl_host_eglWaitClient(struct yagl_thread_state *cur_ts)
{
struct yagl_egl_surface *sfc = NULL;
- if (!egl_api_ts->context) {
+ if (!cur_ts->egl_api_ts->context) {
return;
}
- sfc = egl_api_ts->context->draw;
+ sfc = cur_ts->egl_api_ts->context->draw;
if (!sfc) {
return;
}
- sfc->backend_sfc->wait_gl(sfc->backend_sfc);
+ sfc->backend_sfc->wait_gl(cur_ts,
+ sfc->backend_sfc);
}
-EGLBoolean yagl_host_eglReleaseThread(EGLint *error)
+EGLBoolean yagl_host_eglReleaseThread(struct yagl_thread_state *cur_ts, EGLint *error)
{
EGLBoolean res = EGL_FALSE;
YAGL_LOG_FUNC_SET(eglReleaseThread);
- if (egl_api_ts->context) {
- if (!yagl_egl_release_current_context(egl_api_ts->context->dpy)) {
+ if (cur_ts->egl_api_ts->context) {
+ if (!yagl_egl_release_current_context(cur_ts, cur_ts->egl_api_ts->context->dpy)) {
YAGL_SET_ERR(EGL_BAD_ACCESS);
goto out;
}
}
- yagl_egl_api_ts_reset(egl_api_ts);
+ yagl_egl_api_ts_reset(cur_ts->egl_api_ts);
res = EGL_TRUE;
return res;
}
-EGLBoolean yagl_host_eglSurfaceAttrib(yagl_host_handle dpy_,
+EGLBoolean yagl_host_eglSurfaceAttrib(struct yagl_thread_state *cur_ts,
+ yagl_host_handle dpy_,
yagl_host_handle surface_,
EGLint attribute,
EGLint value,
struct yagl_egl_display *dpy = NULL;
struct yagl_egl_surface *surface = NULL;
- if (!yagl_validate_display(dpy_, &dpy, error)) {
+ if (!yagl_validate_display(cur_ts, dpy_, &dpy, error)) {
goto out;
}
- if (!yagl_validate_surface(dpy, surface_, &surface, error)) {
+ if (!yagl_validate_surface(cur_ts, dpy, surface_, &surface, error)) {
goto out;
}
res = EGL_TRUE;
out:
- yagl_egl_surface_release(surface);
+ yagl_egl_surface_release(cur_ts, surface);
return res;
}
-yagl_host_handle yagl_host_eglCreateContext(yagl_host_handle dpy_,
+yagl_host_handle yagl_host_eglCreateContext(struct yagl_thread_state *cur_ts,
+ yagl_host_handle dpy_,
yagl_host_handle config_,
yagl_host_handle share_context_,
const EGLint *attrib_list, int32_t attrib_list_count,
YAGL_LOG_FUNC_SET(eglCreateContext);
- if (!yagl_validate_display(dpy_, &dpy, error)) {
+ if (!yagl_validate_display(cur_ts, dpy_, &dpy, error)) {
goto out;
}
- if (!yagl_validate_config(dpy, config_, &config, error)) {
+ if (!yagl_validate_config(cur_ts, dpy, config_, &config, error)) {
goto out;
}
- if (egl_api_ts->api == EGL_OPENGL_ES_API) {
+ if (cur_ts->egl_api_ts->api == EGL_OPENGL_ES_API) {
if (!yagl_egl_is_attrib_list_empty(attrib_list)) {
while (attrib_list[i] != EGL_NONE) {
switch (attrib_list[i]) {
}
if (share_context_) {
- if (!yagl_validate_context(dpy, share_context_, &share_context, error)) {
+ if (!yagl_validate_context(cur_ts, dpy, share_context_, &share_context, error)) {
goto out;
}
}
- ctx = yagl_egl_context_create(dpy,
+ ctx = yagl_egl_context_create(cur_ts,
+ dpy,
config,
(share_context ? share_context->backend_ctx
: NULL),
}
yagl_egl_display_add_context(dpy, ctx);
- yagl_egl_context_release(ctx);
+ yagl_egl_context_release(cur_ts, ctx);
res = ctx->res.handle;
out:
- yagl_egl_context_release(share_context);
- yagl_egl_config_release(config);
+ yagl_egl_context_release(cur_ts, share_context);
+ yagl_egl_config_release(cur_ts, config);
return res;
}
-EGLBoolean yagl_host_eglDestroyContext(yagl_host_handle dpy_,
+EGLBoolean yagl_host_eglDestroyContext(struct yagl_thread_state *cur_ts,
+ yagl_host_handle dpy_,
yagl_host_handle ctx_,
EGLint *error)
{
YAGL_LOG_FUNC_SET(eglDestroyContext);
- if (!yagl_validate_display(dpy_, &dpy, error)) {
+ if (!yagl_validate_display(cur_ts, dpy_, &dpy, error)) {
goto out;
}
- if (!yagl_validate_context(dpy, ctx_, &ctx, error)) {
+ if (!yagl_validate_context(cur_ts, dpy, ctx_, &ctx, error)) {
goto out;
}
- if (yagl_egl_display_remove_context(dpy, ctx->res.handle)) {
+ if (yagl_egl_display_remove_context(cur_ts, dpy, ctx->res.handle)) {
res = EGL_TRUE;
} else {
YAGL_SET_ERR(EGL_BAD_CONTEXT);
}
out:
- yagl_egl_context_release(ctx);
+ yagl_egl_context_release(cur_ts, ctx);
return res;
}
-void yagl_host_eglMakeCurrent(yagl_host_handle dpy_,
+void yagl_host_eglMakeCurrent(struct yagl_thread_state *cur_ts,
+ yagl_host_handle dpy_,
yagl_host_handle draw_,
yagl_host_handle read_,
yagl_host_handle ctx_)
struct yagl_egl_context *ctx = NULL;
struct yagl_egl_surface *draw = NULL;
struct yagl_egl_surface *read = NULL;
+ struct yagl_egl_api_ts *egl_api_ts = cur_ts->egl_api_ts;
YAGL_LOG_FUNC_SET(eglMakeCurrent);
- if (!yagl_validate_display(dpy_, &dpy, &error)) {
+ if (!yagl_validate_display(cur_ts, dpy_, &dpy, &error)) {
goto out;
}
yagl_egl_context_acquire(prev_ctx);
if (release_context) {
- if (!yagl_egl_release_current_context(dpy)) {
+ if (!yagl_egl_release_current_context(cur_ts, dpy)) {
YAGL_LOG_ERROR("cannot release current context");
goto out;
}
} else {
- if (!yagl_validate_context(dpy, ctx_, &ctx, &error)) {
+ if (!yagl_validate_context(cur_ts, dpy, ctx_, &ctx, &error)) {
goto out;
}
- if (draw_ && !yagl_validate_surface(dpy, draw_, &draw, &error)) {
+ if (draw_ && !yagl_validate_surface(cur_ts, dpy, draw_, &draw, &error)) {
goto out;
}
- if (read_ && !yagl_validate_surface(dpy, read_, &read, &error)) {
+ if (read_ && !yagl_validate_surface(cur_ts, dpy, read_, &read, &error)) {
goto out;
}
release_context = true;
}
- if (!egl_api_ts->backend->make_current(egl_api_ts->backend,
+ if (!egl_api_ts->backend->make_current(cur_ts,
+ egl_api_ts->backend,
dpy->backend_dpy,
ctx->backend_ctx,
(draw ? draw->backend_sfc : NULL),
goto out;
}
- yagl_egl_context_update_surfaces(ctx, draw, read);
+ yagl_egl_context_update_surfaces(cur_ts, ctx, draw, read);
- yagl_egl_api_ts_update_context(egl_api_ts, ctx);
+ yagl_egl_api_ts_update_context(cur_ts, egl_api_ts, ctx);
}
if (release_context && prev_ctx) {
- yagl_egl_context_update_surfaces(prev_ctx, NULL, NULL);
+ yagl_egl_context_update_surfaces(cur_ts, prev_ctx, NULL, NULL);
}
YAGL_LOG_TRACE("Context switched (%u, %u, %u, %u)",
ctx_);
out:
- yagl_egl_surface_release(read);
- yagl_egl_surface_release(draw);
- yagl_egl_context_release(ctx);
- yagl_egl_context_release(prev_ctx);
+ yagl_egl_surface_release(cur_ts, read);
+ yagl_egl_surface_release(cur_ts, draw);
+ yagl_egl_context_release(cur_ts, ctx);
+ yagl_egl_context_release(cur_ts, prev_ctx);
}
-EGLBoolean yagl_host_eglQueryContext(yagl_host_handle dpy_,
+EGLBoolean yagl_host_eglQueryContext(struct yagl_thread_state *cur_ts,
+ yagl_host_handle dpy_,
yagl_host_handle ctx_,
EGLint attribute,
EGLint *value,
YAGL_LOG_FUNC_SET(eglQueryContext);
- if (!yagl_validate_display(dpy_, &dpy, error)) {
+ if (!yagl_validate_display(cur_ts, dpy_, &dpy, error)) {
goto out;
}
- if (!yagl_validate_context(dpy, ctx_, &ctx, error)) {
+ if (!yagl_validate_context(cur_ts, dpy, ctx_, &ctx, error)) {
goto out;
}
res = EGL_TRUE;
out:
- yagl_egl_context_release(ctx);
+ yagl_egl_context_release(cur_ts, ctx);
return res;
}
-void yagl_host_eglSwapBuffers(yagl_host_handle dpy_,
+void yagl_host_eglSwapBuffers(struct yagl_thread_state *cur_ts,
+ yagl_host_handle dpy_,
yagl_host_handle surface_)
{
EGLint error = 0;
struct yagl_egl_display *dpy = NULL;
struct yagl_egl_surface *surface = NULL;
- if (!yagl_validate_display(dpy_, &dpy, &error)) {
+ if (!yagl_validate_display(cur_ts, dpy_, &dpy, &error)) {
goto out;
}
- if (!yagl_validate_surface(dpy, surface_, &surface, &error)) {
+ if (!yagl_validate_surface(cur_ts, dpy, surface_, &surface, &error)) {
goto out;
}
- surface->backend_sfc->swap_buffers(surface->backend_sfc);
+ surface->backend_sfc->swap_buffers(cur_ts, surface->backend_sfc);
out:
- yagl_egl_surface_release(surface);
+ yagl_egl_surface_release(cur_ts, surface);
}
-void yagl_host_eglCopyBuffers(yagl_host_handle dpy_,
+void yagl_host_eglCopyBuffers(struct yagl_thread_state *cur_ts,
+ yagl_host_handle dpy_,
yagl_host_handle surface_)
{
EGLint error = 0;
struct yagl_egl_display *dpy = NULL;
struct yagl_egl_surface *surface = NULL;
- if (!yagl_validate_display(dpy_, &dpy, &error)) {
+ if (!yagl_validate_display(cur_ts, dpy_, &dpy, &error)) {
goto out;
}
- if (!yagl_validate_surface(dpy, surface_, &surface, &error)) {
+ if (!yagl_validate_surface(cur_ts, dpy, surface_, &surface, &error)) {
goto out;
}
- surface->backend_sfc->copy_buffers(surface->backend_sfc);
+ surface->backend_sfc->copy_buffers(cur_ts, surface->backend_sfc);
out:
- yagl_egl_surface_release(surface);
+ yagl_egl_surface_release(cur_ts, surface);
}
-yagl_host_handle yagl_host_eglCreateWindowSurfaceOffscreenYAGL(yagl_host_handle dpy_,
+yagl_host_handle yagl_host_eglCreateWindowSurfaceOffscreenYAGL(struct yagl_thread_state *cur_ts,
+ yagl_host_handle dpy_,
yagl_host_handle config_,
uint32_t width,
uint32_t height,
}
}
- if (!yagl_validate_display(dpy_, &dpy, error)) {
+ if (!yagl_validate_display(cur_ts, dpy_, &dpy, error)) {
goto out;
}
- if (!yagl_validate_config(dpy, config_, &config, error)) {
+ if (!yagl_validate_config(cur_ts, dpy, config_, &config, error)) {
goto out;
}
goto out;
}
- backend_sfc = dpy->backend_dpy->create_offscreen_surface(dpy->backend_dpy,
+ backend_sfc = dpy->backend_dpy->create_offscreen_surface(cur_ts,
+ dpy->backend_dpy,
&config->native,
EGL_WINDOW_BIT,
&attribs,
backend_sfc = NULL;
yagl_egl_display_add_surface(dpy, surface);
- yagl_egl_surface_release(surface);
+ yagl_egl_surface_release(cur_ts, surface);
res = surface->res.handle;
out:
- yagl_egl_config_release(config);
+ yagl_egl_config_release(cur_ts, config);
if (backend_sfc) {
- backend_sfc->destroy(backend_sfc);
+ backend_sfc->destroy(cur_ts, backend_sfc);
}
return res;
}
-yagl_host_handle yagl_host_eglCreatePbufferSurfaceOffscreenYAGL(yagl_host_handle dpy_,
+yagl_host_handle yagl_host_eglCreatePbufferSurfaceOffscreenYAGL(struct yagl_thread_state *cur_ts,
+ yagl_host_handle dpy_,
yagl_host_handle config_,
uint32_t width,
uint32_t height,
}
}
- if (!yagl_validate_display(dpy_, &dpy, error)) {
+ if (!yagl_validate_display(cur_ts, dpy_, &dpy, error)) {
goto out;
}
- if (!yagl_validate_config(dpy, config_, &config, error)) {
+ if (!yagl_validate_config(cur_ts, dpy, config_, &config, error)) {
goto out;
}
goto out;
}
- backend_sfc = dpy->backend_dpy->create_offscreen_surface(dpy->backend_dpy,
+ backend_sfc = dpy->backend_dpy->create_offscreen_surface(cur_ts,
+ dpy->backend_dpy,
&config->native,
EGL_PBUFFER_BIT,
&attribs,
backend_sfc = NULL;
yagl_egl_display_add_surface(dpy, surface);
- yagl_egl_surface_release(surface);
+ yagl_egl_surface_release(cur_ts, surface);
res = surface->res.handle;
out:
- yagl_egl_config_release(config);
+ yagl_egl_config_release(cur_ts, config);
if (backend_sfc) {
- backend_sfc->destroy(backend_sfc);
+ backend_sfc->destroy(cur_ts, backend_sfc);
}
return res;
}
-yagl_host_handle yagl_host_eglCreatePixmapSurfaceOffscreenYAGL(yagl_host_handle dpy_,
+yagl_host_handle yagl_host_eglCreatePixmapSurfaceOffscreenYAGL(struct yagl_thread_state *cur_ts,
+ yagl_host_handle dpy_,
yagl_host_handle config_,
uint32_t width,
uint32_t height,
goto out;
}
- if (!yagl_validate_display(dpy_, &dpy, error)) {
+ if (!yagl_validate_display(cur_ts, dpy_, &dpy, error)) {
goto out;
}
- if (!yagl_validate_config(dpy, config_, &config, error)) {
+ if (!yagl_validate_config(cur_ts, dpy, config_, &config, error)) {
goto out;
}
goto out;
}
- backend_sfc = dpy->backend_dpy->create_offscreen_surface(dpy->backend_dpy,
+ backend_sfc = dpy->backend_dpy->create_offscreen_surface(cur_ts,
+ dpy->backend_dpy,
&config->native,
EGL_PIXMAP_BIT,
&attribs,
backend_sfc = NULL;
yagl_egl_display_add_surface(dpy, surface);
- yagl_egl_surface_release(surface);
+ yagl_egl_surface_release(cur_ts, surface);
res = surface->res.handle;
out:
- yagl_egl_config_release(config);
+ yagl_egl_config_release(cur_ts, config);
if (backend_sfc) {
- backend_sfc->destroy(backend_sfc);
+ backend_sfc->destroy(cur_ts, backend_sfc);
}
return res;
}
-EGLBoolean yagl_host_eglResizeOffscreenSurfaceYAGL(yagl_host_handle dpy_,
+EGLBoolean yagl_host_eglResizeOffscreenSurfaceYAGL(struct yagl_thread_state *cur_ts,
+ yagl_host_handle dpy_,
yagl_host_handle surface_,
uint32_t width,
uint32_t height,
struct yagl_eglb_surface *backend_sfc = NULL;
struct yagl_eglb_surface *draw_sfc = NULL;
struct yagl_eglb_surface *read_sfc = NULL;
+ struct yagl_egl_api_ts *egl_api_ts = cur_ts->egl_api_ts;
YAGL_LOG_FUNC_SET(eglResizeOffscreenSurfaceYAGL);
- if (!yagl_validate_display(dpy_, &dpy, error)) {
+ if (!yagl_validate_display(cur_ts, dpy_, &dpy, error)) {
goto out;
}
- if (!yagl_validate_surface(dpy, surface_, &surface, error)) {
+ if (!yagl_validate_surface(cur_ts, dpy, surface_, &surface, error)) {
goto out;
}
goto out;
}
- backend_sfc = dpy->backend_dpy->create_offscreen_surface(dpy->backend_dpy,
+ backend_sfc = dpy->backend_dpy->create_offscreen_surface(cur_ts,
+ dpy->backend_dpy,
&surface->cfg->native,
surface->backend_sfc->type,
&surface->backend_sfc->attribs,
}
}
- if (!egl_api_ts->backend->make_current(egl_api_ts->backend,
+ if (!egl_api_ts->backend->make_current(cur_ts,
+ egl_api_ts->backend,
dpy->backend_dpy,
egl_api_ts->context->backend_ctx,
draw_sfc,
goto out;
}
- surface->backend_sfc->replace(surface->backend_sfc, backend_sfc);
+ surface->backend_sfc->replace(cur_ts, surface->backend_sfc, backend_sfc);
backend_sfc = NULL;
out:
if (backend_sfc) {
- backend_sfc->destroy(backend_sfc);
+ backend_sfc->destroy(cur_ts, backend_sfc);
}
- yagl_egl_surface_release(surface);
+ yagl_egl_surface_release(cur_ts, surface);
return res;
}
-yagl_host_handle yagl_host_eglCreateWindowSurfaceOnscreenYAGL(yagl_host_handle dpy_,
+yagl_host_handle yagl_host_eglCreateWindowSurfaceOnscreenYAGL(struct yagl_thread_state *cur_ts,
+ yagl_host_handle dpy_,
yagl_host_handle config_,
yagl_winsys_id win,
const EGLint *attrib_list, int32_t attrib_list_count,
}
}
- if (!yagl_validate_display(dpy_, &dpy, error)) {
+ if (!yagl_validate_display(cur_ts, dpy_, &dpy, error)) {
goto out;
}
- if (!yagl_validate_config(dpy, config_, &config, error)) {
+ if (!yagl_validate_config(cur_ts, dpy, config_, &config, error)) {
goto out;
}
goto out;
}
- backend_sfc = dpy->backend_dpy->create_onscreen_window_surface(dpy->backend_dpy,
+ backend_sfc = dpy->backend_dpy->create_onscreen_window_surface(cur_ts,
+ dpy->backend_dpy,
&config->native,
&attribs,
win);
backend_sfc = NULL;
yagl_egl_display_add_surface(dpy, surface);
- yagl_egl_surface_release(surface);
+ yagl_egl_surface_release(cur_ts, surface);
res = surface->res.handle;
out:
- yagl_egl_config_release(config);
+ yagl_egl_config_release(cur_ts, config);
if (backend_sfc) {
- backend_sfc->destroy(backend_sfc);
+ backend_sfc->destroy(cur_ts, backend_sfc);
}
return res;
}
-yagl_host_handle yagl_host_eglCreatePbufferSurfaceOnscreenYAGL(yagl_host_handle dpy_,
+yagl_host_handle yagl_host_eglCreatePbufferSurfaceOnscreenYAGL(struct yagl_thread_state *cur_ts,
+ yagl_host_handle dpy_,
yagl_host_handle config_,
yagl_winsys_id buffer,
const EGLint *attrib_list, int32_t attrib_list_count,
}
}
- if (!yagl_validate_display(dpy_, &dpy, error)) {
+ if (!yagl_validate_display(cur_ts, dpy_, &dpy, error)) {
goto out;
}
- if (!yagl_validate_config(dpy, config_, &config, error)) {
+ if (!yagl_validate_config(cur_ts, dpy, config_, &config, error)) {
goto out;
}
goto out;
}
- backend_sfc = dpy->backend_dpy->create_onscreen_pbuffer_surface(dpy->backend_dpy,
+ backend_sfc = dpy->backend_dpy->create_onscreen_pbuffer_surface(cur_ts,
+ dpy->backend_dpy,
&config->native,
&attribs,
buffer);
backend_sfc = NULL;
yagl_egl_display_add_surface(dpy, surface);
- yagl_egl_surface_release(surface);
+ yagl_egl_surface_release(cur_ts, surface);
res = surface->res.handle;
out:
- yagl_egl_config_release(config);
+ yagl_egl_config_release(cur_ts, config);
if (backend_sfc) {
- backend_sfc->destroy(backend_sfc);
+ backend_sfc->destroy(cur_ts, backend_sfc);
}
return res;
}
-yagl_host_handle yagl_host_eglCreatePixmapSurfaceOnscreenYAGL(yagl_host_handle dpy_,
+yagl_host_handle yagl_host_eglCreatePixmapSurfaceOnscreenYAGL(struct yagl_thread_state *cur_ts,
+ yagl_host_handle dpy_,
yagl_host_handle config_,
yagl_winsys_id pixmap,
const EGLint *attrib_list, int32_t attrib_list_count,
goto out;
}
- if (!yagl_validate_display(dpy_, &dpy, error)) {
+ if (!yagl_validate_display(cur_ts, dpy_, &dpy, error)) {
goto out;
}
- if (!yagl_validate_config(dpy, config_, &config, error)) {
+ if (!yagl_validate_config(cur_ts, dpy, config_, &config, error)) {
goto out;
}
goto out;
}
- backend_sfc = dpy->backend_dpy->create_onscreen_pixmap_surface(dpy->backend_dpy,
+ backend_sfc = dpy->backend_dpy->create_onscreen_pixmap_surface(cur_ts,
+ dpy->backend_dpy,
&config->native,
&attribs,
pixmap);
backend_sfc = NULL;
yagl_egl_display_add_surface(dpy, surface);
- yagl_egl_surface_release(surface);
+ yagl_egl_surface_release(cur_ts, surface);
res = surface->res.handle;
out:
- yagl_egl_config_release(config);
+ yagl_egl_config_release(cur_ts, config);
if (backend_sfc) {
- backend_sfc->destroy(backend_sfc);
+ backend_sfc->destroy(cur_ts, backend_sfc);
}
return res;
}
-void yagl_host_eglInvalidateOnscreenSurfaceYAGL(yagl_host_handle dpy_,
+void yagl_host_eglInvalidateOnscreenSurfaceYAGL(struct yagl_thread_state *cur_ts,
+ yagl_host_handle dpy_,
yagl_host_handle surface_,
yagl_winsys_id buffer)
{
struct yagl_egl_display *dpy = NULL;
struct yagl_egl_surface *surface = NULL;
- if (!yagl_validate_display(dpy_, &dpy, &error)) {
+ if (!yagl_validate_display(cur_ts, dpy_, &dpy, &error)) {
goto out;
}
- if (!yagl_validate_surface(dpy, surface_, &surface, &error)) {
+ if (!yagl_validate_surface(cur_ts, dpy, surface_, &surface, &error)) {
goto out;
}
- surface->backend_sfc->invalidate(surface->backend_sfc, buffer);
+ surface->backend_sfc->invalidate(cur_ts, surface->backend_sfc, buffer);
out:
- yagl_egl_surface_release(surface);
+ yagl_egl_surface_release(cur_ts, surface);
}
-EGLBoolean yagl_host_eglCreateImageYAGL(uint32_t texture,
+EGLBoolean yagl_host_eglCreateImageYAGL(struct yagl_thread_state *cur_ts,
+ uint32_t texture,
yagl_host_handle dpy_,
yagl_winsys_id buffer,
EGLint *error)
YAGL_LOG_FUNC_SET(eglCreateImageYAGL);
- if (!yagl_validate_display(dpy_, &dpy, error)) {
+ if (!yagl_validate_display(cur_ts, dpy_, &dpy, error)) {
goto out;
}
- image = dpy->backend_dpy->create_image(dpy->backend_dpy, buffer);
+ image = dpy->backend_dpy->create_image(cur_ts, dpy->backend_dpy, buffer);
if (!image) {
YAGL_SET_ERR(EGL_BAD_ALLOC);
#include "yagl_api.h"
#include <EGL/egl.h>
-struct yagl_api_ps *yagl_host_egl_process_init(struct yagl_api *api);
+struct yagl_api_ps *yagl_host_egl_process_init(struct yagl_process_state *ps, struct yagl_api *api);
-yagl_host_handle yagl_host_eglGetDisplay(uint32_t display_id,
+yagl_host_handle yagl_host_eglGetDisplay(struct yagl_thread_state *cur_ts,
+ uint32_t display_id,
EGLint *error);
-EGLBoolean yagl_host_eglInitialize(yagl_host_handle dpy,
+EGLBoolean yagl_host_eglInitialize(struct yagl_thread_state *cur_ts,
+ yagl_host_handle dpy,
EGLint *major,
EGLint *minor,
EGLint *error);
-EGLBoolean yagl_host_eglTerminate(yagl_host_handle dpy,
+EGLBoolean yagl_host_eglTerminate(struct yagl_thread_state *cur_ts,
+ yagl_host_handle dpy,
EGLint *error);
-EGLBoolean yagl_host_eglGetConfigs(yagl_host_handle dpy,
+EGLBoolean yagl_host_eglGetConfigs(struct yagl_thread_state *cur_ts, yagl_host_handle dpy,
yagl_host_handle *configs, int32_t configs_maxcount, int32_t *configs_count,
EGLint *error);
-EGLBoolean yagl_host_eglChooseConfig(yagl_host_handle dpy,
+EGLBoolean yagl_host_eglChooseConfig(struct yagl_thread_state *cur_ts, yagl_host_handle dpy,
const EGLint *attrib_list, int32_t attrib_list_count,
yagl_host_handle *configs, int32_t configs_maxcount, int32_t *configs_count,
EGLint *error);
-EGLBoolean yagl_host_eglGetConfigAttrib(yagl_host_handle dpy,
+EGLBoolean yagl_host_eglGetConfigAttrib(struct yagl_thread_state *cur_ts,
+ yagl_host_handle dpy,
yagl_host_handle config,
EGLint attribute,
EGLint *value,
EGLint *error);
-EGLBoolean yagl_host_eglDestroySurface(yagl_host_handle dpy,
+EGLBoolean yagl_host_eglDestroySurface(struct yagl_thread_state *cur_ts,
+ yagl_host_handle dpy,
yagl_host_handle surface,
EGLint *error);
-EGLBoolean yagl_host_eglQuerySurface(yagl_host_handle dpy,
+EGLBoolean yagl_host_eglQuerySurface(struct yagl_thread_state *cur_ts,
+ yagl_host_handle dpy,
yagl_host_handle surface,
EGLint attribute,
EGLint *value,
EGLint *error);
-void yagl_host_eglBindAPI(EGLenum api);
-void yagl_host_eglWaitClient(void);
-EGLBoolean yagl_host_eglReleaseThread(EGLint *error);
-EGLBoolean yagl_host_eglSurfaceAttrib(yagl_host_handle dpy,
+void yagl_host_eglBindAPI(struct yagl_thread_state *cur_ts, EGLenum api);
+void yagl_host_eglWaitClient(struct yagl_thread_state *cur_ts);
+EGLBoolean yagl_host_eglReleaseThread(struct yagl_thread_state *cur_ts, EGLint *error);
+EGLBoolean yagl_host_eglSurfaceAttrib(struct yagl_thread_state *cur_ts,
+ yagl_host_handle dpy,
yagl_host_handle surface,
EGLint attribute,
EGLint value,
EGLint *error);
-yagl_host_handle yagl_host_eglCreateContext(yagl_host_handle dpy,
+yagl_host_handle yagl_host_eglCreateContext(struct yagl_thread_state *cur_ts,
+ yagl_host_handle dpy,
yagl_host_handle config,
yagl_host_handle share_context,
const EGLint *attrib_list, int32_t attrib_list_count,
EGLint *error);
-EGLBoolean yagl_host_eglDestroyContext(yagl_host_handle dpy,
+EGLBoolean yagl_host_eglDestroyContext(struct yagl_thread_state *cur_ts,
+ yagl_host_handle dpy,
yagl_host_handle ctx,
EGLint *error);
-void yagl_host_eglMakeCurrent(yagl_host_handle dpy,
+void yagl_host_eglMakeCurrent(struct yagl_thread_state *cur_ts,
+ yagl_host_handle dpy,
yagl_host_handle draw,
yagl_host_handle read,
yagl_host_handle ctx);
-EGLBoolean yagl_host_eglQueryContext(yagl_host_handle dpy,
+EGLBoolean yagl_host_eglQueryContext(struct yagl_thread_state *cur_ts,
+ yagl_host_handle dpy,
yagl_host_handle ctx,
EGLint attribute,
EGLint *value,
EGLint *error);
-void yagl_host_eglSwapBuffers(yagl_host_handle dpy,
+void yagl_host_eglSwapBuffers(struct yagl_thread_state *cur_ts,
+ yagl_host_handle dpy,
yagl_host_handle surface);
-void yagl_host_eglCopyBuffers(yagl_host_handle dpy,
+void yagl_host_eglCopyBuffers(struct yagl_thread_state *cur_ts,
+ yagl_host_handle dpy,
yagl_host_handle surface);
-yagl_host_handle yagl_host_eglCreateWindowSurfaceOffscreenYAGL(yagl_host_handle dpy,
+yagl_host_handle yagl_host_eglCreateWindowSurfaceOffscreenYAGL(struct yagl_thread_state *cur_ts,
+ yagl_host_handle dpy,
yagl_host_handle config,
uint32_t width,
uint32_t height,
target_ulong pixels,
const EGLint *attrib_list, int32_t attrib_list_count,
EGLint *error);
-yagl_host_handle yagl_host_eglCreatePbufferSurfaceOffscreenYAGL(yagl_host_handle dpy,
+yagl_host_handle yagl_host_eglCreatePbufferSurfaceOffscreenYAGL(struct yagl_thread_state *cur_ts,
+ yagl_host_handle dpy,
yagl_host_handle config,
uint32_t width,
uint32_t height,
target_ulong pixels,
const EGLint *attrib_list, int32_t attrib_list_count,
EGLint *error);
-yagl_host_handle yagl_host_eglCreatePixmapSurfaceOffscreenYAGL(yagl_host_handle dpy,
+yagl_host_handle yagl_host_eglCreatePixmapSurfaceOffscreenYAGL(struct yagl_thread_state *cur_ts,
+ yagl_host_handle dpy,
yagl_host_handle config,
uint32_t width,
uint32_t height,
target_ulong pixels,
const EGLint *attrib_list, int32_t attrib_list_count,
EGLint *error);
-EGLBoolean yagl_host_eglResizeOffscreenSurfaceYAGL(yagl_host_handle dpy,
+EGLBoolean yagl_host_eglResizeOffscreenSurfaceYAGL(struct yagl_thread_state *cur_ts,
+ yagl_host_handle dpy,
yagl_host_handle surface,
uint32_t width,
uint32_t height,
uint32_t bpp,
target_ulong pixels,
EGLint *error);
-yagl_host_handle yagl_host_eglCreateWindowSurfaceOnscreenYAGL(yagl_host_handle dpy,
+yagl_host_handle yagl_host_eglCreateWindowSurfaceOnscreenYAGL(struct yagl_thread_state *cur_ts,
+ yagl_host_handle dpy,
yagl_host_handle config,
yagl_winsys_id win,
const EGLint *attrib_list, int32_t attrib_list_count,
EGLint *error);
-yagl_host_handle yagl_host_eglCreatePbufferSurfaceOnscreenYAGL(yagl_host_handle dpy,
+yagl_host_handle yagl_host_eglCreatePbufferSurfaceOnscreenYAGL(struct yagl_thread_state *cur_ts,
+ yagl_host_handle dpy,
yagl_host_handle config,
yagl_winsys_id buffer,
const EGLint *attrib_list, int32_t attrib_list_count,
EGLint *error);
-yagl_host_handle yagl_host_eglCreatePixmapSurfaceOnscreenYAGL(yagl_host_handle dpy,
+yagl_host_handle yagl_host_eglCreatePixmapSurfaceOnscreenYAGL(struct yagl_thread_state *cur_ts,
+ yagl_host_handle dpy,
yagl_host_handle config,
yagl_winsys_id pixmap,
const EGLint *attrib_list, int32_t attrib_list_count,
EGLint *error);
-void yagl_host_eglInvalidateOnscreenSurfaceYAGL(yagl_host_handle dpy,
+void yagl_host_eglInvalidateOnscreenSurfaceYAGL(struct yagl_thread_state *cur_ts,
+ yagl_host_handle dpy,
yagl_host_handle surface,
yagl_winsys_id buffer);
-EGLBoolean yagl_host_eglCreateImageYAGL(uint32_t texture,
+EGLBoolean yagl_host_eglCreateImageYAGL(struct yagl_thread_state *cur_ts,
+ uint32_t texture,
yagl_host_handle dpy,
yagl_winsys_id buffer,
EGLint *error);
#include "yagl_thread.h"
#include "yagl_log.h"
-static GLuint yagl_gles_api_ts_create_shader(struct yagl_gles_driver *driver,
+static GLuint yagl_gles_api_ts_create_shader(struct yagl_thread_state *cur_ts,
+ struct yagl_gles_driver *driver,
const char *source,
GLenum type)
{
* To (partially) work around the problem we must patch
* index lookups by UB name.
*/
-static bool yagl_gles_api_ts_broken_ubo_test(struct yagl_gles_driver *driver)
+static bool yagl_gles_api_ts_broken_ubo_test(struct yagl_thread_state *cur_ts,
+ struct yagl_gles_driver *driver)
{
static const char *vs_source_es3 =
"#version 300 es\n\n"
YAGL_LOG_FUNC_SET(yagl_gles_api_ts_broken_ubo_test);
- vs = yagl_gles_api_ts_create_shader(driver,
+ vs = yagl_gles_api_ts_create_shader(cur_ts, driver,
((driver->gl_version == yagl_gl_3_1_es3) ? vs_source_es3 : vs_source_3_2),
GL_VERTEX_SHADER);
goto out1;
}
- fs = yagl_gles_api_ts_create_shader(driver,
+ fs = yagl_gles_api_ts_create_shader(cur_ts, driver,
((driver->gl_version == yagl_gl_3_1_es3) ? fs_source_es3 : fs_source_3_2),
GL_FRAGMENT_SHADER);
return res;
}
-void yagl_gles_api_ts_init(struct yagl_gles_api_ts *gles_api_ts,
+void yagl_gles_api_ts_init(struct yagl_thread_state *cur_ts,
+ struct yagl_gles_api_ts *gles_api_ts,
struct yagl_gles_driver *driver,
struct yagl_gles_api_ps *ps)
{
return;
}
- yagl_ensure_ctx(0);
+ yagl_ensure_ctx(cur_ts, 0);
if (driver->gl_version > yagl_gl_2) {
gles_api_ts->api->use_map_buffer_range = true;
}
if (driver->gl_version >= yagl_gl_3_1_es3) {
- gles_api_ts->api->broken_ubo = yagl_gles_api_ts_broken_ubo_test(driver);
+ gles_api_ts->api->broken_ubo = yagl_gles_api_ts_broken_ubo_test(cur_ts, driver);
} else {
gles_api_ts->api->broken_ubo = false;
}
- yagl_unensure_ctx(0);
+ yagl_unensure_ctx(cur_ts, 0);
gles_api_ts->api->checked = true;
}
-void yagl_gles_api_ts_cleanup(struct yagl_gles_api_ts *gles_api_ts)
+void yagl_gles_api_ts_cleanup(struct yagl_thread_state *cur_ts,
+ struct yagl_gles_api_ts *gles_api_ts)
{
if (gles_api_ts->num_arrays > 0) {
uint32_t i;
- yagl_ensure_ctx(0);
+ yagl_ensure_ctx(cur_ts, 0);
if (gles_api_ts->ebo) {
gles_api_ts->driver->DeleteBuffers(1, &gles_api_ts->ebo);
&gles_api_ts->arrays[i].vbo);
}
- yagl_unensure_ctx(0);
+ yagl_unensure_ctx(cur_ts, 0);
}
g_free(gles_api_ts->arrays);
uint32_t ebo_size;
};
-void yagl_gles_api_ts_init(struct yagl_gles_api_ts *gles_api_ts,
+void yagl_gles_api_ts_init(struct yagl_thread_state *cur_ts,
+ struct yagl_gles_api_ts *gles_api_ts,
struct yagl_gles_driver *driver,
struct yagl_gles_api_ps *ps);
-void yagl_gles_api_ts_cleanup(struct yagl_gles_api_ts *gles_api_ts);
+void yagl_gles_api_ts_cleanup(struct yagl_thread_state *cur_ts,
+ struct yagl_gles_api_ts *gles_api_ts);
#endif
*/
static void yagl_func_glDrawArrays(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum mode;
GLint first;
GLsizei count;
first = yagl_transport_get_out_GLint(t);
count = yagl_transport_get_out_GLsizei(t);
YAGL_LOG_FUNC_ENTER_SPLIT3(glDrawArrays, GLenum, GLint, GLsizei, mode, first, count);
- (void)yagl_host_glDrawArrays(mode, first, count);
+ (void)yagl_host_glDrawArrays(cur_ts, mode, first, count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glDrawElements(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum mode;
GLsizei count;
GLenum type;
type = yagl_transport_get_out_GLenum(t);
yagl_transport_get_out_array(t, 1, (const void**)&indices, &indices_count);
YAGL_LOG_FUNC_ENTER_SPLIT4(glDrawElements, GLenum, GLsizei, GLenum, void*, mode, count, type, indices);
- (void)yagl_host_glDrawElements(mode, count, type, indices, indices_count);
+ (void)yagl_host_glDrawElements(cur_ts, mode, count, type, indices, indices_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glReadPixelsData(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLint x;
GLint y;
GLsizei width;
yagl_transport_get_in_array(t, 1, (void**)&pixels, &pixels_maxcount, &pixels_count);
YAGL_LOG_FUNC_ENTER_SPLIT7(glReadPixelsData, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, void*, x, y, width, height, format, type, pixels);
*pixels_count = 0;
- (void)yagl_host_glReadPixelsData(x, y, width, height, format, type, pixels, pixels_maxcount, pixels_count);
+ (void)yagl_host_glReadPixelsData(cur_ts, x, y, width, height, format, type, pixels, pixels_maxcount, pixels_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glReadPixelsOffset(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLint x;
GLint y;
GLsizei width;
type = yagl_transport_get_out_GLenum(t);
pixels = yagl_transport_get_out_uintptr_t(t);
YAGL_LOG_FUNC_ENTER_SPLIT7(glReadPixelsOffset, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, uintptr_t, x, y, width, height, format, type, pixels);
- (void)yagl_host_glReadPixelsOffset(x, y, width, height, format, type, pixels);
+ (void)yagl_host_glReadPixelsOffset(cur_ts, x, y, width, height, format, type, pixels);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glDrawArraysInstanced(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum mode;
GLint start;
GLsizei count;
count = yagl_transport_get_out_GLsizei(t);
primcount = yagl_transport_get_out_GLsizei(t);
YAGL_LOG_FUNC_ENTER_SPLIT4(glDrawArraysInstanced, GLenum, GLint, GLsizei, GLsizei, mode, start, count, primcount);
- (void)yagl_host_glDrawArraysInstanced(mode, start, count, primcount);
+ (void)yagl_host_glDrawArraysInstanced(cur_ts, mode, start, count, primcount);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glDrawElementsInstanced(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum mode;
GLsizei count;
GLenum type;
yagl_transport_get_out_array(t, 1, (const void**)&indices, &indices_count);
primcount = yagl_transport_get_out_GLsizei(t);
YAGL_LOG_FUNC_ENTER_SPLIT5(glDrawElementsInstanced, GLenum, GLsizei, GLenum, void*, GLsizei, mode, count, type, indices, primcount);
- (void)yagl_host_glDrawElementsInstanced(mode, count, type, indices, indices_count, primcount);
+ (void)yagl_host_glDrawElementsInstanced(cur_ts, mode, count, type, indices, indices_count, primcount);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glDrawRangeElements(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum mode;
GLuint start;
GLuint end;
type = yagl_transport_get_out_GLenum(t);
yagl_transport_get_out_array(t, 1, (const void**)&indices, &indices_count);
YAGL_LOG_FUNC_ENTER_SPLIT6(glDrawRangeElements, GLenum, GLuint, GLuint, GLsizei, GLenum, void*, mode, start, end, count, type, indices);
- (void)yagl_host_glDrawRangeElements(mode, start, end, count, type, indices, indices_count);
+ (void)yagl_host_glDrawRangeElements(cur_ts, mode, start, end, count, type, indices, indices_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glGenVertexArrays(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
const GLuint *arrays;
int32_t arrays_count;
yagl_transport_get_out_array(t, sizeof(GLuint), (const void**)&arrays, &arrays_count);
YAGL_LOG_FUNC_ENTER_SPLIT1(glGenVertexArrays, void*, arrays);
- (void)yagl_host_glGenVertexArrays(arrays, arrays_count);
+ (void)yagl_host_glGenVertexArrays(cur_ts, arrays, arrays_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glBindVertexArray(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLuint array;
array = yagl_transport_get_out_GLuint(t);
YAGL_LOG_FUNC_ENTER_SPLIT1(glBindVertexArray, GLuint, array);
- (void)yagl_host_glBindVertexArray(array);
+ (void)yagl_host_glBindVertexArray(cur_ts, array);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glDisableVertexAttribArray(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLuint index;
index = yagl_transport_get_out_GLuint(t);
YAGL_LOG_FUNC_ENTER_SPLIT1(glDisableVertexAttribArray, GLuint, index);
- (void)yagl_host_glDisableVertexAttribArray(index);
+ (void)yagl_host_glDisableVertexAttribArray(cur_ts, index);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glEnableVertexAttribArray(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLuint index;
index = yagl_transport_get_out_GLuint(t);
YAGL_LOG_FUNC_ENTER_SPLIT1(glEnableVertexAttribArray, GLuint, index);
- (void)yagl_host_glEnableVertexAttribArray(index);
+ (void)yagl_host_glEnableVertexAttribArray(cur_ts, index);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glVertexAttribPointerData(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLuint indx;
GLint size;
GLenum type;
first = yagl_transport_get_out_GLint(t);
yagl_transport_get_out_array(t, 1, (const void**)&data, &data_count);
YAGL_LOG_FUNC_ENTER_SPLIT7(glVertexAttribPointerData, GLuint, GLint, GLenum, GLboolean, GLsizei, GLint, void*, indx, size, type, normalized, stride, first, data);
- (void)yagl_host_glVertexAttribPointerData(indx, size, type, normalized, stride, first, data, data_count);
+ (void)yagl_host_glVertexAttribPointerData(cur_ts, indx, size, type, normalized, stride, first, data, data_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glVertexAttribPointerOffset(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLuint indx;
GLint size;
GLenum type;
stride = yagl_transport_get_out_GLsizei(t);
offset = yagl_transport_get_out_uintptr_t(t);
YAGL_LOG_FUNC_ENTER_SPLIT6(glVertexAttribPointerOffset, GLuint, GLint, GLenum, GLboolean, GLsizei, uintptr_t, indx, size, type, normalized, stride, offset);
- (void)yagl_host_glVertexAttribPointerOffset(indx, size, type, normalized, stride, offset);
+ (void)yagl_host_glVertexAttribPointerOffset(cur_ts, indx, size, type, normalized, stride, offset);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glVertexPointerData(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLint size;
GLenum type;
GLsizei stride;
first = yagl_transport_get_out_GLint(t);
yagl_transport_get_out_array(t, 1, (const void**)&data, &data_count);
YAGL_LOG_FUNC_ENTER_SPLIT5(glVertexPointerData, GLint, GLenum, GLsizei, GLint, void*, size, type, stride, first, data);
- (void)yagl_host_glVertexPointerData(size, type, stride, first, data, data_count);
+ (void)yagl_host_glVertexPointerData(cur_ts, size, type, stride, first, data, data_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glVertexPointerOffset(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLint size;
GLenum type;
GLsizei stride;
stride = yagl_transport_get_out_GLsizei(t);
offset = yagl_transport_get_out_uintptr_t(t);
YAGL_LOG_FUNC_ENTER_SPLIT4(glVertexPointerOffset, GLint, GLenum, GLsizei, uintptr_t, size, type, stride, offset);
- (void)yagl_host_glVertexPointerOffset(size, type, stride, offset);
+ (void)yagl_host_glVertexPointerOffset(cur_ts, size, type, stride, offset);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glNormalPointerData(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum type;
GLsizei stride;
GLint first;
first = yagl_transport_get_out_GLint(t);
yagl_transport_get_out_array(t, 1, (const void**)&data, &data_count);
YAGL_LOG_FUNC_ENTER_SPLIT4(glNormalPointerData, GLenum, GLsizei, GLint, void*, type, stride, first, data);
- (void)yagl_host_glNormalPointerData(type, stride, first, data, data_count);
+ (void)yagl_host_glNormalPointerData(cur_ts, type, stride, first, data, data_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glNormalPointerOffset(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum type;
GLsizei stride;
uintptr_t offset;
stride = yagl_transport_get_out_GLsizei(t);
offset = yagl_transport_get_out_uintptr_t(t);
YAGL_LOG_FUNC_ENTER_SPLIT3(glNormalPointerOffset, GLenum, GLsizei, uintptr_t, type, stride, offset);
- (void)yagl_host_glNormalPointerOffset(type, stride, offset);
+ (void)yagl_host_glNormalPointerOffset(cur_ts, type, stride, offset);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glColorPointerData(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLint size;
GLenum type;
GLsizei stride;
first = yagl_transport_get_out_GLint(t);
yagl_transport_get_out_array(t, 1, (const void**)&data, &data_count);
YAGL_LOG_FUNC_ENTER_SPLIT5(glColorPointerData, GLint, GLenum, GLsizei, GLint, void*, size, type, stride, first, data);
- (void)yagl_host_glColorPointerData(size, type, stride, first, data, data_count);
+ (void)yagl_host_glColorPointerData(cur_ts, size, type, stride, first, data, data_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glColorPointerOffset(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLint size;
GLenum type;
GLsizei stride;
stride = yagl_transport_get_out_GLsizei(t);
offset = yagl_transport_get_out_uintptr_t(t);
YAGL_LOG_FUNC_ENTER_SPLIT4(glColorPointerOffset, GLint, GLenum, GLsizei, uintptr_t, size, type, stride, offset);
- (void)yagl_host_glColorPointerOffset(size, type, stride, offset);
+ (void)yagl_host_glColorPointerOffset(cur_ts, size, type, stride, offset);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glTexCoordPointerData(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLint tex_id;
GLint size;
GLenum type;
first = yagl_transport_get_out_GLint(t);
yagl_transport_get_out_array(t, 1, (const void**)&data, &data_count);
YAGL_LOG_FUNC_ENTER_SPLIT6(glTexCoordPointerData, GLint, GLint, GLenum, GLsizei, GLint, void*, tex_id, size, type, stride, first, data);
- (void)yagl_host_glTexCoordPointerData(tex_id, size, type, stride, first, data, data_count);
+ (void)yagl_host_glTexCoordPointerData(cur_ts, tex_id, size, type, stride, first, data, data_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glTexCoordPointerOffset(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLint size;
GLenum type;
GLsizei stride;
stride = yagl_transport_get_out_GLsizei(t);
offset = yagl_transport_get_out_uintptr_t(t);
YAGL_LOG_FUNC_ENTER_SPLIT4(glTexCoordPointerOffset, GLint, GLenum, GLsizei, uintptr_t, size, type, stride, offset);
- (void)yagl_host_glTexCoordPointerOffset(size, type, stride, offset);
+ (void)yagl_host_glTexCoordPointerOffset(cur_ts, size, type, stride, offset);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glDisableClientState(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum array;
array = yagl_transport_get_out_GLenum(t);
YAGL_LOG_FUNC_ENTER_SPLIT1(glDisableClientState, GLenum, array);
- (void)yagl_host_glDisableClientState(array);
+ (void)yagl_host_glDisableClientState(cur_ts, array);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glEnableClientState(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum array;
array = yagl_transport_get_out_GLenum(t);
YAGL_LOG_FUNC_ENTER_SPLIT1(glEnableClientState, GLenum, array);
- (void)yagl_host_glEnableClientState(array);
+ (void)yagl_host_glEnableClientState(cur_ts, array);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glVertexAttribDivisor(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLuint index;
GLuint divisor;
index = yagl_transport_get_out_GLuint(t);
divisor = yagl_transport_get_out_GLuint(t);
YAGL_LOG_FUNC_ENTER_SPLIT2(glVertexAttribDivisor, GLuint, GLuint, index, divisor);
- (void)yagl_host_glVertexAttribDivisor(index, divisor);
+ (void)yagl_host_glVertexAttribDivisor(cur_ts, index, divisor);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glVertexAttribIPointerData(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLuint index;
GLint size;
GLenum type;
first = yagl_transport_get_out_GLint(t);
yagl_transport_get_out_array(t, 1, (const void**)&data, &data_count);
YAGL_LOG_FUNC_ENTER_SPLIT6(glVertexAttribIPointerData, GLuint, GLint, GLenum, GLsizei, GLint, void*, index, size, type, stride, first, data);
- (void)yagl_host_glVertexAttribIPointerData(index, size, type, stride, first, data, data_count);
+ (void)yagl_host_glVertexAttribIPointerData(cur_ts, index, size, type, stride, first, data, data_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glVertexAttribIPointerOffset(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLuint index;
GLint size;
GLenum type;
stride = yagl_transport_get_out_GLsizei(t);
offset = yagl_transport_get_out_uintptr_t(t);
YAGL_LOG_FUNC_ENTER_SPLIT5(glVertexAttribIPointerOffset, GLuint, GLint, GLenum, GLsizei, uintptr_t, index, size, type, stride, offset);
- (void)yagl_host_glVertexAttribIPointerOffset(index, size, type, stride, offset);
+ (void)yagl_host_glVertexAttribIPointerOffset(cur_ts, index, size, type, stride, offset);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glGenBuffers(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
const GLuint *buffers;
int32_t buffers_count;
yagl_transport_get_out_array(t, sizeof(GLuint), (const void**)&buffers, &buffers_count);
YAGL_LOG_FUNC_ENTER_SPLIT1(glGenBuffers, void*, buffers);
- (void)yagl_host_glGenBuffers(buffers, buffers_count);
+ (void)yagl_host_glGenBuffers(cur_ts, buffers, buffers_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glBindBuffer(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum target;
GLuint buffer;
target = yagl_transport_get_out_GLenum(t);
buffer = yagl_transport_get_out_GLuint(t);
YAGL_LOG_FUNC_ENTER_SPLIT2(glBindBuffer, GLenum, GLuint, target, buffer);
- (void)yagl_host_glBindBuffer(target, buffer);
+ (void)yagl_host_glBindBuffer(cur_ts, target, buffer);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glBufferData(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum target;
const GLvoid *data;
int32_t data_count;
yagl_transport_get_out_array(t, 1, (const void**)&data, &data_count);
usage = yagl_transport_get_out_GLenum(t);
YAGL_LOG_FUNC_ENTER_SPLIT3(glBufferData, GLenum, void*, GLenum, target, data, usage);
- (void)yagl_host_glBufferData(target, data, data_count, usage);
+ (void)yagl_host_glBufferData(cur_ts, target, data, data_count, usage);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glBufferSubData(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum target;
GLsizei offset;
const GLvoid *data;
offset = yagl_transport_get_out_GLsizei(t);
yagl_transport_get_out_array(t, 1, (const void**)&data, &data_count);
YAGL_LOG_FUNC_ENTER_SPLIT3(glBufferSubData, GLenum, GLsizei, void*, target, offset, data);
- (void)yagl_host_glBufferSubData(target, offset, data, data_count);
+ (void)yagl_host_glBufferSubData(cur_ts, target, offset, data, data_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glBindBufferBase(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum target;
GLuint index;
GLuint buffer;
index = yagl_transport_get_out_GLuint(t);
buffer = yagl_transport_get_out_GLuint(t);
YAGL_LOG_FUNC_ENTER_SPLIT3(glBindBufferBase, GLenum, GLuint, GLuint, target, index, buffer);
- (void)yagl_host_glBindBufferBase(target, index, buffer);
+ (void)yagl_host_glBindBufferBase(cur_ts, target, index, buffer);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glBindBufferRange(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum target;
GLuint index;
GLuint buffer;
offset = yagl_transport_get_out_GLint(t);
size = yagl_transport_get_out_GLsizei(t);
YAGL_LOG_FUNC_ENTER_SPLIT5(glBindBufferRange, GLenum, GLuint, GLuint, GLint, GLsizei, target, index, buffer, offset, size);
- (void)yagl_host_glBindBufferRange(target, index, buffer, offset, size);
+ (void)yagl_host_glBindBufferRange(cur_ts, target, index, buffer, offset, size);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glMapBuffer(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLuint buffer;
const GLuint *ranges;
int32_t ranges_count;
yagl_transport_get_in_array(t, 1, (void**)&data, &data_maxcount, &data_count);
YAGL_LOG_FUNC_ENTER_SPLIT3(glMapBuffer, GLuint, void*, void*, buffer, ranges, data);
*data_count = 0;
- (void)yagl_host_glMapBuffer(buffer, ranges, ranges_count, data, data_maxcount, data_count);
+ (void)yagl_host_glMapBuffer(cur_ts, buffer, ranges, ranges_count, data, data_maxcount, data_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glCopyBufferSubData(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum readTarget;
GLenum writeTarget;
GLintptr readOffset;
writeOffset = yagl_transport_get_out_GLintptr(t);
size = yagl_transport_get_out_GLsizei(t);
YAGL_LOG_FUNC_ENTER_SPLIT5(glCopyBufferSubData, GLenum, GLenum, GLintptr, GLintptr, GLsizei, readTarget, writeTarget, readOffset, writeOffset, size);
- (void)yagl_host_glCopyBufferSubData(readTarget, writeTarget, readOffset, writeOffset, size);
+ (void)yagl_host_glCopyBufferSubData(cur_ts, readTarget, writeTarget, readOffset, writeOffset, size);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glGenTextures(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
const GLuint *textures;
int32_t textures_count;
yagl_transport_get_out_array(t, sizeof(GLuint), (const void**)&textures, &textures_count);
YAGL_LOG_FUNC_ENTER_SPLIT1(glGenTextures, void*, textures);
- (void)yagl_host_glGenTextures(textures, textures_count);
+ (void)yagl_host_glGenTextures(cur_ts, textures, textures_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glBindTexture(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum target;
GLuint texture;
target = yagl_transport_get_out_GLenum(t);
texture = yagl_transport_get_out_GLuint(t);
YAGL_LOG_FUNC_ENTER_SPLIT2(glBindTexture, GLenum, GLuint, target, texture);
- (void)yagl_host_glBindTexture(target, texture);
+ (void)yagl_host_glBindTexture(cur_ts, target, texture);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glActiveTexture(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum texture;
texture = yagl_transport_get_out_GLenum(t);
YAGL_LOG_FUNC_ENTER_SPLIT1(glActiveTexture, GLenum, texture);
- (void)yagl_host_glActiveTexture(texture);
+ (void)yagl_host_glActiveTexture(cur_ts, texture);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glCopyTexImage2D(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum target;
GLint level;
GLenum internalformat;
height = yagl_transport_get_out_GLsizei(t);
border = yagl_transport_get_out_GLint(t);
YAGL_LOG_FUNC_ENTER_SPLIT8(glCopyTexImage2D, GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint, target, level, internalformat, x, y, width, height, border);
- (void)yagl_host_glCopyTexImage2D(target, level, internalformat, x, y, width, height, border);
+ (void)yagl_host_glCopyTexImage2D(cur_ts, target, level, internalformat, x, y, width, height, border);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glCopyTexSubImage2D(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum target;
GLint level;
GLint xoffset;
width = yagl_transport_get_out_GLsizei(t);
height = yagl_transport_get_out_GLsizei(t);
YAGL_LOG_FUNC_ENTER_SPLIT8(glCopyTexSubImage2D, GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei, target, level, xoffset, yoffset, x, y, width, height);
- (void)yagl_host_glCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height);
+ (void)yagl_host_glCopyTexSubImage2D(cur_ts, target, level, xoffset, yoffset, x, y, width, height);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glGetTexParameterfv(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum target;
GLenum pname;
GLfloat *param;
pname = yagl_transport_get_out_GLenum(t);
yagl_transport_get_in_arg(t, (void**)¶m);
YAGL_LOG_FUNC_ENTER_SPLIT3(glGetTexParameterfv, GLenum, GLenum, void*, target, pname, param);
- (void)yagl_host_glGetTexParameterfv(target, pname, param);
+ (void)yagl_host_glGetTexParameterfv(cur_ts, target, pname, param);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glGetTexParameteriv(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum target;
GLenum pname;
GLint *param;
pname = yagl_transport_get_out_GLenum(t);
yagl_transport_get_in_arg(t, (void**)¶m);
YAGL_LOG_FUNC_ENTER_SPLIT3(glGetTexParameteriv, GLenum, GLenum, void*, target, pname, param);
- (void)yagl_host_glGetTexParameteriv(target, pname, param);
+ (void)yagl_host_glGetTexParameteriv(cur_ts, target, pname, param);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glTexImage2DData(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum target;
GLint level;
GLint internalformat;
type = yagl_transport_get_out_GLenum(t);
yagl_transport_get_out_array(t, 1, (const void**)&pixels, &pixels_count);
YAGL_LOG_FUNC_ENTER_SPLIT9(glTexImage2DData, GLenum, GLint, GLint, GLsizei, GLsizei, GLint, GLenum, GLenum, void*, target, level, internalformat, width, height, border, format, type, pixels);
- (void)yagl_host_glTexImage2DData(target, level, internalformat, width, height, border, format, type, pixels, pixels_count);
+ (void)yagl_host_glTexImage2DData(cur_ts, target, level, internalformat, width, height, border, format, type, pixels, pixels_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glTexImage2DOffset(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum target;
GLint level;
GLint internalformat;
type = yagl_transport_get_out_GLenum(t);
pixels = yagl_transport_get_out_uintptr_t(t);
YAGL_LOG_FUNC_ENTER_SPLIT9(glTexImage2DOffset, GLenum, GLint, GLint, GLsizei, GLsizei, GLint, GLenum, GLenum, uintptr_t, target, level, internalformat, width, height, border, format, type, pixels);
- (void)yagl_host_glTexImage2DOffset(target, level, internalformat, width, height, border, format, type, pixels);
+ (void)yagl_host_glTexImage2DOffset(cur_ts, target, level, internalformat, width, height, border, format, type, pixels);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glTexParameterf(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum target;
GLenum pname;
GLfloat param;
pname = yagl_transport_get_out_GLenum(t);
param = yagl_transport_get_out_GLfloat(t);
YAGL_LOG_FUNC_ENTER_SPLIT3(glTexParameterf, GLenum, GLenum, GLfloat, target, pname, param);
- (void)yagl_host_glTexParameterf(target, pname, param);
+ (void)yagl_host_glTexParameterf(cur_ts, target, pname, param);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glTexParameterfv(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum target;
GLenum pname;
const GLfloat *params;
pname = yagl_transport_get_out_GLenum(t);
yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)¶ms, ¶ms_count);
YAGL_LOG_FUNC_ENTER_SPLIT3(glTexParameterfv, GLenum, GLenum, void*, target, pname, params);
- (void)yagl_host_glTexParameterfv(target, pname, params, params_count);
+ (void)yagl_host_glTexParameterfv(cur_ts, target, pname, params, params_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glTexParameteri(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum target;
GLenum pname;
GLint param;
pname = yagl_transport_get_out_GLenum(t);
param = yagl_transport_get_out_GLint(t);
YAGL_LOG_FUNC_ENTER_SPLIT3(glTexParameteri, GLenum, GLenum, GLint, target, pname, param);
- (void)yagl_host_glTexParameteri(target, pname, param);
+ (void)yagl_host_glTexParameteri(cur_ts, target, pname, param);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glTexParameteriv(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum target;
GLenum pname;
const GLint *params;
pname = yagl_transport_get_out_GLenum(t);
yagl_transport_get_out_array(t, sizeof(GLint), (const void**)¶ms, ¶ms_count);
YAGL_LOG_FUNC_ENTER_SPLIT3(glTexParameteriv, GLenum, GLenum, void*, target, pname, params);
- (void)yagl_host_glTexParameteriv(target, pname, params, params_count);
+ (void)yagl_host_glTexParameteriv(cur_ts, target, pname, params, params_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glTexSubImage2DData(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum target;
GLint level;
GLint xoffset;
type = yagl_transport_get_out_GLenum(t);
yagl_transport_get_out_array(t, 1, (const void**)&pixels, &pixels_count);
YAGL_LOG_FUNC_ENTER_SPLIT9(glTexSubImage2DData, GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, void*, target, level, xoffset, yoffset, width, height, format, type, pixels);
- (void)yagl_host_glTexSubImage2DData(target, level, xoffset, yoffset, width, height, format, type, pixels, pixels_count);
+ (void)yagl_host_glTexSubImage2DData(cur_ts, target, level, xoffset, yoffset, width, height, format, type, pixels, pixels_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glTexSubImage2DOffset(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum target;
GLint level;
GLint xoffset;
type = yagl_transport_get_out_GLenum(t);
pixels = yagl_transport_get_out_uintptr_t(t);
YAGL_LOG_FUNC_ENTER_SPLIT9(glTexSubImage2DOffset, GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, uintptr_t, target, level, xoffset, yoffset, width, height, format, type, pixels);
- (void)yagl_host_glTexSubImage2DOffset(target, level, xoffset, yoffset, width, height, format, type, pixels);
+ (void)yagl_host_glTexSubImage2DOffset(cur_ts, target, level, xoffset, yoffset, width, height, format, type, pixels);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glClientActiveTexture(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum texture;
texture = yagl_transport_get_out_GLenum(t);
YAGL_LOG_FUNC_ENTER_SPLIT1(glClientActiveTexture, GLenum, texture);
- (void)yagl_host_glClientActiveTexture(texture);
+ (void)yagl_host_glClientActiveTexture(cur_ts, texture);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glTexEnvi(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum target;
GLenum pname;
GLint param;
pname = yagl_transport_get_out_GLenum(t);
param = yagl_transport_get_out_GLint(t);
YAGL_LOG_FUNC_ENTER_SPLIT3(glTexEnvi, GLenum, GLenum, GLint, target, pname, param);
- (void)yagl_host_glTexEnvi(target, pname, param);
+ (void)yagl_host_glTexEnvi(cur_ts, target, pname, param);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glTexEnvf(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum target;
GLenum pname;
GLfloat param;
pname = yagl_transport_get_out_GLenum(t);
param = yagl_transport_get_out_GLfloat(t);
YAGL_LOG_FUNC_ENTER_SPLIT3(glTexEnvf, GLenum, GLenum, GLfloat, target, pname, param);
- (void)yagl_host_glTexEnvf(target, pname, param);
+ (void)yagl_host_glTexEnvf(cur_ts, target, pname, param);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glMultiTexCoord4f(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum target;
GLfloat s;
GLfloat tt;
r = yagl_transport_get_out_GLfloat(t);
q = yagl_transport_get_out_GLfloat(t);
YAGL_LOG_FUNC_ENTER_SPLIT5(glMultiTexCoord4f, GLenum, GLfloat, GLfloat, GLfloat, GLfloat, target, s, tt, r, q);
- (void)yagl_host_glMultiTexCoord4f(target, s, tt, r, q);
+ (void)yagl_host_glMultiTexCoord4f(cur_ts, target, s, tt, r, q);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glTexEnviv(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum target;
GLenum pname;
const GLint *params;
pname = yagl_transport_get_out_GLenum(t);
yagl_transport_get_out_array(t, sizeof(GLint), (const void**)¶ms, ¶ms_count);
YAGL_LOG_FUNC_ENTER_SPLIT3(glTexEnviv, GLenum, GLenum, void*, target, pname, params);
- (void)yagl_host_glTexEnviv(target, pname, params, params_count);
+ (void)yagl_host_glTexEnviv(cur_ts, target, pname, params, params_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glTexEnvfv(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum target;
GLenum pname;
const GLfloat *params;
pname = yagl_transport_get_out_GLenum(t);
yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)¶ms, ¶ms_count);
YAGL_LOG_FUNC_ENTER_SPLIT3(glTexEnvfv, GLenum, GLenum, void*, target, pname, params);
- (void)yagl_host_glTexEnvfv(target, pname, params, params_count);
+ (void)yagl_host_glTexEnvfv(cur_ts, target, pname, params, params_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glGetTexEnviv(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum env;
GLenum pname;
GLint *params;
yagl_transport_get_in_array(t, sizeof(GLint), (void**)¶ms, ¶ms_maxcount, ¶ms_count);
YAGL_LOG_FUNC_ENTER_SPLIT3(glGetTexEnviv, GLenum, GLenum, void*, env, pname, params);
*params_count = 0;
- (void)yagl_host_glGetTexEnviv(env, pname, params, params_maxcount, params_count);
+ (void)yagl_host_glGetTexEnviv(cur_ts, env, pname, params, params_maxcount, params_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glGetTexEnvfv(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum env;
GLenum pname;
GLfloat *params;
yagl_transport_get_in_array(t, sizeof(GLfloat), (void**)¶ms, ¶ms_maxcount, ¶ms_count);
YAGL_LOG_FUNC_ENTER_SPLIT3(glGetTexEnvfv, GLenum, GLenum, void*, env, pname, params);
*params_count = 0;
- (void)yagl_host_glGetTexEnvfv(env, pname, params, params_maxcount, params_count);
+ (void)yagl_host_glGetTexEnvfv(cur_ts, env, pname, params, params_maxcount, params_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glTexImage3DData(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum target;
GLint level;
GLint internalformat;
type = yagl_transport_get_out_GLenum(t);
yagl_transport_get_out_array(t, 1, (const void**)&pixels, &pixels_count);
YAGL_LOG_FUNC_ENTER_SPLIT10(glTexImage3DData, GLenum, GLint, GLint, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, void*, target, level, internalformat, width, height, depth, border, format, type, pixels);
- (void)yagl_host_glTexImage3DData(target, level, internalformat, width, height, depth, border, format, type, pixels, pixels_count);
+ (void)yagl_host_glTexImage3DData(cur_ts, target, level, internalformat, width, height, depth, border, format, type, pixels, pixels_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glTexImage3DOffset(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum target;
GLint level;
GLint internalformat;
type = yagl_transport_get_out_GLenum(t);
pixels = yagl_transport_get_out_uintptr_t(t);
YAGL_LOG_FUNC_ENTER_SPLIT10(glTexImage3DOffset, GLenum, GLint, GLint, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, uintptr_t, target, level, internalformat, width, height, depth, border, format, type, pixels);
- (void)yagl_host_glTexImage3DOffset(target, level, internalformat, width, height, depth, border, format, type, pixels);
+ (void)yagl_host_glTexImage3DOffset(cur_ts, target, level, internalformat, width, height, depth, border, format, type, pixels);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glTexSubImage3DData(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum target;
GLint level;
GLint xoffset;
type = yagl_transport_get_out_GLenum(t);
yagl_transport_get_out_array(t, 1, (const void**)&pixels, &pixels_count);
YAGL_LOG_FUNC_ENTER_SPLIT11(glTexSubImage3DData, GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, void*, target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels);
- (void)yagl_host_glTexSubImage3DData(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels, pixels_count);
+ (void)yagl_host_glTexSubImage3DData(cur_ts, target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels, pixels_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glTexSubImage3DOffset(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum target;
GLint level;
GLint xoffset;
type = yagl_transport_get_out_GLenum(t);
pixels = yagl_transport_get_out_uintptr_t(t);
YAGL_LOG_FUNC_ENTER_SPLIT11(glTexSubImage3DOffset, GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, uintptr_t, target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels);
- (void)yagl_host_glTexSubImage3DOffset(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels);
+ (void)yagl_host_glTexSubImage3DOffset(cur_ts, target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glCopyTexSubImage3D(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum target;
GLint level;
GLint xoffset;
width = yagl_transport_get_out_GLsizei(t);
height = yagl_transport_get_out_GLsizei(t);
YAGL_LOG_FUNC_ENTER_SPLIT9(glCopyTexSubImage3D, GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei, target, level, xoffset, yoffset, zoffset, x, y, width, height);
- (void)yagl_host_glCopyTexSubImage3D(target, level, xoffset, yoffset, zoffset, x, y, width, height);
+ (void)yagl_host_glCopyTexSubImage3D(cur_ts, target, level, xoffset, yoffset, zoffset, x, y, width, height);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glGenFramebuffers(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
const GLuint *framebuffers;
int32_t framebuffers_count;
yagl_transport_get_out_array(t, sizeof(GLuint), (const void**)&framebuffers, &framebuffers_count);
YAGL_LOG_FUNC_ENTER_SPLIT1(glGenFramebuffers, void*, framebuffers);
- (void)yagl_host_glGenFramebuffers(framebuffers, framebuffers_count);
+ (void)yagl_host_glGenFramebuffers(cur_ts, framebuffers, framebuffers_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glBindFramebuffer(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum target;
GLuint framebuffer;
target = yagl_transport_get_out_GLenum(t);
framebuffer = yagl_transport_get_out_GLuint(t);
YAGL_LOG_FUNC_ENTER_SPLIT2(glBindFramebuffer, GLenum, GLuint, target, framebuffer);
- (void)yagl_host_glBindFramebuffer(target, framebuffer);
+ (void)yagl_host_glBindFramebuffer(cur_ts, target, framebuffer);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glFramebufferTexture2D(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum target;
GLenum attachment;
GLenum textarget;
texture = yagl_transport_get_out_GLuint(t);
level = yagl_transport_get_out_GLint(t);
YAGL_LOG_FUNC_ENTER_SPLIT5(glFramebufferTexture2D, GLenum, GLenum, GLenum, GLuint, GLint, target, attachment, textarget, texture, level);
- (void)yagl_host_glFramebufferTexture2D(target, attachment, textarget, texture, level);
+ (void)yagl_host_glFramebufferTexture2D(cur_ts, target, attachment, textarget, texture, level);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glFramebufferRenderbuffer(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum target;
GLenum attachment;
GLenum renderbuffertarget;
renderbuffertarget = yagl_transport_get_out_GLenum(t);
renderbuffer = yagl_transport_get_out_GLuint(t);
YAGL_LOG_FUNC_ENTER_SPLIT4(glFramebufferRenderbuffer, GLenum, GLenum, GLenum, GLuint, target, attachment, renderbuffertarget, renderbuffer);
- (void)yagl_host_glFramebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer);
+ (void)yagl_host_glFramebufferRenderbuffer(cur_ts, target, attachment, renderbuffertarget, renderbuffer);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glBlitFramebuffer(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLint srcX0;
GLint srcY0;
GLint srcX1;
mask = yagl_transport_get_out_GLbitfield(t);
filter = yagl_transport_get_out_GLenum(t);
YAGL_LOG_FUNC_ENTER_SPLIT10(glBlitFramebuffer, GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLbitfield, GLenum, srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
- (void)yagl_host_glBlitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
+ (void)yagl_host_glBlitFramebuffer(cur_ts, srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glDrawBuffers(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
const GLenum *bufs;
int32_t bufs_count;
yagl_transport_get_out_array(t, sizeof(GLenum), (const void**)&bufs, &bufs_count);
YAGL_LOG_FUNC_ENTER_SPLIT1(glDrawBuffers, void*, bufs);
- (void)yagl_host_glDrawBuffers(bufs, bufs_count);
+ (void)yagl_host_glDrawBuffers(cur_ts, bufs, bufs_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glReadBuffer(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum mode;
mode = yagl_transport_get_out_GLenum(t);
YAGL_LOG_FUNC_ENTER_SPLIT1(glReadBuffer, GLenum, mode);
- (void)yagl_host_glReadBuffer(mode);
+ (void)yagl_host_glReadBuffer(cur_ts, mode);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glFramebufferTexture3D(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum target;
GLenum attachment;
GLenum textarget;
level = yagl_transport_get_out_GLint(t);
zoffset = yagl_transport_get_out_GLint(t);
YAGL_LOG_FUNC_ENTER_SPLIT6(glFramebufferTexture3D, GLenum, GLenum, GLenum, GLuint, GLint, GLint, target, attachment, textarget, texture, level, zoffset);
- (void)yagl_host_glFramebufferTexture3D(target, attachment, textarget, texture, level, zoffset);
+ (void)yagl_host_glFramebufferTexture3D(cur_ts, target, attachment, textarget, texture, level, zoffset);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glFramebufferTextureLayer(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum target;
GLenum attachment;
GLuint texture;
level = yagl_transport_get_out_GLint(t);
layer = yagl_transport_get_out_GLint(t);
YAGL_LOG_FUNC_ENTER_SPLIT5(glFramebufferTextureLayer, GLenum, GLenum, GLuint, GLint, GLint, target, attachment, texture, level, layer);
- (void)yagl_host_glFramebufferTextureLayer(target, attachment, texture, level, layer);
+ (void)yagl_host_glFramebufferTextureLayer(cur_ts, target, attachment, texture, level, layer);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glClearBufferiv(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum buffer;
GLint drawbuffer;
const GLint *value;
drawbuffer = yagl_transport_get_out_GLint(t);
yagl_transport_get_out_array(t, sizeof(GLint), (const void**)&value, &value_count);
YAGL_LOG_FUNC_ENTER_SPLIT3(glClearBufferiv, GLenum, GLint, void*, buffer, drawbuffer, value);
- (void)yagl_host_glClearBufferiv(buffer, drawbuffer, value, value_count);
+ (void)yagl_host_glClearBufferiv(cur_ts, buffer, drawbuffer, value, value_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glClearBufferuiv(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum buffer;
GLint drawbuffer;
const GLuint *value;
drawbuffer = yagl_transport_get_out_GLint(t);
yagl_transport_get_out_array(t, sizeof(GLuint), (const void**)&value, &value_count);
YAGL_LOG_FUNC_ENTER_SPLIT3(glClearBufferuiv, GLenum, GLint, void*, buffer, drawbuffer, value);
- (void)yagl_host_glClearBufferuiv(buffer, drawbuffer, value, value_count);
+ (void)yagl_host_glClearBufferuiv(cur_ts, buffer, drawbuffer, value, value_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glClearBufferfi(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum buffer;
GLint drawbuffer;
GLfloat depth;
depth = yagl_transport_get_out_GLfloat(t);
stencil = yagl_transport_get_out_GLint(t);
YAGL_LOG_FUNC_ENTER_SPLIT4(glClearBufferfi, GLenum, GLint, GLfloat, GLint, buffer, drawbuffer, depth, stencil);
- (void)yagl_host_glClearBufferfi(buffer, drawbuffer, depth, stencil);
+ (void)yagl_host_glClearBufferfi(cur_ts, buffer, drawbuffer, depth, stencil);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glClearBufferfv(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum buffer;
GLint drawbuffer;
const GLfloat *value;
drawbuffer = yagl_transport_get_out_GLint(t);
yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&value, &value_count);
YAGL_LOG_FUNC_ENTER_SPLIT3(glClearBufferfv, GLenum, GLint, void*, buffer, drawbuffer, value);
- (void)yagl_host_glClearBufferfv(buffer, drawbuffer, value, value_count);
+ (void)yagl_host_glClearBufferfv(cur_ts, buffer, drawbuffer, value, value_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glGenRenderbuffers(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
const GLuint *renderbuffers;
int32_t renderbuffers_count;
yagl_transport_get_out_array(t, sizeof(GLuint), (const void**)&renderbuffers, &renderbuffers_count);
YAGL_LOG_FUNC_ENTER_SPLIT1(glGenRenderbuffers, void*, renderbuffers);
- (void)yagl_host_glGenRenderbuffers(renderbuffers, renderbuffers_count);
+ (void)yagl_host_glGenRenderbuffers(cur_ts, renderbuffers, renderbuffers_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glBindRenderbuffer(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum target;
GLuint renderbuffer;
target = yagl_transport_get_out_GLenum(t);
renderbuffer = yagl_transport_get_out_GLuint(t);
YAGL_LOG_FUNC_ENTER_SPLIT2(glBindRenderbuffer, GLenum, GLuint, target, renderbuffer);
- (void)yagl_host_glBindRenderbuffer(target, renderbuffer);
+ (void)yagl_host_glBindRenderbuffer(cur_ts, target, renderbuffer);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glRenderbufferStorage(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum target;
GLenum internalformat;
GLsizei width;
width = yagl_transport_get_out_GLsizei(t);
height = yagl_transport_get_out_GLsizei(t);
YAGL_LOG_FUNC_ENTER_SPLIT4(glRenderbufferStorage, GLenum, GLenum, GLsizei, GLsizei, target, internalformat, width, height);
- (void)yagl_host_glRenderbufferStorage(target, internalformat, width, height);
+ (void)yagl_host_glRenderbufferStorage(cur_ts, target, internalformat, width, height);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glGetRenderbufferParameteriv(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum target;
GLenum pname;
GLint *param;
pname = yagl_transport_get_out_GLenum(t);
yagl_transport_get_in_arg(t, (void**)¶m);
YAGL_LOG_FUNC_ENTER_SPLIT3(glGetRenderbufferParameteriv, GLenum, GLenum, void*, target, pname, param);
- (void)yagl_host_glGetRenderbufferParameteriv(target, pname, param);
+ (void)yagl_host_glGetRenderbufferParameteriv(cur_ts, target, pname, param);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glRenderbufferStorageMultisample(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum target;
GLsizei samples;
GLenum internalformat;
width = yagl_transport_get_out_GLsizei(t);
height = yagl_transport_get_out_GLsizei(t);
YAGL_LOG_FUNC_ENTER_SPLIT5(glRenderbufferStorageMultisample, GLenum, GLsizei, GLenum, GLsizei, GLsizei, target, samples, internalformat, width, height);
- (void)yagl_host_glRenderbufferStorageMultisample(target, samples, internalformat, width, height);
+ (void)yagl_host_glRenderbufferStorageMultisample(cur_ts, target, samples, internalformat, width, height);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glCreateProgram(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLuint program;
program = yagl_transport_get_out_GLuint(t);
YAGL_LOG_FUNC_ENTER_SPLIT1(glCreateProgram, GLuint, program);
- (void)yagl_host_glCreateProgram(program);
+ (void)yagl_host_glCreateProgram(cur_ts, program);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glCreateShader(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLuint shader;
GLenum type;
shader = yagl_transport_get_out_GLuint(t);
type = yagl_transport_get_out_GLenum(t);
YAGL_LOG_FUNC_ENTER_SPLIT2(glCreateShader, GLuint, GLenum, shader, type);
- (void)yagl_host_glCreateShader(shader, type);
+ (void)yagl_host_glCreateShader(cur_ts, shader, type);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glShaderSource(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLuint shader;
const GLchar *string;
int32_t string_count;
shader = yagl_transport_get_out_GLuint(t);
yagl_transport_get_out_array(t, sizeof(GLchar), (const void**)&string, &string_count);
YAGL_LOG_FUNC_ENTER_SPLIT2(glShaderSource, GLuint, void*, shader, string);
- (void)yagl_host_glShaderSource(shader, string, string_count);
+ (void)yagl_host_glShaderSource(cur_ts, shader, string, string_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glAttachShader(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLuint program;
GLuint shader;
program = yagl_transport_get_out_GLuint(t);
shader = yagl_transport_get_out_GLuint(t);
YAGL_LOG_FUNC_ENTER_SPLIT2(glAttachShader, GLuint, GLuint, program, shader);
- (void)yagl_host_glAttachShader(program, shader);
+ (void)yagl_host_glAttachShader(cur_ts, program, shader);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glDetachShader(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLuint program;
GLuint shader;
program = yagl_transport_get_out_GLuint(t);
shader = yagl_transport_get_out_GLuint(t);
YAGL_LOG_FUNC_ENTER_SPLIT2(glDetachShader, GLuint, GLuint, program, shader);
- (void)yagl_host_glDetachShader(program, shader);
+ (void)yagl_host_glDetachShader(cur_ts, program, shader);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glCompileShader(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLuint shader;
shader = yagl_transport_get_out_GLuint(t);
YAGL_LOG_FUNC_ENTER_SPLIT1(glCompileShader, GLuint, shader);
- (void)yagl_host_glCompileShader(shader);
+ (void)yagl_host_glCompileShader(cur_ts, shader);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glBindAttribLocation(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLuint program;
GLuint index;
const GLchar *name;
index = yagl_transport_get_out_GLuint(t);
yagl_transport_get_out_array(t, sizeof(GLchar), (const void**)&name, &name_count);
YAGL_LOG_FUNC_ENTER_SPLIT3(glBindAttribLocation, GLuint, GLuint, void*, program, index, name);
- (void)yagl_host_glBindAttribLocation(program, index, name, name_count);
+ (void)yagl_host_glBindAttribLocation(cur_ts, program, index, name, name_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glGetActiveAttrib(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLuint program;
GLuint index;
GLint *size;
yagl_transport_get_in_array(t, sizeof(GLchar), (void**)&name, &name_maxcount, &name_count);
YAGL_LOG_FUNC_ENTER_SPLIT5(glGetActiveAttrib, GLuint, GLuint, void*, void*, void*, program, index, size, type, name);
*name_count = 0;
- (void)yagl_host_glGetActiveAttrib(program, index, size, type, name, name_maxcount, name_count);
+ (void)yagl_host_glGetActiveAttrib(cur_ts, program, index, size, type, name, name_maxcount, name_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glGetActiveUniform(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLuint program;
GLuint index;
GLint *size;
yagl_transport_get_in_array(t, sizeof(GLchar), (void**)&name, &name_maxcount, &name_count);
YAGL_LOG_FUNC_ENTER_SPLIT5(glGetActiveUniform, GLuint, GLuint, void*, void*, void*, program, index, size, type, name);
*name_count = 0;
- (void)yagl_host_glGetActiveUniform(program, index, size, type, name, name_maxcount, name_count);
+ (void)yagl_host_glGetActiveUniform(cur_ts, program, index, size, type, name, name_maxcount, name_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glGetAttribLocation(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLuint program;
const GLchar *name;
int32_t name_count;
yagl_transport_get_out_array(t, sizeof(GLchar), (const void**)&name, &name_count);
yagl_transport_get_in_arg(t, (void**)&retval);
YAGL_LOG_FUNC_ENTER_SPLIT2(glGetAttribLocation, GLuint, void*, program, name);
- *retval = yagl_host_glGetAttribLocation(program, name, name_count);
+ *retval = yagl_host_glGetAttribLocation(cur_ts, program, name, name_count);
YAGL_LOG_FUNC_EXIT_SPLIT(int, *retval);
}
*/
static void yagl_func_glGetProgramiv(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLuint program;
GLenum pname;
GLint *param;
pname = yagl_transport_get_out_GLenum(t);
yagl_transport_get_in_arg(t, (void**)¶m);
YAGL_LOG_FUNC_ENTER_SPLIT3(glGetProgramiv, GLuint, GLenum, void*, program, pname, param);
- (void)yagl_host_glGetProgramiv(program, pname, param);
+ (void)yagl_host_glGetProgramiv(cur_ts, program, pname, param);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glGetProgramInfoLog(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLuint program;
GLchar *infolog;
int32_t infolog_maxcount;
yagl_transport_get_in_arg(t, (void**)&retval);
YAGL_LOG_FUNC_ENTER_SPLIT2(glGetProgramInfoLog, GLuint, void*, program, infolog);
*infolog_count = 0;
- *retval = yagl_host_glGetProgramInfoLog(program, infolog, infolog_maxcount, infolog_count);
+ *retval = yagl_host_glGetProgramInfoLog(cur_ts, program, infolog, infolog_maxcount, infolog_count);
YAGL_LOG_FUNC_EXIT_SPLIT(GLboolean, *retval);
}
*/
static void yagl_func_glGetShaderiv(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLuint shader;
GLenum pname;
GLint *param;
pname = yagl_transport_get_out_GLenum(t);
yagl_transport_get_in_arg(t, (void**)¶m);
YAGL_LOG_FUNC_ENTER_SPLIT3(glGetShaderiv, GLuint, GLenum, void*, shader, pname, param);
- (void)yagl_host_glGetShaderiv(shader, pname, param);
+ (void)yagl_host_glGetShaderiv(cur_ts, shader, pname, param);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glGetShaderInfoLog(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLuint shader;
GLchar *infolog;
int32_t infolog_maxcount;
yagl_transport_get_in_arg(t, (void**)&retval);
YAGL_LOG_FUNC_ENTER_SPLIT2(glGetShaderInfoLog, GLuint, void*, shader, infolog);
*infolog_count = 0;
- *retval = yagl_host_glGetShaderInfoLog(shader, infolog, infolog_maxcount, infolog_count);
+ *retval = yagl_host_glGetShaderInfoLog(cur_ts, shader, infolog, infolog_maxcount, infolog_count);
YAGL_LOG_FUNC_EXIT_SPLIT(GLboolean, *retval);
}
*/
static void yagl_func_glGetUniformfv(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLboolean tl;
GLuint program;
uint32_t location;
yagl_transport_get_in_array(t, sizeof(GLfloat), (void**)¶ms, ¶ms_maxcount, ¶ms_count);
YAGL_LOG_FUNC_ENTER_SPLIT4(glGetUniformfv, GLboolean, GLuint, uint32_t, void*, tl, program, location, params);
*params_count = 0;
- (void)yagl_host_glGetUniformfv(tl, program, location, params, params_maxcount, params_count);
+ (void)yagl_host_glGetUniformfv(cur_ts, tl, program, location, params, params_maxcount, params_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glGetUniformiv(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLboolean tl;
GLuint program;
uint32_t location;
yagl_transport_get_in_array(t, sizeof(GLint), (void**)¶ms, ¶ms_maxcount, ¶ms_count);
YAGL_LOG_FUNC_ENTER_SPLIT4(glGetUniformiv, GLboolean, GLuint, uint32_t, void*, tl, program, location, params);
*params_count = 0;
- (void)yagl_host_glGetUniformiv(tl, program, location, params, params_maxcount, params_count);
+ (void)yagl_host_glGetUniformiv(cur_ts, tl, program, location, params, params_maxcount, params_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glGetUniformLocation(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLuint program;
const GLchar *name;
int32_t name_count;
yagl_transport_get_out_array(t, sizeof(GLchar), (const void**)&name, &name_count);
yagl_transport_get_in_arg(t, (void**)&retval);
YAGL_LOG_FUNC_ENTER_SPLIT2(glGetUniformLocation, GLuint, void*, program, name);
- *retval = yagl_host_glGetUniformLocation(program, name, name_count);
+ *retval = yagl_host_glGetUniformLocation(cur_ts, program, name, name_count);
YAGL_LOG_FUNC_EXIT_SPLIT(int, *retval);
}
*/
static void yagl_func_glGetVertexAttribfv(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLuint index;
GLenum pname;
GLfloat *params;
yagl_transport_get_in_array(t, sizeof(GLfloat), (void**)¶ms, ¶ms_maxcount, ¶ms_count);
YAGL_LOG_FUNC_ENTER_SPLIT3(glGetVertexAttribfv, GLuint, GLenum, void*, index, pname, params);
*params_count = 0;
- (void)yagl_host_glGetVertexAttribfv(index, pname, params, params_maxcount, params_count);
+ (void)yagl_host_glGetVertexAttribfv(cur_ts, index, pname, params, params_maxcount, params_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glGetVertexAttribiv(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLuint index;
GLenum pname;
GLint *params;
yagl_transport_get_in_array(t, sizeof(GLint), (void**)¶ms, ¶ms_maxcount, ¶ms_count);
YAGL_LOG_FUNC_ENTER_SPLIT3(glGetVertexAttribiv, GLuint, GLenum, void*, index, pname, params);
*params_count = 0;
- (void)yagl_host_glGetVertexAttribiv(index, pname, params, params_maxcount, params_count);
+ (void)yagl_host_glGetVertexAttribiv(cur_ts, index, pname, params, params_maxcount, params_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glLinkProgram(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLuint program;
GLint *params;
int32_t params_maxcount;
yagl_transport_get_in_array(t, sizeof(GLint), (void**)¶ms, ¶ms_maxcount, ¶ms_count);
YAGL_LOG_FUNC_ENTER_SPLIT2(glLinkProgram, GLuint, void*, program, params);
*params_count = 0;
- (void)yagl_host_glLinkProgram(program, params, params_maxcount, params_count);
+ (void)yagl_host_glLinkProgram(cur_ts, program, params, params_maxcount, params_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glUniform1f(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLboolean tl;
uint32_t location;
GLfloat x;
location = yagl_transport_get_out_uint32_t(t);
x = yagl_transport_get_out_GLfloat(t);
YAGL_LOG_FUNC_ENTER_SPLIT3(glUniform1f, GLboolean, uint32_t, GLfloat, tl, location, x);
- (void)yagl_host_glUniform1f(tl, location, x);
+ (void)yagl_host_glUniform1f(cur_ts, tl, location, x);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glUniform1fv(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLboolean tl;
uint32_t location;
const GLfloat *v;
location = yagl_transport_get_out_uint32_t(t);
yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&v, &v_count);
YAGL_LOG_FUNC_ENTER_SPLIT3(glUniform1fv, GLboolean, uint32_t, void*, tl, location, v);
- (void)yagl_host_glUniform1fv(tl, location, v, v_count);
+ (void)yagl_host_glUniform1fv(cur_ts, tl, location, v, v_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glUniform1i(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLboolean tl;
uint32_t location;
GLint x;
location = yagl_transport_get_out_uint32_t(t);
x = yagl_transport_get_out_GLint(t);
YAGL_LOG_FUNC_ENTER_SPLIT3(glUniform1i, GLboolean, uint32_t, GLint, tl, location, x);
- (void)yagl_host_glUniform1i(tl, location, x);
+ (void)yagl_host_glUniform1i(cur_ts, tl, location, x);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glUniform1iv(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLboolean tl;
uint32_t location;
const GLint *v;
location = yagl_transport_get_out_uint32_t(t);
yagl_transport_get_out_array(t, sizeof(GLint), (const void**)&v, &v_count);
YAGL_LOG_FUNC_ENTER_SPLIT3(glUniform1iv, GLboolean, uint32_t, void*, tl, location, v);
- (void)yagl_host_glUniform1iv(tl, location, v, v_count);
+ (void)yagl_host_glUniform1iv(cur_ts, tl, location, v, v_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glUniform2f(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLboolean tl;
uint32_t location;
GLfloat x;
x = yagl_transport_get_out_GLfloat(t);
y = yagl_transport_get_out_GLfloat(t);
YAGL_LOG_FUNC_ENTER_SPLIT4(glUniform2f, GLboolean, uint32_t, GLfloat, GLfloat, tl, location, x, y);
- (void)yagl_host_glUniform2f(tl, location, x, y);
+ (void)yagl_host_glUniform2f(cur_ts, tl, location, x, y);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glUniform2fv(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLboolean tl;
uint32_t location;
const GLfloat *v;
location = yagl_transport_get_out_uint32_t(t);
yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&v, &v_count);
YAGL_LOG_FUNC_ENTER_SPLIT3(glUniform2fv, GLboolean, uint32_t, void*, tl, location, v);
- (void)yagl_host_glUniform2fv(tl, location, v, v_count);
+ (void)yagl_host_glUniform2fv(cur_ts, tl, location, v, v_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glUniform2i(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLboolean tl;
uint32_t location;
GLint x;
x = yagl_transport_get_out_GLint(t);
y = yagl_transport_get_out_GLint(t);
YAGL_LOG_FUNC_ENTER_SPLIT4(glUniform2i, GLboolean, uint32_t, GLint, GLint, tl, location, x, y);
- (void)yagl_host_glUniform2i(tl, location, x, y);
+ (void)yagl_host_glUniform2i(cur_ts, tl, location, x, y);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glUniform2iv(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLboolean tl;
uint32_t location;
const GLint *v;
location = yagl_transport_get_out_uint32_t(t);
yagl_transport_get_out_array(t, sizeof(GLint), (const void**)&v, &v_count);
YAGL_LOG_FUNC_ENTER_SPLIT3(glUniform2iv, GLboolean, uint32_t, void*, tl, location, v);
- (void)yagl_host_glUniform2iv(tl, location, v, v_count);
+ (void)yagl_host_glUniform2iv(cur_ts, tl, location, v, v_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glUniform3f(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLboolean tl;
uint32_t location;
GLfloat x;
y = yagl_transport_get_out_GLfloat(t);
z = yagl_transport_get_out_GLfloat(t);
YAGL_LOG_FUNC_ENTER_SPLIT5(glUniform3f, GLboolean, uint32_t, GLfloat, GLfloat, GLfloat, tl, location, x, y, z);
- (void)yagl_host_glUniform3f(tl, location, x, y, z);
+ (void)yagl_host_glUniform3f(cur_ts, tl, location, x, y, z);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glUniform3fv(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLboolean tl;
uint32_t location;
const GLfloat *v;
location = yagl_transport_get_out_uint32_t(t);
yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&v, &v_count);
YAGL_LOG_FUNC_ENTER_SPLIT3(glUniform3fv, GLboolean, uint32_t, void*, tl, location, v);
- (void)yagl_host_glUniform3fv(tl, location, v, v_count);
+ (void)yagl_host_glUniform3fv(cur_ts, tl, location, v, v_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glUniform3i(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLboolean tl;
uint32_t location;
GLint x;
y = yagl_transport_get_out_GLint(t);
z = yagl_transport_get_out_GLint(t);
YAGL_LOG_FUNC_ENTER_SPLIT5(glUniform3i, GLboolean, uint32_t, GLint, GLint, GLint, tl, location, x, y, z);
- (void)yagl_host_glUniform3i(tl, location, x, y, z);
+ (void)yagl_host_glUniform3i(cur_ts, tl, location, x, y, z);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glUniform3iv(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLboolean tl;
uint32_t location;
const GLint *v;
location = yagl_transport_get_out_uint32_t(t);
yagl_transport_get_out_array(t, sizeof(GLint), (const void**)&v, &v_count);
YAGL_LOG_FUNC_ENTER_SPLIT3(glUniform3iv, GLboolean, uint32_t, void*, tl, location, v);
- (void)yagl_host_glUniform3iv(tl, location, v, v_count);
+ (void)yagl_host_glUniform3iv(cur_ts, tl, location, v, v_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glUniform4f(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLboolean tl;
uint32_t location;
GLfloat x;
z = yagl_transport_get_out_GLfloat(t);
w = yagl_transport_get_out_GLfloat(t);
YAGL_LOG_FUNC_ENTER_SPLIT6(glUniform4f, GLboolean, uint32_t, GLfloat, GLfloat, GLfloat, GLfloat, tl, location, x, y, z, w);
- (void)yagl_host_glUniform4f(tl, location, x, y, z, w);
+ (void)yagl_host_glUniform4f(cur_ts, tl, location, x, y, z, w);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glUniform4fv(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLboolean tl;
uint32_t location;
const GLfloat *v;
location = yagl_transport_get_out_uint32_t(t);
yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&v, &v_count);
YAGL_LOG_FUNC_ENTER_SPLIT3(glUniform4fv, GLboolean, uint32_t, void*, tl, location, v);
- (void)yagl_host_glUniform4fv(tl, location, v, v_count);
+ (void)yagl_host_glUniform4fv(cur_ts, tl, location, v, v_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glUniform4i(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLboolean tl;
uint32_t location;
GLint x;
z = yagl_transport_get_out_GLint(t);
w = yagl_transport_get_out_GLint(t);
YAGL_LOG_FUNC_ENTER_SPLIT6(glUniform4i, GLboolean, uint32_t, GLint, GLint, GLint, GLint, tl, location, x, y, z, w);
- (void)yagl_host_glUniform4i(tl, location, x, y, z, w);
+ (void)yagl_host_glUniform4i(cur_ts, tl, location, x, y, z, w);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glUniform4iv(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLboolean tl;
uint32_t location;
const GLint *v;
location = yagl_transport_get_out_uint32_t(t);
yagl_transport_get_out_array(t, sizeof(GLint), (const void**)&v, &v_count);
YAGL_LOG_FUNC_ENTER_SPLIT3(glUniform4iv, GLboolean, uint32_t, void*, tl, location, v);
- (void)yagl_host_glUniform4iv(tl, location, v, v_count);
+ (void)yagl_host_glUniform4iv(cur_ts, tl, location, v, v_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glUniformMatrix2fv(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLboolean tl;
uint32_t location;
GLboolean transpose;
transpose = yagl_transport_get_out_GLboolean(t);
yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&value, &value_count);
YAGL_LOG_FUNC_ENTER_SPLIT4(glUniformMatrix2fv, GLboolean, uint32_t, GLboolean, void*, tl, location, transpose, value);
- (void)yagl_host_glUniformMatrix2fv(tl, location, transpose, value, value_count);
+ (void)yagl_host_glUniformMatrix2fv(cur_ts, tl, location, transpose, value, value_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glUniformMatrix3fv(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLboolean tl;
uint32_t location;
GLboolean transpose;
transpose = yagl_transport_get_out_GLboolean(t);
yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&value, &value_count);
YAGL_LOG_FUNC_ENTER_SPLIT4(glUniformMatrix3fv, GLboolean, uint32_t, GLboolean, void*, tl, location, transpose, value);
- (void)yagl_host_glUniformMatrix3fv(tl, location, transpose, value, value_count);
+ (void)yagl_host_glUniformMatrix3fv(cur_ts, tl, location, transpose, value, value_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glUniformMatrix4fv(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLboolean tl;
uint32_t location;
GLboolean transpose;
transpose = yagl_transport_get_out_GLboolean(t);
yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&value, &value_count);
YAGL_LOG_FUNC_ENTER_SPLIT4(glUniformMatrix4fv, GLboolean, uint32_t, GLboolean, void*, tl, location, transpose, value);
- (void)yagl_host_glUniformMatrix4fv(tl, location, transpose, value, value_count);
+ (void)yagl_host_glUniformMatrix4fv(cur_ts, tl, location, transpose, value, value_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glUseProgram(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLuint program;
program = yagl_transport_get_out_GLuint(t);
YAGL_LOG_FUNC_ENTER_SPLIT1(glUseProgram, GLuint, program);
- (void)yagl_host_glUseProgram(program);
+ (void)yagl_host_glUseProgram(cur_ts, program);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glValidateProgram(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLuint program;
program = yagl_transport_get_out_GLuint(t);
YAGL_LOG_FUNC_ENTER_SPLIT1(glValidateProgram, GLuint, program);
- (void)yagl_host_glValidateProgram(program);
+ (void)yagl_host_glValidateProgram(cur_ts, program);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glVertexAttrib1f(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLuint indx;
GLfloat x;
indx = yagl_transport_get_out_GLuint(t);
x = yagl_transport_get_out_GLfloat(t);
YAGL_LOG_FUNC_ENTER_SPLIT2(glVertexAttrib1f, GLuint, GLfloat, indx, x);
- (void)yagl_host_glVertexAttrib1f(indx, x);
+ (void)yagl_host_glVertexAttrib1f(cur_ts, indx, x);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glVertexAttrib1fv(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLuint indx;
const GLfloat *values;
int32_t values_count;
indx = yagl_transport_get_out_GLuint(t);
yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&values, &values_count);
YAGL_LOG_FUNC_ENTER_SPLIT2(glVertexAttrib1fv, GLuint, void*, indx, values);
- (void)yagl_host_glVertexAttrib1fv(indx, values, values_count);
+ (void)yagl_host_glVertexAttrib1fv(cur_ts, indx, values, values_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glVertexAttrib2f(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLuint indx;
GLfloat x;
GLfloat y;
x = yagl_transport_get_out_GLfloat(t);
y = yagl_transport_get_out_GLfloat(t);
YAGL_LOG_FUNC_ENTER_SPLIT3(glVertexAttrib2f, GLuint, GLfloat, GLfloat, indx, x, y);
- (void)yagl_host_glVertexAttrib2f(indx, x, y);
+ (void)yagl_host_glVertexAttrib2f(cur_ts, indx, x, y);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glVertexAttrib2fv(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLuint indx;
const GLfloat *values;
int32_t values_count;
indx = yagl_transport_get_out_GLuint(t);
yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&values, &values_count);
YAGL_LOG_FUNC_ENTER_SPLIT2(glVertexAttrib2fv, GLuint, void*, indx, values);
- (void)yagl_host_glVertexAttrib2fv(indx, values, values_count);
+ (void)yagl_host_glVertexAttrib2fv(cur_ts, indx, values, values_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glVertexAttrib3f(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLuint indx;
GLfloat x;
GLfloat y;
y = yagl_transport_get_out_GLfloat(t);
z = yagl_transport_get_out_GLfloat(t);
YAGL_LOG_FUNC_ENTER_SPLIT4(glVertexAttrib3f, GLuint, GLfloat, GLfloat, GLfloat, indx, x, y, z);
- (void)yagl_host_glVertexAttrib3f(indx, x, y, z);
+ (void)yagl_host_glVertexAttrib3f(cur_ts, indx, x, y, z);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glVertexAttrib3fv(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLuint indx;
const GLfloat *values;
int32_t values_count;
indx = yagl_transport_get_out_GLuint(t);
yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&values, &values_count);
YAGL_LOG_FUNC_ENTER_SPLIT2(glVertexAttrib3fv, GLuint, void*, indx, values);
- (void)yagl_host_glVertexAttrib3fv(indx, values, values_count);
+ (void)yagl_host_glVertexAttrib3fv(cur_ts, indx, values, values_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glVertexAttrib4f(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLuint indx;
GLfloat x;
GLfloat y;
z = yagl_transport_get_out_GLfloat(t);
w = yagl_transport_get_out_GLfloat(t);
YAGL_LOG_FUNC_ENTER_SPLIT5(glVertexAttrib4f, GLuint, GLfloat, GLfloat, GLfloat, GLfloat, indx, x, y, z, w);
- (void)yagl_host_glVertexAttrib4f(indx, x, y, z, w);
+ (void)yagl_host_glVertexAttrib4f(cur_ts, indx, x, y, z, w);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glVertexAttrib4fv(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLuint indx;
const GLfloat *values;
int32_t values_count;
indx = yagl_transport_get_out_GLuint(t);
yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&values, &values_count);
YAGL_LOG_FUNC_ENTER_SPLIT2(glVertexAttrib4fv, GLuint, void*, indx, values);
- (void)yagl_host_glVertexAttrib4fv(indx, values, values_count);
+ (void)yagl_host_glVertexAttrib4fv(cur_ts, indx, values, values_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glGetActiveUniformsiv(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLuint program;
const GLuint *uniformIndices;
int32_t uniformIndices_count;
yagl_transport_get_in_array(t, sizeof(GLint), (void**)¶ms, ¶ms_maxcount, ¶ms_count);
YAGL_LOG_FUNC_ENTER_SPLIT3(glGetActiveUniformsiv, GLuint, void*, void*, program, uniformIndices, params);
*params_count = 0;
- (void)yagl_host_glGetActiveUniformsiv(program, uniformIndices, uniformIndices_count, params, params_maxcount, params_count);
+ (void)yagl_host_glGetActiveUniformsiv(cur_ts, program, uniformIndices, uniformIndices_count, params, params_maxcount, params_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glGetUniformIndices(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLuint program;
const GLchar *uniformNames;
int32_t uniformNames_count;
yagl_transport_get_in_array(t, sizeof(GLuint), (void**)&uniformIndices, &uniformIndices_maxcount, &uniformIndices_count);
YAGL_LOG_FUNC_ENTER_SPLIT3(glGetUniformIndices, GLuint, void*, void*, program, uniformNames, uniformIndices);
*uniformIndices_count = 0;
- (void)yagl_host_glGetUniformIndices(program, uniformNames, uniformNames_count, uniformIndices, uniformIndices_maxcount, uniformIndices_count);
+ (void)yagl_host_glGetUniformIndices(cur_ts, program, uniformNames, uniformNames_count, uniformIndices, uniformIndices_maxcount, uniformIndices_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glGetUniformBlockIndex(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLuint program;
const GLchar *uniformBlockName;
int32_t uniformBlockName_count;
yagl_transport_get_out_array(t, sizeof(GLchar), (const void**)&uniformBlockName, &uniformBlockName_count);
yagl_transport_get_in_arg(t, (void**)&retval);
YAGL_LOG_FUNC_ENTER_SPLIT2(glGetUniformBlockIndex, GLuint, void*, program, uniformBlockName);
- *retval = yagl_host_glGetUniformBlockIndex(program, uniformBlockName, uniformBlockName_count);
+ *retval = yagl_host_glGetUniformBlockIndex(cur_ts, program, uniformBlockName, uniformBlockName_count);
YAGL_LOG_FUNC_EXIT_SPLIT(GLuint, *retval);
}
*/
static void yagl_func_glUniformBlockBinding(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLuint program;
GLuint uniformBlockIndex;
GLuint uniformBlockBinding;
uniformBlockIndex = yagl_transport_get_out_GLuint(t);
uniformBlockBinding = yagl_transport_get_out_GLuint(t);
YAGL_LOG_FUNC_ENTER_SPLIT3(glUniformBlockBinding, GLuint, GLuint, GLuint, program, uniformBlockIndex, uniformBlockBinding);
- (void)yagl_host_glUniformBlockBinding(program, uniformBlockIndex, uniformBlockBinding);
+ (void)yagl_host_glUniformBlockBinding(cur_ts, program, uniformBlockIndex, uniformBlockBinding);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glGetActiveUniformBlockName(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLuint program;
GLuint uniformBlockIndex;
GLchar *uniformBlockName;
yagl_transport_get_in_array(t, sizeof(GLchar), (void**)&uniformBlockName, &uniformBlockName_maxcount, &uniformBlockName_count);
YAGL_LOG_FUNC_ENTER_SPLIT3(glGetActiveUniformBlockName, GLuint, GLuint, void*, program, uniformBlockIndex, uniformBlockName);
*uniformBlockName_count = 0;
- (void)yagl_host_glGetActiveUniformBlockName(program, uniformBlockIndex, uniformBlockName, uniformBlockName_maxcount, uniformBlockName_count);
+ (void)yagl_host_glGetActiveUniformBlockName(cur_ts, program, uniformBlockIndex, uniformBlockName, uniformBlockName_maxcount, uniformBlockName_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glGetActiveUniformBlockiv(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLuint program;
GLuint uniformBlockIndex;
GLenum pname;
yagl_transport_get_in_array(t, sizeof(GLint), (void**)¶ms, ¶ms_maxcount, ¶ms_count);
YAGL_LOG_FUNC_ENTER_SPLIT4(glGetActiveUniformBlockiv, GLuint, GLuint, GLenum, void*, program, uniformBlockIndex, pname, params);
*params_count = 0;
- (void)yagl_host_glGetActiveUniformBlockiv(program, uniformBlockIndex, pname, params, params_maxcount, params_count);
+ (void)yagl_host_glGetActiveUniformBlockiv(cur_ts, program, uniformBlockIndex, pname, params, params_maxcount, params_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glGetVertexAttribIiv(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLuint index;
GLenum pname;
GLint *params;
yagl_transport_get_in_array(t, sizeof(GLint), (void**)¶ms, ¶ms_maxcount, ¶ms_count);
YAGL_LOG_FUNC_ENTER_SPLIT3(glGetVertexAttribIiv, GLuint, GLenum, void*, index, pname, params);
*params_count = 0;
- (void)yagl_host_glGetVertexAttribIiv(index, pname, params, params_maxcount, params_count);
+ (void)yagl_host_glGetVertexAttribIiv(cur_ts, index, pname, params, params_maxcount, params_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glGetVertexAttribIuiv(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLuint index;
GLenum pname;
GLuint *params;
yagl_transport_get_in_array(t, sizeof(GLuint), (void**)¶ms, ¶ms_maxcount, ¶ms_count);
YAGL_LOG_FUNC_ENTER_SPLIT3(glGetVertexAttribIuiv, GLuint, GLenum, void*, index, pname, params);
*params_count = 0;
- (void)yagl_host_glGetVertexAttribIuiv(index, pname, params, params_maxcount, params_count);
+ (void)yagl_host_glGetVertexAttribIuiv(cur_ts, index, pname, params, params_maxcount, params_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glVertexAttribI4i(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLuint index;
GLint x;
GLint y;
z = yagl_transport_get_out_GLint(t);
w = yagl_transport_get_out_GLint(t);
YAGL_LOG_FUNC_ENTER_SPLIT5(glVertexAttribI4i, GLuint, GLint, GLint, GLint, GLint, index, x, y, z, w);
- (void)yagl_host_glVertexAttribI4i(index, x, y, z, w);
+ (void)yagl_host_glVertexAttribI4i(cur_ts, index, x, y, z, w);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glVertexAttribI4ui(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLuint index;
GLuint x;
GLuint y;
z = yagl_transport_get_out_GLuint(t);
w = yagl_transport_get_out_GLuint(t);
YAGL_LOG_FUNC_ENTER_SPLIT5(glVertexAttribI4ui, GLuint, GLuint, GLuint, GLuint, GLuint, index, x, y, z, w);
- (void)yagl_host_glVertexAttribI4ui(index, x, y, z, w);
+ (void)yagl_host_glVertexAttribI4ui(cur_ts, index, x, y, z, w);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glVertexAttribI4iv(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLuint index;
const GLint *v;
int32_t v_count;
index = yagl_transport_get_out_GLuint(t);
yagl_transport_get_out_array(t, sizeof(GLint), (const void**)&v, &v_count);
YAGL_LOG_FUNC_ENTER_SPLIT2(glVertexAttribI4iv, GLuint, void*, index, v);
- (void)yagl_host_glVertexAttribI4iv(index, v, v_count);
+ (void)yagl_host_glVertexAttribI4iv(cur_ts, index, v, v_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glVertexAttribI4uiv(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLuint index;
const GLuint *v;
int32_t v_count;
index = yagl_transport_get_out_GLuint(t);
yagl_transport_get_out_array(t, sizeof(GLuint), (const void**)&v, &v_count);
YAGL_LOG_FUNC_ENTER_SPLIT2(glVertexAttribI4uiv, GLuint, void*, index, v);
- (void)yagl_host_glVertexAttribI4uiv(index, v, v_count);
+ (void)yagl_host_glVertexAttribI4uiv(cur_ts, index, v, v_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glGetUniformuiv(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLboolean tl;
GLuint program;
uint32_t location;
yagl_transport_get_in_array(t, sizeof(GLuint), (void**)¶ms, ¶ms_maxcount, ¶ms_count);
YAGL_LOG_FUNC_ENTER_SPLIT4(glGetUniformuiv, GLboolean, GLuint, uint32_t, void*, tl, program, location, params);
*params_count = 0;
- (void)yagl_host_glGetUniformuiv(tl, program, location, params, params_maxcount, params_count);
+ (void)yagl_host_glGetUniformuiv(cur_ts, tl, program, location, params, params_maxcount, params_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glUniform1ui(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLboolean tl;
uint32_t location;
GLuint v0;
location = yagl_transport_get_out_uint32_t(t);
v0 = yagl_transport_get_out_GLuint(t);
YAGL_LOG_FUNC_ENTER_SPLIT3(glUniform1ui, GLboolean, uint32_t, GLuint, tl, location, v0);
- (void)yagl_host_glUniform1ui(tl, location, v0);
+ (void)yagl_host_glUniform1ui(cur_ts, tl, location, v0);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glUniform2ui(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLboolean tl;
uint32_t location;
GLuint v0;
v0 = yagl_transport_get_out_GLuint(t);
v1 = yagl_transport_get_out_GLuint(t);
YAGL_LOG_FUNC_ENTER_SPLIT4(glUniform2ui, GLboolean, uint32_t, GLuint, GLuint, tl, location, v0, v1);
- (void)yagl_host_glUniform2ui(tl, location, v0, v1);
+ (void)yagl_host_glUniform2ui(cur_ts, tl, location, v0, v1);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glUniform3ui(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLboolean tl;
uint32_t location;
GLuint v0;
v1 = yagl_transport_get_out_GLuint(t);
v2 = yagl_transport_get_out_GLuint(t);
YAGL_LOG_FUNC_ENTER_SPLIT5(glUniform3ui, GLboolean, uint32_t, GLuint, GLuint, GLuint, tl, location, v0, v1, v2);
- (void)yagl_host_glUniform3ui(tl, location, v0, v1, v2);
+ (void)yagl_host_glUniform3ui(cur_ts, tl, location, v0, v1, v2);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glUniform4ui(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLboolean tl;
uint32_t location;
GLuint v0;
v2 = yagl_transport_get_out_GLuint(t);
v3 = yagl_transport_get_out_GLuint(t);
YAGL_LOG_FUNC_ENTER_SPLIT6(glUniform4ui, GLboolean, uint32_t, GLuint, GLuint, GLuint, GLuint, tl, location, v0, v1, v2, v3);
- (void)yagl_host_glUniform4ui(tl, location, v0, v1, v2, v3);
+ (void)yagl_host_glUniform4ui(cur_ts, tl, location, v0, v1, v2, v3);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glUniform1uiv(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLboolean tl;
uint32_t location;
const GLuint *v;
location = yagl_transport_get_out_uint32_t(t);
yagl_transport_get_out_array(t, sizeof(GLuint), (const void**)&v, &v_count);
YAGL_LOG_FUNC_ENTER_SPLIT3(glUniform1uiv, GLboolean, uint32_t, void*, tl, location, v);
- (void)yagl_host_glUniform1uiv(tl, location, v, v_count);
+ (void)yagl_host_glUniform1uiv(cur_ts, tl, location, v, v_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glUniform2uiv(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLboolean tl;
uint32_t location;
const GLuint *v;
location = yagl_transport_get_out_uint32_t(t);
yagl_transport_get_out_array(t, sizeof(GLuint), (const void**)&v, &v_count);
YAGL_LOG_FUNC_ENTER_SPLIT3(glUniform2uiv, GLboolean, uint32_t, void*, tl, location, v);
- (void)yagl_host_glUniform2uiv(tl, location, v, v_count);
+ (void)yagl_host_glUniform2uiv(cur_ts, tl, location, v, v_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glUniform3uiv(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLboolean tl;
uint32_t location;
const GLuint *v;
location = yagl_transport_get_out_uint32_t(t);
yagl_transport_get_out_array(t, sizeof(GLuint), (const void**)&v, &v_count);
YAGL_LOG_FUNC_ENTER_SPLIT3(glUniform3uiv, GLboolean, uint32_t, void*, tl, location, v);
- (void)yagl_host_glUniform3uiv(tl, location, v, v_count);
+ (void)yagl_host_glUniform3uiv(cur_ts, tl, location, v, v_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glUniform4uiv(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLboolean tl;
uint32_t location;
const GLuint *v;
location = yagl_transport_get_out_uint32_t(t);
yagl_transport_get_out_array(t, sizeof(GLuint), (const void**)&v, &v_count);
YAGL_LOG_FUNC_ENTER_SPLIT3(glUniform4uiv, GLboolean, uint32_t, void*, tl, location, v);
- (void)yagl_host_glUniform4uiv(tl, location, v, v_count);
+ (void)yagl_host_glUniform4uiv(cur_ts, tl, location, v, v_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glUniformMatrix2x3fv(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLboolean tl;
uint32_t location;
GLboolean transpose;
transpose = yagl_transport_get_out_GLboolean(t);
yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&value, &value_count);
YAGL_LOG_FUNC_ENTER_SPLIT4(glUniformMatrix2x3fv, GLboolean, uint32_t, GLboolean, void*, tl, location, transpose, value);
- (void)yagl_host_glUniformMatrix2x3fv(tl, location, transpose, value, value_count);
+ (void)yagl_host_glUniformMatrix2x3fv(cur_ts, tl, location, transpose, value, value_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glUniformMatrix2x4fv(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLboolean tl;
uint32_t location;
GLboolean transpose;
transpose = yagl_transport_get_out_GLboolean(t);
yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&value, &value_count);
YAGL_LOG_FUNC_ENTER_SPLIT4(glUniformMatrix2x4fv, GLboolean, uint32_t, GLboolean, void*, tl, location, transpose, value);
- (void)yagl_host_glUniformMatrix2x4fv(tl, location, transpose, value, value_count);
+ (void)yagl_host_glUniformMatrix2x4fv(cur_ts, tl, location, transpose, value, value_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glUniformMatrix3x2fv(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLboolean tl;
uint32_t location;
GLboolean transpose;
transpose = yagl_transport_get_out_GLboolean(t);
yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&value, &value_count);
YAGL_LOG_FUNC_ENTER_SPLIT4(glUniformMatrix3x2fv, GLboolean, uint32_t, GLboolean, void*, tl, location, transpose, value);
- (void)yagl_host_glUniformMatrix3x2fv(tl, location, transpose, value, value_count);
+ (void)yagl_host_glUniformMatrix3x2fv(cur_ts, tl, location, transpose, value, value_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glUniformMatrix3x4fv(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLboolean tl;
uint32_t location;
GLboolean transpose;
transpose = yagl_transport_get_out_GLboolean(t);
yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&value, &value_count);
YAGL_LOG_FUNC_ENTER_SPLIT4(glUniformMatrix3x4fv, GLboolean, uint32_t, GLboolean, void*, tl, location, transpose, value);
- (void)yagl_host_glUniformMatrix3x4fv(tl, location, transpose, value, value_count);
+ (void)yagl_host_glUniformMatrix3x4fv(cur_ts, tl, location, transpose, value, value_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glUniformMatrix4x2fv(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLboolean tl;
uint32_t location;
GLboolean transpose;
transpose = yagl_transport_get_out_GLboolean(t);
yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&value, &value_count);
YAGL_LOG_FUNC_ENTER_SPLIT4(glUniformMatrix4x2fv, GLboolean, uint32_t, GLboolean, void*, tl, location, transpose, value);
- (void)yagl_host_glUniformMatrix4x2fv(tl, location, transpose, value, value_count);
+ (void)yagl_host_glUniformMatrix4x2fv(cur_ts, tl, location, transpose, value, value_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glUniformMatrix4x3fv(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLboolean tl;
uint32_t location;
GLboolean transpose;
transpose = yagl_transport_get_out_GLboolean(t);
yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&value, &value_count);
YAGL_LOG_FUNC_ENTER_SPLIT4(glUniformMatrix4x3fv, GLboolean, uint32_t, GLboolean, void*, tl, location, transpose, value);
- (void)yagl_host_glUniformMatrix4x3fv(tl, location, transpose, value, value_count);
+ (void)yagl_host_glUniformMatrix4x3fv(cur_ts, tl, location, transpose, value, value_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glGetFragDataLocation(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLuint program;
const GLchar *name;
int32_t name_count;
yagl_transport_get_out_array(t, sizeof(GLchar), (const void**)&name, &name_count);
yagl_transport_get_in_arg(t, (void**)&retval);
YAGL_LOG_FUNC_ENTER_SPLIT2(glGetFragDataLocation, GLuint, void*, program, name);
- *retval = yagl_host_glGetFragDataLocation(program, name, name_count);
+ *retval = yagl_host_glGetFragDataLocation(cur_ts, program, name, name_count);
YAGL_LOG_FUNC_EXIT_SPLIT(int, *retval);
}
*/
static void yagl_func_glGetIntegerv(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum pname;
GLint *params;
int32_t params_maxcount;
yagl_transport_get_in_array(t, sizeof(GLint), (void**)¶ms, ¶ms_maxcount, ¶ms_count);
YAGL_LOG_FUNC_ENTER_SPLIT2(glGetIntegerv, GLenum, void*, pname, params);
*params_count = 0;
- (void)yagl_host_glGetIntegerv(pname, params, params_maxcount, params_count);
+ (void)yagl_host_glGetIntegerv(cur_ts, pname, params, params_maxcount, params_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glGetFloatv(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum pname;
GLfloat *params;
int32_t params_maxcount;
yagl_transport_get_in_array(t, sizeof(GLfloat), (void**)¶ms, ¶ms_maxcount, ¶ms_count);
YAGL_LOG_FUNC_ENTER_SPLIT2(glGetFloatv, GLenum, void*, pname, params);
*params_count = 0;
- (void)yagl_host_glGetFloatv(pname, params, params_maxcount, params_count);
+ (void)yagl_host_glGetFloatv(cur_ts, pname, params, params_maxcount, params_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glGetString(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum name;
GLchar *str;
int32_t str_maxcount;
yagl_transport_get_in_array(t, sizeof(GLchar), (void**)&str, &str_maxcount, &str_count);
YAGL_LOG_FUNC_ENTER_SPLIT2(glGetString, GLenum, void*, name, str);
*str_count = 0;
- (void)yagl_host_glGetString(name, str, str_maxcount, str_count);
+ (void)yagl_host_glGetString(cur_ts, name, str, str_maxcount, str_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glIsEnabled(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum cap;
GLboolean *retval;
cap = yagl_transport_get_out_GLenum(t);
yagl_transport_get_in_arg(t, (void**)&retval);
YAGL_LOG_FUNC_ENTER_SPLIT1(glIsEnabled, GLenum, cap);
- *retval = yagl_host_glIsEnabled(cap);
+ *retval = yagl_host_glIsEnabled(cur_ts, cap);
YAGL_LOG_FUNC_EXIT_SPLIT(GLboolean, *retval);
}
*/
static void yagl_func_glGenTransformFeedbacks(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
const GLuint *ids;
int32_t ids_count;
yagl_transport_get_out_array(t, sizeof(GLuint), (const void**)&ids, &ids_count);
YAGL_LOG_FUNC_ENTER_SPLIT1(glGenTransformFeedbacks, void*, ids);
- (void)yagl_host_glGenTransformFeedbacks(ids, ids_count);
+ (void)yagl_host_glGenTransformFeedbacks(cur_ts, ids, ids_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glBindTransformFeedback(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum target;
GLuint id;
target = yagl_transport_get_out_GLenum(t);
id = yagl_transport_get_out_GLuint(t);
YAGL_LOG_FUNC_ENTER_SPLIT2(glBindTransformFeedback, GLenum, GLuint, target, id);
- (void)yagl_host_glBindTransformFeedback(target, id);
+ (void)yagl_host_glBindTransformFeedback(cur_ts, target, id);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glBeginTransformFeedback(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum primitiveMode;
primitiveMode = yagl_transport_get_out_GLenum(t);
YAGL_LOG_FUNC_ENTER_SPLIT1(glBeginTransformFeedback, GLenum, primitiveMode);
- (void)yagl_host_glBeginTransformFeedback(primitiveMode);
+ (void)yagl_host_glBeginTransformFeedback(cur_ts, primitiveMode);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glEndTransformFeedback(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
YAGL_LOG_FUNC_ENTER_SPLIT0(glEndTransformFeedback);
- (void)yagl_host_glEndTransformFeedback();
+ (void)yagl_host_glEndTransformFeedback(cur_ts);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glPauseTransformFeedback(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
YAGL_LOG_FUNC_ENTER_SPLIT0(glPauseTransformFeedback);
- (void)yagl_host_glPauseTransformFeedback();
+ (void)yagl_host_glPauseTransformFeedback(cur_ts);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glResumeTransformFeedback(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
YAGL_LOG_FUNC_ENTER_SPLIT0(glResumeTransformFeedback);
- (void)yagl_host_glResumeTransformFeedback();
+ (void)yagl_host_glResumeTransformFeedback(cur_ts);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glTransformFeedbackVaryings(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLuint program;
const GLchar *varyings;
int32_t varyings_count;
yagl_transport_get_out_array(t, sizeof(GLchar), (const void**)&varyings, &varyings_count);
bufferMode = yagl_transport_get_out_GLenum(t);
YAGL_LOG_FUNC_ENTER_SPLIT3(glTransformFeedbackVaryings, GLuint, void*, GLenum, program, varyings, bufferMode);
- (void)yagl_host_glTransformFeedbackVaryings(program, varyings, varyings_count, bufferMode);
+ (void)yagl_host_glTransformFeedbackVaryings(cur_ts, t, program, varyings, varyings_count, bufferMode);
YAGL_LOG_FUNC_EXIT(NULL);
}
+
/*
* glGetTransformFeedbackVaryings dispatcher. id = 169
*/
static void yagl_func_glGetTransformFeedbackVaryings(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLuint program;
GLsizei *sizes;
int32_t sizes_maxcount;
YAGL_LOG_FUNC_ENTER_SPLIT3(glGetTransformFeedbackVaryings, GLuint, void*, void*, program, sizes, types);
*sizes_count = 0;
*types_count = 0;
- (void)yagl_host_glGetTransformFeedbackVaryings(program, sizes, sizes_maxcount, sizes_count, types, types_maxcount, types_count);
+ (void)yagl_host_glGetTransformFeedbackVaryings(cur_ts, program, sizes, sizes_maxcount, sizes_count, types, types_maxcount, types_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glGenQueries(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
const GLuint *ids;
int32_t ids_count;
yagl_transport_get_out_array(t, sizeof(GLuint), (const void**)&ids, &ids_count);
YAGL_LOG_FUNC_ENTER_SPLIT1(glGenQueries, void*, ids);
- (void)yagl_host_glGenQueries(ids, ids_count);
+ (void)yagl_host_glGenQueries(cur_ts, ids, ids_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glBeginQuery(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum target;
GLuint id;
target = yagl_transport_get_out_GLenum(t);
id = yagl_transport_get_out_GLuint(t);
YAGL_LOG_FUNC_ENTER_SPLIT2(glBeginQuery, GLenum, GLuint, target, id);
- (void)yagl_host_glBeginQuery(target, id);
+ (void)yagl_host_glBeginQuery(cur_ts, target, id);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glEndQuery(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum target;
target = yagl_transport_get_out_GLenum(t);
YAGL_LOG_FUNC_ENTER_SPLIT1(glEndQuery, GLenum, target);
- (void)yagl_host_glEndQuery(target);
+ (void)yagl_host_glEndQuery(cur_ts, target);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glGetQueryObjectuiv(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLuint id;
GLenum pname;
GLuint *result;
yagl_transport_get_in_arg(t, (void**)&result);
yagl_transport_get_in_arg(t, (void**)&retval);
YAGL_LOG_FUNC_ENTER_SPLIT3(glGetQueryObjectuiv, GLuint, GLenum, void*, id, pname, result);
- *retval = yagl_host_glGetQueryObjectuiv(id, pname, result);
+ *retval = yagl_host_glGetQueryObjectuiv(cur_ts, id, pname, result);
YAGL_LOG_FUNC_EXIT_SPLIT(GLboolean, *retval);
}
*/
static void yagl_func_glGenSamplers(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
const GLuint *samplers;
int32_t samplers_count;
yagl_transport_get_out_array(t, sizeof(GLuint), (const void**)&samplers, &samplers_count);
YAGL_LOG_FUNC_ENTER_SPLIT1(glGenSamplers, void*, samplers);
- (void)yagl_host_glGenSamplers(samplers, samplers_count);
+ (void)yagl_host_glGenSamplers(cur_ts, samplers, samplers_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glBindSampler(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLuint unit;
GLuint sampler;
unit = yagl_transport_get_out_GLuint(t);
sampler = yagl_transport_get_out_GLuint(t);
YAGL_LOG_FUNC_ENTER_SPLIT2(glBindSampler, GLuint, GLuint, unit, sampler);
- (void)yagl_host_glBindSampler(unit, sampler);
+ (void)yagl_host_glBindSampler(cur_ts, unit, sampler);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glSamplerParameteri(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLuint sampler;
GLenum pname;
GLint param;
pname = yagl_transport_get_out_GLenum(t);
param = yagl_transport_get_out_GLint(t);
YAGL_LOG_FUNC_ENTER_SPLIT3(glSamplerParameteri, GLuint, GLenum, GLint, sampler, pname, param);
- (void)yagl_host_glSamplerParameteri(sampler, pname, param);
+ (void)yagl_host_glSamplerParameteri(cur_ts, sampler, pname, param);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glSamplerParameteriv(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLuint sampler;
GLenum pname;
const GLint *param;
pname = yagl_transport_get_out_GLenum(t);
yagl_transport_get_out_array(t, sizeof(GLint), (const void**)¶m, ¶m_count);
YAGL_LOG_FUNC_ENTER_SPLIT3(glSamplerParameteriv, GLuint, GLenum, void*, sampler, pname, param);
- (void)yagl_host_glSamplerParameteriv(sampler, pname, param, param_count);
+ (void)yagl_host_glSamplerParameteriv(cur_ts, sampler, pname, param, param_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glSamplerParameterf(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLuint sampler;
GLenum pname;
GLfloat param;
pname = yagl_transport_get_out_GLenum(t);
param = yagl_transport_get_out_GLfloat(t);
YAGL_LOG_FUNC_ENTER_SPLIT3(glSamplerParameterf, GLuint, GLenum, GLfloat, sampler, pname, param);
- (void)yagl_host_glSamplerParameterf(sampler, pname, param);
+ (void)yagl_host_glSamplerParameterf(cur_ts, sampler, pname, param);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glSamplerParameterfv(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLuint sampler;
GLenum pname;
const GLfloat *param;
pname = yagl_transport_get_out_GLenum(t);
yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)¶m, ¶m_count);
YAGL_LOG_FUNC_ENTER_SPLIT3(glSamplerParameterfv, GLuint, GLenum, void*, sampler, pname, param);
- (void)yagl_host_glSamplerParameterfv(sampler, pname, param, param_count);
+ (void)yagl_host_glSamplerParameterfv(cur_ts, sampler, pname, param, param_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glDeleteObjects(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
const GLuint *objects;
int32_t objects_count;
yagl_transport_get_out_array(t, sizeof(GLuint), (const void**)&objects, &objects_count);
YAGL_LOG_FUNC_ENTER_SPLIT1(glDeleteObjects, void*, objects);
- (void)yagl_host_glDeleteObjects(objects, objects_count);
+ (void)yagl_host_glDeleteObjects(cur_ts, objects, objects_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glBlendEquation(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum mode;
mode = yagl_transport_get_out_GLenum(t);
YAGL_LOG_FUNC_ENTER_SPLIT1(glBlendEquation, GLenum, mode);
- (void)yagl_host_glBlendEquation(mode);
+ (void)yagl_host_glBlendEquation(cur_ts, mode);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glBlendEquationSeparate(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum modeRGB;
GLenum modeAlpha;
modeRGB = yagl_transport_get_out_GLenum(t);
modeAlpha = yagl_transport_get_out_GLenum(t);
YAGL_LOG_FUNC_ENTER_SPLIT2(glBlendEquationSeparate, GLenum, GLenum, modeRGB, modeAlpha);
- (void)yagl_host_glBlendEquationSeparate(modeRGB, modeAlpha);
+ (void)yagl_host_glBlendEquationSeparate(cur_ts, modeRGB, modeAlpha);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glBlendFunc(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum sfactor;
GLenum dfactor;
sfactor = yagl_transport_get_out_GLenum(t);
dfactor = yagl_transport_get_out_GLenum(t);
YAGL_LOG_FUNC_ENTER_SPLIT2(glBlendFunc, GLenum, GLenum, sfactor, dfactor);
- (void)yagl_host_glBlendFunc(sfactor, dfactor);
+ (void)yagl_host_glBlendFunc(cur_ts, sfactor, dfactor);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glBlendFuncSeparate(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum srcRGB;
GLenum dstRGB;
GLenum srcAlpha;
srcAlpha = yagl_transport_get_out_GLenum(t);
dstAlpha = yagl_transport_get_out_GLenum(t);
YAGL_LOG_FUNC_ENTER_SPLIT4(glBlendFuncSeparate, GLenum, GLenum, GLenum, GLenum, srcRGB, dstRGB, srcAlpha, dstAlpha);
- (void)yagl_host_glBlendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha);
+ (void)yagl_host_glBlendFuncSeparate(cur_ts, srcRGB, dstRGB, srcAlpha, dstAlpha);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glBlendColor(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLclampf red;
GLclampf green;
GLclampf blue;
blue = yagl_transport_get_out_GLclampf(t);
alpha = yagl_transport_get_out_GLclampf(t);
YAGL_LOG_FUNC_ENTER_SPLIT4(glBlendColor, GLclampf, GLclampf, GLclampf, GLclampf, red, green, blue, alpha);
- (void)yagl_host_glBlendColor(red, green, blue, alpha);
+ (void)yagl_host_glBlendColor(cur_ts, red, green, blue, alpha);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glClear(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLbitfield mask;
mask = yagl_transport_get_out_GLbitfield(t);
YAGL_LOG_FUNC_ENTER_SPLIT1(glClear, GLbitfield, mask);
- (void)yagl_host_glClear(mask);
+ (void)yagl_host_glClear(cur_ts, mask);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glClearColor(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLclampf red;
GLclampf green;
GLclampf blue;
blue = yagl_transport_get_out_GLclampf(t);
alpha = yagl_transport_get_out_GLclampf(t);
YAGL_LOG_FUNC_ENTER_SPLIT4(glClearColor, GLclampf, GLclampf, GLclampf, GLclampf, red, green, blue, alpha);
- (void)yagl_host_glClearColor(red, green, blue, alpha);
+ (void)yagl_host_glClearColor(cur_ts, red, green, blue, alpha);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glClearDepthf(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLclampf depth;
depth = yagl_transport_get_out_GLclampf(t);
YAGL_LOG_FUNC_ENTER_SPLIT1(glClearDepthf, GLclampf, depth);
- (void)yagl_host_glClearDepthf(depth);
+ (void)yagl_host_glClearDepthf(cur_ts, depth);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glClearStencil(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLint s;
s = yagl_transport_get_out_GLint(t);
YAGL_LOG_FUNC_ENTER_SPLIT1(glClearStencil, GLint, s);
- (void)yagl_host_glClearStencil(s);
+ (void)yagl_host_glClearStencil(cur_ts, s);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glColorMask(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLboolean red;
GLboolean green;
GLboolean blue;
blue = yagl_transport_get_out_GLboolean(t);
alpha = yagl_transport_get_out_GLboolean(t);
YAGL_LOG_FUNC_ENTER_SPLIT4(glColorMask, GLboolean, GLboolean, GLboolean, GLboolean, red, green, blue, alpha);
- (void)yagl_host_glColorMask(red, green, blue, alpha);
+ (void)yagl_host_glColorMask(cur_ts, red, green, blue, alpha);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glCullFace(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum mode;
mode = yagl_transport_get_out_GLenum(t);
YAGL_LOG_FUNC_ENTER_SPLIT1(glCullFace, GLenum, mode);
- (void)yagl_host_glCullFace(mode);
+ (void)yagl_host_glCullFace(cur_ts, mode);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glDepthFunc(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum func;
func = yagl_transport_get_out_GLenum(t);
YAGL_LOG_FUNC_ENTER_SPLIT1(glDepthFunc, GLenum, func);
- (void)yagl_host_glDepthFunc(func);
+ (void)yagl_host_glDepthFunc(cur_ts, func);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glDepthMask(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLboolean flag;
flag = yagl_transport_get_out_GLboolean(t);
YAGL_LOG_FUNC_ENTER_SPLIT1(glDepthMask, GLboolean, flag);
- (void)yagl_host_glDepthMask(flag);
+ (void)yagl_host_glDepthMask(cur_ts, flag);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glDepthRangef(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLclampf zNear;
GLclampf zFar;
zNear = yagl_transport_get_out_GLclampf(t);
zFar = yagl_transport_get_out_GLclampf(t);
YAGL_LOG_FUNC_ENTER_SPLIT2(glDepthRangef, GLclampf, GLclampf, zNear, zFar);
- (void)yagl_host_glDepthRangef(zNear, zFar);
+ (void)yagl_host_glDepthRangef(cur_ts, zNear, zFar);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glEnable(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum cap;
cap = yagl_transport_get_out_GLenum(t);
YAGL_LOG_FUNC_ENTER_SPLIT1(glEnable, GLenum, cap);
- (void)yagl_host_glEnable(cap);
+ (void)yagl_host_glEnable(cur_ts, cap);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glDisable(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum cap;
cap = yagl_transport_get_out_GLenum(t);
YAGL_LOG_FUNC_ENTER_SPLIT1(glDisable, GLenum, cap);
- (void)yagl_host_glDisable(cap);
+ (void)yagl_host_glDisable(cur_ts, cap);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glFlush(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
YAGL_LOG_FUNC_ENTER_SPLIT0(glFlush);
- (void)yagl_host_glFlush();
+ (void)yagl_host_glFlush(cur_ts);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glFrontFace(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum mode;
mode = yagl_transport_get_out_GLenum(t);
YAGL_LOG_FUNC_ENTER_SPLIT1(glFrontFace, GLenum, mode);
- (void)yagl_host_glFrontFace(mode);
+ (void)yagl_host_glFrontFace(cur_ts, mode);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glGenerateMipmap(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum target;
target = yagl_transport_get_out_GLenum(t);
YAGL_LOG_FUNC_ENTER_SPLIT1(glGenerateMipmap, GLenum, target);
- (void)yagl_host_glGenerateMipmap(target);
+ (void)yagl_host_glGenerateMipmap(cur_ts, target);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glHint(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum target;
GLenum mode;
target = yagl_transport_get_out_GLenum(t);
mode = yagl_transport_get_out_GLenum(t);
YAGL_LOG_FUNC_ENTER_SPLIT2(glHint, GLenum, GLenum, target, mode);
- (void)yagl_host_glHint(target, mode);
+ (void)yagl_host_glHint(cur_ts, target, mode);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glLineWidth(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLfloat width;
width = yagl_transport_get_out_GLfloat(t);
YAGL_LOG_FUNC_ENTER_SPLIT1(glLineWidth, GLfloat, width);
- (void)yagl_host_glLineWidth(width);
+ (void)yagl_host_glLineWidth(cur_ts, width);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glPixelStorei(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum pname;
GLint param;
pname = yagl_transport_get_out_GLenum(t);
param = yagl_transport_get_out_GLint(t);
YAGL_LOG_FUNC_ENTER_SPLIT2(glPixelStorei, GLenum, GLint, pname, param);
- (void)yagl_host_glPixelStorei(pname, param);
+ (void)yagl_host_glPixelStorei(cur_ts, pname, param);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glPolygonOffset(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLfloat factor;
GLfloat units;
factor = yagl_transport_get_out_GLfloat(t);
units = yagl_transport_get_out_GLfloat(t);
YAGL_LOG_FUNC_ENTER_SPLIT2(glPolygonOffset, GLfloat, GLfloat, factor, units);
- (void)yagl_host_glPolygonOffset(factor, units);
+ (void)yagl_host_glPolygonOffset(cur_ts, factor, units);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glScissor(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLint x;
GLint y;
GLsizei width;
width = yagl_transport_get_out_GLsizei(t);
height = yagl_transport_get_out_GLsizei(t);
YAGL_LOG_FUNC_ENTER_SPLIT4(glScissor, GLint, GLint, GLsizei, GLsizei, x, y, width, height);
- (void)yagl_host_glScissor(x, y, width, height);
+ (void)yagl_host_glScissor(cur_ts, x, y, width, height);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glStencilFunc(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum func;
GLint ref;
GLuint mask;
ref = yagl_transport_get_out_GLint(t);
mask = yagl_transport_get_out_GLuint(t);
YAGL_LOG_FUNC_ENTER_SPLIT3(glStencilFunc, GLenum, GLint, GLuint, func, ref, mask);
- (void)yagl_host_glStencilFunc(func, ref, mask);
+ (void)yagl_host_glStencilFunc(cur_ts, func, ref, mask);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glStencilMask(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLuint mask;
mask = yagl_transport_get_out_GLuint(t);
YAGL_LOG_FUNC_ENTER_SPLIT1(glStencilMask, GLuint, mask);
- (void)yagl_host_glStencilMask(mask);
+ (void)yagl_host_glStencilMask(cur_ts, mask);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glStencilOp(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum fail;
GLenum zfail;
GLenum zpass;
zfail = yagl_transport_get_out_GLenum(t);
zpass = yagl_transport_get_out_GLenum(t);
YAGL_LOG_FUNC_ENTER_SPLIT3(glStencilOp, GLenum, GLenum, GLenum, fail, zfail, zpass);
- (void)yagl_host_glStencilOp(fail, zfail, zpass);
+ (void)yagl_host_glStencilOp(cur_ts, fail, zfail, zpass);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glSampleCoverage(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLclampf value;
GLboolean invert;
value = yagl_transport_get_out_GLclampf(t);
invert = yagl_transport_get_out_GLboolean(t);
YAGL_LOG_FUNC_ENTER_SPLIT2(glSampleCoverage, GLclampf, GLboolean, value, invert);
- (void)yagl_host_glSampleCoverage(value, invert);
+ (void)yagl_host_glSampleCoverage(cur_ts, value, invert);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glViewport(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLint x;
GLint y;
GLsizei width;
width = yagl_transport_get_out_GLsizei(t);
height = yagl_transport_get_out_GLsizei(t);
YAGL_LOG_FUNC_ENTER_SPLIT4(glViewport, GLint, GLint, GLsizei, GLsizei, x, y, width, height);
- (void)yagl_host_glViewport(x, y, width, height);
+ (void)yagl_host_glViewport(cur_ts, x, y, width, height);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glStencilFuncSeparate(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum face;
GLenum func;
GLint ref;
ref = yagl_transport_get_out_GLint(t);
mask = yagl_transport_get_out_GLuint(t);
YAGL_LOG_FUNC_ENTER_SPLIT4(glStencilFuncSeparate, GLenum, GLenum, GLint, GLuint, face, func, ref, mask);
- (void)yagl_host_glStencilFuncSeparate(face, func, ref, mask);
+ (void)yagl_host_glStencilFuncSeparate(cur_ts, face, func, ref, mask);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glStencilMaskSeparate(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum face;
GLuint mask;
face = yagl_transport_get_out_GLenum(t);
mask = yagl_transport_get_out_GLuint(t);
YAGL_LOG_FUNC_ENTER_SPLIT2(glStencilMaskSeparate, GLenum, GLuint, face, mask);
- (void)yagl_host_glStencilMaskSeparate(face, mask);
+ (void)yagl_host_glStencilMaskSeparate(cur_ts, face, mask);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glStencilOpSeparate(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum face;
GLenum fail;
GLenum zfail;
zfail = yagl_transport_get_out_GLenum(t);
zpass = yagl_transport_get_out_GLenum(t);
YAGL_LOG_FUNC_ENTER_SPLIT4(glStencilOpSeparate, GLenum, GLenum, GLenum, GLenum, face, fail, zfail, zpass);
- (void)yagl_host_glStencilOpSeparate(face, fail, zfail, zpass);
+ (void)yagl_host_glStencilOpSeparate(cur_ts, face, fail, zfail, zpass);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glPointSize(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLfloat size;
size = yagl_transport_get_out_GLfloat(t);
YAGL_LOG_FUNC_ENTER_SPLIT1(glPointSize, GLfloat, size);
- (void)yagl_host_glPointSize(size);
+ (void)yagl_host_glPointSize(cur_ts, size);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glAlphaFunc(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum func;
GLclampf ref;
func = yagl_transport_get_out_GLenum(t);
ref = yagl_transport_get_out_GLclampf(t);
YAGL_LOG_FUNC_ENTER_SPLIT2(glAlphaFunc, GLenum, GLclampf, func, ref);
- (void)yagl_host_glAlphaFunc(func, ref);
+ (void)yagl_host_glAlphaFunc(cur_ts, func, ref);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glMatrixMode(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum mode;
mode = yagl_transport_get_out_GLenum(t);
YAGL_LOG_FUNC_ENTER_SPLIT1(glMatrixMode, GLenum, mode);
- (void)yagl_host_glMatrixMode(mode);
+ (void)yagl_host_glMatrixMode(cur_ts, mode);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glLoadIdentity(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
YAGL_LOG_FUNC_ENTER_SPLIT0(glLoadIdentity);
- (void)yagl_host_glLoadIdentity();
+ (void)yagl_host_glLoadIdentity(cur_ts);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glPopMatrix(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
YAGL_LOG_FUNC_ENTER_SPLIT0(glPopMatrix);
- (void)yagl_host_glPopMatrix();
+ (void)yagl_host_glPopMatrix(cur_ts);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glPushMatrix(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
YAGL_LOG_FUNC_ENTER_SPLIT0(glPushMatrix);
- (void)yagl_host_glPushMatrix();
+ (void)yagl_host_glPushMatrix(cur_ts);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glRotatef(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLfloat angle;
GLfloat x;
GLfloat y;
y = yagl_transport_get_out_GLfloat(t);
z = yagl_transport_get_out_GLfloat(t);
YAGL_LOG_FUNC_ENTER_SPLIT4(glRotatef, GLfloat, GLfloat, GLfloat, GLfloat, angle, x, y, z);
- (void)yagl_host_glRotatef(angle, x, y, z);
+ (void)yagl_host_glRotatef(cur_ts, angle, x, y, z);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glTranslatef(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLfloat x;
GLfloat y;
GLfloat z;
y = yagl_transport_get_out_GLfloat(t);
z = yagl_transport_get_out_GLfloat(t);
YAGL_LOG_FUNC_ENTER_SPLIT3(glTranslatef, GLfloat, GLfloat, GLfloat, x, y, z);
- (void)yagl_host_glTranslatef(x, y, z);
+ (void)yagl_host_glTranslatef(cur_ts, x, y, z);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glScalef(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLfloat x;
GLfloat y;
GLfloat z;
y = yagl_transport_get_out_GLfloat(t);
z = yagl_transport_get_out_GLfloat(t);
YAGL_LOG_FUNC_ENTER_SPLIT3(glScalef, GLfloat, GLfloat, GLfloat, x, y, z);
- (void)yagl_host_glScalef(x, y, z);
+ (void)yagl_host_glScalef(cur_ts, x, y, z);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glOrthof(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLfloat left;
GLfloat right;
GLfloat bottom;
zNear = yagl_transport_get_out_GLfloat(t);
zFar = yagl_transport_get_out_GLfloat(t);
YAGL_LOG_FUNC_ENTER_SPLIT6(glOrthof, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, left, right, bottom, top, zNear, zFar);
- (void)yagl_host_glOrthof(left, right, bottom, top, zNear, zFar);
+ (void)yagl_host_glOrthof(cur_ts, left, right, bottom, top, zNear, zFar);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glColor4f(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLfloat red;
GLfloat green;
GLfloat blue;
blue = yagl_transport_get_out_GLfloat(t);
alpha = yagl_transport_get_out_GLfloat(t);
YAGL_LOG_FUNC_ENTER_SPLIT4(glColor4f, GLfloat, GLfloat, GLfloat, GLfloat, red, green, blue, alpha);
- (void)yagl_host_glColor4f(red, green, blue, alpha);
+ (void)yagl_host_glColor4f(cur_ts, red, green, blue, alpha);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glColor4ub(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLubyte red;
GLubyte green;
GLubyte blue;
blue = yagl_transport_get_out_GLubyte(t);
alpha = yagl_transport_get_out_GLubyte(t);
YAGL_LOG_FUNC_ENTER_SPLIT4(glColor4ub, GLubyte, GLubyte, GLubyte, GLubyte, red, green, blue, alpha);
- (void)yagl_host_glColor4ub(red, green, blue, alpha);
+ (void)yagl_host_glColor4ub(cur_ts, red, green, blue, alpha);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glNormal3f(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLfloat nx;
GLfloat ny;
GLfloat nz;
ny = yagl_transport_get_out_GLfloat(t);
nz = yagl_transport_get_out_GLfloat(t);
YAGL_LOG_FUNC_ENTER_SPLIT3(glNormal3f, GLfloat, GLfloat, GLfloat, nx, ny, nz);
- (void)yagl_host_glNormal3f(nx, ny, nz);
+ (void)yagl_host_glNormal3f(cur_ts, nx, ny, nz);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glPointParameterf(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum pname;
GLfloat param;
pname = yagl_transport_get_out_GLenum(t);
param = yagl_transport_get_out_GLfloat(t);
YAGL_LOG_FUNC_ENTER_SPLIT2(glPointParameterf, GLenum, GLfloat, pname, param);
- (void)yagl_host_glPointParameterf(pname, param);
+ (void)yagl_host_glPointParameterf(cur_ts, pname, param);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glPointParameterfv(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum pname;
const GLfloat *params;
int32_t params_count;
pname = yagl_transport_get_out_GLenum(t);
yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)¶ms, ¶ms_count);
YAGL_LOG_FUNC_ENTER_SPLIT2(glPointParameterfv, GLenum, void*, pname, params);
- (void)yagl_host_glPointParameterfv(pname, params, params_count);
+ (void)yagl_host_glPointParameterfv(cur_ts, pname, params, params_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glFogf(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum pname;
GLfloat param;
pname = yagl_transport_get_out_GLenum(t);
param = yagl_transport_get_out_GLfloat(t);
YAGL_LOG_FUNC_ENTER_SPLIT2(glFogf, GLenum, GLfloat, pname, param);
- (void)yagl_host_glFogf(pname, param);
+ (void)yagl_host_glFogf(cur_ts, pname, param);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glFogfv(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum pname;
const GLfloat *params;
int32_t params_count;
pname = yagl_transport_get_out_GLenum(t);
yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)¶ms, ¶ms_count);
YAGL_LOG_FUNC_ENTER_SPLIT2(glFogfv, GLenum, void*, pname, params);
- (void)yagl_host_glFogfv(pname, params, params_count);
+ (void)yagl_host_glFogfv(cur_ts, pname, params, params_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glFrustumf(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLfloat left;
GLfloat right;
GLfloat bottom;
zNear = yagl_transport_get_out_GLfloat(t);
zFar = yagl_transport_get_out_GLfloat(t);
YAGL_LOG_FUNC_ENTER_SPLIT6(glFrustumf, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, left, right, bottom, top, zNear, zFar);
- (void)yagl_host_glFrustumf(left, right, bottom, top, zNear, zFar);
+ (void)yagl_host_glFrustumf(cur_ts, left, right, bottom, top, zNear, zFar);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glLightf(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum light;
GLenum pname;
GLfloat param;
pname = yagl_transport_get_out_GLenum(t);
param = yagl_transport_get_out_GLfloat(t);
YAGL_LOG_FUNC_ENTER_SPLIT3(glLightf, GLenum, GLenum, GLfloat, light, pname, param);
- (void)yagl_host_glLightf(light, pname, param);
+ (void)yagl_host_glLightf(cur_ts, light, pname, param);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glLightfv(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum light;
GLenum pname;
const GLfloat *params;
pname = yagl_transport_get_out_GLenum(t);
yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)¶ms, ¶ms_count);
YAGL_LOG_FUNC_ENTER_SPLIT3(glLightfv, GLenum, GLenum, void*, light, pname, params);
- (void)yagl_host_glLightfv(light, pname, params, params_count);
+ (void)yagl_host_glLightfv(cur_ts, light, pname, params, params_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glGetLightfv(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum light;
GLenum pname;
GLfloat *params;
yagl_transport_get_in_array(t, sizeof(GLfloat), (void**)¶ms, ¶ms_maxcount, ¶ms_count);
YAGL_LOG_FUNC_ENTER_SPLIT3(glGetLightfv, GLenum, GLenum, void*, light, pname, params);
*params_count = 0;
- (void)yagl_host_glGetLightfv(light, pname, params, params_maxcount, params_count);
+ (void)yagl_host_glGetLightfv(cur_ts, light, pname, params, params_maxcount, params_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glLightModelf(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum pname;
GLfloat param;
pname = yagl_transport_get_out_GLenum(t);
param = yagl_transport_get_out_GLfloat(t);
YAGL_LOG_FUNC_ENTER_SPLIT2(glLightModelf, GLenum, GLfloat, pname, param);
- (void)yagl_host_glLightModelf(pname, param);
+ (void)yagl_host_glLightModelf(cur_ts, pname, param);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glLightModelfv(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum pname;
const GLfloat *params;
int32_t params_count;
pname = yagl_transport_get_out_GLenum(t);
yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)¶ms, ¶ms_count);
YAGL_LOG_FUNC_ENTER_SPLIT2(glLightModelfv, GLenum, void*, pname, params);
- (void)yagl_host_glLightModelfv(pname, params, params_count);
+ (void)yagl_host_glLightModelfv(cur_ts, pname, params, params_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glMaterialf(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum face;
GLenum pname;
GLfloat param;
pname = yagl_transport_get_out_GLenum(t);
param = yagl_transport_get_out_GLfloat(t);
YAGL_LOG_FUNC_ENTER_SPLIT3(glMaterialf, GLenum, GLenum, GLfloat, face, pname, param);
- (void)yagl_host_glMaterialf(face, pname, param);
+ (void)yagl_host_glMaterialf(cur_ts, face, pname, param);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glMaterialfv(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum face;
GLenum pname;
const GLfloat *params;
pname = yagl_transport_get_out_GLenum(t);
yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)¶ms, ¶ms_count);
YAGL_LOG_FUNC_ENTER_SPLIT3(glMaterialfv, GLenum, GLenum, void*, face, pname, params);
- (void)yagl_host_glMaterialfv(face, pname, params, params_count);
+ (void)yagl_host_glMaterialfv(cur_ts, face, pname, params, params_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glGetMaterialfv(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum face;
GLenum pname;
GLfloat *params;
yagl_transport_get_in_array(t, sizeof(GLfloat), (void**)¶ms, ¶ms_maxcount, ¶ms_count);
YAGL_LOG_FUNC_ENTER_SPLIT3(glGetMaterialfv, GLenum, GLenum, void*, face, pname, params);
*params_count = 0;
- (void)yagl_host_glGetMaterialfv(face, pname, params, params_maxcount, params_count);
+ (void)yagl_host_glGetMaterialfv(cur_ts, face, pname, params, params_maxcount, params_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glShadeModel(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum mode;
mode = yagl_transport_get_out_GLenum(t);
YAGL_LOG_FUNC_ENTER_SPLIT1(glShadeModel, GLenum, mode);
- (void)yagl_host_glShadeModel(mode);
+ (void)yagl_host_glShadeModel(cur_ts, mode);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glLogicOp(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum opcode;
opcode = yagl_transport_get_out_GLenum(t);
YAGL_LOG_FUNC_ENTER_SPLIT1(glLogicOp, GLenum, opcode);
- (void)yagl_host_glLogicOp(opcode);
+ (void)yagl_host_glLogicOp(cur_ts, opcode);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glMultMatrixf(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
const GLfloat *m;
int32_t m_count;
yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&m, &m_count);
YAGL_LOG_FUNC_ENTER_SPLIT1(glMultMatrixf, void*, m);
- (void)yagl_host_glMultMatrixf(m, m_count);
+ (void)yagl_host_glMultMatrixf(cur_ts, m, m_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glLoadMatrixf(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
const GLfloat *m;
int32_t m_count;
yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&m, &m_count);
YAGL_LOG_FUNC_ENTER_SPLIT1(glLoadMatrixf, void*, m);
- (void)yagl_host_glLoadMatrixf(m, m_count);
+ (void)yagl_host_glLoadMatrixf(cur_ts, m, m_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glClipPlanef(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum plane;
const GLfloat *equation;
int32_t equation_count;
plane = yagl_transport_get_out_GLenum(t);
yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&equation, &equation_count);
YAGL_LOG_FUNC_ENTER_SPLIT2(glClipPlanef, GLenum, void*, plane, equation);
- (void)yagl_host_glClipPlanef(plane, equation, equation_count);
+ (void)yagl_host_glClipPlanef(cur_ts, plane, equation, equation_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glGetClipPlanef(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLenum pname;
GLfloat *eqn;
int32_t eqn_maxcount;
yagl_transport_get_in_array(t, sizeof(GLfloat), (void**)&eqn, &eqn_maxcount, &eqn_count);
YAGL_LOG_FUNC_ENTER_SPLIT2(glGetClipPlanef, GLenum, void*, pname, eqn);
*eqn_count = 0;
- (void)yagl_host_glGetClipPlanef(pname, eqn, eqn_maxcount, eqn_count);
+ (void)yagl_host_glGetClipPlanef(cur_ts, pname, eqn, eqn_maxcount, eqn_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glUpdateOffscreenImageYAGL(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
GLuint texture;
uint32_t width;
uint32_t height;
bpp = yagl_transport_get_out_uint32_t(t);
yagl_transport_get_out_array(t, 1, (const void**)&pixels, &pixels_count);
YAGL_LOG_FUNC_ENTER_SPLIT5(glUpdateOffscreenImageYAGL, GLuint, uint32_t, uint32_t, uint32_t, void*, texture, width, height, bpp, pixels);
- (void)yagl_host_glUpdateOffscreenImageYAGL(texture, width, height, bpp, pixels, pixels_count);
+ (void)yagl_host_glUpdateOffscreenImageYAGL(cur_ts, texture, width, height, bpp, pixels, pixels_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glGenUniformLocationYAGL(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
uint32_t location;
GLuint program;
const GLchar *name;
program = yagl_transport_get_out_GLuint(t);
yagl_transport_get_out_array(t, sizeof(GLchar), (const void**)&name, &name_count);
YAGL_LOG_FUNC_ENTER_SPLIT3(glGenUniformLocationYAGL, uint32_t, GLuint, void*, location, program, name);
- (void)yagl_host_glGenUniformLocationYAGL(location, program, name, name_count);
+ (void)yagl_host_glGenUniformLocationYAGL(cur_ts, location, program, name, name_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
*/
static void yagl_func_glDeleteUniformLocationsYAGL(struct yagl_transport *t)
{
+ struct yagl_thread_state *cur_ts = t->ts;
const uint32_t *locations;
int32_t locations_count;
yagl_transport_get_out_array(t, sizeof(uint32_t), (const void**)&locations, &locations_count);
YAGL_LOG_FUNC_ENTER_SPLIT1(glDeleteUniformLocationsYAGL, void*, locations);
- (void)yagl_host_glDeleteUniformLocationsYAGL(locations, locations_count);
+ (void)yagl_host_glDeleteUniformLocationsYAGL(cur_ts, locations, locations_count);
YAGL_LOG_FUNC_EXIT(NULL);
}
#include "yagl_gles_driver.h"
#include "yagl_gles_api_ps.h"
#include "yagl_gles_api_ts.h"
-#include "yagl_tls.h"
#include "yagl_log.h"
#include "yagl_process.h"
#include "yagl_thread.h"
#include "yagl_object_map.h"
#include "yagl_transport.h"
-static YAGL_DEFINE_TLS(struct yagl_gles_api_ts*, gles_api_ts);
-
struct yagl_gles_object
{
struct yagl_object base;
yagl_gles1_array_texcoord,
} yagl_gles1_array_type;
-static GLuint yagl_gles_bind_array(uint32_t indx,
+static GLuint yagl_gles_bind_array(struct yagl_thread_state *cur_ts,
+ uint32_t indx,
GLint first,
GLsizei stride,
const GLvoid *data,
GLuint current_vbo;
uint32_t size;
void *ptr;
+ struct yagl_gles_api_ts *gles_api_ts = cur_ts->gles_api_ts;
YAGL_LOG_FUNC_SET(yagl_gles_bind_array);
gles_api_ts->num_arrays = indx + 1;
}
- gles_api_ts->driver->GetIntegerv(GL_ARRAY_BUFFER_BINDING,
+ cur_ts->gles_api_ts->driver->GetIntegerv(GL_ARRAY_BUFFER_BINDING,
(GLint*)¤t_vbo);
- gles_api_ts->driver->BindBuffer(GL_ARRAY_BUFFER, gles_api_ts->arrays[indx].vbo);
+ cur_ts->gles_api_ts->driver->BindBuffer(GL_ARRAY_BUFFER, gles_api_ts->arrays[indx].vbo);
size = first * stride + data_count;
return current_vbo;
}
-static GLuint yagl_gles_bind_ebo(const GLvoid *data, int32_t size)
+static GLuint yagl_gles_bind_ebo(struct yagl_thread_state *cur_ts,
+ const GLvoid *data, int32_t size)
{
GLuint current_ebo;
void *ptr;
+ struct yagl_gles_api_ts *gles_api_ts = cur_ts->gles_api_ts;
YAGL_LOG_FUNC_SET(yagl_gles_bind_ebo);
gles_api_ts->driver->GenBuffers(1, &gles_api_ts->ebo);
}
- gles_api_ts->driver->GetIntegerv(GL_ELEMENT_ARRAY_BUFFER_BINDING,
+ cur_ts->gles_api_ts->driver->GetIntegerv(GL_ELEMENT_ARRAY_BUFFER_BINDING,
(GLint*)¤t_ebo);
- gles_api_ts->driver->BindBuffer(GL_ELEMENT_ARRAY_BUFFER, gles_api_ts->ebo);
+ cur_ts->gles_api_ts->driver->BindBuffer(GL_ELEMENT_ARRAY_BUFFER, gles_api_ts->ebo);
if (size > gles_api_ts->ebo_size) {
gles_api_ts->driver->BufferData(GL_ELEMENT_ARRAY_BUFFER,
return current_ebo;
}
-static bool yagl_gles_program_get_uniform_type(GLuint program,
+static bool yagl_gles_program_get_uniform_type(struct yagl_thread_state *cur_ts,
+ GLuint program,
GLint location,
GLenum *type)
{
GLint uniform_name_max_length = 0;
GLchar *uniform_name = NULL;
bool res = false;
+ struct yagl_gles_api_ts *gles_api_ts = cur_ts->gles_api_ts;
YAGL_LOG_FUNC_SET(yagl_gles_program_get_uniform_type);
return false;
}
- gles_api_ts->driver->GetProgramiv(program,
+ cur_ts->gles_api_ts->driver->GetProgramiv(program,
GL_LINK_STATUS,
&link_status);
return false;
}
- gles_api_ts->driver->GetProgramiv(program,
+ cur_ts->gles_api_ts->driver->GetProgramiv(program,
GL_ACTIVE_UNIFORMS,
&num_active_uniforms);
- gles_api_ts->driver->GetProgramiv(program,
+ cur_ts->gles_api_ts->driver->GetProgramiv(program,
GL_ACTIVE_UNIFORM_MAX_LENGTH,
&uniform_name_max_length);
return true;
}
-static void yagl_gles_object_add(GLuint local_name,
+static void yagl_gles_object_add(struct yagl_thread_state *cur_ts,
+ GLuint local_name,
GLuint global_name,
uint32_t ctx_id,
- void (*destroy_func)(struct yagl_object */*obj*/))
+ yagl_object_destroy_func destroy_func)
{
struct yagl_gles_object *obj;
obj->base.global_name = global_name;
obj->base.destroy = destroy_func;
- obj->driver = gles_api_ts->driver;
+ obj->driver = cur_ts->gles_api_ts->driver;
obj->ctx_id = ctx_id;
yagl_object_map_add(cur_ts->ps->object_map,
&obj->base);
}
-static void yagl_gles_buffer_destroy(struct yagl_object *obj)
+static void yagl_gles_buffer_destroy(struct yagl_thread_state *cur_ts,
+ struct yagl_object *obj)
{
struct yagl_gles_object *gles_obj = (struct yagl_gles_object*)obj;
YAGL_LOG_FUNC_ENTER(yagl_gles_buffer_destroy, "%u", obj->global_name);
- yagl_ensure_ctx(0);
+ yagl_ensure_ctx(cur_ts, 0);
gles_obj->driver->DeleteBuffers(1, &obj->global_name);
- yagl_unensure_ctx(0);
+ yagl_unensure_ctx(cur_ts, 0);
g_free(gles_obj);
YAGL_LOG_FUNC_EXIT(NULL);
}
-static void yagl_gles_texture_destroy(struct yagl_object *obj)
+static void yagl_gles_texture_destroy(struct yagl_thread_state *cur_ts,
+ struct yagl_object *obj)
{
struct yagl_gles_object *gles_obj = (struct yagl_gles_object*)obj;
YAGL_LOG_FUNC_ENTER(yagl_gles_texture_destroy, "%u", obj->global_name);
- yagl_ensure_ctx(0);
+ yagl_ensure_ctx(cur_ts, 0);
gles_obj->driver->DeleteTextures(1, &obj->global_name);
- yagl_unensure_ctx(0);
+ yagl_unensure_ctx(cur_ts, 0);
g_free(gles_obj);
YAGL_LOG_FUNC_EXIT(NULL);
}
-static void yagl_gles_framebuffer_destroy(struct yagl_object *obj)
+static void yagl_gles_framebuffer_destroy(struct yagl_thread_state *cur_ts,
+ struct yagl_object *obj)
{
struct yagl_gles_object *gles_obj = (struct yagl_gles_object*)obj;
YAGL_LOG_FUNC_ENTER(yagl_gles_framebuffer_destroy, "%u", obj->global_name);
- yagl_ensure_ctx(gles_obj->ctx_id);
+ yagl_ensure_ctx(cur_ts, gles_obj->ctx_id);
gles_obj->driver->DeleteFramebuffers(1, &obj->global_name);
- yagl_unensure_ctx(gles_obj->ctx_id);
+ yagl_unensure_ctx(cur_ts, gles_obj->ctx_id);
g_free(gles_obj);
YAGL_LOG_FUNC_EXIT(NULL);
}
-static void yagl_gles_renderbuffer_destroy(struct yagl_object *obj)
+static void yagl_gles_renderbuffer_destroy(struct yagl_thread_state *cur_ts,
+ struct yagl_object *obj)
{
struct yagl_gles_object *gles_obj = (struct yagl_gles_object*)obj;
YAGL_LOG_FUNC_ENTER(yagl_gles_renderbuffer_destroy, "%u", obj->global_name);
- yagl_ensure_ctx(0);
+ yagl_ensure_ctx(cur_ts, 0);
gles_obj->driver->DeleteRenderbuffers(1, &obj->global_name);
- yagl_unensure_ctx(0);
+ yagl_unensure_ctx(cur_ts, 0);
g_free(gles_obj);
YAGL_LOG_FUNC_EXIT(NULL);
}
-static void yagl_gles_program_destroy(struct yagl_object *obj)
+static void yagl_gles_program_destroy(struct yagl_thread_state *cur_ts,
+ struct yagl_object *obj)
{
struct yagl_gles_object *gles_obj = (struct yagl_gles_object*)obj;
YAGL_LOG_FUNC_ENTER(yagl_gles_program_destroy, "%u", obj->global_name);
- yagl_ensure_ctx(0);
+ yagl_ensure_ctx(cur_ts, 0);
gles_obj->driver->DeleteProgram(obj->global_name);
- yagl_unensure_ctx(0);
+ yagl_unensure_ctx(cur_ts, 0);
g_free(gles_obj);
YAGL_LOG_FUNC_EXIT(NULL);
}
-static void yagl_gles_shader_destroy(struct yagl_object *obj)
+static void yagl_gles_shader_destroy(struct yagl_thread_state *cur_ts,
+ struct yagl_object *obj)
{
struct yagl_gles_object *gles_obj = (struct yagl_gles_object*)obj;
YAGL_LOG_FUNC_ENTER(yagl_gles_shader_destroy, "%u", obj->global_name);
- yagl_ensure_ctx(0);
+ yagl_ensure_ctx(cur_ts, 0);
gles_obj->driver->DeleteShader(obj->global_name);
- yagl_unensure_ctx(0);
+ yagl_unensure_ctx(cur_ts, 0);
g_free(gles_obj);
YAGL_LOG_FUNC_EXIT(NULL);
}
-static void yagl_gles_vertex_array_destroy(struct yagl_object *obj)
+static void yagl_gles_vertex_array_destroy(struct yagl_thread_state *cur_ts,
+ struct yagl_object *obj)
{
struct yagl_gles_object *gles_obj = (struct yagl_gles_object*)obj;
YAGL_LOG_FUNC_ENTER(yagl_gles_vertex_array_destroy, "%u", obj->global_name);
- yagl_ensure_ctx(gles_obj->ctx_id);
+ yagl_ensure_ctx(cur_ts, gles_obj->ctx_id);
gles_obj->driver->DeleteVertexArrays(1, &obj->global_name);
- yagl_unensure_ctx(gles_obj->ctx_id);
+ yagl_unensure_ctx(cur_ts, gles_obj->ctx_id);
g_free(gles_obj);
YAGL_LOG_FUNC_EXIT(NULL);
}
-static void yagl_gles_transform_feedback_destroy(struct yagl_object *obj)
+static void yagl_gles_transform_feedback_destroy(struct yagl_thread_state *cur_ts,
+ struct yagl_object *obj)
{
struct yagl_gles_object *gles_obj = (struct yagl_gles_object*)obj;
YAGL_LOG_FUNC_ENTER(yagl_gles_transform_feedback_destroy, "%u", obj->global_name);
- yagl_ensure_ctx(gles_obj->ctx_id);
+ yagl_ensure_ctx(cur_ts, gles_obj->ctx_id);
gles_obj->driver->DeleteTransformFeedbacks(1, &obj->global_name);
- yagl_unensure_ctx(gles_obj->ctx_id);
+ yagl_unensure_ctx(cur_ts, gles_obj->ctx_id);
g_free(gles_obj);
YAGL_LOG_FUNC_EXIT(NULL);
}
-static void yagl_gles_query_destroy(struct yagl_object *obj)
+static void yagl_gles_query_destroy(struct yagl_thread_state *cur_ts,
+ struct yagl_object *obj)
{
struct yagl_gles_object *gles_obj = (struct yagl_gles_object*)obj;
YAGL_LOG_FUNC_ENTER(yagl_gles_query_destroy, "%u", obj->global_name);
- yagl_ensure_ctx(gles_obj->ctx_id);
+ yagl_ensure_ctx(cur_ts, gles_obj->ctx_id);
gles_obj->driver->DeleteQueries(1, &obj->global_name);
- yagl_unensure_ctx(gles_obj->ctx_id);
+ yagl_unensure_ctx(cur_ts, gles_obj->ctx_id);
g_free(gles_obj);
YAGL_LOG_FUNC_EXIT(NULL);
}
-static void yagl_gles_sampler_destroy(struct yagl_object *obj)
+static void yagl_gles_sampler_destroy(struct yagl_thread_state *cur_ts,
+ struct yagl_object *obj)
{
struct yagl_gles_object *gles_obj = (struct yagl_gles_object*)obj;
YAGL_LOG_FUNC_ENTER(yagl_gles_sampler_destroy, "%u", obj->global_name);
- yagl_ensure_ctx(0);
+ yagl_ensure_ctx(cur_ts, 0);
gles_obj->driver->DeleteSamplers(1, &obj->global_name);
- yagl_unensure_ctx(0);
+ yagl_unensure_ctx(cur_ts, 0);
g_free(gles_obj);
YAGL_LOG_FUNC_EXIT(NULL);
}
-static __inline GLuint yagl_gles_object_get(GLuint local_name)
+static __inline GLuint yagl_gles_object_get(struct yagl_thread_state *cur_ts,
+ GLuint local_name)
{
return (local_name > 0) ? yagl_object_map_get(cur_ts->ps->object_map, local_name) : 0;
}
}
}
-static void yagl_host_gles_thread_init(struct yagl_api_ps *api_ps)
+static void yagl_host_gles_thread_init(struct yagl_thread_state *cur_ts,
+ struct yagl_api_ps *api_ps)
{
struct yagl_gles_api_ps *gles_api_ps = (struct yagl_gles_api_ps*)api_ps;
YAGL_LOG_FUNC_ENTER(yagl_host_gles_thread_init, NULL);
- gles_api_ts = g_malloc0(sizeof(*gles_api_ts));
-
- yagl_gles_api_ts_init(gles_api_ts, gles_api_ps->driver, gles_api_ps);
+ cur_ts->gles_api_ts = g_malloc0(sizeof(struct yagl_gles_api_ts));
- cur_ts->gles_api_ts = gles_api_ts;
+ yagl_gles_api_ts_init(cur_ts, cur_ts->gles_api_ts, gles_api_ps->driver, gles_api_ps);
YAGL_LOG_FUNC_EXIT(NULL);
}
-static void yagl_host_gles_batch_start(struct yagl_api_ps *api_ps)
+static void yagl_host_gles_batch_start(struct yagl_thread_state *cur_ts,
+ struct yagl_api_ps *api_ps)
{
- gles_api_ts = cur_ts->gles_api_ts;
}
-static void yagl_host_gles_batch_end(struct yagl_api_ps *api_ps)
+static void yagl_host_gles_batch_end(struct yagl_thread_state *cur_ts,
+ struct yagl_api_ps *api_ps)
{
}
-static void yagl_host_gles_thread_fini(struct yagl_api_ps *api_ps)
+static void yagl_host_gles_thread_fini(struct yagl_thread_state *cur_ts,
+ struct yagl_api_ps *api_ps)
{
YAGL_LOG_FUNC_ENTER(yagl_host_gles_thread_fini, NULL);
- gles_api_ts = cur_ts->gles_api_ts;
-
- yagl_gles_api_ts_cleanup(gles_api_ts);
+ yagl_gles_api_ts_cleanup(cur_ts, cur_ts->gles_api_ts);
- g_free(gles_api_ts);
+ g_free(cur_ts->gles_api_ts);
- gles_api_ts = cur_ts->gles_api_ts = NULL;
+ cur_ts->gles_api_ts = NULL;
YAGL_LOG_FUNC_EXIT(NULL);
}
-static void yagl_host_gles_process_destroy(struct yagl_api_ps *api_ps)
+static void yagl_host_gles_process_destroy(struct yagl_thread_state *cur_ts,
+ struct yagl_api_ps *api_ps)
{
struct yagl_gles_api_ps *gles_api_ps = (struct yagl_gles_api_ps*)api_ps;
YAGL_LOG_FUNC_EXIT(NULL);
}
-struct yagl_api_ps *yagl_host_gles_process_init(struct yagl_api *api)
+struct yagl_api_ps *yagl_host_gles_process_init(struct yagl_process_state *ps,
+ struct yagl_api *api)
{
struct yagl_gles_api *gles_api = (struct yagl_gles_api*)api;
struct yagl_gles_api_ps *gles_api_ps;
+ YAGL_LOG_NO_TS;
YAGL_LOG_FUNC_ENTER(yagl_host_gles_process_init, NULL);
return &gles_api_ps->base;
}
-void yagl_host_glDrawArrays(GLenum mode,
+void yagl_host_glDrawArrays(struct yagl_thread_state *cur_ts,
+ GLenum mode,
GLint first,
GLsizei count)
{
- gles_api_ts->driver->DrawArrays(mode, first, count);
+ cur_ts->gles_api_ts->driver->DrawArrays(mode, first, count);
}
-void yagl_host_glDrawElements(GLenum mode,
+void yagl_host_glDrawElements(struct yagl_thread_state *cur_ts,
+ GLenum mode,
GLsizei count,
GLenum type,
const GLvoid *indices, int32_t indices_count)
{
if (indices) {
- GLuint current_ebo = yagl_gles_bind_ebo(indices, indices_count);
+ GLuint current_ebo = yagl_gles_bind_ebo(cur_ts, indices, indices_count);
- gles_api_ts->driver->DrawElements(mode, count, type, NULL);
+ cur_ts->gles_api_ts->driver->DrawElements(mode, count, type, NULL);
- gles_api_ts->driver->BindBuffer(GL_ELEMENT_ARRAY_BUFFER, current_ebo);
+ cur_ts->gles_api_ts->driver->BindBuffer(GL_ELEMENT_ARRAY_BUFFER, current_ebo);
} else {
- gles_api_ts->driver->DrawElements(mode, count, type,
- (const GLvoid*)(uintptr_t)indices_count);
+ cur_ts->gles_api_ts->driver->DrawElements(mode, count, type,
+ (const GLvoid*)(uintptr_t)indices_count);
}
}
-void yagl_host_glReadPixelsData(GLint x,
+void yagl_host_glReadPixelsData(struct yagl_thread_state *cur_ts,
+ GLint x,
GLint y,
GLsizei width,
GLsizei height,
GLenum type,
GLvoid *pixels, int32_t pixels_maxcount, int32_t *pixels_count)
{
- gles_api_ts->driver->ReadPixels(x,
- y,
- width,
- height,
- format,
- type,
- pixels);
+ cur_ts->gles_api_ts->driver->ReadPixels(x,
+ y,
+ width,
+ height,
+ format,
+ type,
+ pixels);
*pixels_count = pixels_maxcount;
}
-void yagl_host_glReadPixelsOffset(GLint x,
+void yagl_host_glReadPixelsOffset(struct yagl_thread_state *cur_ts,
+ GLint x,
GLint y,
GLsizei width,
GLsizei height,
GLenum type,
uintptr_t pixels)
{
- gles_api_ts->driver->ReadPixels(x,
- y,
- width,
- height,
- format,
- type,
- (GLvoid*)pixels);
+ cur_ts->gles_api_ts->driver->ReadPixels(x,
+ y,
+ width,
+ height,
+ format,
+ type,
+ (GLvoid*)pixels);
}
-void yagl_host_glDrawArraysInstanced(GLenum mode,
+void yagl_host_glDrawArraysInstanced(struct yagl_thread_state *cur_ts,
+ GLenum mode,
GLint start,
GLsizei count,
GLsizei primcount)
{
- gles_api_ts->driver->DrawArraysInstanced(mode, start, count, primcount);
+ cur_ts->gles_api_ts->driver->DrawArraysInstanced(mode, start, count, primcount);
}
-void yagl_host_glDrawElementsInstanced(GLenum mode,
+void yagl_host_glDrawElementsInstanced(struct yagl_thread_state *cur_ts,
+ GLenum mode,
GLsizei count,
GLenum type,
const void *indices, int32_t indices_count,
GLsizei primcount)
{
if (indices) {
- GLuint current_ebo = yagl_gles_bind_ebo(indices, indices_count);
+ GLuint current_ebo = yagl_gles_bind_ebo(cur_ts, indices, indices_count);
- gles_api_ts->driver->DrawElementsInstanced(mode, count, type, NULL, primcount);
+ cur_ts->gles_api_ts->driver->DrawElementsInstanced(mode, count, type, NULL, primcount);
- gles_api_ts->driver->BindBuffer(GL_ELEMENT_ARRAY_BUFFER, current_ebo);
+ cur_ts->gles_api_ts->driver->BindBuffer(GL_ELEMENT_ARRAY_BUFFER, current_ebo);
} else {
- gles_api_ts->driver->DrawElementsInstanced(mode,
- count,
- type,
- (const GLvoid*)(uintptr_t)indices_count,
- primcount);
+ cur_ts->gles_api_ts->driver->DrawElementsInstanced(mode,
+ count,
+ type,
+ (const GLvoid*)(uintptr_t)indices_count,
+ primcount);
}
}
-void yagl_host_glDrawRangeElements(GLenum mode,
+void yagl_host_glDrawRangeElements(struct yagl_thread_state *cur_ts,
+ GLenum mode,
GLuint start,
GLuint end,
GLsizei count,
const GLvoid *indices, int32_t indices_count)
{
if (indices) {
- GLuint current_ebo = yagl_gles_bind_ebo(indices, indices_count);
+ GLuint current_ebo = yagl_gles_bind_ebo(cur_ts, indices, indices_count);
- gles_api_ts->driver->DrawRangeElements(mode, start, end, count, type, NULL);
+ cur_ts->gles_api_ts->driver->DrawRangeElements(mode, start, end, count, type, NULL);
- gles_api_ts->driver->BindBuffer(GL_ELEMENT_ARRAY_BUFFER, current_ebo);
+ cur_ts->gles_api_ts->driver->BindBuffer(GL_ELEMENT_ARRAY_BUFFER, current_ebo);
} else {
- gles_api_ts->driver->DrawRangeElements(mode, start, end, count, type,
- (const GLvoid*)(uintptr_t)indices_count);
+ cur_ts->gles_api_ts->driver->DrawRangeElements(mode, start, end, count, type,
+ (const GLvoid*)(uintptr_t)indices_count);
}
}
-void yagl_host_glGenVertexArrays(const GLuint *arrays, int32_t arrays_count)
+void yagl_host_glGenVertexArrays(struct yagl_thread_state *cur_ts,
+ const GLuint *arrays, int32_t arrays_count)
{
int i;
for (i = 0; i < arrays_count; ++i) {
GLuint global_name;
- gles_api_ts->driver->GenVertexArrays(1, &global_name);
+ cur_ts->gles_api_ts->driver->GenVertexArrays(1, &global_name);
- yagl_gles_object_add(arrays[i],
+ yagl_gles_object_add(cur_ts,
+ arrays[i],
global_name,
- yagl_get_ctx_id(),
+ yagl_get_ctx_id(cur_ts),
&yagl_gles_vertex_array_destroy);
}
}
-void yagl_host_glBindVertexArray(GLuint array)
+void yagl_host_glBindVertexArray(struct yagl_thread_state *cur_ts,
+ GLuint array)
{
- gles_api_ts->driver->BindVertexArray(yagl_gles_object_get(array));
+ cur_ts->gles_api_ts->driver->BindVertexArray(yagl_gles_object_get(cur_ts, array));
}
-void yagl_host_glDisableVertexAttribArray(GLuint index)
+void yagl_host_glDisableVertexAttribArray(struct yagl_thread_state *cur_ts,
+ GLuint index)
{
- gles_api_ts->driver->DisableVertexAttribArray(index);
+ cur_ts->gles_api_ts->driver->DisableVertexAttribArray(index);
}
-void yagl_host_glEnableVertexAttribArray(GLuint index)
+void yagl_host_glEnableVertexAttribArray(struct yagl_thread_state *cur_ts,
+ GLuint index)
{
- gles_api_ts->driver->EnableVertexAttribArray(index);
+ cur_ts->gles_api_ts->driver->EnableVertexAttribArray(index);
}
-void yagl_host_glVertexAttribPointerData(GLuint indx,
+void yagl_host_glVertexAttribPointerData(struct yagl_thread_state *cur_ts,
+ GLuint indx,
GLint size,
GLenum type,
GLboolean normalized,
GLint first,
const GLvoid *data, int32_t data_count)
{
- GLuint current_vbo = yagl_gles_bind_array(indx, first, stride,
+ GLuint current_vbo = yagl_gles_bind_array(cur_ts, indx, first, stride,
data, data_count);
- gles_api_ts->driver->VertexAttribPointer(indx, size, type, normalized,
- stride,
- NULL);
+ cur_ts->gles_api_ts->driver->VertexAttribPointer(indx, size, type, normalized,
+ stride,
+ NULL);
- gles_api_ts->driver->BindBuffer(GL_ARRAY_BUFFER, current_vbo);
+ cur_ts->gles_api_ts->driver->BindBuffer(GL_ARRAY_BUFFER, current_vbo);
}
-void yagl_host_glVertexAttribPointerOffset(GLuint indx,
+void yagl_host_glVertexAttribPointerOffset(struct yagl_thread_state *cur_ts,
+ GLuint indx,
GLint size,
GLenum type,
GLboolean normalized,
GLsizei stride,
uintptr_t offset)
{
- gles_api_ts->driver->VertexAttribPointer(indx, size, type, normalized,
- stride,
- (const GLvoid*)offset);
+ cur_ts->gles_api_ts->driver->VertexAttribPointer(indx, size, type, normalized,
+ stride,
+ (const GLvoid*)offset);
}
-void yagl_host_glVertexPointerData(GLint size,
+void yagl_host_glVertexPointerData(struct yagl_thread_state *cur_ts,
+ GLint size,
GLenum type,
GLsizei stride,
GLint first,
const GLvoid *data, int32_t data_count)
{
- GLuint current_vbo = yagl_gles_bind_array(yagl_gles1_array_vertex,
+ GLuint current_vbo = yagl_gles_bind_array(cur_ts, yagl_gles1_array_vertex,
first, stride,
data, data_count);
- gles_api_ts->driver->VertexPointer(size, type, stride, NULL);
+ cur_ts->gles_api_ts->driver->VertexPointer(size, type, stride, NULL);
- gles_api_ts->driver->BindBuffer(GL_ARRAY_BUFFER, current_vbo);
+ cur_ts->gles_api_ts->driver->BindBuffer(GL_ARRAY_BUFFER, current_vbo);
}
-void yagl_host_glVertexPointerOffset(GLint size,
+void yagl_host_glVertexPointerOffset(struct yagl_thread_state *cur_ts,
+ GLint size,
GLenum type,
GLsizei stride,
uintptr_t offset)
{
- gles_api_ts->driver->VertexPointer(size, type, stride, (const GLvoid*)offset);
+ cur_ts->gles_api_ts->driver->VertexPointer(size, type, stride, (const GLvoid*)offset);
}
-void yagl_host_glNormalPointerData(GLenum type,
+void yagl_host_glNormalPointerData(struct yagl_thread_state *cur_ts,
+ GLenum type,
GLsizei stride,
GLint first,
const GLvoid *data, int32_t data_count)
{
- GLuint current_vbo = yagl_gles_bind_array(yagl_gles1_array_normal,
+ GLuint current_vbo = yagl_gles_bind_array(cur_ts, yagl_gles1_array_normal,
first, stride,
data, data_count);
- gles_api_ts->driver->NormalPointer(type, stride, NULL);
+ cur_ts->gles_api_ts->driver->NormalPointer(type, stride, NULL);
- gles_api_ts->driver->BindBuffer(GL_ARRAY_BUFFER, current_vbo);
+ cur_ts->gles_api_ts->driver->BindBuffer(GL_ARRAY_BUFFER, current_vbo);
}
-void yagl_host_glNormalPointerOffset(GLenum type,
+void yagl_host_glNormalPointerOffset(struct yagl_thread_state *cur_ts,
+ GLenum type,
GLsizei stride,
uintptr_t offset)
{
- gles_api_ts->driver->NormalPointer(type, stride, (const GLvoid*)offset);
+ cur_ts->gles_api_ts->driver->NormalPointer(type, stride, (const GLvoid*)offset);
}
-void yagl_host_glColorPointerData(GLint size,
+void yagl_host_glColorPointerData(struct yagl_thread_state *cur_ts,
+ GLint size,
GLenum type,
GLsizei stride,
GLint first,
const GLvoid *data, int32_t data_count)
{
- GLuint current_vbo = yagl_gles_bind_array(yagl_gles1_array_color,
+ GLuint current_vbo = yagl_gles_bind_array(cur_ts, yagl_gles1_array_color,
first, stride,
data, data_count);
- gles_api_ts->driver->ColorPointer(size, type, stride, NULL);
+ cur_ts->gles_api_ts->driver->ColorPointer(size, type, stride, NULL);
- gles_api_ts->driver->BindBuffer(GL_ARRAY_BUFFER, current_vbo);
+ cur_ts->gles_api_ts->driver->BindBuffer(GL_ARRAY_BUFFER, current_vbo);
}
-void yagl_host_glColorPointerOffset(GLint size,
+void yagl_host_glColorPointerOffset(struct yagl_thread_state *cur_ts,
+ GLint size,
GLenum type,
GLsizei stride,
uintptr_t offset)
{
- gles_api_ts->driver->ColorPointer(size, type, stride, (const GLvoid*)offset);
+ cur_ts->gles_api_ts->driver->ColorPointer(size, type, stride, (const GLvoid*)offset);
}
-void yagl_host_glTexCoordPointerData(GLint tex_id,
+void yagl_host_glTexCoordPointerData(struct yagl_thread_state *cur_ts,
+ GLint tex_id,
GLint size,
GLenum type,
GLsizei stride,
GLint first,
const GLvoid *data, int32_t data_count)
{
- GLuint current_vbo = yagl_gles_bind_array(yagl_gles1_array_texcoord + tex_id,
+ GLuint current_vbo = yagl_gles_bind_array(cur_ts, yagl_gles1_array_texcoord + tex_id,
first, stride,
data, data_count);
- gles_api_ts->driver->TexCoordPointer(size, type, stride, NULL);
+ cur_ts->gles_api_ts->driver->TexCoordPointer(size, type, stride, NULL);
- gles_api_ts->driver->BindBuffer(GL_ARRAY_BUFFER, current_vbo);
+ cur_ts->gles_api_ts->driver->BindBuffer(GL_ARRAY_BUFFER, current_vbo);
}
-void yagl_host_glTexCoordPointerOffset(GLint size,
+void yagl_host_glTexCoordPointerOffset(struct yagl_thread_state *cur_ts,
+ GLint size,
GLenum type,
GLsizei stride,
uintptr_t offset)
{
- gles_api_ts->driver->TexCoordPointer(size, type, stride, (const GLvoid*)offset);
+ cur_ts->gles_api_ts->driver->TexCoordPointer(size, type, stride, (const GLvoid*)offset);
}
-void yagl_host_glDisableClientState(GLenum array)
+void yagl_host_glDisableClientState(struct yagl_thread_state *cur_ts,
+ GLenum array)
{
- gles_api_ts->driver->DisableClientState(array);
+ cur_ts->gles_api_ts->driver->DisableClientState(array);
}
-void yagl_host_glEnableClientState(GLenum array)
+void yagl_host_glEnableClientState(struct yagl_thread_state *cur_ts,
+ GLenum array)
{
- gles_api_ts->driver->EnableClientState(array);
+ cur_ts->gles_api_ts->driver->EnableClientState(array);
}
-void yagl_host_glVertexAttribDivisor(GLuint index,
+void yagl_host_glVertexAttribDivisor(struct yagl_thread_state *cur_ts,
+ GLuint index,
GLuint divisor)
{
- gles_api_ts->driver->VertexAttribDivisor(index, divisor);
+ cur_ts->gles_api_ts->driver->VertexAttribDivisor(index, divisor);
}
-void yagl_host_glVertexAttribIPointerData(GLuint index,
+void yagl_host_glVertexAttribIPointerData(struct yagl_thread_state *cur_ts,
+ GLuint index,
GLint size,
GLenum type,
GLsizei stride,
GLint first,
const GLvoid *data, int32_t data_count)
{
- GLuint current_vbo = yagl_gles_bind_array(index, first, stride,
+ GLuint current_vbo = yagl_gles_bind_array(cur_ts, index, first, stride,
data, data_count);
- gles_api_ts->driver->VertexAttribIPointer(index, size, type, stride, NULL);
+ cur_ts->gles_api_ts->driver->VertexAttribIPointer(index, size, type, stride, NULL);
- gles_api_ts->driver->BindBuffer(GL_ARRAY_BUFFER, current_vbo);
+ cur_ts->gles_api_ts->driver->BindBuffer(GL_ARRAY_BUFFER, current_vbo);
}
-void yagl_host_glVertexAttribIPointerOffset(GLuint index,
+void yagl_host_glVertexAttribIPointerOffset(struct yagl_thread_state *cur_ts,
+ GLuint index,
GLint size,
GLenum type,
GLsizei stride,
uintptr_t offset)
{
- gles_api_ts->driver->VertexAttribIPointer(index, size, type,
- stride,
- (const GLvoid*)offset);
+ cur_ts->gles_api_ts->driver->VertexAttribIPointer(index, size, type,
+ stride,
+ (const GLvoid*)offset);
}
-void yagl_host_glGenBuffers(const GLuint *buffers, int32_t buffers_count)
+void yagl_host_glGenBuffers(struct yagl_thread_state *cur_ts,
+ const GLuint *buffers, int32_t buffers_count)
{
int i;
for (i = 0; i < buffers_count; ++i) {
GLuint global_name;
- gles_api_ts->driver->GenBuffers(1, &global_name);
+ cur_ts->gles_api_ts->driver->GenBuffers(1, &global_name);
- yagl_gles_object_add(buffers[i],
+ yagl_gles_object_add(cur_ts,
+ buffers[i],
global_name,
0,
&yagl_gles_buffer_destroy);
}
}
-void yagl_host_glBindBuffer(GLenum target,
+void yagl_host_glBindBuffer(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLuint buffer)
{
- gles_api_ts->driver->BindBuffer(target, yagl_gles_object_get(buffer));
+ cur_ts->gles_api_ts->driver->BindBuffer(target, yagl_gles_object_get(cur_ts, buffer));
}
-void yagl_host_glBufferData(GLenum target,
+void yagl_host_glBufferData(struct yagl_thread_state *cur_ts,
+ GLenum target,
const GLvoid *data, int32_t data_count,
GLenum usage)
{
- gles_api_ts->driver->BufferData(target, data_count, data, usage);
+ cur_ts->gles_api_ts->driver->BufferData(target, data_count, data, usage);
}
-void yagl_host_glBufferSubData(GLenum target,
+void yagl_host_glBufferSubData(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLsizei offset,
const GLvoid *data, int32_t data_count)
{
void *ptr;
+ struct yagl_gles_api_ts *gles_api_ts = cur_ts->gles_api_ts;
YAGL_LOG_FUNC_SET(glBufferSubData);
}
}
-void yagl_host_glBindBufferBase(GLenum target,
+void yagl_host_glBindBufferBase(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLuint index,
GLuint buffer)
{
- gles_api_ts->driver->BindBufferBase(target, index,
- yagl_gles_object_get(buffer));
+ cur_ts->gles_api_ts->driver->BindBufferBase(target, index,
+ yagl_gles_object_get(cur_ts, buffer));
}
-void yagl_host_glBindBufferRange(GLenum target,
+void yagl_host_glBindBufferRange(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLuint index,
GLuint buffer,
GLint offset,
GLsizei size)
{
- gles_api_ts->driver->BindBufferRange(target, index,
- yagl_gles_object_get(buffer),
- offset, size);
+ cur_ts->gles_api_ts->driver->BindBufferRange(target, index,
+ yagl_gles_object_get(cur_ts, buffer),
+ offset, size);
}
-void yagl_host_glMapBuffer(GLuint buffer,
+void yagl_host_glMapBuffer(struct yagl_thread_state *cur_ts,
+ GLuint buffer,
const GLuint *ranges, int32_t ranges_count,
GLvoid *data, int32_t data_maxcount, int32_t *data_count)
{
YAGL_LOG_FUNC_SET(glMapBuffer);
- gles_api_ts->driver->GetIntegerv(GL_PIXEL_PACK_BUFFER_BINDING_ARB,
+ cur_ts->gles_api_ts->driver->GetIntegerv(GL_PIXEL_PACK_BUFFER_BINDING_ARB,
(GLint*)¤t_pbo);
- gles_api_ts->driver->BindBuffer(GL_PIXEL_PACK_BUFFER_ARB, yagl_gles_object_get(buffer));
+ cur_ts->gles_api_ts->driver->BindBuffer(GL_PIXEL_PACK_BUFFER_ARB, yagl_gles_object_get(cur_ts, buffer));
- map_ptr = gles_api_ts->driver->MapBuffer(GL_PIXEL_PACK_BUFFER_ARB, GL_READ_ONLY);
+ map_ptr = cur_ts->gles_api_ts->driver->MapBuffer(GL_PIXEL_PACK_BUFFER_ARB, GL_READ_ONLY);
if (!map_ptr) {
YAGL_LOG_ERROR("glMapBuffer failed");
*data_count = data_ptr - data;
out2:
- gles_api_ts->driver->UnmapBuffer(GL_PIXEL_PACK_BUFFER_ARB);
+ cur_ts->gles_api_ts->driver->UnmapBuffer(GL_PIXEL_PACK_BUFFER_ARB);
out1:
- gles_api_ts->driver->BindBuffer(GL_PIXEL_PACK_BUFFER_ARB, current_pbo);
+ cur_ts->gles_api_ts->driver->BindBuffer(GL_PIXEL_PACK_BUFFER_ARB, current_pbo);
}
-void yagl_host_glCopyBufferSubData(GLenum readTarget,
+void yagl_host_glCopyBufferSubData(struct yagl_thread_state *cur_ts,
+ GLenum readTarget,
GLenum writeTarget,
GLintptr readOffset,
GLintptr writeOffset,
GLsizei size)
{
- gles_api_ts->driver->CopyBufferSubData(readTarget, writeTarget,
- readOffset, writeOffset, size);
+ cur_ts->gles_api_ts->driver->CopyBufferSubData(readTarget, writeTarget,
+ readOffset, writeOffset, size);
}
-void yagl_host_glGenTextures(const GLuint *textures, int32_t textures_count)
+void yagl_host_glGenTextures(struct yagl_thread_state *cur_ts,
+ const GLuint *textures, int32_t textures_count)
{
int i;
* might be called without an active context, but
* which needs to create a texture.
*/
- yagl_ensure_ctx(0);
- gles_api_ts->driver->GenTextures(1, &global_name);
- yagl_unensure_ctx(0);
+ yagl_ensure_ctx(cur_ts, 0);
+ cur_ts->gles_api_ts->driver->GenTextures(1, &global_name);
+ yagl_unensure_ctx(cur_ts, 0);
- yagl_gles_object_add(textures[i],
+ yagl_gles_object_add(cur_ts,
+ textures[i],
global_name,
0,
&yagl_gles_texture_destroy);
}
}
-void yagl_host_glBindTexture(GLenum target,
+void yagl_host_glBindTexture(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLuint texture)
{
- gles_api_ts->driver->BindTexture(target, yagl_gles_object_get(texture));
+ cur_ts->gles_api_ts->driver->BindTexture(target, yagl_gles_object_get(cur_ts, texture));
}
-void yagl_host_glActiveTexture(GLenum texture)
+void yagl_host_glActiveTexture(struct yagl_thread_state *cur_ts,
+ GLenum texture)
{
- gles_api_ts->driver->ActiveTexture(texture);
+ cur_ts->gles_api_ts->driver->ActiveTexture(texture);
}
-void yagl_host_glCopyTexImage2D(GLenum target,
+void yagl_host_glCopyTexImage2D(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLint level,
GLenum internalformat,
GLint x,
GLsizei height,
GLint border)
{
- gles_api_ts->driver->CopyTexImage2D(target,
+ cur_ts->gles_api_ts->driver->CopyTexImage2D(target,
level,
internalformat,
x,
border);
}
-void yagl_host_glCopyTexSubImage2D(GLenum target,
+void yagl_host_glCopyTexSubImage2D(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLint level,
GLint xoffset,
GLint yoffset,
GLsizei width,
GLsizei height)
{
- gles_api_ts->driver->CopyTexSubImage2D(target,
+ cur_ts->gles_api_ts->driver->CopyTexSubImage2D(target,
level,
xoffset,
yoffset,
height);
}
-void yagl_host_glGetTexParameterfv(GLenum target,
+void yagl_host_glGetTexParameterfv(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLenum pname,
GLfloat *param)
{
GLfloat params[10];
- gles_api_ts->driver->GetTexParameterfv(target,
+ cur_ts->gles_api_ts->driver->GetTexParameterfv(target,
pname,
params);
}
}
-void yagl_host_glGetTexParameteriv(GLenum target,
+void yagl_host_glGetTexParameteriv(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLenum pname,
GLint *param)
{
GLint params[10];
- gles_api_ts->driver->GetTexParameteriv(target,
+ cur_ts->gles_api_ts->driver->GetTexParameteriv(target,
pname,
params);
}
}
-void yagl_host_glTexImage2DData(GLenum target,
+void yagl_host_glTexImage2DData(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLint level,
GLint internalformat,
GLsizei width,
GLenum type,
const GLvoid *pixels, int32_t pixels_count)
{
- gles_api_ts->driver->TexImage2D(target,
+ cur_ts->gles_api_ts->driver->TexImage2D(target,
level,
internalformat,
width,
pixels);
}
-void yagl_host_glTexImage2DOffset(GLenum target,
+void yagl_host_glTexImage2DOffset(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLint level,
GLint internalformat,
GLsizei width,
GLenum type,
uintptr_t pixels)
{
- gles_api_ts->driver->TexImage2D(target,
+ cur_ts->gles_api_ts->driver->TexImage2D(target,
level,
internalformat,
width,
(const GLvoid*)pixels);
}
-void yagl_host_glTexParameterf(GLenum target,
+void yagl_host_glTexParameterf(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLenum pname,
GLfloat param)
{
- gles_api_ts->driver->TexParameterf(target, pname, param);
+ cur_ts->gles_api_ts->driver->TexParameterf(target, pname, param);
}
-void yagl_host_glTexParameterfv(GLenum target,
+void yagl_host_glTexParameterfv(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLenum pname,
const GLfloat *params, int32_t params_count)
{
tmp[0] = *params;
}
- gles_api_ts->driver->TexParameterfv(target,
- pname,
- (params ? tmp : NULL));
+ cur_ts->gles_api_ts->driver->TexParameterfv(target,
+ pname,
+ (params ? tmp : NULL));
}
-void yagl_host_glTexParameteri(GLenum target,
+void yagl_host_glTexParameteri(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLenum pname,
GLint param)
{
- gles_api_ts->driver->TexParameteri(target, pname, param);
+ cur_ts->gles_api_ts->driver->TexParameteri(target, pname, param);
}
-void yagl_host_glTexParameteriv(GLenum target,
+void yagl_host_glTexParameteriv(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLenum pname,
const GLint *params, int32_t params_count)
{
tmp[0] = *params;
}
- gles_api_ts->driver->TexParameteriv(target,
- pname,
- (params ? tmp : NULL));
+ cur_ts->gles_api_ts->driver->TexParameteriv(target,
+ pname,
+ (params ? tmp : NULL));
}
-void yagl_host_glTexSubImage2DData(GLenum target,
+void yagl_host_glTexSubImage2DData(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLint level,
GLint xoffset,
GLint yoffset,
const GLvoid *pixels, int32_t pixels_count)
{
GLint row_length;
+ struct yagl_gles_api_ts *gles_api_ts = cur_ts->gles_api_ts;
/*
* Nvidia Windows OpenGL drivers don't account for GL_UNPACK_ALIGNMENT
}
}
-void yagl_host_glTexSubImage2DOffset(GLenum target,
+void yagl_host_glTexSubImage2DOffset(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLint level,
GLint xoffset,
GLint yoffset,
uintptr_t pixels)
{
GLint row_length;
+ struct yagl_gles_api_ts *gles_api_ts = cur_ts->gles_api_ts;
/*
* Nvidia Windows OpenGL drivers don't account for GL_UNPACK_ALIGNMENT
}
}
-void yagl_host_glClientActiveTexture(GLenum texture)
+void yagl_host_glClientActiveTexture(struct yagl_thread_state *cur_ts,
+ GLenum texture)
{
- gles_api_ts->driver->ClientActiveTexture(texture);
+ cur_ts->gles_api_ts->driver->ClientActiveTexture(texture);
}
-void yagl_host_glTexEnvi(GLenum target,
+void yagl_host_glTexEnvi(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLenum pname,
GLint param)
{
- gles_api_ts->driver->TexEnvi(target, pname, param);
+ cur_ts->gles_api_ts->driver->TexEnvi(target, pname, param);
}
-void yagl_host_glTexEnvf(GLenum target,
+void yagl_host_glTexEnvf(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLenum pname,
GLfloat param)
{
- gles_api_ts->driver->TexEnvf(target, pname, param);
+ cur_ts->gles_api_ts->driver->TexEnvf(target, pname, param);
}
-void yagl_host_glMultiTexCoord4f(GLenum target,
+void yagl_host_glMultiTexCoord4f(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLfloat s,
GLfloat tt,
GLfloat r,
GLfloat q)
{
- gles_api_ts->driver->MultiTexCoord4f(target, s, tt, r, q);
+ cur_ts->gles_api_ts->driver->MultiTexCoord4f(target, s, tt, r, q);
}
-void yagl_host_glTexEnviv(GLenum target,
+void yagl_host_glTexEnviv(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLenum pname,
const GLint *params, int32_t params_count)
{
- gles_api_ts->driver->TexEnviv(target, pname, params);
+ cur_ts->gles_api_ts->driver->TexEnviv(target, pname, params);
}
-void yagl_host_glTexEnvfv(GLenum target,
+void yagl_host_glTexEnvfv(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLenum pname,
const GLfloat *params, int32_t params_count)
{
- gles_api_ts->driver->TexEnvfv(target, pname, params);
+ cur_ts->gles_api_ts->driver->TexEnvfv(target, pname, params);
}
-void yagl_host_glGetTexEnviv(GLenum env,
+void yagl_host_glGetTexEnviv(struct yagl_thread_state *cur_ts,
+ GLenum env,
GLenum pname,
GLint *params, int32_t params_maxcount, int32_t *params_count)
{
- gles_api_ts->driver->GetTexEnviv(env, pname, params);
+ cur_ts->gles_api_ts->driver->GetTexEnviv(env, pname, params);
*params_count = params_maxcount;
}
-void yagl_host_glGetTexEnvfv(GLenum env,
+void yagl_host_glGetTexEnvfv(struct yagl_thread_state *cur_ts,
+ GLenum env,
GLenum pname,
GLfloat *params, int32_t params_maxcount, int32_t *params_count)
{
- gles_api_ts->driver->GetTexEnvfv(env, pname, params);
+ cur_ts->gles_api_ts->driver->GetTexEnvfv(env, pname, params);
*params_count = params_maxcount;
}
-void yagl_host_glTexImage3DData(GLenum target,
+void yagl_host_glTexImage3DData(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLint level,
GLint internalformat,
GLsizei width,
GLenum type,
const void *pixels, int32_t pixels_count)
{
- gles_api_ts->driver->TexImage3D(target,
- level,
- internalformat,
- width,
- height,
- depth,
- border,
- format,
- type,
- pixels);
+ cur_ts->gles_api_ts->driver->TexImage3D(target,
+ level,
+ internalformat,
+ width,
+ height,
+ depth,
+ border,
+ format,
+ type,
+ pixels);
}
-void yagl_host_glTexImage3DOffset(GLenum target,
+void yagl_host_glTexImage3DOffset(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLint level,
GLint internalformat,
GLsizei width,
GLenum type,
uintptr_t pixels)
{
- gles_api_ts->driver->TexImage3D(target,
- level,
- internalformat,
- width,
- height,
- depth,
- border,
- format,
- type,
- (const void*)pixels);
+ cur_ts->gles_api_ts->driver->TexImage3D(target,
+ level,
+ internalformat,
+ width,
+ height,
+ depth,
+ border,
+ format,
+ type,
+ (const void*)pixels);
}
-void yagl_host_glTexSubImage3DData(GLenum target,
+void yagl_host_glTexSubImage3DData(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLint level,
GLint xoffset,
GLint yoffset,
GLenum type,
const void *pixels, int32_t pixels_count)
{
- gles_api_ts->driver->TexSubImage3D(target,
- level,
- xoffset,
- yoffset,
- zoffset,
- width,
- height,
- depth,
- format,
- type,
- pixels);
-}
-
-void yagl_host_glTexSubImage3DOffset(GLenum target,
+ cur_ts->gles_api_ts->driver->TexSubImage3D(target,
+ level,
+ xoffset,
+ yoffset,
+ zoffset,
+ width,
+ height,
+ depth,
+ format,
+ type,
+ pixels);
+}
+
+void yagl_host_glTexSubImage3DOffset(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLint level,
GLint xoffset,
GLint yoffset,
GLenum type,
uintptr_t pixels)
{
- gles_api_ts->driver->TexSubImage3D(target,
- level,
- xoffset,
- yoffset,
- zoffset,
- width,
- height,
- depth,
- format,
- type,
- (const void*)pixels);
-}
-
-void yagl_host_glCopyTexSubImage3D(GLenum target,
+ cur_ts->gles_api_ts->driver->TexSubImage3D(target,
+ level,
+ xoffset,
+ yoffset,
+ zoffset,
+ width,
+ height,
+ depth,
+ format,
+ type,
+ (const void*)pixels);
+}
+
+void yagl_host_glCopyTexSubImage3D(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLint level,
GLint xoffset,
GLint yoffset,
GLsizei width,
GLsizei height)
{
- gles_api_ts->driver->CopyTexSubImage3D(target,
- level,
- xoffset,
- yoffset,
- zoffset,
- x,
- y,
- width,
- height);
+ cur_ts->gles_api_ts->driver->CopyTexSubImage3D(target,
+ level,
+ xoffset,
+ yoffset,
+ zoffset,
+ x,
+ y,
+ width,
+ height);
}
-void yagl_host_glGenFramebuffers(const GLuint *framebuffers, int32_t framebuffers_count)
+void yagl_host_glGenFramebuffers(struct yagl_thread_state *cur_ts,
+ const GLuint *framebuffers, int32_t framebuffers_count)
{
int i;
for (i = 0; i < framebuffers_count; ++i) {
GLuint global_name;
- gles_api_ts->driver->GenFramebuffers(1, &global_name);
+ cur_ts->gles_api_ts->driver->GenFramebuffers(1, &global_name);
- yagl_gles_object_add(framebuffers[i],
+ yagl_gles_object_add(cur_ts,
+ framebuffers[i],
global_name,
- yagl_get_ctx_id(),
+ yagl_get_ctx_id(cur_ts),
&yagl_gles_framebuffer_destroy);
}
}
-void yagl_host_glBindFramebuffer(GLenum target,
+void yagl_host_glBindFramebuffer(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLuint framebuffer)
{
- gles_api_ts->driver->BindFramebuffer(target,
- yagl_gles_object_get(framebuffer));
+ cur_ts->gles_api_ts->driver->BindFramebufferYAGL(cur_ts,
+ target,
+ yagl_gles_object_get(cur_ts, framebuffer));
}
-void yagl_host_glFramebufferTexture2D(GLenum target,
+void yagl_host_glFramebufferTexture2D(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLenum attachment,
GLenum textarget,
GLuint texture,
GLint level)
{
- gles_api_ts->driver->FramebufferTexture2D(target, attachment,
- textarget,
- yagl_gles_object_get(texture),
- level);
+ cur_ts->gles_api_ts->driver->FramebufferTexture2D(target, attachment,
+ textarget,
+ yagl_gles_object_get(cur_ts, texture),
+ level);
}
-void yagl_host_glFramebufferRenderbuffer(GLenum target,
+void yagl_host_glFramebufferRenderbuffer(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLenum attachment,
GLenum renderbuffertarget,
GLuint renderbuffer)
{
- gles_api_ts->driver->FramebufferRenderbuffer(target,
- attachment,
- renderbuffertarget,
- yagl_gles_object_get(renderbuffer));
+ cur_ts->gles_api_ts->driver->FramebufferRenderbuffer(target,
+ attachment,
+ renderbuffertarget,
+ yagl_gles_object_get(cur_ts, renderbuffer));
}
-void yagl_host_glBlitFramebuffer(GLint srcX0,
+void yagl_host_glBlitFramebuffer(struct yagl_thread_state *cur_ts,
+ GLint srcX0,
GLint srcY0,
GLint srcX1,
GLint srcY1,
GLbitfield mask,
GLenum filter)
{
- gles_api_ts->driver->BlitFramebuffer(srcX0, srcY0, srcX1, srcY1,
- dstX0, dstY0, dstX1, dstY1,
- mask, filter);
+ cur_ts->gles_api_ts->driver->BlitFramebuffer(srcX0, srcY0, srcX1, srcY1,
+ dstX0, dstY0, dstX1, dstY1,
+ mask, filter);
}
-void yagl_host_glDrawBuffers(const GLenum *bufs, int32_t bufs_count)
+void yagl_host_glDrawBuffers(struct yagl_thread_state *cur_ts,
+ const GLenum *bufs, int32_t bufs_count)
{
- gles_api_ts->driver->DrawBuffers(bufs_count, bufs);
+ cur_ts->gles_api_ts->driver->DrawBuffers(bufs_count, bufs);
}
-void yagl_host_glReadBuffer(GLenum mode)
+void yagl_host_glReadBuffer(struct yagl_thread_state *cur_ts,
+ GLenum mode)
{
- gles_api_ts->driver->ReadBuffer(mode);
+ cur_ts->gles_api_ts->driver->ReadBuffer(mode);
}
-void yagl_host_glFramebufferTexture3D(GLenum target,
+void yagl_host_glFramebufferTexture3D(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLenum attachment,
GLenum textarget,
GLuint texture,
GLint level,
GLint zoffset)
{
- gles_api_ts->driver->FramebufferTexture3D(target, attachment,
- textarget,
- yagl_gles_object_get(texture),
- level, zoffset);
+ cur_ts->gles_api_ts->driver->FramebufferTexture3D(target, attachment,
+ textarget,
+ yagl_gles_object_get(cur_ts, texture),
+ level, zoffset);
}
-void yagl_host_glFramebufferTextureLayer(GLenum target,
+void yagl_host_glFramebufferTextureLayer(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLenum attachment,
GLuint texture,
GLint level,
GLint layer)
{
- gles_api_ts->driver->FramebufferTextureLayer(target, attachment,
- yagl_gles_object_get(texture),
- level, layer);
+ cur_ts->gles_api_ts->driver->FramebufferTextureLayer(target, attachment,
+ yagl_gles_object_get(cur_ts, texture),
+ level, layer);
}
-void yagl_host_glClearBufferiv(GLenum buffer,
+void yagl_host_glClearBufferiv(struct yagl_thread_state *cur_ts,
+ GLenum buffer,
GLint drawbuffer,
const GLint *value, int32_t value_count)
{
- gles_api_ts->driver->ClearBufferiv(buffer, drawbuffer, value);
+ cur_ts->gles_api_ts->driver->ClearBufferiv(buffer, drawbuffer, value);
}
-void yagl_host_glClearBufferuiv(GLenum buffer,
+void yagl_host_glClearBufferuiv(struct yagl_thread_state *cur_ts,
+ GLenum buffer,
GLint drawbuffer,
const GLuint *value, int32_t value_count)
{
- gles_api_ts->driver->ClearBufferuiv(buffer, drawbuffer, value);
+ cur_ts->gles_api_ts->driver->ClearBufferuiv(buffer, drawbuffer, value);
}
-void yagl_host_glClearBufferfi(GLenum buffer,
+void yagl_host_glClearBufferfi(struct yagl_thread_state *cur_ts,
+ GLenum buffer,
GLint drawbuffer,
GLfloat depth,
GLint stencil)
{
- gles_api_ts->driver->ClearBufferfi(buffer, drawbuffer, depth, stencil);
+ cur_ts->gles_api_ts->driver->ClearBufferfi(buffer, drawbuffer, depth, stencil);
}
-void yagl_host_glClearBufferfv(GLenum buffer,
+void yagl_host_glClearBufferfv(struct yagl_thread_state *cur_ts,
+ GLenum buffer,
GLint drawbuffer,
const GLfloat *value, int32_t value_count)
{
- gles_api_ts->driver->ClearBufferfv(buffer, drawbuffer, value);
+ cur_ts->gles_api_ts->driver->ClearBufferfv(buffer, drawbuffer, value);
}
-void yagl_host_glGenRenderbuffers(const GLuint *renderbuffers, int32_t renderbuffers_count)
+void yagl_host_glGenRenderbuffers(struct yagl_thread_state *cur_ts,
+ const GLuint *renderbuffers, int32_t renderbuffers_count)
{
int i;
for (i = 0; i < renderbuffers_count; ++i) {
GLuint global_name;
- gles_api_ts->driver->GenRenderbuffers(1, &global_name);
+ cur_ts->gles_api_ts->driver->GenRenderbuffers(1, &global_name);
- yagl_gles_object_add(renderbuffers[i],
+ yagl_gles_object_add(cur_ts,
+ renderbuffers[i],
global_name,
0,
&yagl_gles_renderbuffer_destroy);
}
}
-void yagl_host_glBindRenderbuffer(GLenum target,
+void yagl_host_glBindRenderbuffer(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLuint renderbuffer)
{
- gles_api_ts->driver->BindRenderbuffer(target,
- yagl_gles_object_get(renderbuffer));
+ cur_ts->gles_api_ts->driver->BindRenderbuffer(target,
+ yagl_gles_object_get(cur_ts, renderbuffer));
}
-void yagl_host_glRenderbufferStorage(GLenum target,
+void yagl_host_glRenderbufferStorage(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLenum internalformat,
GLsizei width,
GLsizei height)
{
- gles_api_ts->driver->RenderbufferStorage(target, internalformat, width, height);
+ cur_ts->gles_api_ts->driver->RenderbufferStorage(target, internalformat, width, height);
}
-void yagl_host_glGetRenderbufferParameteriv(GLenum target,
+void yagl_host_glGetRenderbufferParameteriv(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLenum pname,
GLint *param)
{
GLint params[10];
- gles_api_ts->driver->GetRenderbufferParameteriv(target,
+ cur_ts->gles_api_ts->driver->GetRenderbufferParameteriv(target,
pname,
params);
}
}
-void yagl_host_glRenderbufferStorageMultisample(GLenum target,
+void yagl_host_glRenderbufferStorageMultisample(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLsizei samples,
GLenum internalformat,
GLsizei width,
GLsizei height)
{
- gles_api_ts->driver->RenderbufferStorageMultisample(target, samples, internalformat, width, height);
+ cur_ts->gles_api_ts->driver->RenderbufferStorageMultisample(target, samples, internalformat, width, height);
}
-void yagl_host_glCreateProgram(GLuint program)
+void yagl_host_glCreateProgram(struct yagl_thread_state *cur_ts,
+ GLuint program)
{
- GLuint global_name = gles_api_ts->driver->CreateProgram();
+ GLuint global_name = cur_ts->gles_api_ts->driver->CreateProgram();
- yagl_gles_object_add(program,
+ yagl_gles_object_add(cur_ts,
+ program,
global_name,
0,
&yagl_gles_program_destroy);
}
-void yagl_host_glCreateShader(GLuint shader,
+void yagl_host_glCreateShader(struct yagl_thread_state *cur_ts,
+ GLuint shader,
GLenum type)
{
- GLuint global_name = gles_api_ts->driver->CreateShader(type);
+ GLuint global_name = cur_ts->gles_api_ts->driver->CreateShader(type);
- yagl_gles_object_add(shader,
+ yagl_gles_object_add(cur_ts,
+ shader,
global_name,
0,
&yagl_gles_shader_destroy);
}
-void yagl_host_glShaderSource(GLuint shader,
+void yagl_host_glShaderSource(struct yagl_thread_state *cur_ts,
+ GLuint shader,
const GLchar *string, int32_t string_count)
{
const GLchar *strings[1];
strings[0] = string;
lenghts[0] = string_count - 1;
- gles_api_ts->driver->ShaderSource(yagl_gles_object_get(shader),
- 1,
- strings,
- lenghts);
+ cur_ts->gles_api_ts->driver->ShaderSource(yagl_gles_object_get(cur_ts, shader),
+ 1,
+ strings,
+ lenghts);
}
-void yagl_host_glAttachShader(GLuint program,
+void yagl_host_glAttachShader(struct yagl_thread_state *cur_ts,
+ GLuint program,
GLuint shader)
{
- gles_api_ts->driver->AttachShader(yagl_gles_object_get(program),
- yagl_gles_object_get(shader));
+ cur_ts->gles_api_ts->driver->AttachShader(yagl_gles_object_get(cur_ts, program),
+ yagl_gles_object_get(cur_ts, shader));
}
-void yagl_host_glDetachShader(GLuint program,
+void yagl_host_glDetachShader(struct yagl_thread_state *cur_ts,
+ GLuint program,
GLuint shader)
{
- gles_api_ts->driver->DetachShader(yagl_gles_object_get(program),
- yagl_gles_object_get(shader));
+ cur_ts->gles_api_ts->driver->DetachShader(yagl_gles_object_get(cur_ts, program),
+ yagl_gles_object_get(cur_ts, shader));
}
-void yagl_host_glCompileShader(GLuint shader)
+void yagl_host_glCompileShader(struct yagl_thread_state *cur_ts,
+ GLuint shader)
{
+ struct yagl_gles_api_ts *gles_api_ts = cur_ts->gles_api_ts;
#ifndef CONFIG_DARWIN
- gles_api_ts->driver->CompileShader(yagl_gles_object_get(shader));
+ gles_api_ts->driver->CompileShader(yagl_gles_object_get(cur_ts, shader));
#else
GLint tmp = 0;
YAGL_LOG_FUNC_SET(glCompileShader);
- gles_api_ts->driver->CompileShader(yagl_gles_object_get(shader));
+ gles_api_ts->driver->CompileShader(yagl_gles_object_get(cur_ts, shader));
- gles_api_ts->driver->GetShaderiv(yagl_gles_object_get(shader), GL_COMPILE_STATUS, &tmp);
+ gles_api_ts->driver->GetShaderiv(yagl_gles_object_get(cur_ts, shader), GL_COMPILE_STATUS, &tmp);
if (tmp == GL_FALSE) {
char *buff;
char *substring;
const char texture_lookup_define[] = "#define TextureLookup texture2D";
tmp = 0;
- gles_api_ts->driver->GetShaderiv(yagl_gles_object_get(shader), GL_INFO_LOG_LENGTH, &tmp);
+ gles_api_ts->driver->GetShaderiv(yagl_gles_object_get(cur_ts, shader), GL_INFO_LOG_LENGTH, &tmp);
buff = g_malloc0(tmp);
- gles_api_ts->driver->GetShaderInfoLog(yagl_gles_object_get(shader), tmp, NULL, buff);
+ gles_api_ts->driver->GetShaderInfoLog(yagl_gles_object_get(cur_ts, shader), tmp, NULL, buff);
if (gles_api_ts->driver->gl_version < yagl_gl_3_2 ||
strstr(buff, textue2d_err) == NULL) {
YAGL_LOG_ERROR("Unable to compile shader %s", buff);
g_free(buff);
tmp = 0;
- gles_api_ts->driver->GetShaderiv(yagl_gles_object_get(shader), GL_SHADER_SOURCE_LENGTH, &tmp);
+ gles_api_ts->driver->GetShaderiv(yagl_gles_object_get(cur_ts, shader), GL_SHADER_SOURCE_LENGTH, &tmp);
buff = g_malloc0(tmp);
- gles_api_ts->driver->GetShaderSource(yagl_gles_object_get(shader), tmp, NULL, buff);
+ gles_api_ts->driver->GetShaderSource(yagl_gles_object_get(cur_ts, shader), tmp, NULL, buff);
YAGL_LOG_DEBUG("Shader Source: \n%s", buff);
substring = strstr(buff, texture_lookup_define);
strings[0] = buff;
lenghts[0] = tmp - 1;
- gles_api_ts->driver->ShaderSource(yagl_gles_object_get(shader),
+ gles_api_ts->driver->ShaderSource(yagl_gles_object_get(cur_ts, shader),
1,
strings,
lenghts);
- gles_api_ts->driver->CompileShader(yagl_gles_object_get(shader));
- gles_api_ts->driver->GetShaderiv(yagl_gles_object_get(shader), GL_COMPILE_STATUS, &tmp);
+ gles_api_ts->driver->CompileShader(yagl_gles_object_get(cur_ts, shader));
+ gles_api_ts->driver->GetShaderiv(yagl_gles_object_get(cur_ts, shader), GL_COMPILE_STATUS, &tmp);
if (!tmp) {
YAGL_LOG_ERROR("Unable to compile the patched shader source: \n%s", buff);
g_free(buff);
tmp = 0;
- gles_api_ts->driver->GetShaderiv(yagl_gles_object_get(shader), GL_INFO_LOG_LENGTH, &tmp);
+ gles_api_ts->driver->GetShaderiv(yagl_gles_object_get(cur_ts, shader), GL_INFO_LOG_LENGTH, &tmp);
buff = g_malloc0(tmp);
- gles_api_ts->driver->GetShaderInfoLog(yagl_gles_object_get(shader), tmp, NULL, buff);
+ gles_api_ts->driver->GetShaderInfoLog(yagl_gles_object_get(cur_ts, shader), tmp, NULL, buff);
YAGL_LOG_ERROR("Cause of compilation failure: %s", buff);
}
}
#endif
}
-void yagl_host_glBindAttribLocation(GLuint program,
+void yagl_host_glBindAttribLocation(struct yagl_thread_state *cur_ts,
+ GLuint program,
GLuint index,
const GLchar *name, int32_t name_count)
{
- gles_api_ts->driver->BindAttribLocation(yagl_gles_object_get(program),
- index,
- name);
+ cur_ts->gles_api_ts->driver->BindAttribLocation(yagl_gles_object_get(cur_ts, program),
+ index,
+ name);
}
-void yagl_host_glGetActiveAttrib(GLuint program,
+void yagl_host_glGetActiveAttrib(struct yagl_thread_state *cur_ts,
+ GLuint program,
GLuint index,
GLint *size,
GLenum *type,
{
GLsizei tmp = -1;
- gles_api_ts->driver->GetActiveAttrib(yagl_gles_object_get(program),
- index,
- name_maxcount,
- &tmp,
- size,
- type,
- name);
+ cur_ts->gles_api_ts->driver->GetActiveAttrib(yagl_gles_object_get(cur_ts, program),
+ index,
+ name_maxcount,
+ &tmp,
+ size,
+ type,
+ name);
if (tmp >= 0) {
*name_count = MIN(tmp + 1, name_maxcount);
}
}
-void yagl_host_glGetActiveUniform(GLuint program,
+void yagl_host_glGetActiveUniform(struct yagl_thread_state *cur_ts,
+ GLuint program,
GLuint index,
GLint *size,
GLenum *type,
{
GLsizei tmp = -1;
- gles_api_ts->driver->GetActiveUniform(yagl_gles_object_get(program),
- index,
- name_maxcount,
- &tmp,
- size,
- type,
- name);
+ cur_ts->gles_api_ts->driver->GetActiveUniform(yagl_gles_object_get(cur_ts, program),
+ index,
+ name_maxcount,
+ &tmp,
+ size,
+ type,
+ name);
if (tmp >= 0) {
*name_count = MIN(tmp + 1, name_maxcount);
}
}
-int yagl_host_glGetAttribLocation(GLuint program,
+int yagl_host_glGetAttribLocation(struct yagl_thread_state *cur_ts,
+ GLuint program,
const GLchar *name, int32_t name_count)
{
- return gles_api_ts->driver->GetAttribLocation(yagl_gles_object_get(program),
- name);
+ return cur_ts->gles_api_ts->driver->GetAttribLocation(yagl_gles_object_get(cur_ts, program),
+ name);
}
-void yagl_host_glGetProgramiv(GLuint program,
+void yagl_host_glGetProgramiv(struct yagl_thread_state *cur_ts,
+ GLuint program,
GLenum pname,
GLint *param)
{
- gles_api_ts->driver->GetProgramiv(yagl_gles_object_get(program),
- pname,
- param);
+ cur_ts->gles_api_ts->driver->GetProgramiv(yagl_gles_object_get(cur_ts, program),
+ pname,
+ param);
}
-GLboolean yagl_host_glGetProgramInfoLog(GLuint program,
+GLboolean yagl_host_glGetProgramInfoLog(struct yagl_thread_state *cur_ts,
+ GLuint program,
GLchar *infolog, int32_t infolog_maxcount, int32_t *infolog_count)
{
GLsizei tmp = -1;
- gles_api_ts->driver->GetProgramInfoLog(yagl_gles_object_get(program),
- infolog_maxcount,
- &tmp,
- infolog);
+ cur_ts->gles_api_ts->driver->GetProgramInfoLog(yagl_gles_object_get(cur_ts, program),
+ infolog_maxcount,
+ &tmp,
+ infolog);
if (tmp >= 0) {
*infolog_count = MIN(tmp + 1, infolog_maxcount);
}
}
-void yagl_host_glGetShaderiv(GLuint shader,
+void yagl_host_glGetShaderiv(struct yagl_thread_state *cur_ts,
+ GLuint shader,
GLenum pname,
GLint *param)
{
- gles_api_ts->driver->GetShaderiv(yagl_gles_object_get(shader),
- pname,
- param);
+ cur_ts->gles_api_ts->driver->GetShaderiv(yagl_gles_object_get(cur_ts, shader),
+ pname,
+ param);
}
-GLboolean yagl_host_glGetShaderInfoLog(GLuint shader,
+GLboolean yagl_host_glGetShaderInfoLog(struct yagl_thread_state *cur_ts,
+ GLuint shader,
GLchar *infolog, int32_t infolog_maxcount, int32_t *infolog_count)
{
GLsizei tmp = -1;
- gles_api_ts->driver->GetShaderInfoLog(yagl_gles_object_get(shader),
- infolog_maxcount,
- &tmp,
- infolog);
+ cur_ts->gles_api_ts->driver->GetShaderInfoLog(yagl_gles_object_get(cur_ts, shader),
+ infolog_maxcount,
+ &tmp,
+ infolog);
if (tmp >= 0) {
*infolog_count = MIN(tmp + 1, infolog_maxcount);
}
}
-void yagl_host_glGetUniformfv(GLboolean tl,
+void yagl_host_glGetUniformfv(struct yagl_thread_state *cur_ts,
+ GLboolean tl,
GLuint program,
uint32_t location,
GLfloat *params, int32_t params_maxcount, int32_t *params_count)
{
GLenum type;
- GLuint global_name = yagl_gles_object_get(program);
- GLint actual_location = yagl_gles_api_ps_translate_location(gles_api_ts->ps,
+ GLuint global_name = yagl_gles_object_get(cur_ts, program);
+ GLint actual_location = yagl_gles_api_ps_translate_location(cur_ts->gles_api_ts->ps,
tl,
location);
- if (!yagl_gles_program_get_uniform_type(global_name,
+ if (!yagl_gles_program_get_uniform_type(cur_ts,
+ global_name,
actual_location,
&type)) {
return;
return;
}
- gles_api_ts->driver->GetUniformfv(global_name,
- actual_location,
- params);
+ cur_ts->gles_api_ts->driver->GetUniformfv(global_name,
+ actual_location,
+ params);
}
-void yagl_host_glGetUniformiv(GLboolean tl,
+void yagl_host_glGetUniformiv(struct yagl_thread_state *cur_ts,
+ GLboolean tl,
GLuint program,
uint32_t location,
GLint *params, int32_t params_maxcount, int32_t *params_count)
{
GLenum type;
- GLuint global_name = yagl_gles_object_get(program);
- GLint actual_location = yagl_gles_api_ps_translate_location(gles_api_ts->ps,
+ GLuint global_name = yagl_gles_object_get(cur_ts, program);
+ GLint actual_location = yagl_gles_api_ps_translate_location(cur_ts->gles_api_ts->ps,
tl,
location);
- if (!yagl_gles_program_get_uniform_type(global_name,
+ if (!yagl_gles_program_get_uniform_type(cur_ts,
+ global_name,
actual_location,
&type)) {
return;
return;
}
- gles_api_ts->driver->GetUniformiv(global_name,
- actual_location,
- params);
+ cur_ts->gles_api_ts->driver->GetUniformiv(global_name,
+ actual_location,
+ params);
}
-int yagl_host_glGetUniformLocation(GLuint program,
+int yagl_host_glGetUniformLocation(struct yagl_thread_state *cur_ts,
+ GLuint program,
const GLchar *name, int32_t name_count)
{
- return gles_api_ts->driver->GetUniformLocation(yagl_gles_object_get(program),
- name);
+ return cur_ts->gles_api_ts->driver->GetUniformLocation(yagl_gles_object_get(cur_ts, program),
+ name);
}
-void yagl_host_glGetVertexAttribfv(GLuint index,
+void yagl_host_glGetVertexAttribfv(struct yagl_thread_state *cur_ts,
+ GLuint index,
GLenum pname,
GLfloat *params, int32_t params_maxcount, int32_t *params_count)
{
return;
}
- gles_api_ts->driver->GetVertexAttribfv(index, pname, params);
+ cur_ts->gles_api_ts->driver->GetVertexAttribfv(index, pname, params);
}
-void yagl_host_glGetVertexAttribiv(GLuint index,
+void yagl_host_glGetVertexAttribiv(struct yagl_thread_state *cur_ts,
+ GLuint index,
GLenum pname,
GLint *params, int32_t params_maxcount, int32_t *params_count)
{
return;
}
- gles_api_ts->driver->GetVertexAttribiv(index, pname, params);
+ cur_ts->gles_api_ts->driver->GetVertexAttribiv(index, pname, params);
}
-void yagl_host_glLinkProgram(GLuint program,
+void yagl_host_glLinkProgram(struct yagl_thread_state *cur_ts,
+ GLuint program,
GLint *params, int32_t params_maxcount, int32_t *params_count)
{
- GLuint obj = yagl_gles_object_get(program);
+ GLuint obj = yagl_gles_object_get(cur_ts, program);
+ struct yagl_gles_api_ts *gles_api_ts = cur_ts->gles_api_ts;
gles_api_ts->driver->LinkProgram(obj);
}
}
-void yagl_host_glUniform1f(GLboolean tl,
+void yagl_host_glUniform1f(struct yagl_thread_state *cur_ts,
+ GLboolean tl,
uint32_t location,
GLfloat x)
{
- gles_api_ts->driver->Uniform1f(
- yagl_gles_api_ps_translate_location(gles_api_ts->ps, tl, location), x);
+ cur_ts->gles_api_ts->driver->Uniform1f(
+ yagl_gles_api_ps_translate_location(cur_ts->gles_api_ts->ps, tl, location), x);
}
-void yagl_host_glUniform1fv(GLboolean tl,
+void yagl_host_glUniform1fv(struct yagl_thread_state *cur_ts,
+ GLboolean tl,
uint32_t location,
const GLfloat *v, int32_t v_count)
{
- gles_api_ts->driver->Uniform1fv(
- yagl_gles_api_ps_translate_location(gles_api_ts->ps, tl, location),
+ cur_ts->gles_api_ts->driver->Uniform1fv(
+ yagl_gles_api_ps_translate_location(cur_ts->gles_api_ts->ps, tl, location),
v_count, v);
}
-void yagl_host_glUniform1i(GLboolean tl,
+void yagl_host_glUniform1i(struct yagl_thread_state *cur_ts,
+ GLboolean tl,
uint32_t location,
GLint x)
{
- gles_api_ts->driver->Uniform1i(
- yagl_gles_api_ps_translate_location(gles_api_ts->ps, tl, location),
+ cur_ts->gles_api_ts->driver->Uniform1i(
+ yagl_gles_api_ps_translate_location(cur_ts->gles_api_ts->ps, tl, location),
x);
}
-void yagl_host_glUniform1iv(GLboolean tl,
+void yagl_host_glUniform1iv(struct yagl_thread_state *cur_ts,
+ GLboolean tl,
uint32_t location,
const GLint *v, int32_t v_count)
{
- gles_api_ts->driver->Uniform1iv(
- yagl_gles_api_ps_translate_location(gles_api_ts->ps, tl, location),
+ cur_ts->gles_api_ts->driver->Uniform1iv(
+ yagl_gles_api_ps_translate_location(cur_ts->gles_api_ts->ps, tl, location),
v_count, v);
}
-void yagl_host_glUniform2f(GLboolean tl,
+void yagl_host_glUniform2f(struct yagl_thread_state *cur_ts,
+ GLboolean tl,
uint32_t location,
GLfloat x,
GLfloat y)
{
- gles_api_ts->driver->Uniform2f(
- yagl_gles_api_ps_translate_location(gles_api_ts->ps, tl, location),
+ cur_ts->gles_api_ts->driver->Uniform2f(
+ yagl_gles_api_ps_translate_location(cur_ts->gles_api_ts->ps, tl, location),
x, y);
}
-void yagl_host_glUniform2fv(GLboolean tl,
+void yagl_host_glUniform2fv(struct yagl_thread_state *cur_ts,
+ GLboolean tl,
uint32_t location,
const GLfloat *v, int32_t v_count)
{
- gles_api_ts->driver->Uniform2fv(
- yagl_gles_api_ps_translate_location(gles_api_ts->ps, tl, location),
+ cur_ts->gles_api_ts->driver->Uniform2fv(
+ yagl_gles_api_ps_translate_location(cur_ts->gles_api_ts->ps, tl, location),
(v_count / 2), v);
}
-void yagl_host_glUniform2i(GLboolean tl,
+void yagl_host_glUniform2i(struct yagl_thread_state *cur_ts,
+ GLboolean tl,
uint32_t location,
GLint x,
GLint y)
{
- gles_api_ts->driver->Uniform2i(
- yagl_gles_api_ps_translate_location(gles_api_ts->ps, tl, location),
+ cur_ts->gles_api_ts->driver->Uniform2i(
+ yagl_gles_api_ps_translate_location(cur_ts->gles_api_ts->ps, tl, location),
x, y);
}
-void yagl_host_glUniform2iv(GLboolean tl,
+void yagl_host_glUniform2iv(struct yagl_thread_state *cur_ts,
+ GLboolean tl,
uint32_t location,
const GLint *v, int32_t v_count)
{
- gles_api_ts->driver->Uniform2iv(
- yagl_gles_api_ps_translate_location(gles_api_ts->ps, tl, location),
+ cur_ts->gles_api_ts->driver->Uniform2iv(
+ yagl_gles_api_ps_translate_location(cur_ts->gles_api_ts->ps, tl, location),
(v_count / 2), v);
}
-void yagl_host_glUniform3f(GLboolean tl,
+void yagl_host_glUniform3f(struct yagl_thread_state *cur_ts,
+ GLboolean tl,
uint32_t location,
GLfloat x,
GLfloat y,
GLfloat z)
{
- gles_api_ts->driver->Uniform3f(
- yagl_gles_api_ps_translate_location(gles_api_ts->ps, tl, location),
+ cur_ts->gles_api_ts->driver->Uniform3f(
+ yagl_gles_api_ps_translate_location(cur_ts->gles_api_ts->ps, tl, location),
x, y, z);
}
-void yagl_host_glUniform3fv(GLboolean tl,
+void yagl_host_glUniform3fv(struct yagl_thread_state *cur_ts,
+ GLboolean tl,
uint32_t location,
const GLfloat *v, int32_t v_count)
{
- gles_api_ts->driver->Uniform3fv(
- yagl_gles_api_ps_translate_location(gles_api_ts->ps, tl, location),
+ cur_ts->gles_api_ts->driver->Uniform3fv(
+ yagl_gles_api_ps_translate_location(cur_ts->gles_api_ts->ps, tl, location),
(v_count / 3), v);
}
-void yagl_host_glUniform3i(GLboolean tl,
+void yagl_host_glUniform3i(struct yagl_thread_state *cur_ts,
+ GLboolean tl,
uint32_t location,
GLint x,
GLint y,
GLint z)
{
- gles_api_ts->driver->Uniform3i(
- yagl_gles_api_ps_translate_location(gles_api_ts->ps, tl, location),
+ cur_ts->gles_api_ts->driver->Uniform3i(
+ yagl_gles_api_ps_translate_location(cur_ts->gles_api_ts->ps, tl, location),
x, y, z);
}
-void yagl_host_glUniform3iv(GLboolean tl,
+void yagl_host_glUniform3iv(struct yagl_thread_state *cur_ts,
+ GLboolean tl,
uint32_t location,
const GLint *v, int32_t v_count)
{
- gles_api_ts->driver->Uniform3iv(
- yagl_gles_api_ps_translate_location(gles_api_ts->ps, tl, location),
+ cur_ts->gles_api_ts->driver->Uniform3iv(
+ yagl_gles_api_ps_translate_location(cur_ts->gles_api_ts->ps, tl, location),
(v_count / 3), v);
}
-void yagl_host_glUniform4f(GLboolean tl,
+void yagl_host_glUniform4f(struct yagl_thread_state *cur_ts,
+ GLboolean tl,
uint32_t location,
GLfloat x,
GLfloat y,
GLfloat z,
GLfloat w)
{
- gles_api_ts->driver->Uniform4f(
- yagl_gles_api_ps_translate_location(gles_api_ts->ps, tl, location),
+ cur_ts->gles_api_ts->driver->Uniform4f(
+ yagl_gles_api_ps_translate_location(cur_ts->gles_api_ts->ps, tl, location),
x, y, z, w);
}
-void yagl_host_glUniform4fv(GLboolean tl,
+void yagl_host_glUniform4fv(struct yagl_thread_state *cur_ts,
+ GLboolean tl,
uint32_t location,
const GLfloat *v, int32_t v_count)
{
- gles_api_ts->driver->Uniform4fv(
- yagl_gles_api_ps_translate_location(gles_api_ts->ps, tl, location),
+ cur_ts->gles_api_ts->driver->Uniform4fv(
+ yagl_gles_api_ps_translate_location(cur_ts->gles_api_ts->ps, tl, location),
(v_count / 4), v);
}
-void yagl_host_glUniform4i(GLboolean tl,
+void yagl_host_glUniform4i(struct yagl_thread_state *cur_ts,
+ GLboolean tl,
uint32_t location,
GLint x,
GLint y,
GLint z,
GLint w)
{
- gles_api_ts->driver->Uniform4i(
- yagl_gles_api_ps_translate_location(gles_api_ts->ps, tl, location),
+ cur_ts->gles_api_ts->driver->Uniform4i(
+ yagl_gles_api_ps_translate_location(cur_ts->gles_api_ts->ps, tl, location),
x, y, z, w);
}
-void yagl_host_glUniform4iv(GLboolean tl,
+void yagl_host_glUniform4iv(struct yagl_thread_state *cur_ts,
+ GLboolean tl,
uint32_t location,
const GLint *v, int32_t v_count)
{
- gles_api_ts->driver->Uniform4iv(
- yagl_gles_api_ps_translate_location(gles_api_ts->ps, tl, location),
+ cur_ts->gles_api_ts->driver->Uniform4iv(
+ yagl_gles_api_ps_translate_location(cur_ts->gles_api_ts->ps, tl, location),
(v_count / 4), v);
}
-void yagl_host_glUniformMatrix2fv(GLboolean tl,
+void yagl_host_glUniformMatrix2fv(struct yagl_thread_state *cur_ts,
+ GLboolean tl,
uint32_t location,
GLboolean transpose,
const GLfloat *value, int32_t value_count)
{
- gles_api_ts->driver->UniformMatrix2fv(
- yagl_gles_api_ps_translate_location(gles_api_ts->ps, tl, location),
+ cur_ts->gles_api_ts->driver->UniformMatrix2fv(
+ yagl_gles_api_ps_translate_location(cur_ts->gles_api_ts->ps, tl, location),
value_count / (2 * 2), transpose, value);
}
-void yagl_host_glUniformMatrix3fv(GLboolean tl,
+void yagl_host_glUniformMatrix3fv(struct yagl_thread_state *cur_ts,
+ GLboolean tl,
uint32_t location,
GLboolean transpose,
const GLfloat *value, int32_t value_count)
{
- gles_api_ts->driver->UniformMatrix3fv(
- yagl_gles_api_ps_translate_location(gles_api_ts->ps, tl, location),
+ cur_ts->gles_api_ts->driver->UniformMatrix3fv(
+ yagl_gles_api_ps_translate_location(cur_ts->gles_api_ts->ps, tl, location),
value_count / (3 * 3), transpose, value);
}
-void yagl_host_glUniformMatrix4fv(GLboolean tl,
+void yagl_host_glUniformMatrix4fv(struct yagl_thread_state *cur_ts,
+ GLboolean tl,
uint32_t location,
GLboolean transpose,
const GLfloat *value, int32_t value_count)
{
- gles_api_ts->driver->UniformMatrix4fv(
- yagl_gles_api_ps_translate_location(gles_api_ts->ps, tl, location),
+ cur_ts->gles_api_ts->driver->UniformMatrix4fv(
+ yagl_gles_api_ps_translate_location(cur_ts->gles_api_ts->ps, tl, location),
value_count / (4 * 4), transpose, value);
}
-void yagl_host_glUseProgram(GLuint program)
+void yagl_host_glUseProgram(struct yagl_thread_state *cur_ts,
+ GLuint program)
{
- gles_api_ts->driver->UseProgram(yagl_gles_object_get(program));
+ cur_ts->gles_api_ts->driver->UseProgram(yagl_gles_object_get(cur_ts, program));
}
-void yagl_host_glValidateProgram(GLuint program)
+void yagl_host_glValidateProgram(struct yagl_thread_state *cur_ts,
+ GLuint program)
{
- gles_api_ts->driver->ValidateProgram(yagl_gles_object_get(program));
+ cur_ts->gles_api_ts->driver->ValidateProgram(yagl_gles_object_get(cur_ts, program));
}
-void yagl_host_glVertexAttrib1f(GLuint indx,
+void yagl_host_glVertexAttrib1f(struct yagl_thread_state *cur_ts,
+ GLuint indx,
GLfloat x)
{
- gles_api_ts->driver->VertexAttrib1f(indx, x);
+ cur_ts->gles_api_ts->driver->VertexAttrib1f(indx, x);
}
-void yagl_host_glVertexAttrib1fv(GLuint indx,
+void yagl_host_glVertexAttrib1fv(struct yagl_thread_state *cur_ts,
+ GLuint indx,
const GLfloat *values, int32_t values_count)
{
- gles_api_ts->driver->VertexAttrib1fv(indx, values);
+ cur_ts->gles_api_ts->driver->VertexAttrib1fv(indx, values);
}
-void yagl_host_glVertexAttrib2f(GLuint indx,
+void yagl_host_glVertexAttrib2f(struct yagl_thread_state *cur_ts,
+ GLuint indx,
GLfloat x,
GLfloat y)
{
- gles_api_ts->driver->VertexAttrib2f(indx, x, y);
+ cur_ts->gles_api_ts->driver->VertexAttrib2f(indx, x, y);
}
-void yagl_host_glVertexAttrib2fv(GLuint indx,
+void yagl_host_glVertexAttrib2fv(struct yagl_thread_state *cur_ts,
+ GLuint indx,
const GLfloat *values, int32_t values_count)
{
- gles_api_ts->driver->VertexAttrib2fv(indx, values);
+ cur_ts->gles_api_ts->driver->VertexAttrib2fv(indx, values);
}
-void yagl_host_glVertexAttrib3f(GLuint indx,
+void yagl_host_glVertexAttrib3f(struct yagl_thread_state *cur_ts,
+ GLuint indx,
GLfloat x,
GLfloat y,
GLfloat z)
{
- gles_api_ts->driver->VertexAttrib3f(indx, x, y, z);
+ cur_ts->gles_api_ts->driver->VertexAttrib3f(indx, x, y, z);
}
-void yagl_host_glVertexAttrib3fv(GLuint indx,
+void yagl_host_glVertexAttrib3fv(struct yagl_thread_state *cur_ts,
+ GLuint indx,
const GLfloat *values, int32_t values_count)
{
- gles_api_ts->driver->VertexAttrib3fv(indx, values);
+ cur_ts->gles_api_ts->driver->VertexAttrib3fv(indx, values);
}
-void yagl_host_glVertexAttrib4f(GLuint indx,
+void yagl_host_glVertexAttrib4f(struct yagl_thread_state *cur_ts,
+ GLuint indx,
GLfloat x,
GLfloat y,
GLfloat z,
GLfloat w)
{
- gles_api_ts->driver->VertexAttrib4f(indx, x, y, z, w);
+ cur_ts->gles_api_ts->driver->VertexAttrib4f(indx, x, y, z, w);
}
-void yagl_host_glVertexAttrib4fv(GLuint indx,
+void yagl_host_glVertexAttrib4fv(struct yagl_thread_state *cur_ts,
+ GLuint indx,
const GLfloat *values, int32_t values_count)
{
- gles_api_ts->driver->VertexAttrib4fv(indx, values);
+ cur_ts->gles_api_ts->driver->VertexAttrib4fv(indx, values);
}
-void yagl_host_glGetActiveUniformsiv(GLuint program,
+void yagl_host_glGetActiveUniformsiv(struct yagl_thread_state *cur_ts,
+ GLuint program,
const GLuint *uniformIndices, int32_t uniformIndices_count,
GLint *params, int32_t params_maxcount, int32_t *params_count)
{
GL_UNIFORM_MATRIX_STRIDE,
GL_UNIFORM_IS_ROW_MAJOR
};
- GLuint obj = yagl_gles_object_get(program);
+ GLuint obj = yagl_gles_object_get(cur_ts, program);
int i, num_pnames = sizeof(pnames)/sizeof(pnames[0]);
if (params_maxcount != (uniformIndices_count * num_pnames)) {
}
for (i = 0; i < num_pnames; ++i) {
- gles_api_ts->driver->GetActiveUniformsiv(obj,
- uniformIndices_count,
- uniformIndices,
- pnames[i],
- params);
+ cur_ts->gles_api_ts->driver->GetActiveUniformsiv(obj,
+ uniformIndices_count,
+ uniformIndices,
+ pnames[i],
+ params);
params += uniformIndices_count;
}
*params_count = uniformIndices_count * num_pnames;
}
-void yagl_host_glGetUniformIndices(GLuint program,
+void yagl_host_glGetUniformIndices(struct yagl_thread_state *cur_ts,
+ GLuint program,
const GLchar *uniformNames, int32_t uniformNames_count,
GLuint *uniformIndices, int32_t uniformIndices_maxcount, int32_t *uniformIndices_count)
{
const GLchar **name_pointers;
int num_active_uniforms = 0;
GLchar *uniform_name;
+ struct yagl_gles_api_ts *gles_api_ts = cur_ts->gles_api_ts;
YAGL_LOG_FUNC_SET(glGetUniformIndices);
- obj = yagl_gles_object_get(program);
+ obj = yagl_gles_object_get(cur_ts, program);
gles_api_ts->driver->GetProgramiv(obj,
GL_ACTIVE_UNIFORM_MAX_LENGTH,
g_free(uniform_name);
}
-GLuint yagl_host_glGetUniformBlockIndex(GLuint program,
+GLuint yagl_host_glGetUniformBlockIndex(struct yagl_thread_state *cur_ts,
+ GLuint program,
const GLchar *uniformBlockName, int32_t uniformBlockName_count)
{
- return gles_api_ts->driver->GetUniformBlockIndex(yagl_gles_object_get(program),
- uniformBlockName);
+ return cur_ts->gles_api_ts->driver->GetUniformBlockIndex(yagl_gles_object_get(cur_ts, program),
+ uniformBlockName);
}
-void yagl_host_glUniformBlockBinding(GLuint program,
+void yagl_host_glUniformBlockBinding(struct yagl_thread_state *cur_ts,
+ GLuint program,
GLuint uniformBlockIndex,
GLuint uniformBlockBinding)
{
- gles_api_ts->driver->UniformBlockBinding(yagl_gles_object_get(program),
- uniformBlockIndex,
- uniformBlockBinding);
+ cur_ts->gles_api_ts->driver->UniformBlockBinding(yagl_gles_object_get(cur_ts, program),
+ uniformBlockIndex,
+ uniformBlockBinding);
}
-void yagl_host_glGetActiveUniformBlockName(GLuint program,
+void yagl_host_glGetActiveUniformBlockName(struct yagl_thread_state *cur_ts,
+ GLuint program,
GLuint uniformBlockIndex,
GLchar *uniformBlockName, int32_t uniformBlockName_maxcount, int32_t *uniformBlockName_count)
{
GLsizei tmp = -1;
- gles_api_ts->driver->GetActiveUniformBlockName(yagl_gles_object_get(program),
- uniformBlockIndex,
- uniformBlockName_maxcount,
- &tmp,
- uniformBlockName);
+ cur_ts->gles_api_ts->driver->GetActiveUniformBlockName(yagl_gles_object_get(cur_ts, program),
+ uniformBlockIndex,
+ uniformBlockName_maxcount,
+ &tmp,
+ uniformBlockName);
if (tmp >= 0) {
*uniformBlockName_count = MIN(tmp + 1, uniformBlockName_maxcount);
}
}
-void yagl_host_glGetActiveUniformBlockiv(GLuint program,
+void yagl_host_glGetActiveUniformBlockiv(struct yagl_thread_state *cur_ts,
+ GLuint program,
GLuint uniformBlockIndex,
GLenum pname,
GLint *params, int32_t params_maxcount, int32_t *params_count)
return;
}
- obj = yagl_gles_object_get(program);
+ obj = yagl_gles_object_get(cur_ts, program);
switch (pname) {
case 0:
}
for (i = 0; i < num_pnames; ++i) {
- gles_api_ts->driver->GetActiveUniformBlockiv(obj,
- uniformBlockIndex,
- pnames[i],
- ¶ms[i]);
+ cur_ts->gles_api_ts->driver->GetActiveUniformBlockiv(obj,
+ uniformBlockIndex,
+ pnames[i],
+ ¶ms[i]);
}
*params_count = num_pnames;
* Return active uniform indices only.
*/
- gles_api_ts->driver->GetActiveUniformBlockiv(obj,
- uniformBlockIndex,
- GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES,
- params);
+ cur_ts->gles_api_ts->driver->GetActiveUniformBlockiv(obj,
+ uniformBlockIndex,
+ GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES,
+ params);
*params_count = params_maxcount;
}
}
-void yagl_host_glGetVertexAttribIiv(GLuint index,
+void yagl_host_glGetVertexAttribIiv(struct yagl_thread_state *cur_ts,
+ GLuint index,
GLenum pname,
GLint *params, int32_t params_maxcount, int32_t *params_count)
{
return;
}
- gles_api_ts->driver->GetVertexAttribIiv(index, pname, params);
+ cur_ts->gles_api_ts->driver->GetVertexAttribIiv(index, pname, params);
}
-void yagl_host_glGetVertexAttribIuiv(GLuint index,
+void yagl_host_glGetVertexAttribIuiv(struct yagl_thread_state *cur_ts,
+ GLuint index,
GLenum pname,
GLuint *params, int32_t params_maxcount, int32_t *params_count)
{
return;
}
- gles_api_ts->driver->GetVertexAttribIuiv(index, pname, params);
+ cur_ts->gles_api_ts->driver->GetVertexAttribIuiv(index, pname, params);
}
-void yagl_host_glVertexAttribI4i(GLuint index,
+void yagl_host_glVertexAttribI4i(struct yagl_thread_state *cur_ts,
+ GLuint index,
GLint x,
GLint y,
GLint z,
GLint w)
{
- gles_api_ts->driver->VertexAttribI4i(index, x, y, z, w);
+ cur_ts->gles_api_ts->driver->VertexAttribI4i(index, x, y, z, w);
}
-void yagl_host_glVertexAttribI4ui(GLuint index,
+void yagl_host_glVertexAttribI4ui(struct yagl_thread_state *cur_ts,
+ GLuint index,
GLuint x,
GLuint y,
GLuint z,
GLuint w)
{
- gles_api_ts->driver->VertexAttribI4ui(index, x, y, z, w);
+ cur_ts->gles_api_ts->driver->VertexAttribI4ui(index, x, y, z, w);
}
-void yagl_host_glVertexAttribI4iv(GLuint index,
+void yagl_host_glVertexAttribI4iv(struct yagl_thread_state *cur_ts,
+ GLuint index,
const GLint *v, int32_t v_count)
{
- gles_api_ts->driver->VertexAttribI4iv(index, v);
+ cur_ts->gles_api_ts->driver->VertexAttribI4iv(index, v);
}
-void yagl_host_glVertexAttribI4uiv(GLuint index,
+void yagl_host_glVertexAttribI4uiv(struct yagl_thread_state *cur_ts,
+ GLuint index,
const GLuint *v, int32_t v_count)
{
- gles_api_ts->driver->VertexAttribI4uiv(index, v);
+ cur_ts->gles_api_ts->driver->VertexAttribI4uiv(index, v);
}
-void yagl_host_glGetUniformuiv(GLboolean tl,
+void yagl_host_glGetUniformuiv(struct yagl_thread_state *cur_ts,
+ GLboolean tl,
GLuint program,
uint32_t location,
GLuint *params, int32_t params_maxcount, int32_t *params_count)
{
GLenum type;
- GLuint global_name = yagl_gles_object_get(program);
- GLint actual_location = yagl_gles_api_ps_translate_location(gles_api_ts->ps,
+ GLuint global_name = yagl_gles_object_get(cur_ts, program);
+ GLint actual_location = yagl_gles_api_ps_translate_location(cur_ts->gles_api_ts->ps,
tl,
location);
- if (!yagl_gles_program_get_uniform_type(global_name,
+ if (!yagl_gles_program_get_uniform_type(cur_ts,
+ global_name,
actual_location,
&type)) {
return;
return;
}
- gles_api_ts->driver->GetUniformuiv(global_name,
- actual_location,
- params);
+ cur_ts->gles_api_ts->driver->GetUniformuiv(global_name,
+ actual_location,
+ params);
}
-void yagl_host_glUniform1ui(GLboolean tl,
+void yagl_host_glUniform1ui(struct yagl_thread_state *cur_ts,
+ GLboolean tl,
uint32_t location,
GLuint v0)
{
- gles_api_ts->driver->Uniform1ui(
- yagl_gles_api_ps_translate_location(gles_api_ts->ps, tl, location),
+ cur_ts->gles_api_ts->driver->Uniform1ui(
+ yagl_gles_api_ps_translate_location(cur_ts->gles_api_ts->ps, tl, location),
v0);
}
-void yagl_host_glUniform2ui(GLboolean tl,
+void yagl_host_glUniform2ui(struct yagl_thread_state *cur_ts,
+ GLboolean tl,
uint32_t location,
GLuint v0,
GLuint v1)
{
- gles_api_ts->driver->Uniform2ui(
- yagl_gles_api_ps_translate_location(gles_api_ts->ps, tl, location),
+ cur_ts->gles_api_ts->driver->Uniform2ui(
+ yagl_gles_api_ps_translate_location(cur_ts->gles_api_ts->ps, tl, location),
v0, v1);
}
-void yagl_host_glUniform3ui(GLboolean tl,
+void yagl_host_glUniform3ui(struct yagl_thread_state *cur_ts,
+ GLboolean tl,
uint32_t location,
GLuint v0,
GLuint v1,
GLuint v2)
{
- gles_api_ts->driver->Uniform3ui(
- yagl_gles_api_ps_translate_location(gles_api_ts->ps, tl, location),
+ cur_ts->gles_api_ts->driver->Uniform3ui(
+ yagl_gles_api_ps_translate_location(cur_ts->gles_api_ts->ps, tl, location),
v0, v1, v2);
}
-void yagl_host_glUniform4ui(GLboolean tl,
+void yagl_host_glUniform4ui(struct yagl_thread_state *cur_ts,
+ GLboolean tl,
uint32_t location,
GLuint v0,
GLuint v1,
GLuint v2,
GLuint v3)
{
- gles_api_ts->driver->Uniform4ui(
- yagl_gles_api_ps_translate_location(gles_api_ts->ps, tl, location),
+ cur_ts->gles_api_ts->driver->Uniform4ui(
+ yagl_gles_api_ps_translate_location(cur_ts->gles_api_ts->ps, tl, location),
v0, v1, v2, v3);
}
-void yagl_host_glUniform1uiv(GLboolean tl,
+void yagl_host_glUniform1uiv(struct yagl_thread_state *cur_ts,
+ GLboolean tl,
uint32_t location,
const GLuint *v, int32_t v_count)
{
- gles_api_ts->driver->Uniform1uiv(
- yagl_gles_api_ps_translate_location(gles_api_ts->ps, tl, location),
+ cur_ts->gles_api_ts->driver->Uniform1uiv(
+ yagl_gles_api_ps_translate_location(cur_ts->gles_api_ts->ps, tl, location),
v_count, v);
}
-void yagl_host_glUniform2uiv(GLboolean tl,
+void yagl_host_glUniform2uiv(struct yagl_thread_state *cur_ts,
+ GLboolean tl,
uint32_t location,
const GLuint *v, int32_t v_count)
{
- gles_api_ts->driver->Uniform2uiv(
- yagl_gles_api_ps_translate_location(gles_api_ts->ps, tl, location),
+ cur_ts->gles_api_ts->driver->Uniform2uiv(
+ yagl_gles_api_ps_translate_location(cur_ts->gles_api_ts->ps, tl, location),
(v_count / 2), v);
}
-void yagl_host_glUniform3uiv(GLboolean tl,
+void yagl_host_glUniform3uiv(struct yagl_thread_state *cur_ts,
+ GLboolean tl,
uint32_t location,
const GLuint *v, int32_t v_count)
{
- gles_api_ts->driver->Uniform3uiv(
- yagl_gles_api_ps_translate_location(gles_api_ts->ps, tl, location),
+ cur_ts->gles_api_ts->driver->Uniform3uiv(
+ yagl_gles_api_ps_translate_location(cur_ts->gles_api_ts->ps, tl, location),
(v_count / 3), v);
}
-void yagl_host_glUniform4uiv(GLboolean tl,
+void yagl_host_glUniform4uiv(struct yagl_thread_state *cur_ts,
+ GLboolean tl,
uint32_t location,
const GLuint *v, int32_t v_count)
{
- gles_api_ts->driver->Uniform4uiv(
- yagl_gles_api_ps_translate_location(gles_api_ts->ps, tl, location),
+ cur_ts->gles_api_ts->driver->Uniform4uiv(
+ yagl_gles_api_ps_translate_location(cur_ts->gles_api_ts->ps, tl, location),
(v_count / 4), v);
}
-void yagl_host_glUniformMatrix2x3fv(GLboolean tl,
+void yagl_host_glUniformMatrix2x3fv(struct yagl_thread_state *cur_ts,
+ GLboolean tl,
uint32_t location,
GLboolean transpose,
const GLfloat *value, int32_t value_count)
{
- gles_api_ts->driver->UniformMatrix2x3fv(
- yagl_gles_api_ps_translate_location(gles_api_ts->ps, tl, location),
+ cur_ts->gles_api_ts->driver->UniformMatrix2x3fv(
+ yagl_gles_api_ps_translate_location(cur_ts->gles_api_ts->ps, tl, location),
value_count / (2 * 3), transpose, value);
}
-void yagl_host_glUniformMatrix2x4fv(GLboolean tl,
+void yagl_host_glUniformMatrix2x4fv(struct yagl_thread_state *cur_ts,
+ GLboolean tl,
uint32_t location,
GLboolean transpose,
const GLfloat *value, int32_t value_count)
{
- gles_api_ts->driver->UniformMatrix2x4fv(
- yagl_gles_api_ps_translate_location(gles_api_ts->ps, tl, location),
+ cur_ts->gles_api_ts->driver->UniformMatrix2x4fv(
+ yagl_gles_api_ps_translate_location(cur_ts->gles_api_ts->ps, tl, location),
value_count / (2 * 4), transpose, value);
}
-void yagl_host_glUniformMatrix3x2fv(GLboolean tl,
+void yagl_host_glUniformMatrix3x2fv(struct yagl_thread_state *cur_ts,
+ GLboolean tl,
uint32_t location,
GLboolean transpose,
const GLfloat *value, int32_t value_count)
{
- gles_api_ts->driver->UniformMatrix3x2fv(
- yagl_gles_api_ps_translate_location(gles_api_ts->ps, tl, location),
+ cur_ts->gles_api_ts->driver->UniformMatrix3x2fv(
+ yagl_gles_api_ps_translate_location(cur_ts->gles_api_ts->ps, tl, location),
value_count / (3 * 2), transpose, value);
}
-void yagl_host_glUniformMatrix3x4fv(GLboolean tl,
+void yagl_host_glUniformMatrix3x4fv(struct yagl_thread_state *cur_ts,
+ GLboolean tl,
uint32_t location,
GLboolean transpose,
const GLfloat *value, int32_t value_count)
{
- gles_api_ts->driver->UniformMatrix3x4fv(
- yagl_gles_api_ps_translate_location(gles_api_ts->ps, tl, location),
+ cur_ts->gles_api_ts->driver->UniformMatrix3x4fv(
+ yagl_gles_api_ps_translate_location(cur_ts->gles_api_ts->ps, tl, location),
value_count / (3 * 4), transpose, value);
}
-void yagl_host_glUniformMatrix4x2fv(GLboolean tl,
+void yagl_host_glUniformMatrix4x2fv(struct yagl_thread_state *cur_ts,
+ GLboolean tl,
uint32_t location,
GLboolean transpose,
const GLfloat *value, int32_t value_count)
{
- gles_api_ts->driver->UniformMatrix4x2fv(
- yagl_gles_api_ps_translate_location(gles_api_ts->ps, tl, location),
+ cur_ts->gles_api_ts->driver->UniformMatrix4x2fv(
+ yagl_gles_api_ps_translate_location(cur_ts->gles_api_ts->ps, tl, location),
value_count / (4 * 2), transpose, value);
}
-void yagl_host_glUniformMatrix4x3fv(GLboolean tl,
+void yagl_host_glUniformMatrix4x3fv(struct yagl_thread_state *cur_ts,
+ GLboolean tl,
uint32_t location,
GLboolean transpose,
const GLfloat *value, int32_t value_count)
{
- gles_api_ts->driver->UniformMatrix4x3fv(
- yagl_gles_api_ps_translate_location(gles_api_ts->ps, tl, location),
+ cur_ts->gles_api_ts->driver->UniformMatrix4x3fv(
+ yagl_gles_api_ps_translate_location(cur_ts->gles_api_ts->ps, tl, location),
value_count / (4 * 3), transpose, value);
}
-int yagl_host_glGetFragDataLocation(GLuint program,
+int yagl_host_glGetFragDataLocation(struct yagl_thread_state *cur_ts,
+ GLuint program,
const GLchar *name, int32_t name_count)
{
- return gles_api_ts->driver->GetFragDataLocation(yagl_gles_object_get(program),
- name);
+ return cur_ts->gles_api_ts->driver->GetFragDataLocation(yagl_gles_object_get(cur_ts, program),
+ name);
}
-void yagl_host_glGetIntegerv(GLenum pname,
+void yagl_host_glGetIntegerv(struct yagl_thread_state *cur_ts,
+ GLenum pname,
GLint *params, int32_t params_maxcount, int32_t *params_count)
{
- gles_api_ts->driver->GetIntegerv(pname, params);
+ cur_ts->gles_api_ts->driver->GetIntegerv(pname, params);
*params_count = params_maxcount;
}
-void yagl_host_glGetFloatv(GLenum pname,
+void yagl_host_glGetFloatv(struct yagl_thread_state *cur_ts,
+ GLenum pname,
GLfloat *params, int32_t params_maxcount, int32_t *params_count)
{
- gles_api_ts->driver->GetFloatv(pname, params);
+ cur_ts->gles_api_ts->driver->GetFloatv(pname, params);
*params_count = params_maxcount;
}
-void yagl_host_glGetString(GLenum name,
+void yagl_host_glGetString(struct yagl_thread_state *cur_ts,
+ GLenum name,
GLchar *str, int32_t str_maxcount, int32_t *str_count)
{
const char *tmp;
+ struct yagl_gles_api_ts *gles_api_ts = cur_ts->gles_api_ts;
if ((name == GL_EXTENSIONS) &&
(gles_api_ts->driver->gl_version > yagl_gl_2)) {
}
}
-GLboolean yagl_host_glIsEnabled(GLenum cap)
+GLboolean yagl_host_glIsEnabled(struct yagl_thread_state *cur_ts,
+ GLenum cap)
{
- return gles_api_ts->driver->IsEnabled(cap);
+ return cur_ts->gles_api_ts->driver->IsEnabled(cap);
}
-void yagl_host_glGenTransformFeedbacks(const GLuint *ids, int32_t ids_count)
+void yagl_host_glGenTransformFeedbacks(struct yagl_thread_state *cur_ts,
+ const GLuint *ids, int32_t ids_count)
{
int i;
for (i = 0; i < ids_count; ++i) {
GLuint global_name;
- gles_api_ts->driver->GenTransformFeedbacks(1, &global_name);
+ cur_ts->gles_api_ts->driver->GenTransformFeedbacks(1, &global_name);
- yagl_gles_object_add(ids[i],
+ yagl_gles_object_add(cur_ts,
+ ids[i],
global_name,
- yagl_get_ctx_id(),
+ yagl_get_ctx_id(cur_ts),
&yagl_gles_transform_feedback_destroy);
}
}
-void yagl_host_glBindTransformFeedback(GLenum target,
+void yagl_host_glBindTransformFeedback(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLuint id)
{
- gles_api_ts->driver->BindTransformFeedback(target,
- yagl_gles_object_get(id));
+ cur_ts->gles_api_ts->driver->BindTransformFeedback(target,
+ yagl_gles_object_get(cur_ts, id));
}
-void yagl_host_glBeginTransformFeedback(GLenum primitiveMode)
+void yagl_host_glBeginTransformFeedback(struct yagl_thread_state *cur_ts,
+ GLenum primitiveMode)
{
- gles_api_ts->driver->BeginTransformFeedback(primitiveMode);
+ cur_ts->gles_api_ts->driver->BeginTransformFeedback(primitiveMode);
}
-void yagl_host_glEndTransformFeedback(void)
+void yagl_host_glEndTransformFeedback(struct yagl_thread_state *cur_ts)
{
- gles_api_ts->driver->EndTransformFeedback();
+ cur_ts->gles_api_ts->driver->EndTransformFeedback();
}
-void yagl_host_glPauseTransformFeedback(void)
+void yagl_host_glPauseTransformFeedback(struct yagl_thread_state *cur_ts)
{
- gles_api_ts->driver->PauseTransformFeedback();
+ cur_ts->gles_api_ts->driver->PauseTransformFeedback();
}
-void yagl_host_glResumeTransformFeedback(void)
+void yagl_host_glResumeTransformFeedback(struct yagl_thread_state *cur_ts)
{
- gles_api_ts->driver->ResumeTransformFeedback();
+ cur_ts->gles_api_ts->driver->ResumeTransformFeedback();
}
-void yagl_host_glTransformFeedbackVaryings(GLuint program,
+void yagl_host_glTransformFeedbackVaryings(struct yagl_thread_state *cur_ts,
+ struct yagl_transport *t,
+ GLuint program,
const GLchar *varyings, int32_t varyings_count,
GLenum bufferMode)
{
const char **strings;
int32_t num_strings = 0;
- strings = yagl_transport_get_out_string_array(varyings,
+ strings = yagl_transport_get_out_string_array(t, varyings,
varyings_count,
&num_strings);
- gles_api_ts->driver->TransformFeedbackVaryings(yagl_gles_object_get(program),
- num_strings,
- strings,
- bufferMode);
+ cur_ts->gles_api_ts->driver->TransformFeedbackVaryings(yagl_gles_object_get(cur_ts, program),
+ num_strings,
+ strings,
+ bufferMode);
g_free(strings);
}
-void yagl_host_glGetTransformFeedbackVaryings(GLuint program,
+void yagl_host_glGetTransformFeedbackVaryings(struct yagl_thread_state *cur_ts,
+ GLuint program,
GLsizei *sizes, int32_t sizes_maxcount, int32_t *sizes_count,
GLenum *types, int32_t types_maxcount, int32_t *types_count)
{
- GLuint obj = yagl_gles_object_get(program);
+ GLuint obj = yagl_gles_object_get(cur_ts, program);
int32_t i;
if (sizes_maxcount != types_maxcount) {
GLsizei length = -1;
GLchar c[2];
- gles_api_ts->driver->GetTransformFeedbackVarying(obj,
- i, sizeof(c), &length,
- &sizes[i], &types[i],
- c);
+ cur_ts->gles_api_ts->driver->GetTransformFeedbackVarying(obj,
+ i, sizeof(c), &length,
+ &sizes[i], &types[i],
+ c);
if (length <= 0) {
sizes[i] = 0;
*sizes_count = *types_count = sizes_maxcount;
}
-void yagl_host_glGenQueries(const GLuint *ids, int32_t ids_count)
+void yagl_host_glGenQueries(struct yagl_thread_state *cur_ts,
+ const GLuint *ids, int32_t ids_count)
{
int i;
for (i = 0; i < ids_count; ++i) {
GLuint global_name;
- gles_api_ts->driver->GenQueries(1, &global_name);
+ cur_ts->gles_api_ts->driver->GenQueries(1, &global_name);
- yagl_gles_object_add(ids[i],
+ yagl_gles_object_add(cur_ts,
+ ids[i],
global_name,
- yagl_get_ctx_id(),
+ yagl_get_ctx_id(cur_ts),
&yagl_gles_query_destroy);
}
}
-void yagl_host_glBeginQuery(GLenum target,
+void yagl_host_glBeginQuery(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLuint id)
{
- gles_api_ts->driver->BeginQuery(target, yagl_gles_object_get(id));
+ cur_ts->gles_api_ts->driver->BeginQuery(target, yagl_gles_object_get(cur_ts, id));
}
-void yagl_host_glEndQuery(GLenum target)
+void yagl_host_glEndQuery(struct yagl_thread_state *cur_ts,
+ GLenum target)
{
- gles_api_ts->driver->EndQuery(target);
+ cur_ts->gles_api_ts->driver->EndQuery(target);
}
-GLboolean yagl_host_glGetQueryObjectuiv(GLuint id,
+GLboolean yagl_host_glGetQueryObjectuiv(struct yagl_thread_state *cur_ts,
+ GLuint id,
GLenum pname, GLuint *result)
{
- GLuint obj = yagl_gles_object_get(id);
+ GLuint obj = yagl_gles_object_get(cur_ts, id);
GLuint tmp = 0;
if (pname == GL_QUERY_RESULT_AVAILABLE) {
- gles_api_ts->driver->GetQueryObjectuiv(obj, GL_QUERY_RESULT_AVAILABLE, &tmp);
+ cur_ts->gles_api_ts->driver->GetQueryObjectuiv(obj, GL_QUERY_RESULT_AVAILABLE, &tmp);
if (tmp) {
- gles_api_ts->driver->GetQueryObjectuiv(obj, GL_QUERY_RESULT, result);
+ cur_ts->gles_api_ts->driver->GetQueryObjectuiv(obj, GL_QUERY_RESULT, result);
}
} else {
- gles_api_ts->driver->GetQueryObjectuiv(obj, GL_QUERY_RESULT, result);
+ cur_ts->gles_api_ts->driver->GetQueryObjectuiv(obj, GL_QUERY_RESULT, result);
tmp = GL_TRUE;
}
return tmp;
}
-void yagl_host_glGenSamplers(const GLuint *samplers, int32_t samplers_count)
+void yagl_host_glGenSamplers(struct yagl_thread_state *cur_ts,
+ const GLuint *samplers, int32_t samplers_count)
{
int i;
for (i = 0; i < samplers_count; ++i) {
GLuint global_name;
- gles_api_ts->driver->GenSamplers(1, &global_name);
+ cur_ts->gles_api_ts->driver->GenSamplers(1, &global_name);
- yagl_gles_object_add(samplers[i],
+ yagl_gles_object_add(cur_ts,
+ samplers[i],
global_name,
0,
&yagl_gles_sampler_destroy);
}
}
-void yagl_host_glBindSampler(GLuint unit,
+void yagl_host_glBindSampler(struct yagl_thread_state *cur_ts,
+ GLuint unit,
GLuint sampler)
{
- gles_api_ts->driver->BindSampler(unit, yagl_gles_object_get(sampler));
+ cur_ts->gles_api_ts->driver->BindSampler(unit, yagl_gles_object_get(cur_ts, sampler));
}
-void yagl_host_glSamplerParameteri(GLuint sampler,
+void yagl_host_glSamplerParameteri(struct yagl_thread_state *cur_ts,
+ GLuint sampler,
GLenum pname,
GLint param)
{
- gles_api_ts->driver->SamplerParameteri(yagl_gles_object_get(sampler), pname, param);
+ cur_ts->gles_api_ts->driver->SamplerParameteri(yagl_gles_object_get(cur_ts, sampler), pname, param);
}
-void yagl_host_glSamplerParameteriv(GLuint sampler,
+void yagl_host_glSamplerParameteriv(struct yagl_thread_state *cur_ts,
+ GLuint sampler,
GLenum pname,
const GLint *param, int32_t param_count)
{
- gles_api_ts->driver->SamplerParameteriv(yagl_gles_object_get(sampler), pname, param);
+ cur_ts->gles_api_ts->driver->SamplerParameteriv(yagl_gles_object_get(cur_ts, sampler), pname, param);
}
-void yagl_host_glSamplerParameterf(GLuint sampler,
+void yagl_host_glSamplerParameterf(struct yagl_thread_state *cur_ts,
+ GLuint sampler,
GLenum pname,
GLfloat param)
{
- gles_api_ts->driver->SamplerParameterf(yagl_gles_object_get(sampler), pname, param);
+ cur_ts->gles_api_ts->driver->SamplerParameterf(yagl_gles_object_get(cur_ts, sampler), pname, param);
}
-void yagl_host_glSamplerParameterfv(GLuint sampler,
+void yagl_host_glSamplerParameterfv(struct yagl_thread_state *cur_ts,
+ GLuint sampler,
GLenum pname,
const GLfloat *param, int32_t param_count)
{
- gles_api_ts->driver->SamplerParameterfv(yagl_gles_object_get(sampler), pname, param);
+ cur_ts->gles_api_ts->driver->SamplerParameterfv(yagl_gles_object_get(cur_ts, sampler), pname, param);
}
-void yagl_host_glDeleteObjects(const GLuint *objects, int32_t objects_count)
+void yagl_host_glDeleteObjects(struct yagl_thread_state *cur_ts,
+ const GLuint *objects, int32_t objects_count)
{
int i;
for (i = 0; i < objects_count; ++i) {
- yagl_object_map_remove(cur_ts->ps->object_map, objects[i]);
+ yagl_object_map_remove(cur_ts, cur_ts->ps->object_map, objects[i]);
}
}
-void yagl_host_glBlendEquation(GLenum mode)
+void yagl_host_glBlendEquation(struct yagl_thread_state *cur_ts,
+ GLenum mode)
{
- gles_api_ts->driver->BlendEquation(mode);
+ cur_ts->gles_api_ts->driver->BlendEquation(mode);
}
-void yagl_host_glBlendEquationSeparate(GLenum modeRGB,
+void yagl_host_glBlendEquationSeparate(struct yagl_thread_state *cur_ts,
+ GLenum modeRGB,
GLenum modeAlpha)
{
- gles_api_ts->driver->BlendEquationSeparate(modeRGB, modeAlpha);
+ cur_ts->gles_api_ts->driver->BlendEquationSeparate(modeRGB, modeAlpha);
}
-void yagl_host_glBlendFunc(GLenum sfactor,
+void yagl_host_glBlendFunc(struct yagl_thread_state *cur_ts,
+ GLenum sfactor,
GLenum dfactor)
{
- gles_api_ts->driver->BlendFunc(sfactor, dfactor);
+ cur_ts->gles_api_ts->driver->BlendFunc(sfactor, dfactor);
}
-void yagl_host_glBlendFuncSeparate(GLenum srcRGB,
+void yagl_host_glBlendFuncSeparate(struct yagl_thread_state *cur_ts,
+ GLenum srcRGB,
GLenum dstRGB,
GLenum srcAlpha,
GLenum dstAlpha)
{
- gles_api_ts->driver->BlendFuncSeparate(srcRGB,
+ cur_ts->gles_api_ts->driver->BlendFuncSeparate(srcRGB,
dstRGB,
srcAlpha,
dstAlpha);
}
-void yagl_host_glBlendColor(GLclampf red,
+void yagl_host_glBlendColor(struct yagl_thread_state *cur_ts,
+ GLclampf red,
GLclampf green,
GLclampf blue,
GLclampf alpha)
{
- gles_api_ts->driver->BlendColor(red, green, blue, alpha);
+ cur_ts->gles_api_ts->driver->BlendColor(red, green, blue, alpha);
}
-void yagl_host_glClear(GLbitfield mask)
+void yagl_host_glClear(struct yagl_thread_state *cur_ts,
+ GLbitfield mask)
{
- gles_api_ts->driver->Clear(mask);
+ cur_ts->gles_api_ts->driver->Clear(mask);
}
-void yagl_host_glClearColor(GLclampf red,
+void yagl_host_glClearColor(struct yagl_thread_state *cur_ts,
+ GLclampf red,
GLclampf green,
GLclampf blue,
GLclampf alpha)
{
- gles_api_ts->driver->ClearColor(red, green, blue, alpha);
+ cur_ts->gles_api_ts->driver->ClearColor(red, green, blue, alpha);
}
-void yagl_host_glClearDepthf(GLclampf depth)
+void yagl_host_glClearDepthf(struct yagl_thread_state *cur_ts,
+ GLclampf depth)
{
- gles_api_ts->driver->ClearDepth(depth);
+ cur_ts->gles_api_ts->driver->ClearDepth(depth);
}
-void yagl_host_glClearStencil(GLint s)
+void yagl_host_glClearStencil(struct yagl_thread_state *cur_ts,
+ GLint s)
{
- gles_api_ts->driver->ClearStencil(s);
+ cur_ts->gles_api_ts->driver->ClearStencil(s);
}
-void yagl_host_glColorMask(GLboolean red,
+void yagl_host_glColorMask(struct yagl_thread_state *cur_ts,
+ GLboolean red,
GLboolean green,
GLboolean blue,
GLboolean alpha)
{
- gles_api_ts->driver->ColorMask(red, green, blue, alpha);
+ cur_ts->gles_api_ts->driver->ColorMask(red, green, blue, alpha);
}
-void yagl_host_glCullFace(GLenum mode)
+void yagl_host_glCullFace(struct yagl_thread_state *cur_ts,
+ GLenum mode)
{
- gles_api_ts->driver->CullFace(mode);
+ cur_ts->gles_api_ts->driver->CullFace(mode);
}
-void yagl_host_glDepthFunc(GLenum func)
+void yagl_host_glDepthFunc(struct yagl_thread_state *cur_ts,
+ GLenum func)
{
- gles_api_ts->driver->DepthFunc(func);
+ cur_ts->gles_api_ts->driver->DepthFunc(func);
}
-void yagl_host_glDepthMask(GLboolean flag)
+void yagl_host_glDepthMask(struct yagl_thread_state *cur_ts,
+ GLboolean flag)
{
- gles_api_ts->driver->DepthMask(flag);
+ cur_ts->gles_api_ts->driver->DepthMask(flag);
}
-void yagl_host_glDepthRangef(GLclampf zNear,
+void yagl_host_glDepthRangef(struct yagl_thread_state *cur_ts,
+ GLclampf zNear,
GLclampf zFar)
{
- gles_api_ts->driver->DepthRange(zNear, zFar);
+ cur_ts->gles_api_ts->driver->DepthRange(zNear, zFar);
}
-void yagl_host_glEnable(GLenum cap)
+void yagl_host_glEnable(struct yagl_thread_state *cur_ts,
+ GLenum cap)
{
- gles_api_ts->driver->Enable(cap);
+ cur_ts->gles_api_ts->driver->Enable(cap);
}
-void yagl_host_glDisable(GLenum cap)
+void yagl_host_glDisable(struct yagl_thread_state *cur_ts,
+ GLenum cap)
{
- gles_api_ts->driver->Disable(cap);
+ cur_ts->gles_api_ts->driver->Disable(cap);
}
-void yagl_host_glFlush(void)
+void yagl_host_glFlush(struct yagl_thread_state *cur_ts)
{
- gles_api_ts->driver->Flush();
+ cur_ts->gles_api_ts->driver->Flush();
}
-void yagl_host_glFrontFace(GLenum mode)
+void yagl_host_glFrontFace(struct yagl_thread_state *cur_ts,
+ GLenum mode)
{
- gles_api_ts->driver->FrontFace(mode);
+ cur_ts->gles_api_ts->driver->FrontFace(mode);
}
-void yagl_host_glGenerateMipmap(GLenum target)
+void yagl_host_glGenerateMipmap(struct yagl_thread_state *cur_ts,
+ GLenum target)
{
- gles_api_ts->driver->GenerateMipmap(target);
+ cur_ts->gles_api_ts->driver->GenerateMipmap(target);
}
-void yagl_host_glHint(GLenum target,
+void yagl_host_glHint(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLenum mode)
{
- gles_api_ts->driver->Hint(target, mode);
+ cur_ts->gles_api_ts->driver->Hint(target, mode);
}
-void yagl_host_glLineWidth(GLfloat width)
+void yagl_host_glLineWidth(struct yagl_thread_state *cur_ts,
+ GLfloat width)
{
- gles_api_ts->driver->LineWidth(width);
+ cur_ts->gles_api_ts->driver->LineWidth(width);
}
-void yagl_host_glPixelStorei(GLenum pname,
+void yagl_host_glPixelStorei(struct yagl_thread_state *cur_ts,
+ GLenum pname,
GLint param)
{
- gles_api_ts->driver->PixelStorei(pname, param);
+ cur_ts->gles_api_ts->driver->PixelStorei(pname, param);
}
-void yagl_host_glPolygonOffset(GLfloat factor,
+void yagl_host_glPolygonOffset(struct yagl_thread_state *cur_ts,
+ GLfloat factor,
GLfloat units)
{
- gles_api_ts->driver->PolygonOffset(factor, units);
+ cur_ts->gles_api_ts->driver->PolygonOffset(factor, units);
}
-void yagl_host_glScissor(GLint x,
+void yagl_host_glScissor(struct yagl_thread_state *cur_ts,
+ GLint x,
GLint y,
GLsizei width,
GLsizei height)
{
- gles_api_ts->driver->Scissor(x, y, width, height);
+ cur_ts->gles_api_ts->driver->Scissor(x, y, width, height);
}
-void yagl_host_glStencilFunc(GLenum func,
+void yagl_host_glStencilFunc(struct yagl_thread_state *cur_ts,
+ GLenum func,
GLint ref,
GLuint mask)
{
- gles_api_ts->driver->StencilFunc(func, ref, mask);
+ cur_ts->gles_api_ts->driver->StencilFunc(func, ref, mask);
}
-void yagl_host_glStencilMask(GLuint mask)
+void yagl_host_glStencilMask(struct yagl_thread_state *cur_ts,
+ GLuint mask)
{
- gles_api_ts->driver->StencilMask(mask);
+ cur_ts->gles_api_ts->driver->StencilMask(mask);
}
-void yagl_host_glStencilOp(GLenum fail,
+void yagl_host_glStencilOp(struct yagl_thread_state *cur_ts,
+ GLenum fail,
GLenum zfail,
GLenum zpass)
{
- gles_api_ts->driver->StencilOp(fail, zfail, zpass);
+ cur_ts->gles_api_ts->driver->StencilOp(fail, zfail, zpass);
}
-void yagl_host_glSampleCoverage(GLclampf value,
+void yagl_host_glSampleCoverage(struct yagl_thread_state *cur_ts,
+ GLclampf value,
GLboolean invert)
{
- gles_api_ts->driver->SampleCoverage(value, invert);
+ cur_ts->gles_api_ts->driver->SampleCoverage(value, invert);
}
-void yagl_host_glViewport(GLint x,
+void yagl_host_glViewport(struct yagl_thread_state *cur_ts,
+ GLint x,
GLint y,
GLsizei width,
GLsizei height)
{
- gles_api_ts->driver->Viewport(x, y, width, height);
+ cur_ts->gles_api_ts->driver->Viewport(x, y, width, height);
}
-void yagl_host_glStencilFuncSeparate(GLenum face,
+void yagl_host_glStencilFuncSeparate(struct yagl_thread_state *cur_ts,
+ GLenum face,
GLenum func,
GLint ref,
GLuint mask)
{
- gles_api_ts->driver->StencilFuncSeparate(face, func, ref, mask);
+ cur_ts->gles_api_ts->driver->StencilFuncSeparate(face, func, ref, mask);
}
-void yagl_host_glStencilMaskSeparate(GLenum face,
+void yagl_host_glStencilMaskSeparate(struct yagl_thread_state *cur_ts,
+ GLenum face,
GLuint mask)
{
- gles_api_ts->driver->StencilMaskSeparate(face, mask);
+ cur_ts->gles_api_ts->driver->StencilMaskSeparate(face, mask);
}
-void yagl_host_glStencilOpSeparate(GLenum face,
+void yagl_host_glStencilOpSeparate(struct yagl_thread_state *cur_ts,
+ GLenum face,
GLenum fail,
GLenum zfail,
GLenum zpass)
{
- gles_api_ts->driver->StencilOpSeparate(face, fail, zfail, zpass);
+ cur_ts->gles_api_ts->driver->StencilOpSeparate(face, fail, zfail, zpass);
}
-void yagl_host_glPointSize(GLfloat size)
+void yagl_host_glPointSize(struct yagl_thread_state *cur_ts,
+ GLfloat size)
{
- gles_api_ts->driver->PointSize(size);
+ cur_ts->gles_api_ts->driver->PointSize(size);
}
-void yagl_host_glAlphaFunc(GLenum func,
+void yagl_host_glAlphaFunc(struct yagl_thread_state *cur_ts,
+ GLenum func,
GLclampf ref)
{
- gles_api_ts->driver->AlphaFunc(func, ref);
+ cur_ts->gles_api_ts->driver->AlphaFunc(func, ref);
}
-void yagl_host_glMatrixMode(GLenum mode)
+void yagl_host_glMatrixMode(struct yagl_thread_state *cur_ts,
+ GLenum mode)
{
- gles_api_ts->driver->MatrixMode(mode);
+ cur_ts->gles_api_ts->driver->MatrixMode(mode);
}
-void yagl_host_glLoadIdentity(void)
+void yagl_host_glLoadIdentity(struct yagl_thread_state *cur_ts)
{
- gles_api_ts->driver->LoadIdentity();
+ cur_ts->gles_api_ts->driver->LoadIdentity();
}
-void yagl_host_glPopMatrix(void)
+void yagl_host_glPopMatrix(struct yagl_thread_state *cur_ts)
{
- gles_api_ts->driver->PopMatrix();
+ cur_ts->gles_api_ts->driver->PopMatrix();
}
-void yagl_host_glPushMatrix(void)
+void yagl_host_glPushMatrix(struct yagl_thread_state *cur_ts)
{
- gles_api_ts->driver->PushMatrix();
+ cur_ts->gles_api_ts->driver->PushMatrix();
}
-void yagl_host_glRotatef(GLfloat angle,
+void yagl_host_glRotatef(struct yagl_thread_state *cur_ts,
+ GLfloat angle,
GLfloat x,
GLfloat y,
GLfloat z)
{
- gles_api_ts->driver->Rotatef(angle, x, y, z);
+ cur_ts->gles_api_ts->driver->Rotatef(angle, x, y, z);
}
-void yagl_host_glTranslatef(GLfloat x,
+void yagl_host_glTranslatef(struct yagl_thread_state *cur_ts,
+ GLfloat x,
GLfloat y,
GLfloat z)
{
- gles_api_ts->driver->Translatef(x, y, z);
+ cur_ts->gles_api_ts->driver->Translatef(x, y, z);
}
-void yagl_host_glScalef(GLfloat x,
+void yagl_host_glScalef(struct yagl_thread_state *cur_ts,
+ GLfloat x,
GLfloat y,
GLfloat z)
{
- gles_api_ts->driver->Scalef(x, y, z);
+ cur_ts->gles_api_ts->driver->Scalef(x, y, z);
}
-void yagl_host_glOrthof(GLfloat left,
+void yagl_host_glOrthof(struct yagl_thread_state *cur_ts,
+ GLfloat left,
GLfloat right,
GLfloat bottom,
GLfloat top,
GLfloat zNear,
GLfloat zFar)
{
- gles_api_ts->driver->Ortho(left, right, bottom, top, zNear, zFar);
+ cur_ts->gles_api_ts->driver->Ortho(left, right, bottom, top, zNear, zFar);
}
-void yagl_host_glColor4f(GLfloat red,
+void yagl_host_glColor4f(struct yagl_thread_state *cur_ts,
+ GLfloat red,
GLfloat green,
GLfloat blue,
GLfloat alpha)
{
- gles_api_ts->driver->Color4f(red, green, blue, alpha);
+ cur_ts->gles_api_ts->driver->Color4f(red, green, blue, alpha);
}
-void yagl_host_glColor4ub(GLubyte red,
+void yagl_host_glColor4ub(struct yagl_thread_state *cur_ts,
+ GLubyte red,
GLubyte green,
GLubyte blue,
GLubyte alpha)
{
- gles_api_ts->driver->Color4ub(red, green, blue, alpha);
+ cur_ts->gles_api_ts->driver->Color4ub(red, green, blue, alpha);
}
-void yagl_host_glNormal3f(GLfloat nx,
+void yagl_host_glNormal3f(struct yagl_thread_state *cur_ts,
+ GLfloat nx,
GLfloat ny,
GLfloat nz)
{
- gles_api_ts->driver->Normal3f(nx, ny, nz);
+ cur_ts->gles_api_ts->driver->Normal3f(nx, ny, nz);
}
-void yagl_host_glPointParameterf(GLenum pname,
+void yagl_host_glPointParameterf(struct yagl_thread_state *cur_ts,
+ GLenum pname,
GLfloat param)
{
- gles_api_ts->driver->PointParameterf(pname, param);
+ cur_ts->gles_api_ts->driver->PointParameterf(pname, param);
}
-void yagl_host_glPointParameterfv(GLenum pname,
+void yagl_host_glPointParameterfv(struct yagl_thread_state *cur_ts,
+ GLenum pname,
const GLfloat *params, int32_t params_count)
{
- gles_api_ts->driver->PointParameterfv(pname, params);
+ cur_ts->gles_api_ts->driver->PointParameterfv(pname, params);
}
-void yagl_host_glFogf(GLenum pname,
+void yagl_host_glFogf(struct yagl_thread_state *cur_ts,
+ GLenum pname,
GLfloat param)
{
- gles_api_ts->driver->Fogf(pname, param);
+ cur_ts->gles_api_ts->driver->Fogf(pname, param);
}
-void yagl_host_glFogfv(GLenum pname,
+void yagl_host_glFogfv(struct yagl_thread_state *cur_ts,
+ GLenum pname,
const GLfloat *params, int32_t params_count)
{
- gles_api_ts->driver->Fogfv(pname, params);
+ cur_ts->gles_api_ts->driver->Fogfv(pname, params);
}
-void yagl_host_glFrustumf(GLfloat left,
+void yagl_host_glFrustumf(struct yagl_thread_state *cur_ts,
+ GLfloat left,
GLfloat right,
GLfloat bottom,
GLfloat top,
GLfloat zNear,
GLfloat zFar)
{
- gles_api_ts->driver->Frustum(left, right, bottom, top, zNear, zFar);
+ cur_ts->gles_api_ts->driver->Frustum(left, right, bottom, top, zNear, zFar);
}
-void yagl_host_glLightf(GLenum light,
+void yagl_host_glLightf(struct yagl_thread_state *cur_ts,
+ GLenum light,
GLenum pname,
GLfloat param)
{
- gles_api_ts->driver->Lightf(light, pname, param);
+ cur_ts->gles_api_ts->driver->Lightf(light, pname, param);
}
-void yagl_host_glLightfv(GLenum light,
+void yagl_host_glLightfv(struct yagl_thread_state *cur_ts,
+ GLenum light,
GLenum pname,
const GLfloat *params, int32_t params_count)
{
- gles_api_ts->driver->Lightfv(light, pname, params);
+ cur_ts->gles_api_ts->driver->Lightfv(light, pname, params);
}
-void yagl_host_glGetLightfv(GLenum light,
+void yagl_host_glGetLightfv(struct yagl_thread_state *cur_ts,
+ GLenum light,
GLenum pname,
GLfloat *params, int32_t params_maxcount, int32_t *params_count)
{
- gles_api_ts->driver->GetLightfv(light, pname, params);
+ cur_ts->gles_api_ts->driver->GetLightfv(light, pname, params);
*params_count = params_maxcount;
}
-void yagl_host_glLightModelf(GLenum pname,
+void yagl_host_glLightModelf(struct yagl_thread_state *cur_ts,
+ GLenum pname,
GLfloat param)
{
- gles_api_ts->driver->LightModelf(pname, param);
+ cur_ts->gles_api_ts->driver->LightModelf(pname, param);
}
-void yagl_host_glLightModelfv(GLenum pname,
+void yagl_host_glLightModelfv(struct yagl_thread_state *cur_ts,
+ GLenum pname,
const GLfloat *params, int32_t params_count)
{
- gles_api_ts->driver->LightModelfv(pname, params);
+ cur_ts->gles_api_ts->driver->LightModelfv(pname, params);
}
-void yagl_host_glMaterialf(GLenum face,
+void yagl_host_glMaterialf(struct yagl_thread_state *cur_ts,
+ GLenum face,
GLenum pname,
GLfloat param)
{
- gles_api_ts->driver->Materialf(face, pname, param);
+ cur_ts->gles_api_ts->driver->Materialf(face, pname, param);
}
-void yagl_host_glMaterialfv(GLenum face,
+void yagl_host_glMaterialfv(struct yagl_thread_state *cur_ts,
+ GLenum face,
GLenum pname,
const GLfloat *params, int32_t params_count)
{
- gles_api_ts->driver->Materialfv(face, pname, params);
+ cur_ts->gles_api_ts->driver->Materialfv(face, pname, params);
}
-void yagl_host_glGetMaterialfv(GLenum face,
+void yagl_host_glGetMaterialfv(struct yagl_thread_state *cur_ts,
+ GLenum face,
GLenum pname,
GLfloat *params, int32_t params_maxcount, int32_t *params_count)
{
- gles_api_ts->driver->GetMaterialfv(face, pname, params);
+ cur_ts->gles_api_ts->driver->GetMaterialfv(face, pname, params);
*params_count = params_maxcount;
}
-void yagl_host_glShadeModel(GLenum mode)
+void yagl_host_glShadeModel(struct yagl_thread_state *cur_ts,
+ GLenum mode)
{
- gles_api_ts->driver->ShadeModel(mode);
+ cur_ts->gles_api_ts->driver->ShadeModel(mode);
}
-void yagl_host_glLogicOp(GLenum opcode)
+void yagl_host_glLogicOp(struct yagl_thread_state *cur_ts,
+ GLenum opcode)
{
- gles_api_ts->driver->LogicOp(opcode);
+ cur_ts->gles_api_ts->driver->LogicOp(opcode);
}
-void yagl_host_glMultMatrixf(const GLfloat *m, int32_t m_count)
+void yagl_host_glMultMatrixf(struct yagl_thread_state *cur_ts,
+ const GLfloat *m, int32_t m_count)
{
- gles_api_ts->driver->MultMatrixf(m);
+ cur_ts->gles_api_ts->driver->MultMatrixf(m);
}
-void yagl_host_glLoadMatrixf(const GLfloat *m, int32_t m_count)
+void yagl_host_glLoadMatrixf(struct yagl_thread_state *cur_ts,
+ const GLfloat *m, int32_t m_count)
{
- gles_api_ts->driver->LoadMatrixf(m);
+ cur_ts->gles_api_ts->driver->LoadMatrixf(m);
}
-void yagl_host_glClipPlanef(GLenum plane,
+void yagl_host_glClipPlanef(struct yagl_thread_state *cur_ts,
+ GLenum plane,
const GLfloat *equation, int32_t equation_count)
{
- yagl_GLdouble equationd[4] = {0};
+ yagl_GLdouble equationd[4];
if (equation) {
equationd[0] = equation[0];
equationd[1] = equation[1];
equationd[2] = equation[2];
equationd[3] = equation[3];
- gles_api_ts->driver->ClipPlane(plane, &equationd[0]);
+ cur_ts->gles_api_ts->driver->ClipPlane(plane, equationd);
} else {
- gles_api_ts->driver->ClipPlane(plane, NULL);
+ cur_ts->gles_api_ts->driver->ClipPlane(plane, NULL);
}
}
-void yagl_host_glGetClipPlanef(GLenum pname,
+void yagl_host_glGetClipPlanef(struct yagl_thread_state *cur_ts,
+ GLenum pname,
GLfloat *eqn, int32_t eqn_maxcount, int32_t *eqn_count)
{
- yagl_GLdouble eqnd[4] = {0};
+ yagl_GLdouble eqnd[4];
- gles_api_ts->driver->GetClipPlane(pname, &eqnd[0]);
+ cur_ts->gles_api_ts->driver->GetClipPlane(pname, eqnd);
if (eqn) {
eqn[0] = eqnd[0];
}
}
-void yagl_host_glUpdateOffscreenImageYAGL(GLuint texture,
+void yagl_host_glUpdateOffscreenImageYAGL(struct yagl_thread_state *cur_ts,
+ GLuint texture,
uint32_t width,
uint32_t height,
uint32_t bpp,
GLenum format = 0;
GLuint cur_tex = 0;
GLsizei unpack[3];
+ struct yagl_gles_api_ts *gles_api_ts = cur_ts->gles_api_ts;
YAGL_LOG_FUNC_SET(glUpdateOffscreenImageYAGL);
gles_api_ts->driver->PixelStorei(GL_UNPACK_IMAGE_HEIGHT, 0);
gles_api_ts->driver->BindTexture(GL_TEXTURE_2D,
- yagl_gles_object_get(texture));
+ yagl_gles_object_get(cur_ts, texture));
gles_api_ts->driver->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
gles_api_ts->driver->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
gles_api_ts->driver->BindTexture(GL_TEXTURE_2D, cur_tex);
}
-void yagl_host_glGenUniformLocationYAGL(uint32_t location,
+void yagl_host_glGenUniformLocationYAGL(struct yagl_thread_state *cur_ts,
+ uint32_t location,
GLuint program,
const GLchar *name, int32_t name_count)
{
- yagl_gles_api_ps_add_location(gles_api_ts->ps,
+ yagl_gles_api_ps_add_location(cur_ts->gles_api_ts->ps,
location,
- gles_api_ts->driver->GetUniformLocation(yagl_gles_object_get(program), name));
+ cur_ts->gles_api_ts->driver->GetUniformLocation(yagl_gles_object_get(cur_ts, program), name));
}
-void yagl_host_glDeleteUniformLocationsYAGL(const uint32_t *locations, int32_t locations_count)
+void yagl_host_glDeleteUniformLocationsYAGL(struct yagl_thread_state *cur_ts,
+ const uint32_t *locations, int32_t locations_count)
{
int i;
for (i = 0; i < locations_count; ++i) {
- yagl_gles_api_ps_remove_location(gles_api_ts->ps, locations[i]);
+ yagl_gles_api_ps_remove_location(cur_ts->gles_api_ts->ps, locations[i]);
}
}
#include "yagl_api.h"
#include <GL/gl.h>
-struct yagl_api_ps *yagl_host_gles_process_init(struct yagl_api *api);
+struct yagl_api_ps *yagl_host_gles_process_init(struct yagl_process_state *ps, struct yagl_api *api);
-void yagl_host_glDrawArrays(GLenum mode,
+void yagl_host_glDrawArrays(struct yagl_thread_state *cur_ts,
+ GLenum mode,
GLint first,
GLsizei count);
-void yagl_host_glDrawElements(GLenum mode,
+void yagl_host_glDrawElements(struct yagl_thread_state *cur_ts,
+ GLenum mode,
GLsizei count,
GLenum type,
const GLvoid *indices, int32_t indices_count);
-void yagl_host_glReadPixelsData(GLint x,
+void yagl_host_glReadPixelsData(struct yagl_thread_state *cur_ts,
+ GLint x,
GLint y,
GLsizei width,
GLsizei height,
GLenum format,
GLenum type,
GLvoid *pixels, int32_t pixels_maxcount, int32_t *pixels_count);
-void yagl_host_glReadPixelsOffset(GLint x,
+void yagl_host_glReadPixelsOffset(struct yagl_thread_state *cur_ts,
+ GLint x,
GLint y,
GLsizei width,
GLsizei height,
GLenum format,
GLenum type,
uintptr_t pixels);
-void yagl_host_glDrawArraysInstanced(GLenum mode,
+void yagl_host_glDrawArraysInstanced(struct yagl_thread_state *cur_ts,
+ GLenum mode,
GLint start,
GLsizei count,
GLsizei primcount);
-void yagl_host_glDrawElementsInstanced(GLenum mode,
+void yagl_host_glDrawElementsInstanced(struct yagl_thread_state *cur_ts,
+ GLenum mode,
GLsizei count,
GLenum type,
const void *indices, int32_t indices_count,
GLsizei primcount);
-void yagl_host_glDrawRangeElements(GLenum mode,
+void yagl_host_glDrawRangeElements(struct yagl_thread_state *cur_ts,
+ GLenum mode,
GLuint start,
GLuint end,
GLsizei count,
GLenum type,
const GLvoid *indices, int32_t indices_count);
-void yagl_host_glGenVertexArrays(const GLuint *arrays, int32_t arrays_count);
-void yagl_host_glBindVertexArray(GLuint array);
-void yagl_host_glDisableVertexAttribArray(GLuint index);
-void yagl_host_glEnableVertexAttribArray(GLuint index);
-void yagl_host_glVertexAttribPointerData(GLuint indx,
+void yagl_host_glGenVertexArrays(struct yagl_thread_state *cur_ts,
+ const GLuint *arrays, int32_t arrays_count);
+void yagl_host_glBindVertexArray(struct yagl_thread_state *cur_ts,
+ GLuint array);
+void yagl_host_glDisableVertexAttribArray(struct yagl_thread_state *cur_ts,
+ GLuint index);
+void yagl_host_glEnableVertexAttribArray(struct yagl_thread_state *cur_ts,
+ GLuint index);
+void yagl_host_glVertexAttribPointerData(struct yagl_thread_state *cur_ts,
+ GLuint indx,
GLint size,
GLenum type,
GLboolean normalized,
GLsizei stride,
GLint first,
const GLvoid *data, int32_t data_count);
-void yagl_host_glVertexAttribPointerOffset(GLuint indx,
+void yagl_host_glVertexAttribPointerOffset(struct yagl_thread_state *cur_ts,
+ GLuint indx,
GLint size,
GLenum type,
GLboolean normalized,
GLsizei stride,
uintptr_t offset);
-void yagl_host_glVertexPointerData(GLint size,
+void yagl_host_glVertexPointerData(struct yagl_thread_state *cur_ts,
+ GLint size,
GLenum type,
GLsizei stride,
GLint first,
const GLvoid *data, int32_t data_count);
-void yagl_host_glVertexPointerOffset(GLint size,
+void yagl_host_glVertexPointerOffset(struct yagl_thread_state *cur_ts,
+ GLint size,
GLenum type,
GLsizei stride,
uintptr_t offset);
-void yagl_host_glNormalPointerData(GLenum type,
+void yagl_host_glNormalPointerData(struct yagl_thread_state *cur_ts,
+ GLenum type,
GLsizei stride,
GLint first,
const GLvoid *data, int32_t data_count);
-void yagl_host_glNormalPointerOffset(GLenum type,
+void yagl_host_glNormalPointerOffset(struct yagl_thread_state *cur_ts,
+ GLenum type,
GLsizei stride,
uintptr_t offset);
-void yagl_host_glColorPointerData(GLint size,
+void yagl_host_glColorPointerData(struct yagl_thread_state *cur_ts,
+ GLint size,
GLenum type,
GLsizei stride,
GLint first,
const GLvoid *data, int32_t data_count);
-void yagl_host_glColorPointerOffset(GLint size,
+void yagl_host_glColorPointerOffset(struct yagl_thread_state *cur_ts,
+ GLint size,
GLenum type,
GLsizei stride,
uintptr_t offset);
-void yagl_host_glTexCoordPointerData(GLint tex_id,
+void yagl_host_glTexCoordPointerData(struct yagl_thread_state *cur_ts,
+ GLint tex_id,
GLint size,
GLenum type,
GLsizei stride,
GLint first,
const GLvoid *data, int32_t data_count);
-void yagl_host_glTexCoordPointerOffset(GLint size,
+void yagl_host_glTexCoordPointerOffset(struct yagl_thread_state *cur_ts,
+ GLint size,
GLenum type,
GLsizei stride,
uintptr_t offset);
-void yagl_host_glDisableClientState(GLenum array);
-void yagl_host_glEnableClientState(GLenum array);
-void yagl_host_glVertexAttribDivisor(GLuint index,
+void yagl_host_glDisableClientState(struct yagl_thread_state *cur_ts,
+ GLenum array);
+void yagl_host_glEnableClientState(struct yagl_thread_state *cur_ts,
+ GLenum array);
+void yagl_host_glVertexAttribDivisor(struct yagl_thread_state *cur_ts,
+ GLuint index,
GLuint divisor);
-void yagl_host_glVertexAttribIPointerData(GLuint index,
+void yagl_host_glVertexAttribIPointerData(struct yagl_thread_state *cur_ts,
+ GLuint index,
GLint size,
GLenum type,
GLsizei stride,
GLint first,
const GLvoid *data, int32_t data_count);
-void yagl_host_glVertexAttribIPointerOffset(GLuint index,
+void yagl_host_glVertexAttribIPointerOffset(struct yagl_thread_state *cur_ts,
+ GLuint index,
GLint size,
GLenum type,
GLsizei stride,
uintptr_t offset);
-void yagl_host_glGenBuffers(const GLuint *buffers, int32_t buffers_count);
-void yagl_host_glBindBuffer(GLenum target,
+void yagl_host_glGenBuffers(struct yagl_thread_state *cur_ts,
+ const GLuint *buffers, int32_t buffers_count);
+void yagl_host_glBindBuffer(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLuint buffer);
-void yagl_host_glBufferData(GLenum target,
+void yagl_host_glBufferData(struct yagl_thread_state *cur_ts,
+ GLenum target,
const GLvoid *data, int32_t data_count,
GLenum usage);
-void yagl_host_glBufferSubData(GLenum target,
+void yagl_host_glBufferSubData(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLsizei offset,
const GLvoid *data, int32_t data_count);
-void yagl_host_glBindBufferBase(GLenum target,
+void yagl_host_glBindBufferBase(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLuint index,
GLuint buffer);
-void yagl_host_glBindBufferRange(GLenum target,
+void yagl_host_glBindBufferRange(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLuint index,
GLuint buffer,
GLint offset,
GLsizei size);
-void yagl_host_glMapBuffer(GLuint buffer,
+void yagl_host_glMapBuffer(struct yagl_thread_state *cur_ts,
+ GLuint buffer,
const GLuint *ranges, int32_t ranges_count,
GLvoid *data, int32_t data_maxcount, int32_t *data_count);
-void yagl_host_glCopyBufferSubData(GLenum readTarget,
+void yagl_host_glCopyBufferSubData(struct yagl_thread_state *cur_ts,
+ GLenum readTarget,
GLenum writeTarget,
GLintptr readOffset,
GLintptr writeOffset,
GLsizei size);
-void yagl_host_glGenTextures(const GLuint *textures, int32_t textures_count);
-void yagl_host_glBindTexture(GLenum target,
+void yagl_host_glGenTextures(struct yagl_thread_state *cur_ts,
+ const GLuint *textures, int32_t textures_count);
+void yagl_host_glBindTexture(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLuint texture);
-void yagl_host_glActiveTexture(GLenum texture);
-void yagl_host_glCopyTexImage2D(GLenum target,
+void yagl_host_glActiveTexture(struct yagl_thread_state *cur_ts,
+ GLenum texture);
+void yagl_host_glCopyTexImage2D(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLint level,
GLenum internalformat,
GLint x,
GLsizei width,
GLsizei height,
GLint border);
-void yagl_host_glCopyTexSubImage2D(GLenum target,
+void yagl_host_glCopyTexSubImage2D(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLint level,
GLint xoffset,
GLint yoffset,
GLint y,
GLsizei width,
GLsizei height);
-void yagl_host_glGetTexParameterfv(GLenum target,
+void yagl_host_glGetTexParameterfv(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLenum pname,
GLfloat *param);
-void yagl_host_glGetTexParameteriv(GLenum target,
+void yagl_host_glGetTexParameteriv(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLenum pname,
GLint *param);
-void yagl_host_glTexImage2DData(GLenum target,
+void yagl_host_glTexImage2DData(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLint level,
GLint internalformat,
GLsizei width,
GLenum format,
GLenum type,
const GLvoid *pixels, int32_t pixels_count);
-void yagl_host_glTexImage2DOffset(GLenum target,
+void yagl_host_glTexImage2DOffset(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLint level,
GLint internalformat,
GLsizei width,
GLenum format,
GLenum type,
uintptr_t pixels);
-void yagl_host_glTexParameterf(GLenum target,
+void yagl_host_glTexParameterf(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLenum pname,
GLfloat param);
-void yagl_host_glTexParameterfv(GLenum target,
+void yagl_host_glTexParameterfv(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLenum pname,
const GLfloat *params, int32_t params_count);
-void yagl_host_glTexParameteri(GLenum target,
+void yagl_host_glTexParameteri(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLenum pname,
GLint param);
-void yagl_host_glTexParameteriv(GLenum target,
+void yagl_host_glTexParameteriv(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLenum pname,
const GLint *params, int32_t params_count);
-void yagl_host_glTexSubImage2DData(GLenum target,
+void yagl_host_glTexSubImage2DData(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLint level,
GLint xoffset,
GLint yoffset,
GLenum format,
GLenum type,
const GLvoid *pixels, int32_t pixels_count);
-void yagl_host_glTexSubImage2DOffset(GLenum target,
+void yagl_host_glTexSubImage2DOffset(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLint level,
GLint xoffset,
GLint yoffset,
GLenum format,
GLenum type,
uintptr_t pixels);
-void yagl_host_glClientActiveTexture(GLenum texture);
-void yagl_host_glTexEnvi(GLenum target,
+void yagl_host_glClientActiveTexture(struct yagl_thread_state *cur_ts,
+ GLenum texture);
+void yagl_host_glTexEnvi(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLenum pname,
GLint param);
-void yagl_host_glTexEnvf(GLenum target,
+void yagl_host_glTexEnvf(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLenum pname,
GLfloat param);
-void yagl_host_glMultiTexCoord4f(GLenum target,
+void yagl_host_glMultiTexCoord4f(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLfloat s,
GLfloat tt,
GLfloat r,
GLfloat q);
-void yagl_host_glTexEnviv(GLenum target,
+void yagl_host_glTexEnviv(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLenum pname,
const GLint *params, int32_t params_count);
-void yagl_host_glTexEnvfv(GLenum target,
+void yagl_host_glTexEnvfv(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLenum pname,
const GLfloat *params, int32_t params_count);
-void yagl_host_glGetTexEnviv(GLenum env,
+void yagl_host_glGetTexEnviv(struct yagl_thread_state *cur_ts,
+ GLenum env,
GLenum pname,
GLint *params, int32_t params_maxcount, int32_t *params_count);
-void yagl_host_glGetTexEnvfv(GLenum env,
+void yagl_host_glGetTexEnvfv(struct yagl_thread_state *cur_ts,
+ GLenum env,
GLenum pname,
GLfloat *params, int32_t params_maxcount, int32_t *params_count);
-void yagl_host_glTexImage3DData(GLenum target,
+void yagl_host_glTexImage3DData(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLint level,
GLint internalformat,
GLsizei width,
GLenum format,
GLenum type,
const void *pixels, int32_t pixels_count);
-void yagl_host_glTexImage3DOffset(GLenum target,
+void yagl_host_glTexImage3DOffset(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLint level,
GLint internalformat,
GLsizei width,
GLenum format,
GLenum type,
uintptr_t pixels);
-void yagl_host_glTexSubImage3DData(GLenum target,
+void yagl_host_glTexSubImage3DData(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLint level,
GLint xoffset,
GLint yoffset,
GLenum format,
GLenum type,
const void *pixels, int32_t pixels_count);
-void yagl_host_glTexSubImage3DOffset(GLenum target,
+void yagl_host_glTexSubImage3DOffset(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLint level,
GLint xoffset,
GLint yoffset,
GLenum format,
GLenum type,
uintptr_t pixels);
-void yagl_host_glCopyTexSubImage3D(GLenum target,
+void yagl_host_glCopyTexSubImage3D(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLint level,
GLint xoffset,
GLint yoffset,
GLint y,
GLsizei width,
GLsizei height);
-void yagl_host_glGenFramebuffers(const GLuint *framebuffers, int32_t framebuffers_count);
-void yagl_host_glBindFramebuffer(GLenum target,
+void yagl_host_glGenFramebuffers(struct yagl_thread_state *cur_ts,
+ const GLuint *framebuffers, int32_t framebuffers_count);
+void yagl_host_glBindFramebuffer(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLuint framebuffer);
-void yagl_host_glFramebufferTexture2D(GLenum target,
+void yagl_host_glFramebufferTexture2D(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLenum attachment,
GLenum textarget,
GLuint texture,
GLint level);
-void yagl_host_glFramebufferRenderbuffer(GLenum target,
+void yagl_host_glFramebufferRenderbuffer(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLenum attachment,
GLenum renderbuffertarget,
GLuint renderbuffer);
-void yagl_host_glBlitFramebuffer(GLint srcX0,
+void yagl_host_glBlitFramebuffer(struct yagl_thread_state *cur_ts,
+ GLint srcX0,
GLint srcY0,
GLint srcX1,
GLint srcY1,
GLint dstY1,
GLbitfield mask,
GLenum filter);
-void yagl_host_glDrawBuffers(const GLenum *bufs, int32_t bufs_count);
-void yagl_host_glReadBuffer(GLenum mode);
-void yagl_host_glFramebufferTexture3D(GLenum target,
+void yagl_host_glDrawBuffers(struct yagl_thread_state *cur_ts,
+ const GLenum *bufs, int32_t bufs_count);
+void yagl_host_glReadBuffer(struct yagl_thread_state *cur_ts,
+ GLenum mode);
+void yagl_host_glFramebufferTexture3D(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLenum attachment,
GLenum textarget,
GLuint texture,
GLint level,
GLint zoffset);
-void yagl_host_glFramebufferTextureLayer(GLenum target,
+void yagl_host_glFramebufferTextureLayer(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLenum attachment,
GLuint texture,
GLint level,
GLint layer);
-void yagl_host_glClearBufferiv(GLenum buffer,
+void yagl_host_glClearBufferiv(struct yagl_thread_state *cur_ts,
+ GLenum buffer,
GLint drawbuffer,
const GLint *value, int32_t value_count);
-void yagl_host_glClearBufferuiv(GLenum buffer,
+void yagl_host_glClearBufferuiv(struct yagl_thread_state *cur_ts,
+ GLenum buffer,
GLint drawbuffer,
const GLuint *value, int32_t value_count);
-void yagl_host_glClearBufferfi(GLenum buffer,
+void yagl_host_glClearBufferfi(struct yagl_thread_state *cur_ts,
+ GLenum buffer,
GLint drawbuffer,
GLfloat depth,
GLint stencil);
-void yagl_host_glClearBufferfv(GLenum buffer,
+void yagl_host_glClearBufferfv(struct yagl_thread_state *cur_ts,
+ GLenum buffer,
GLint drawbuffer,
const GLfloat *value, int32_t value_count);
-void yagl_host_glGenRenderbuffers(const GLuint *renderbuffers, int32_t renderbuffers_count);
-void yagl_host_glBindRenderbuffer(GLenum target,
+void yagl_host_glGenRenderbuffers(struct yagl_thread_state *cur_ts,
+ const GLuint *renderbuffers, int32_t renderbuffers_count);
+void yagl_host_glBindRenderbuffer(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLuint renderbuffer);
-void yagl_host_glRenderbufferStorage(GLenum target,
+void yagl_host_glRenderbufferStorage(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLenum internalformat,
GLsizei width,
GLsizei height);
-void yagl_host_glGetRenderbufferParameteriv(GLenum target,
+void yagl_host_glGetRenderbufferParameteriv(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLenum pname,
GLint *param);
-void yagl_host_glRenderbufferStorageMultisample(GLenum target,
+void yagl_host_glRenderbufferStorageMultisample(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLsizei samples,
GLenum internalformat,
GLsizei width,
GLsizei height);
-void yagl_host_glCreateProgram(GLuint program);
-void yagl_host_glCreateShader(GLuint shader,
+void yagl_host_glCreateProgram(struct yagl_thread_state *cur_ts,
+ GLuint program);
+void yagl_host_glCreateShader(struct yagl_thread_state *cur_ts,
+ GLuint shader,
GLenum type);
-void yagl_host_glShaderSource(GLuint shader,
+void yagl_host_glShaderSource(struct yagl_thread_state *cur_ts,
+ GLuint shader,
const GLchar *string, int32_t string_count);
-void yagl_host_glAttachShader(GLuint program,
+void yagl_host_glAttachShader(struct yagl_thread_state *cur_ts,
+ GLuint program,
+ GLuint shader);
+void yagl_host_glDetachShader(struct yagl_thread_state *cur_ts,
+ GLuint program,
GLuint shader);
-void yagl_host_glDetachShader(GLuint program,
+void yagl_host_glCompileShader(struct yagl_thread_state *cur_ts,
GLuint shader);
-void yagl_host_glCompileShader(GLuint shader);
-void yagl_host_glBindAttribLocation(GLuint program,
+void yagl_host_glBindAttribLocation(struct yagl_thread_state *cur_ts,
+ GLuint program,
GLuint index,
const GLchar *name, int32_t name_count);
-void yagl_host_glGetActiveAttrib(GLuint program,
+void yagl_host_glGetActiveAttrib(struct yagl_thread_state *cur_ts,
+ GLuint program,
GLuint index,
GLint *size,
GLenum *type,
GLchar *name, int32_t name_maxcount, int32_t *name_count);
-void yagl_host_glGetActiveUniform(GLuint program,
+void yagl_host_glGetActiveUniform(struct yagl_thread_state *cur_ts,
+ GLuint program,
GLuint index,
GLint *size,
GLenum *type,
GLchar *name, int32_t name_maxcount, int32_t *name_count);
-int yagl_host_glGetAttribLocation(GLuint program,
+int yagl_host_glGetAttribLocation(struct yagl_thread_state *cur_ts,
+ GLuint program,
const GLchar *name, int32_t name_count);
-void yagl_host_glGetProgramiv(GLuint program,
+void yagl_host_glGetProgramiv(struct yagl_thread_state *cur_ts,
+ GLuint program,
GLenum pname,
GLint *param);
-GLboolean yagl_host_glGetProgramInfoLog(GLuint program,
+GLboolean yagl_host_glGetProgramInfoLog(struct yagl_thread_state *cur_ts,
+ GLuint program,
GLchar *infolog, int32_t infolog_maxcount, int32_t *infolog_count);
-void yagl_host_glGetShaderiv(GLuint shader,
+void yagl_host_glGetShaderiv(struct yagl_thread_state *cur_ts,
+ GLuint shader,
GLenum pname,
GLint *param);
-GLboolean yagl_host_glGetShaderInfoLog(GLuint shader,
+GLboolean yagl_host_glGetShaderInfoLog(struct yagl_thread_state *cur_ts,
+ GLuint shader,
GLchar *infolog, int32_t infolog_maxcount, int32_t *infolog_count);
-void yagl_host_glGetUniformfv(GLboolean tl,
+void yagl_host_glGetUniformfv(struct yagl_thread_state *cur_ts,
+ GLboolean tl,
GLuint program,
uint32_t location,
GLfloat *params, int32_t params_maxcount, int32_t *params_count);
-void yagl_host_glGetUniformiv(GLboolean tl,
+void yagl_host_glGetUniformiv(struct yagl_thread_state *cur_ts,
+ GLboolean tl,
GLuint program,
uint32_t location,
GLint *params, int32_t params_maxcount, int32_t *params_count);
-int yagl_host_glGetUniformLocation(GLuint program,
+int yagl_host_glGetUniformLocation(struct yagl_thread_state *cur_ts,
+ GLuint program,
const GLchar *name, int32_t name_count);
-void yagl_host_glGetVertexAttribfv(GLuint index,
+void yagl_host_glGetVertexAttribfv(struct yagl_thread_state *cur_ts,
+ GLuint index,
GLenum pname,
GLfloat *params, int32_t params_maxcount, int32_t *params_count);
-void yagl_host_glGetVertexAttribiv(GLuint index,
+void yagl_host_glGetVertexAttribiv(struct yagl_thread_state *cur_ts,
+ GLuint index,
GLenum pname,
GLint *params, int32_t params_maxcount, int32_t *params_count);
-void yagl_host_glLinkProgram(GLuint program,
+void yagl_host_glLinkProgram(struct yagl_thread_state *cur_ts,
+ GLuint program,
GLint *params, int32_t params_maxcount, int32_t *params_count);
-void yagl_host_glUniform1f(GLboolean tl,
+void yagl_host_glUniform1f(struct yagl_thread_state *cur_ts,
+ GLboolean tl,
uint32_t location,
GLfloat x);
-void yagl_host_glUniform1fv(GLboolean tl,
+void yagl_host_glUniform1fv(struct yagl_thread_state *cur_ts,
+ GLboolean tl,
uint32_t location,
const GLfloat *v, int32_t v_count);
-void yagl_host_glUniform1i(GLboolean tl,
+void yagl_host_glUniform1i(struct yagl_thread_state *cur_ts,
+ GLboolean tl,
uint32_t location,
GLint x);
-void yagl_host_glUniform1iv(GLboolean tl,
+void yagl_host_glUniform1iv(struct yagl_thread_state *cur_ts,
+ GLboolean tl,
uint32_t location,
const GLint *v, int32_t v_count);
-void yagl_host_glUniform2f(GLboolean tl,
+void yagl_host_glUniform2f(struct yagl_thread_state *cur_ts,
+ GLboolean tl,
uint32_t location,
GLfloat x,
GLfloat y);
-void yagl_host_glUniform2fv(GLboolean tl,
+void yagl_host_glUniform2fv(struct yagl_thread_state *cur_ts,
+ GLboolean tl,
uint32_t location,
const GLfloat *v, int32_t v_count);
-void yagl_host_glUniform2i(GLboolean tl,
+void yagl_host_glUniform2i(struct yagl_thread_state *cur_ts,
+ GLboolean tl,
uint32_t location,
GLint x,
GLint y);
-void yagl_host_glUniform2iv(GLboolean tl,
+void yagl_host_glUniform2iv(struct yagl_thread_state *cur_ts,
+ GLboolean tl,
uint32_t location,
const GLint *v, int32_t v_count);
-void yagl_host_glUniform3f(GLboolean tl,
+void yagl_host_glUniform3f(struct yagl_thread_state *cur_ts,
+ GLboolean tl,
uint32_t location,
GLfloat x,
GLfloat y,
GLfloat z);
-void yagl_host_glUniform3fv(GLboolean tl,
+void yagl_host_glUniform3fv(struct yagl_thread_state *cur_ts,
+ GLboolean tl,
uint32_t location,
const GLfloat *v, int32_t v_count);
-void yagl_host_glUniform3i(GLboolean tl,
+void yagl_host_glUniform3i(struct yagl_thread_state *cur_ts,
+ GLboolean tl,
uint32_t location,
GLint x,
GLint y,
GLint z);
-void yagl_host_glUniform3iv(GLboolean tl,
+void yagl_host_glUniform3iv(struct yagl_thread_state *cur_ts,
+ GLboolean tl,
uint32_t location,
const GLint *v, int32_t v_count);
-void yagl_host_glUniform4f(GLboolean tl,
+void yagl_host_glUniform4f(struct yagl_thread_state *cur_ts,
+ GLboolean tl,
uint32_t location,
GLfloat x,
GLfloat y,
GLfloat z,
GLfloat w);
-void yagl_host_glUniform4fv(GLboolean tl,
+void yagl_host_glUniform4fv(struct yagl_thread_state *cur_ts,
+ GLboolean tl,
uint32_t location,
const GLfloat *v, int32_t v_count);
-void yagl_host_glUniform4i(GLboolean tl,
+void yagl_host_glUniform4i(struct yagl_thread_state *cur_ts,
+ GLboolean tl,
uint32_t location,
GLint x,
GLint y,
GLint z,
GLint w);
-void yagl_host_glUniform4iv(GLboolean tl,
+void yagl_host_glUniform4iv(struct yagl_thread_state *cur_ts,
+ GLboolean tl,
uint32_t location,
const GLint *v, int32_t v_count);
-void yagl_host_glUniformMatrix2fv(GLboolean tl,
+void yagl_host_glUniformMatrix2fv(struct yagl_thread_state *cur_ts,
+ GLboolean tl,
uint32_t location,
GLboolean transpose,
const GLfloat *value, int32_t value_count);
-void yagl_host_glUniformMatrix3fv(GLboolean tl,
+void yagl_host_glUniformMatrix3fv(struct yagl_thread_state *cur_ts,
+ GLboolean tl,
uint32_t location,
GLboolean transpose,
const GLfloat *value, int32_t value_count);
-void yagl_host_glUniformMatrix4fv(GLboolean tl,
+void yagl_host_glUniformMatrix4fv(struct yagl_thread_state *cur_ts,
+ GLboolean tl,
uint32_t location,
GLboolean transpose,
const GLfloat *value, int32_t value_count);
-void yagl_host_glUseProgram(GLuint program);
-void yagl_host_glValidateProgram(GLuint program);
-void yagl_host_glVertexAttrib1f(GLuint indx,
+void yagl_host_glUseProgram(struct yagl_thread_state *cur_ts,
+ GLuint program);
+void yagl_host_glValidateProgram(struct yagl_thread_state *cur_ts,
+ GLuint program);
+void yagl_host_glVertexAttrib1f(struct yagl_thread_state *cur_ts,
+ GLuint indx,
GLfloat x);
-void yagl_host_glVertexAttrib1fv(GLuint indx,
+void yagl_host_glVertexAttrib1fv(struct yagl_thread_state *cur_ts,
+ GLuint indx,
const GLfloat *values, int32_t values_count);
-void yagl_host_glVertexAttrib2f(GLuint indx,
+void yagl_host_glVertexAttrib2f(struct yagl_thread_state *cur_ts,
+ GLuint indx,
GLfloat x,
GLfloat y);
-void yagl_host_glVertexAttrib2fv(GLuint indx,
+void yagl_host_glVertexAttrib2fv(struct yagl_thread_state *cur_ts,
+ GLuint indx,
const GLfloat *values, int32_t values_count);
-void yagl_host_glVertexAttrib3f(GLuint indx,
+void yagl_host_glVertexAttrib3f(struct yagl_thread_state *cur_ts,
+ GLuint indx,
GLfloat x,
GLfloat y,
GLfloat z);
-void yagl_host_glVertexAttrib3fv(GLuint indx,
+void yagl_host_glVertexAttrib3fv(struct yagl_thread_state *cur_ts,
+ GLuint indx,
const GLfloat *values, int32_t values_count);
-void yagl_host_glVertexAttrib4f(GLuint indx,
+void yagl_host_glVertexAttrib4f(struct yagl_thread_state *cur_ts,
+ GLuint indx,
GLfloat x,
GLfloat y,
GLfloat z,
GLfloat w);
-void yagl_host_glVertexAttrib4fv(GLuint indx,
+void yagl_host_glVertexAttrib4fv(struct yagl_thread_state *cur_ts,
+ GLuint indx,
const GLfloat *values, int32_t values_count);
-void yagl_host_glGetActiveUniformsiv(GLuint program,
+void yagl_host_glGetActiveUniformsiv(struct yagl_thread_state *cur_ts,
+ GLuint program,
const GLuint *uniformIndices, int32_t uniformIndices_count,
GLint *params, int32_t params_maxcount, int32_t *params_count);
-void yagl_host_glGetUniformIndices(GLuint program,
+void yagl_host_glGetUniformIndices(struct yagl_thread_state *cur_ts,
+ GLuint program,
const GLchar *uniformNames, int32_t uniformNames_count,
GLuint *uniformIndices, int32_t uniformIndices_maxcount, int32_t *uniformIndices_count);
-GLuint yagl_host_glGetUniformBlockIndex(GLuint program,
+GLuint yagl_host_glGetUniformBlockIndex(struct yagl_thread_state *cur_ts,
+ GLuint program,
const GLchar *uniformBlockName, int32_t uniformBlockName_count);
-void yagl_host_glUniformBlockBinding(GLuint program,
+void yagl_host_glUniformBlockBinding(struct yagl_thread_state *cur_ts,
+ GLuint program,
GLuint uniformBlockIndex,
GLuint uniformBlockBinding);
-void yagl_host_glGetActiveUniformBlockName(GLuint program,
+void yagl_host_glGetActiveUniformBlockName(struct yagl_thread_state *cur_ts,
+ GLuint program,
GLuint uniformBlockIndex,
GLchar *uniformBlockName, int32_t uniformBlockName_maxcount, int32_t *uniformBlockName_count);
-void yagl_host_glGetActiveUniformBlockiv(GLuint program,
+void yagl_host_glGetActiveUniformBlockiv(struct yagl_thread_state *cur_ts,
+ GLuint program,
GLuint uniformBlockIndex,
GLenum pname,
GLint *params, int32_t params_maxcount, int32_t *params_count);
-void yagl_host_glGetVertexAttribIiv(GLuint index,
+void yagl_host_glGetVertexAttribIiv(struct yagl_thread_state *cur_ts,
+ GLuint index,
GLenum pname,
GLint *params, int32_t params_maxcount, int32_t *params_count);
-void yagl_host_glGetVertexAttribIuiv(GLuint index,
+void yagl_host_glGetVertexAttribIuiv(struct yagl_thread_state *cur_ts,
+ GLuint index,
GLenum pname,
GLuint *params, int32_t params_maxcount, int32_t *params_count);
-void yagl_host_glVertexAttribI4i(GLuint index,
+void yagl_host_glVertexAttribI4i(struct yagl_thread_state *cur_ts,
+ GLuint index,
GLint x,
GLint y,
GLint z,
GLint w);
-void yagl_host_glVertexAttribI4ui(GLuint index,
+void yagl_host_glVertexAttribI4ui(struct yagl_thread_state *cur_ts,
+ GLuint index,
GLuint x,
GLuint y,
GLuint z,
GLuint w);
-void yagl_host_glVertexAttribI4iv(GLuint index,
+void yagl_host_glVertexAttribI4iv(struct yagl_thread_state *cur_ts,
+ GLuint index,
const GLint *v, int32_t v_count);
-void yagl_host_glVertexAttribI4uiv(GLuint index,
+void yagl_host_glVertexAttribI4uiv(struct yagl_thread_state *cur_ts,
+ GLuint index,
const GLuint *v, int32_t v_count);
-void yagl_host_glGetUniformuiv(GLboolean tl,
+void yagl_host_glGetUniformuiv(struct yagl_thread_state *cur_ts,
+ GLboolean tl,
GLuint program,
uint32_t location,
GLuint *params, int32_t params_maxcount, int32_t *params_count);
-void yagl_host_glUniform1ui(GLboolean tl,
+void yagl_host_glUniform1ui(struct yagl_thread_state *cur_ts,
+ GLboolean tl,
uint32_t location,
GLuint v0);
-void yagl_host_glUniform2ui(GLboolean tl,
+void yagl_host_glUniform2ui(struct yagl_thread_state *cur_ts,
+ GLboolean tl,
uint32_t location,
GLuint v0,
GLuint v1);
-void yagl_host_glUniform3ui(GLboolean tl,
+void yagl_host_glUniform3ui(struct yagl_thread_state *cur_ts,
+ GLboolean tl,
uint32_t location,
GLuint v0,
GLuint v1,
GLuint v2);
-void yagl_host_glUniform4ui(GLboolean tl,
+void yagl_host_glUniform4ui(struct yagl_thread_state *cur_ts,
+ GLboolean tl,
uint32_t location,
GLuint v0,
GLuint v1,
GLuint v2,
GLuint v3);
-void yagl_host_glUniform1uiv(GLboolean tl,
+void yagl_host_glUniform1uiv(struct yagl_thread_state *cur_ts,
+ GLboolean tl,
uint32_t location,
const GLuint *v, int32_t v_count);
-void yagl_host_glUniform2uiv(GLboolean tl,
+void yagl_host_glUniform2uiv(struct yagl_thread_state *cur_ts,
+ GLboolean tl,
uint32_t location,
const GLuint *v, int32_t v_count);
-void yagl_host_glUniform3uiv(GLboolean tl,
+void yagl_host_glUniform3uiv(struct yagl_thread_state *cur_ts,
+ GLboolean tl,
uint32_t location,
const GLuint *v, int32_t v_count);
-void yagl_host_glUniform4uiv(GLboolean tl,
+void yagl_host_glUniform4uiv(struct yagl_thread_state *cur_ts,
+ GLboolean tl,
uint32_t location,
const GLuint *v, int32_t v_count);
-void yagl_host_glUniformMatrix2x3fv(GLboolean tl,
+void yagl_host_glUniformMatrix2x3fv(struct yagl_thread_state *cur_ts,
+ GLboolean tl,
uint32_t location,
GLboolean transpose,
const GLfloat *value, int32_t value_count);
-void yagl_host_glUniformMatrix2x4fv(GLboolean tl,
+void yagl_host_glUniformMatrix2x4fv(struct yagl_thread_state *cur_ts,
+ GLboolean tl,
uint32_t location,
GLboolean transpose,
const GLfloat *value, int32_t value_count);
-void yagl_host_glUniformMatrix3x2fv(GLboolean tl,
+void yagl_host_glUniformMatrix3x2fv(struct yagl_thread_state *cur_ts,
+ GLboolean tl,
uint32_t location,
GLboolean transpose,
const GLfloat *value, int32_t value_count);
-void yagl_host_glUniformMatrix3x4fv(GLboolean tl,
+void yagl_host_glUniformMatrix3x4fv(struct yagl_thread_state *cur_ts,
+ GLboolean tl,
uint32_t location,
GLboolean transpose,
const GLfloat *value, int32_t value_count);
-void yagl_host_glUniformMatrix4x2fv(GLboolean tl,
+void yagl_host_glUniformMatrix4x2fv(struct yagl_thread_state *cur_ts,
+ GLboolean tl,
uint32_t location,
GLboolean transpose,
const GLfloat *value, int32_t value_count);
-void yagl_host_glUniformMatrix4x3fv(GLboolean tl,
+void yagl_host_glUniformMatrix4x3fv(struct yagl_thread_state *cur_ts,
+ GLboolean tl,
uint32_t location,
GLboolean transpose,
const GLfloat *value, int32_t value_count);
-void yagl_host_glGetIntegerv(GLenum pname,
+void yagl_host_glGetIntegerv(struct yagl_thread_state *cur_ts,
+ GLenum pname,
GLint *params, int32_t params_maxcount, int32_t *params_count);
-int yagl_host_glGetFragDataLocation(GLuint program,
+int yagl_host_glGetFragDataLocation(struct yagl_thread_state *cur_ts,
+ GLuint program,
const GLchar *name, int32_t name_count);
-void yagl_host_glGetFloatv(GLenum pname,
+void yagl_host_glGetFloatv(struct yagl_thread_state *cur_ts,
+ GLenum pname,
GLfloat *params, int32_t params_maxcount, int32_t *params_count);
-void yagl_host_glGetString(GLenum name,
+void yagl_host_glGetString(struct yagl_thread_state *cur_ts,
+ GLenum name,
GLchar *str, int32_t str_maxcount, int32_t *str_count);
-GLboolean yagl_host_glIsEnabled(GLenum cap);
-void yagl_host_glGenTransformFeedbacks(const GLuint *ids, int32_t ids_count);
-void yagl_host_glBindTransformFeedback(GLenum target,
+GLboolean yagl_host_glIsEnabled(struct yagl_thread_state *cur_ts, GLenum cap);
+void yagl_host_glGenTransformFeedbacks(struct yagl_thread_state *cur_ts,
+ const GLuint *ids, int32_t ids_count);
+void yagl_host_glBindTransformFeedback(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLuint id);
-void yagl_host_glBeginTransformFeedback(GLenum primitiveMode);
-void yagl_host_glEndTransformFeedback(void);
-void yagl_host_glPauseTransformFeedback(void);
-void yagl_host_glResumeTransformFeedback(void);
-void yagl_host_glTransformFeedbackVaryings(GLuint program,
+void yagl_host_glBeginTransformFeedback(struct yagl_thread_state *cur_ts,
+ GLenum primitiveMode);
+void yagl_host_glEndTransformFeedback(struct yagl_thread_state *cur_ts);
+void yagl_host_glPauseTransformFeedback(struct yagl_thread_state *cur_ts);
+void yagl_host_glResumeTransformFeedback(struct yagl_thread_state *cur_ts);
+void yagl_host_glTransformFeedbackVaryings(struct yagl_thread_state *cur_ts,
+ struct yagl_transport *t,
+ GLuint program,
const GLchar *varyings, int32_t varyings_count,
GLenum bufferMode);
-void yagl_host_glGetTransformFeedbackVaryings(GLuint program,
+void yagl_host_glGetTransformFeedbackVaryings(struct yagl_thread_state *cur_ts,
+ GLuint program,
GLsizei *sizes, int32_t sizes_maxcount, int32_t *sizes_count,
GLenum *types, int32_t types_maxcount, int32_t *types_count);
-void yagl_host_glGenQueries(const GLuint *ids, int32_t ids_count);
-void yagl_host_glBeginQuery(GLenum target,
+void yagl_host_glGenQueries(struct yagl_thread_state *cur_ts,
+ const GLuint *ids, int32_t ids_count);
+void yagl_host_glBeginQuery(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLuint id);
-void yagl_host_glEndQuery(GLenum target);
-GLboolean yagl_host_glGetQueryObjectuiv(GLuint id,
+void yagl_host_glEndQuery(struct yagl_thread_state *cur_ts,
+ GLenum target);
+GLboolean yagl_host_glGetQueryObjectuiv(struct yagl_thread_state *cur_ts,
+ GLuint id,
GLenum pname, GLuint *result);
-void yagl_host_glGenSamplers(const GLuint *samplers, int32_t samplers_count);
-void yagl_host_glBindSampler(GLuint unit,
+void yagl_host_glGenSamplers(struct yagl_thread_state *cur_ts,
+ const GLuint *samplers, int32_t samplers_count);
+void yagl_host_glBindSampler(struct yagl_thread_state *cur_ts,
+ GLuint unit,
GLuint sampler);
-void yagl_host_glSamplerParameteri(GLuint sampler,
+void yagl_host_glSamplerParameteri(struct yagl_thread_state *cur_ts,
+ GLuint sampler,
GLenum pname,
GLint param);
-void yagl_host_glSamplerParameteriv(GLuint sampler,
+void yagl_host_glSamplerParameteriv(struct yagl_thread_state *cur_ts,
+ GLuint sampler,
GLenum pname,
const GLint *param, int32_t param_count);
-void yagl_host_glSamplerParameterf(GLuint sampler,
+void yagl_host_glSamplerParameterf(struct yagl_thread_state *cur_ts,
+ GLuint sampler,
GLenum pname,
GLfloat param);
-void yagl_host_glSamplerParameterfv(GLuint sampler,
+void yagl_host_glSamplerParameterfv(struct yagl_thread_state *cur_ts,
+ GLuint sampler,
GLenum pname,
const GLfloat *param, int32_t param_count);
-void yagl_host_glDeleteObjects(const GLuint *objects, int32_t objects_count);
-void yagl_host_glBlendEquation(GLenum mode);
-void yagl_host_glBlendEquationSeparate(GLenum modeRGB,
+void yagl_host_glDeleteObjects(struct yagl_thread_state *cur_ts,
+ const GLuint *objects, int32_t objects_count);
+void yagl_host_glBlendEquation(struct yagl_thread_state *cur_ts,
+ GLenum mode);
+void yagl_host_glBlendEquationSeparate(struct yagl_thread_state *cur_ts,
+ GLenum modeRGB,
GLenum modeAlpha);
-void yagl_host_glBlendFunc(GLenum sfactor,
+void yagl_host_glBlendFunc(struct yagl_thread_state *cur_ts,
+ GLenum sfactor,
GLenum dfactor);
-void yagl_host_glBlendFuncSeparate(GLenum srcRGB,
+void yagl_host_glBlendFuncSeparate(struct yagl_thread_state *cur_ts,
+ GLenum srcRGB,
GLenum dstRGB,
GLenum srcAlpha,
GLenum dstAlpha);
-void yagl_host_glBlendColor(GLclampf red,
+void yagl_host_glBlendColor(struct yagl_thread_state *cur_ts,
+ GLclampf red,
GLclampf green,
GLclampf blue,
GLclampf alpha);
-void yagl_host_glClear(GLbitfield mask);
-void yagl_host_glClearColor(GLclampf red,
+void yagl_host_glClear(struct yagl_thread_state *cur_ts,
+ GLbitfield mask);
+void yagl_host_glClearColor(struct yagl_thread_state *cur_ts,
+ GLclampf red,
GLclampf green,
GLclampf blue,
GLclampf alpha);
-void yagl_host_glClearDepthf(GLclampf depth);
-void yagl_host_glClearStencil(GLint s);
-void yagl_host_glColorMask(GLboolean red,
+void yagl_host_glClearDepthf(struct yagl_thread_state *cur_ts,
+ GLclampf depth);
+void yagl_host_glClearStencil(struct yagl_thread_state *cur_ts,
+ GLint s);
+void yagl_host_glColorMask(struct yagl_thread_state *cur_ts,
+ GLboolean red,
GLboolean green,
GLboolean blue,
GLboolean alpha);
-void yagl_host_glCullFace(GLenum mode);
-void yagl_host_glDepthFunc(GLenum func);
-void yagl_host_glDepthMask(GLboolean flag);
-void yagl_host_glDepthRangef(GLclampf zNear,
+void yagl_host_glCullFace(struct yagl_thread_state *cur_ts,
+ GLenum mode);
+void yagl_host_glDepthFunc(struct yagl_thread_state *cur_ts,
+ GLenum func);
+void yagl_host_glDepthMask(struct yagl_thread_state *cur_ts,
+ GLboolean flag);
+void yagl_host_glDepthRangef(struct yagl_thread_state *cur_ts,
+ GLclampf zNear,
GLclampf zFar);
-void yagl_host_glEnable(GLenum cap);
-void yagl_host_glDisable(GLenum cap);
-void yagl_host_glFlush(void);
-void yagl_host_glFrontFace(GLenum mode);
-void yagl_host_glGenerateMipmap(GLenum target);
-void yagl_host_glHint(GLenum target,
+void yagl_host_glEnable(struct yagl_thread_state *cur_ts,
+ GLenum cap);
+void yagl_host_glDisable(struct yagl_thread_state *cur_ts,
+ GLenum cap);
+void yagl_host_glFlush(struct yagl_thread_state *cur_ts);
+void yagl_host_glFrontFace(struct yagl_thread_state *cur_ts,
+ GLenum mode);
+void yagl_host_glGenerateMipmap(struct yagl_thread_state *cur_ts,
+ GLenum target);
+void yagl_host_glHint(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLenum mode);
-void yagl_host_glLineWidth(GLfloat width);
-void yagl_host_glPixelStorei(GLenum pname,
+void yagl_host_glLineWidth(struct yagl_thread_state *cur_ts,
+ GLfloat width);
+void yagl_host_glPixelStorei(struct yagl_thread_state *cur_ts,
+ GLenum pname,
GLint param);
-void yagl_host_glPolygonOffset(GLfloat factor,
+void yagl_host_glPolygonOffset(struct yagl_thread_state *cur_ts,
+ GLfloat factor,
GLfloat units);
-void yagl_host_glScissor(GLint x,
+void yagl_host_glScissor(struct yagl_thread_state *cur_ts,
+ GLint x,
GLint y,
GLsizei width,
GLsizei height);
-void yagl_host_glStencilFunc(GLenum func,
+void yagl_host_glStencilFunc(struct yagl_thread_state *cur_ts,
+ GLenum func,
GLint ref,
GLuint mask);
-void yagl_host_glStencilMask(GLuint mask);
-void yagl_host_glStencilOp(GLenum fail,
+void yagl_host_glStencilMask(struct yagl_thread_state *cur_ts,
+ GLuint mask);
+void yagl_host_glStencilOp(struct yagl_thread_state *cur_ts,
+ GLenum fail,
GLenum zfail,
GLenum zpass);
-void yagl_host_glSampleCoverage(GLclampf value,
+void yagl_host_glSampleCoverage(struct yagl_thread_state *cur_ts,
+ GLclampf value,
GLboolean invert);
-void yagl_host_glViewport(GLint x,
+void yagl_host_glViewport(struct yagl_thread_state *cur_ts,
+ GLint x,
GLint y,
GLsizei width,
GLsizei height);
-void yagl_host_glStencilFuncSeparate(GLenum face,
+void yagl_host_glStencilFuncSeparate(struct yagl_thread_state *cur_ts,
+ GLenum face,
GLenum func,
GLint ref,
GLuint mask);
-void yagl_host_glStencilMaskSeparate(GLenum face,
+void yagl_host_glStencilMaskSeparate(struct yagl_thread_state *cur_ts,
+ GLenum face,
GLuint mask);
-void yagl_host_glStencilOpSeparate(GLenum face,
+void yagl_host_glStencilOpSeparate(struct yagl_thread_state *cur_ts,
+ GLenum face,
GLenum fail,
GLenum zfail,
GLenum zpass);
-void yagl_host_glPointSize(GLfloat size);
-void yagl_host_glAlphaFunc(GLenum func,
+void yagl_host_glPointSize(struct yagl_thread_state *cur_ts,
+ GLfloat size);
+void yagl_host_glAlphaFunc(struct yagl_thread_state *cur_ts,
+ GLenum func,
GLclampf ref);
-void yagl_host_glMatrixMode(GLenum mode);
-void yagl_host_glLoadIdentity(void);
-void yagl_host_glPopMatrix(void);
-void yagl_host_glPushMatrix(void);
-void yagl_host_glRotatef(GLfloat angle,
+void yagl_host_glMatrixMode(struct yagl_thread_state *cur_ts,
+ GLenum mode);
+void yagl_host_glLoadIdentity(struct yagl_thread_state *cur_ts);
+void yagl_host_glPopMatrix(struct yagl_thread_state *cur_ts);
+void yagl_host_glPushMatrix(struct yagl_thread_state *cur_ts);
+void yagl_host_glRotatef(struct yagl_thread_state *cur_ts,
+ GLfloat angle,
GLfloat x,
GLfloat y,
GLfloat z);
-void yagl_host_glTranslatef(GLfloat x,
+void yagl_host_glTranslatef(struct yagl_thread_state *cur_ts,
+ GLfloat x,
GLfloat y,
GLfloat z);
-void yagl_host_glScalef(GLfloat x,
+void yagl_host_glScalef(struct yagl_thread_state *cur_ts,
+ GLfloat x,
GLfloat y,
GLfloat z);
-void yagl_host_glOrthof(GLfloat left,
+void yagl_host_glOrthof(struct yagl_thread_state *cur_ts,
+ GLfloat left,
GLfloat right,
GLfloat bottom,
GLfloat top,
GLfloat zNear,
GLfloat zFar);
-void yagl_host_glColor4f(GLfloat red,
+void yagl_host_glColor4f(struct yagl_thread_state *cur_ts,
+ GLfloat red,
GLfloat green,
GLfloat blue,
GLfloat alpha);
-void yagl_host_glColor4ub(GLubyte red,
+void yagl_host_glColor4ub(struct yagl_thread_state *cur_ts,
+ GLubyte red,
GLubyte green,
GLubyte blue,
GLubyte alpha);
-void yagl_host_glNormal3f(GLfloat nx,
+void yagl_host_glNormal3f(struct yagl_thread_state *cur_ts,
+ GLfloat nx,
GLfloat ny,
GLfloat nz);
-void yagl_host_glPointParameterf(GLenum pname,
+void yagl_host_glPointParameterf(struct yagl_thread_state *cur_ts,
+ GLenum pname,
GLfloat param);
-void yagl_host_glPointParameterfv(GLenum pname,
+void yagl_host_glPointParameterfv(struct yagl_thread_state *cur_ts,
+ GLenum pname,
const GLfloat *params, int32_t params_count);
-void yagl_host_glFogf(GLenum pname,
+void yagl_host_glFogf(struct yagl_thread_state *cur_ts,
+ GLenum pname,
GLfloat param);
-void yagl_host_glFogfv(GLenum pname,
+void yagl_host_glFogfv(struct yagl_thread_state *cur_ts,
+ GLenum pname,
const GLfloat *params, int32_t params_count);
-void yagl_host_glFrustumf(GLfloat left,
+void yagl_host_glFrustumf(struct yagl_thread_state *cur_ts,
+ GLfloat left,
GLfloat right,
GLfloat bottom,
GLfloat top,
GLfloat zNear,
GLfloat zFar);
-void yagl_host_glLightf(GLenum light,
+void yagl_host_glLightf(struct yagl_thread_state *cur_ts,
+ GLenum light,
GLenum pname,
GLfloat param);
-void yagl_host_glLightfv(GLenum light,
+void yagl_host_glLightfv(struct yagl_thread_state *cur_ts,
+ GLenum light,
GLenum pname,
const GLfloat *params, int32_t params_count);
-void yagl_host_glGetLightfv(GLenum light,
+void yagl_host_glGetLightfv(struct yagl_thread_state *cur_ts,
+ GLenum light,
GLenum pname,
GLfloat *params, int32_t params_maxcount, int32_t *params_count);
-void yagl_host_glLightModelf(GLenum pname,
+void yagl_host_glLightModelf(struct yagl_thread_state *cur_ts,
+ GLenum pname,
GLfloat param);
-void yagl_host_glLightModelfv(GLenum pname,
+void yagl_host_glLightModelfv(struct yagl_thread_state *cur_ts,
+ GLenum pname,
const GLfloat *params, int32_t params_count);
-void yagl_host_glMaterialf(GLenum face,
+void yagl_host_glMaterialf(struct yagl_thread_state *cur_ts,
+ GLenum face,
GLenum pname,
GLfloat param);
-void yagl_host_glMaterialfv(GLenum face,
+void yagl_host_glMaterialfv(struct yagl_thread_state *cur_ts,
+ GLenum face,
GLenum pname,
const GLfloat *params, int32_t params_count);
-void yagl_host_glGetMaterialfv(GLenum face,
+void yagl_host_glGetMaterialfv(struct yagl_thread_state *cur_ts,
+ GLenum face,
GLenum pname,
GLfloat *params, int32_t params_maxcount, int32_t *params_count);
-void yagl_host_glShadeModel(GLenum mode);
-void yagl_host_glLogicOp(GLenum opcode);
-void yagl_host_glMultMatrixf(const GLfloat *m, int32_t m_count);
-void yagl_host_glLoadMatrixf(const GLfloat *m, int32_t m_count);
-void yagl_host_glClipPlanef(GLenum plane,
+void yagl_host_glShadeModel(struct yagl_thread_state *cur_ts,
+ GLenum mode);
+void yagl_host_glLogicOp(struct yagl_thread_state *cur_ts,
+ GLenum opcode);
+void yagl_host_glMultMatrixf(struct yagl_thread_state *cur_ts,
+ const GLfloat *m, int32_t m_count);
+void yagl_host_glLoadMatrixf(struct yagl_thread_state *cur_ts,
+ const GLfloat *m, int32_t m_count);
+void yagl_host_glClipPlanef(struct yagl_thread_state *cur_ts,
+ GLenum plane,
const GLfloat *equation, int32_t equation_count);
-void yagl_host_glGetClipPlanef(GLenum pname,
+void yagl_host_glGetClipPlanef(struct yagl_thread_state *cur_ts,
+ GLenum pname,
GLfloat *eqn, int32_t eqn_maxcount, int32_t *eqn_count);
-void yagl_host_glUpdateOffscreenImageYAGL(GLuint texture,
+void yagl_host_glUpdateOffscreenImageYAGL(struct yagl_thread_state *cur_ts,
+ GLuint texture,
uint32_t width,
uint32_t height,
uint32_t bpp,
const void *pixels, int32_t pixels_count);
-void yagl_host_glGenUniformLocationYAGL(uint32_t location,
+void yagl_host_glGenUniformLocationYAGL(struct yagl_thread_state *cur_ts,
+ uint32_t location,
GLuint program,
const GLchar *name, int32_t name_count);
-void yagl_host_glDeleteUniformLocationsYAGL(const uint32_t *locations, int32_t locations_count);
+void yagl_host_glDeleteUniformLocationsYAGL(struct yagl_thread_state *cur_ts,
+ const uint32_t *locations, int32_t locations_count);
#endif
#include "yagl_thread.h"
#include "yagl_gles_driver.h"
-YAGL_DEFINE_TLS(struct yagl_egl_offscreen_ts*, egl_offscreen_ts);
-
-static void yagl_egl_offscreen_thread_init(struct yagl_egl_backend *backend)
+static void yagl_egl_offscreen_thread_init(struct yagl_thread_state *cur_ts,
+ struct yagl_egl_backend *backend)
{
- YAGL_LOG_FUNC_ENTER(yagl_egl_offscreen_thread_init, NULL);
+ struct yagl_egl_offscreen *egl_offscreen = (struct yagl_egl_offscreen*)backend;
- egl_offscreen_ts = yagl_egl_offscreen_ts_create();
+ YAGL_LOG_FUNC_ENTER(yagl_egl_offscreen_thread_init, NULL);
- cur_ts->egl_offscreen_ts = egl_offscreen_ts;
+ cur_ts->egl_offscreen_ts = yagl_egl_offscreen_ts_create(egl_offscreen->gles_driver);
YAGL_LOG_FUNC_EXIT(NULL);
}
-static void yagl_egl_offscreen_batch_start(struct yagl_egl_backend *backend)
+static void yagl_egl_offscreen_batch_start(struct yagl_thread_state *cur_ts,
+ struct yagl_egl_backend *backend)
{
struct yagl_egl_offscreen *egl_offscreen = (struct yagl_egl_offscreen*)backend;
-
- egl_offscreen_ts = cur_ts->egl_offscreen_ts;
+ struct yagl_egl_offscreen_ts *egl_offscreen_ts = cur_ts->egl_offscreen_ts;
if (!egl_offscreen_ts->dpy) {
return;
egl_offscreen_ts->ctx->native_ctx);
}
-static void yagl_egl_offscreen_batch_end(struct yagl_egl_backend *backend)
+static void yagl_egl_offscreen_batch_end(struct yagl_thread_state *cur_ts,
+ struct yagl_egl_backend *backend)
{
struct yagl_egl_offscreen *egl_offscreen = (struct yagl_egl_offscreen*)backend;
+ struct yagl_egl_offscreen_ts *egl_offscreen_ts = cur_ts->egl_offscreen_ts;
if (!egl_offscreen_ts->dpy) {
return;
return dpy ? &dpy->base : NULL;
}
-static bool yagl_egl_offscreen_make_current(struct yagl_egl_backend *backend,
+static bool yagl_egl_offscreen_make_current(struct yagl_thread_state *cur_ts,
+ struct yagl_egl_backend *backend,
struct yagl_eglb_display *dpy,
struct yagl_eglb_context *ctx,
struct yagl_eglb_surface *draw,
struct yagl_eglb_surface *read)
{
struct yagl_egl_offscreen *egl_offscreen = (struct yagl_egl_offscreen*)backend;
+ struct yagl_egl_offscreen_ts *egl_offscreen_ts = cur_ts->egl_offscreen_ts;
struct yagl_egl_offscreen_display *egl_offscreen_dpy = (struct yagl_egl_offscreen_display*)dpy;
struct yagl_egl_offscreen_context *egl_offscreen_ctx = (struct yagl_egl_offscreen_context*)ctx;
struct yagl_egl_offscreen_surface *egl_offscreen_draw = (struct yagl_egl_offscreen_surface*)draw;
return res;
}
-static bool yagl_egl_offscreen_release_current(struct yagl_egl_backend *backend, bool force)
+static bool yagl_egl_offscreen_release_current(struct yagl_thread_state *cur_ts,
+ struct yagl_egl_backend *backend,
+ bool force)
{
struct yagl_egl_offscreen *egl_offscreen = (struct yagl_egl_offscreen*)backend;
+ struct yagl_egl_offscreen_ts *egl_offscreen_ts = cur_ts->egl_offscreen_ts;
bool res;
YAGL_LOG_FUNC_ENTER(yagl_egl_offscreen_release_current, NULL);
return res || force;
}
-static void yagl_egl_offscreen_thread_fini(struct yagl_egl_backend *backend)
+static void yagl_egl_offscreen_thread_fini(struct yagl_thread_state *cur_ts,
+ struct yagl_egl_backend *backend)
{
YAGL_LOG_FUNC_ENTER(yagl_egl_offscreen_thread_fini, NULL);
- yagl_egl_offscreen_ts_destroy(egl_offscreen_ts);
- egl_offscreen_ts = cur_ts->egl_offscreen_ts = NULL;
+ yagl_egl_offscreen_ts_destroy(cur_ts->egl_offscreen_ts);
+ cur_ts->egl_offscreen_ts = NULL;
YAGL_LOG_FUNC_EXIT(NULL);
}
-static void yagl_egl_offscreen_ensure_current(struct yagl_egl_backend *backend)
+static void yagl_egl_offscreen_ensure_current(struct yagl_thread_state *cur_ts,
+ struct yagl_egl_backend *backend)
{
struct yagl_egl_offscreen *egl_offscreen = (struct yagl_egl_offscreen*)backend;
egl_offscreen->ensure_ctx);
}
-static void yagl_egl_offscreen_unensure_current(struct yagl_egl_backend *backend)
+static void yagl_egl_offscreen_unensure_current(struct yagl_thread_state *cur_ts,
+ struct yagl_egl_backend *backend)
{
struct yagl_egl_offscreen *egl_offscreen = (struct yagl_egl_offscreen*)backend;
+ // cur_ts may be NULL here if called from main thread
+ struct yagl_egl_offscreen_ts *egl_offscreen_ts = (cur_ts ? cur_ts->egl_offscreen_ts : NULL);
if (egl_offscreen_ts && egl_offscreen_ts->dpy) {
egl_offscreen->egl_driver->make_current(egl_offscreen->egl_driver,
static void yagl_egl_offscreen_destroy(struct yagl_egl_backend *backend)
{
struct yagl_egl_offscreen *egl_offscreen = (struct yagl_egl_offscreen*)backend;
+ YAGL_LOG_NO_TS;
YAGL_LOG_FUNC_ENTER(yagl_egl_offscreen_destroy, NULL);
EGLSurface sfc = EGL_NO_SURFACE;
EGLContext ctx = EGL_NO_CONTEXT;
EGLContext global_ctx = EGL_NO_CONTEXT;
+ YAGL_LOG_NO_TS;
YAGL_LOG_FUNC_ENTER(yagl_egl_offscreen_create, NULL);
#include "yagl_egl_native_config.h"
#include "yagl_gles_driver.h"
#include "yagl_log.h"
-#include "yagl_tls.h"
#include "yagl_process.h"
#include "yagl_thread.h"
-static void yagl_egl_offscreen_context_destroy(struct yagl_eglb_context *ctx)
+static void yagl_egl_offscreen_context_destroy(struct yagl_thread_state *cur_ts,
+ struct yagl_eglb_context *ctx)
{
struct yagl_egl_offscreen_context *egl_offscreen_ctx =
(struct yagl_egl_offscreen_context*)ctx;
YAGL_LOG_FUNC_ENTER(yagl_egl_offscreen_context_destroy, NULL);
if (egl_offscreen_ctx->rp_pbo) {
- yagl_ensure_ctx(0);
+ yagl_ensure_ctx(cur_ts, 0);
egl_offscreen->gles_driver->DeleteBuffers(1, &egl_offscreen_ctx->rp_pbo);
- yagl_unensure_ctx(0);
+ yagl_unensure_ctx(cur_ts, 0);
}
egl_offscreen->egl_driver->context_destroy(egl_offscreen->egl_driver,
}
struct yagl_egl_offscreen_context
- *yagl_egl_offscreen_context_create(struct yagl_egl_offscreen_display *dpy,
+ *yagl_egl_offscreen_context_create(struct yagl_thread_state *cur_ts,
+ struct yagl_egl_offscreen_display *dpy,
const struct yagl_egl_native_config *cfg,
struct yagl_egl_offscreen_context *share_context,
int version)
yagl_eglb_context_init(&ctx->base, &dpy->base);
ctx->base.destroy = &yagl_egl_offscreen_context_destroy;
+ ctx->base.ps = cur_ts->ps;
ctx->native_ctx = native_ctx;
return ctx;
}
-bool yagl_egl_offscreen_context_read_pixels(struct yagl_egl_offscreen_context *ctx,
+bool yagl_egl_offscreen_context_read_pixels(struct yagl_thread_state *cur_ts,
+ struct yagl_egl_offscreen_context *ctx,
uint32_t width,
uint32_t height,
uint32_t bpp,
gles_driver->GetIntegerv(GL_READ_FRAMEBUFFER_BINDING,
(GLint*)¤t_fb);
- gles_driver->BindFramebuffer(GL_READ_FRAMEBUFFER, 0);
+ gles_driver->BindFramebufferYAGL(cur_ts, GL_READ_FRAMEBUFFER, 0);
gles_driver->GetIntegerv(GL_PACK_ALIGNMENT, ¤t_pack[0]);
gles_driver->GetIntegerv(GL_PACK_ROW_LENGTH, ¤t_pack[1]);
gles_driver->PixelStorei(GL_PACK_IMAGE_HEIGHT, current_pack[2]);
gles_driver->BindBuffer(GL_PIXEL_PACK_BUFFER_ARB,
current_pbo);
- gles_driver->BindFramebuffer(GL_READ_FRAMEBUFFER, current_fb);
+ gles_driver->BindFramebufferYAGL(cur_ts, GL_READ_FRAMEBUFFER, current_fb);
YAGL_LOG_FUNC_EXIT(NULL);
};
struct yagl_egl_offscreen_context
- *yagl_egl_offscreen_context_create(struct yagl_egl_offscreen_display *dpy,
+ *yagl_egl_offscreen_context_create(struct yagl_thread_state *cur_ts,
+ struct yagl_egl_offscreen_display *dpy,
const struct yagl_egl_native_config *cfg,
struct yagl_egl_offscreen_context *share_context,
int version);
-bool yagl_egl_offscreen_context_read_pixels(struct yagl_egl_offscreen_context *ctx,
+bool yagl_egl_offscreen_context_read_pixels(struct yagl_thread_state *cur_ts,
+ struct yagl_egl_offscreen_context *ctx,
uint32_t width,
uint32_t height,
uint32_t bpp,
#include "yagl_egl_offscreen.h"
#include "yagl_egl_native_config.h"
#include "yagl_log.h"
-#include "yagl_tls.h"
#include "yagl_process.h"
#include "yagl_thread.h"
#include "yagl_object_map.h"
struct yagl_gles_driver *driver;
};
-static void yagl_egl_offscreen_image_destroy(struct yagl_object *obj)
+static void yagl_egl_offscreen_image_destroy(struct yagl_thread_state *cur_ts,
+ struct yagl_object *obj)
{
struct yagl_egl_offscreen_image *image = (struct yagl_egl_offscreen_image*)obj;
YAGL_LOG_FUNC_ENTER(yagl_egl_offscreen_image_destroy, "%u", obj->global_name);
- yagl_ensure_ctx(0);
+ yagl_ensure_ctx(cur_ts, 0);
image->driver->DeleteTextures(1, &obj->global_name);
- yagl_unensure_ctx(0);
+ yagl_unensure_ctx(cur_ts, 0);
g_free(image);
struct yagl_egl_offscreen *egl_offscreen =
(struct yagl_egl_offscreen*)dpy->backend;
struct yagl_egl_native_config *native_configs;
+ YAGL_LOG_NO_TS;
YAGL_LOG_FUNC_ENTER(yagl_egl_offscreen_display_config_enum,
"dpy = %p", dpy);
(struct yagl_egl_offscreen_display*)dpy;
struct yagl_egl_offscreen *egl_offscreen =
(struct yagl_egl_offscreen*)dpy->backend;
+ YAGL_LOG_NO_TS;
YAGL_LOG_FUNC_ENTER(yagl_egl_offscreen_display_config_cleanup,
"dpy = %p, cfg = %d",
}
static struct yagl_eglb_context
- *yagl_egl_offscreen_display_create_context(struct yagl_eglb_display *dpy,
+ *yagl_egl_offscreen_display_create_context(struct yagl_thread_state *cur_ts,
+ struct yagl_eglb_display *dpy,
const struct yagl_egl_native_config *cfg,
struct yagl_eglb_context *share_context,
int version)
struct yagl_egl_offscreen_display *egl_offscreen_dpy =
(struct yagl_egl_offscreen_display*)dpy;
struct yagl_egl_offscreen_context *ctx =
- yagl_egl_offscreen_context_create(egl_offscreen_dpy,
+ yagl_egl_offscreen_context_create(cur_ts,
+ egl_offscreen_dpy,
cfg,
(struct yagl_egl_offscreen_context*)share_context,
version);
}
static struct yagl_eglb_surface
- *yagl_egl_offscreen_display_create_surface(struct yagl_eglb_display *dpy,
+ *yagl_egl_offscreen_display_create_surface(struct yagl_thread_state *cur_ts,
+ struct yagl_eglb_display *dpy,
const struct yagl_egl_native_config *cfg,
EGLenum type,
const void *attribs,
struct yagl_egl_offscreen_display *egl_offscreen_dpy =
(struct yagl_egl_offscreen_display*)dpy;
struct yagl_egl_offscreen_surface *sfc =
- yagl_egl_offscreen_surface_create(egl_offscreen_dpy,
+ yagl_egl_offscreen_surface_create(cur_ts,
+ egl_offscreen_dpy,
cfg,
type,
attribs,
return sfc ? &sfc->base : NULL;
}
-static struct yagl_object *yagl_egl_offscreen_display_create_image(struct yagl_eglb_display *dpy,
+static struct yagl_object *yagl_egl_offscreen_display_create_image(struct yagl_thread_state *cur_ts,
+ struct yagl_eglb_display *dpy,
yagl_winsys_id buffer)
{
struct yagl_egl_offscreen *egl_offscreen =
image = g_malloc(sizeof(*image));
- yagl_ensure_ctx(0);
+ yagl_ensure_ctx(cur_ts, 0);
egl_offscreen->gles_driver->GenTextures(1, &image->base.global_name);
- yagl_unensure_ctx(0);
+ yagl_unensure_ctx(cur_ts, 0);
image->base.destroy = &yagl_egl_offscreen_image_destroy;
image->driver = egl_offscreen->gles_driver;
(struct yagl_egl_offscreen_display*)dpy;
struct yagl_egl_offscreen *egl_offscreen =
(struct yagl_egl_offscreen*)dpy->backend;
+ YAGL_LOG_NO_TS;
YAGL_LOG_FUNC_ENTER(yagl_egl_offscreen_display_destroy,
"dpy = %p", dpy);
{
struct yagl_egl_offscreen_display *dpy;
EGLNativeDisplayType native_dpy;
+ YAGL_LOG_NO_TS;
YAGL_LOG_FUNC_ENTER(yagl_egl_offscreen_display_create, NULL);
#include "yagl_egl_offscreen_ts.h"
#include "yagl_egl_offscreen.h"
#include "yagl_egl_native_config.h"
-#include "yagl_tls.h"
#include "yagl_log.h"
#include "yagl_process.h"
#include "yagl_thread.h"
#include "yagl_compiled_transfer.h"
-YAGL_DECLARE_TLS(struct yagl_egl_offscreen_ts*, egl_offscreen_ts);
-
static void yagl_egl_offscreen_surface_cleanup(struct yagl_egl_offscreen_surface *sfc)
{
struct yagl_egl_offscreen_display *dpy =
(struct yagl_egl_offscreen_display*)sfc->base.dpy;
struct yagl_egl_offscreen *egl_offscreen =
(struct yagl_egl_offscreen*)sfc->base.dpy->backend;
+ YAGL_LOG_NO_TS;
YAGL_LOG_FUNC_ENTER(yagl_egl_offscreen_surface_cleanup, NULL);
YAGL_LOG_FUNC_EXIT(NULL);
}
-static void yagl_egl_offscreen_surface_invalidate(struct yagl_eglb_surface *sfc,
+static void yagl_egl_offscreen_surface_invalidate(struct yagl_thread_state *cur_ts,
+ struct yagl_eglb_surface *sfc,
yagl_winsys_id id)
{
}
-static void yagl_egl_offscreen_surface_replace(struct yagl_eglb_surface *sfc,
+static void yagl_egl_offscreen_surface_replace(struct yagl_thread_state *cur_ts,
+ struct yagl_eglb_surface *sfc,
struct yagl_eglb_surface *with)
{
struct yagl_egl_offscreen_surface *osfc =
g_free(owith);
}
-static bool yagl_egl_offscreen_surface_query(struct yagl_eglb_surface *sfc,
+static bool yagl_egl_offscreen_surface_query(struct yagl_thread_state *cur_ts,
+ struct yagl_eglb_surface *sfc,
EGLint attribute,
EGLint *value)
{
return true;
}
-static void yagl_egl_offscreen_surface_swap_buffers(struct yagl_eglb_surface *sfc)
+static void yagl_egl_offscreen_surface_swap_buffers(struct yagl_thread_state *cur_ts,
+ struct yagl_eglb_surface *sfc)
{
struct yagl_egl_offscreen_surface *osfc =
(struct yagl_egl_offscreen_surface*)sfc;
- struct yagl_egl_offscreen_context *octx = egl_offscreen_ts->ctx;
+ struct yagl_egl_offscreen_context *octx = cur_ts->egl_offscreen_ts->ctx; // TODO get from cur_ts
YAGL_LOG_FUNC_SET(yagl_egl_offscreen_surface_swap_buffers);
assert(octx);
- if (!yagl_egl_offscreen_context_read_pixels(octx,
+ if (!yagl_egl_offscreen_context_read_pixels(cur_ts,
+ octx,
osfc->width,
osfc->height,
osfc->bpp,
yagl_compiled_transfer_exec(osfc->bimage_ct, osfc->host_pixels);
}
-static void yagl_egl_offscreen_surface_copy_buffers(struct yagl_eglb_surface *sfc)
+static void yagl_egl_offscreen_surface_copy_buffers(struct yagl_thread_state *cur_ts,
+ struct yagl_eglb_surface *sfc)
{
struct yagl_egl_offscreen_surface *osfc =
(struct yagl_egl_offscreen_surface*)sfc;
- struct yagl_egl_offscreen_context *octx = egl_offscreen_ts->ctx;
+ struct yagl_egl_offscreen_context *octx = cur_ts->egl_offscreen_ts->ctx; // TODO get from cur_ts
YAGL_LOG_FUNC_SET(yagl_egl_offscreen_surface_copy_buffers);
assert(octx);
- if (!yagl_egl_offscreen_context_read_pixels(octx,
+ if (!yagl_egl_offscreen_context_read_pixels(cur_ts,
+ octx,
osfc->width,
osfc->height,
osfc->bpp,
yagl_compiled_transfer_exec(osfc->bimage_ct, osfc->host_pixels);
}
-static void yagl_egl_offscreen_surface_wait_gl(struct yagl_eglb_surface *sfc)
+static void yagl_egl_offscreen_surface_wait_gl(struct yagl_thread_state *cur_ts,
+ struct yagl_eglb_surface *sfc)
{
}
-static void yagl_egl_offscreen_surface_destroy(struct yagl_eglb_surface *sfc)
+static void yagl_egl_offscreen_surface_destroy(struct yagl_thread_state *cur_ts,
+ struct yagl_eglb_surface *sfc)
{
struct yagl_egl_offscreen_surface *egl_offscreen_sfc =
(struct yagl_egl_offscreen_surface*)sfc;
}
struct yagl_egl_offscreen_surface
- *yagl_egl_offscreen_surface_create(struct yagl_egl_offscreen_display *dpy,
+ *yagl_egl_offscreen_surface_create(struct yagl_thread_state *cur_ts,
+ struct yagl_egl_offscreen_display *dpy,
const struct yagl_egl_native_config *cfg,
EGLenum type,
const void *attribs,
return NULL;
}
- bimage_ct = yagl_compiled_transfer_create(pixels,
+ bimage_ct = yagl_compiled_transfer_create(cur_ts,
+ pixels,
(width * height * bpp),
true);
};
struct yagl_egl_offscreen_surface
- *yagl_egl_offscreen_surface_create(struct yagl_egl_offscreen_display *dpy,
+ *yagl_egl_offscreen_surface_create(struct yagl_thread_state *cur_ts,
+ struct yagl_egl_offscreen_display *dpy,
const struct yagl_egl_native_config *cfg,
EGLenum type,
const void *attribs,
#include "yagl_egl_offscreen_ts.h"
-struct yagl_egl_offscreen_ts *yagl_egl_offscreen_ts_create(void)
+struct yagl_egl_offscreen_ts *yagl_egl_offscreen_ts_create(struct yagl_gles_driver *gles_driver)
{
struct yagl_egl_offscreen_ts *egl_offscreen_ts =
g_malloc0(sizeof(struct yagl_egl_offscreen_ts));
+ egl_offscreen_ts->gles_driver = gles_driver;
+
return egl_offscreen_ts;
}
#include "yagl_types.h"
#include <EGL/egl.h>
+struct yagl_gles_driver;
struct yagl_egl_offscreen_display;
struct yagl_egl_offscreen_context;
struct yagl_egl_offscreen_surface;
struct yagl_egl_offscreen_ts
{
+ struct yagl_gles_driver *gles_driver;
+
struct yagl_egl_offscreen_display *dpy;
struct yagl_egl_offscreen_context *ctx;
EGLSurface sfc_draw;
EGLSurface sfc_read;
};
-struct yagl_egl_offscreen_ts *yagl_egl_offscreen_ts_create(void);
+struct yagl_egl_offscreen_ts *yagl_egl_offscreen_ts_create(struct yagl_gles_driver *gles_driver);
void yagl_egl_offscreen_ts_destroy(struct yagl_egl_offscreen_ts *egl_offscreen_ts);
#include "yagl_egl_onscreen_display.h"
#include "yagl_egl_onscreen_context.h"
#include "yagl_egl_onscreen_surface.h"
-#include "yagl_tls.h"
#include "yagl_log.h"
#include "yagl_process.h"
#include "yagl_thread.h"
#include "yagl_gles_driver.h"
#include "hw/vigs/winsys_gl.h"
-YAGL_DEFINE_TLS(struct yagl_egl_onscreen_ts*, egl_onscreen_ts);
-
-static void yagl_egl_onscreen_setup_framebuffer_zero(struct yagl_egl_onscreen *egl_onscreen)
+static void yagl_egl_onscreen_setup_framebuffer_zero(struct yagl_thread_state *cur_ts,
+ struct yagl_egl_onscreen *egl_onscreen)
{
GLuint cur_fb = 0;
+ struct yagl_egl_onscreen_ts *egl_onscreen_ts = cur_ts->egl_onscreen_ts;
assert(egl_onscreen_ts->dpy);
- yagl_egl_onscreen_context_setup(egl_onscreen_ts->ctx);
+ yagl_egl_onscreen_context_setup(cur_ts, egl_onscreen_ts->ctx);
if (!egl_onscreen_ts->sfc_draw) {
return;
egl_onscreen->gles_driver->GetIntegerv(GL_DRAW_FRAMEBUFFER_BINDING,
(GLint*)&cur_fb);
- egl_onscreen->gles_driver->BindFramebuffer(GL_DRAW_FRAMEBUFFER,
- egl_onscreen_ts->ctx->fb);
+ // this might be called when BindFramebufferYAGL was not yet setup
+ if (egl_onscreen->gles_driver->BindFramebufferYAGL)
+ {
+ egl_onscreen->gles_driver->BindFramebufferYAGL(cur_ts,
+ GL_DRAW_FRAMEBUFFER,
+ egl_onscreen_ts->ctx->fb);
+
+ yagl_egl_onscreen_surface_attach_to_framebuffer(egl_onscreen_ts->sfc_draw,
+ GL_DRAW_FRAMEBUFFER);
- yagl_egl_onscreen_surface_attach_to_framebuffer(egl_onscreen_ts->sfc_draw,
- GL_DRAW_FRAMEBUFFER);
+ egl_onscreen->gles_driver->BindFramebufferYAGL(cur_ts,
+ GL_DRAW_FRAMEBUFFER,
+ cur_fb);
+ }
+ else
+ {
+ egl_onscreen->gles_driver->BindFramebuffer(GL_DRAW_FRAMEBUFFER,
+ egl_onscreen_ts->ctx->fb);
- egl_onscreen->gles_driver->BindFramebuffer(GL_DRAW_FRAMEBUFFER,
- cur_fb);
+ yagl_egl_onscreen_surface_attach_to_framebuffer(egl_onscreen_ts->sfc_draw,
+ GL_DRAW_FRAMEBUFFER);
+
+ egl_onscreen->gles_driver->BindFramebuffer(GL_DRAW_FRAMEBUFFER,
+ cur_fb);
+ }
}
-static void yagl_egl_onscreen_thread_init(struct yagl_egl_backend *backend)
+static void yagl_egl_onscreen_thread_init(struct yagl_thread_state *cur_ts,
+ struct yagl_egl_backend *backend)
{
struct yagl_egl_onscreen *egl_onscreen = (struct yagl_egl_onscreen*)backend;
YAGL_LOG_FUNC_ENTER(yagl_egl_onscreen_thread_init, NULL);
- egl_onscreen_ts = yagl_egl_onscreen_ts_create(egl_onscreen->gles_driver);
-
- cur_ts->egl_onscreen_ts = egl_onscreen_ts;
+ cur_ts->egl_onscreen_ts = yagl_egl_onscreen_ts_create(egl_onscreen->gles_driver);
YAGL_LOG_FUNC_EXIT(NULL);
}
-static void yagl_egl_onscreen_batch_start(struct yagl_egl_backend *backend)
+static void yagl_egl_onscreen_batch_start(struct yagl_thread_state *cur_ts,
+ struct yagl_egl_backend *backend)
{
struct yagl_egl_onscreen *egl_onscreen = (struct yagl_egl_onscreen*)backend;
-
- egl_onscreen_ts = cur_ts->egl_onscreen_ts;
+ struct yagl_egl_onscreen_ts *egl_onscreen_ts = cur_ts->egl_onscreen_ts;
if (!egl_onscreen_ts->dpy) {
return;
}
}
-static void yagl_egl_onscreen_batch_end(struct yagl_egl_backend *backend)
+static void yagl_egl_onscreen_batch_end(struct yagl_thread_state *cur_ts,
+ struct yagl_egl_backend *backend)
{
struct yagl_egl_onscreen *egl_onscreen = (struct yagl_egl_onscreen*)backend;
+ struct yagl_egl_onscreen_ts *egl_onscreen_ts = cur_ts->egl_onscreen_ts;
if (!egl_onscreen_ts->dpy) {
return;
return dpy ? &dpy->base : NULL;
}
-static bool yagl_egl_onscreen_make_current(struct yagl_egl_backend *backend,
+static bool yagl_egl_onscreen_make_current(struct yagl_thread_state *cur_ts,
+ struct yagl_egl_backend *backend,
struct yagl_eglb_display *dpy,
struct yagl_eglb_context *ctx,
struct yagl_eglb_surface *draw,
struct yagl_eglb_surface *read)
{
struct yagl_egl_onscreen *egl_onscreen = (struct yagl_egl_onscreen*)backend;
+ struct yagl_egl_onscreen_ts *egl_onscreen_ts = cur_ts->egl_onscreen_ts;
struct yagl_egl_onscreen_display *egl_onscreen_dpy = (struct yagl_egl_onscreen_display*)dpy;
struct yagl_egl_onscreen_context *egl_onscreen_ctx = (struct yagl_egl_onscreen_context*)ctx;
struct yagl_egl_onscreen_surface *egl_onscreen_draw = (struct yagl_egl_onscreen_surface*)draw;
egl_onscreen_ts->sfc_draw = egl_onscreen_draw;
egl_onscreen_ts->sfc_read = egl_onscreen_read;
- yagl_egl_onscreen_setup_framebuffer_zero(egl_onscreen);
+ yagl_egl_onscreen_setup_framebuffer_zero(cur_ts, egl_onscreen);
egl_onscreen->gles_driver->GetIntegerv(GL_DRAW_FRAMEBUFFER_BINDING,
(GLint*)&cur_fb);
* No framebuffer, then bind our framebuffer zero.
*/
- egl_onscreen->gles_driver->BindFramebuffer(GL_FRAMEBUFFER,
- egl_onscreen_ctx->fb);
+ if (egl_onscreen->gles_driver->BindFramebufferYAGL) {
+ egl_onscreen->gles_driver->BindFramebufferYAGL(cur_ts,
+ GL_FRAMEBUFFER,
+ egl_onscreen_ctx->fb);
+ } else {
+ egl_onscreen->gles_driver->BindFramebuffer(GL_FRAMEBUFFER,
+ egl_onscreen_ctx->fb);
+ }
/*
* Setup default viewport and scissor.
return res;
}
-static bool yagl_egl_onscreen_release_current(struct yagl_egl_backend *backend, bool force)
+static bool yagl_egl_onscreen_release_current(struct yagl_thread_state *cur_ts,
+ struct yagl_egl_backend *backend,
+ bool force)
{
struct yagl_egl_onscreen *egl_onscreen = (struct yagl_egl_onscreen*)backend;
+ struct yagl_egl_onscreen_ts *egl_onscreen_ts = cur_ts->egl_onscreen_ts;
bool res;
YAGL_LOG_FUNC_ENTER(yagl_egl_onscreen_release_current, NULL);
return res || force;
}
-static void yagl_egl_onscreen_thread_fini(struct yagl_egl_backend *backend)
+static void yagl_egl_onscreen_thread_fini(struct yagl_thread_state *cur_ts,
+ struct yagl_egl_backend *backend)
{
YAGL_LOG_FUNC_ENTER(yagl_egl_onscreen_thread_fini, NULL);
- yagl_egl_onscreen_ts_destroy(egl_onscreen_ts);
- egl_onscreen_ts = cur_ts->egl_onscreen_ts = NULL;
+ yagl_egl_onscreen_ts_destroy(cur_ts->egl_onscreen_ts);
+ cur_ts->egl_onscreen_ts = NULL;
YAGL_LOG_FUNC_EXIT(NULL);
}
-static void yagl_egl_onscreen_ensure_current(struct yagl_egl_backend *backend)
+static void yagl_egl_onscreen_ensure_current(struct yagl_thread_state *cur_ts,
+ struct yagl_egl_backend *backend)
{
struct yagl_egl_onscreen *egl_onscreen = (struct yagl_egl_onscreen*)backend;
egl_onscreen->ensure_ctx);
}
-static void yagl_egl_onscreen_unensure_current(struct yagl_egl_backend *backend)
+static void yagl_egl_onscreen_unensure_current(struct yagl_thread_state *cur_ts,
+ struct yagl_egl_backend *backend)
{
struct yagl_egl_onscreen *egl_onscreen = (struct yagl_egl_onscreen*)backend;
+ struct yagl_egl_onscreen_ts *egl_onscreen_ts = (cur_ts ? cur_ts->egl_onscreen_ts : NULL);
if (egl_onscreen_ts && egl_onscreen_ts->dpy) {
if (egl_onscreen_ts->sfc_draw && egl_onscreen_ts->sfc_read) {
static void yagl_egl_onscreen_destroy(struct yagl_egl_backend *backend)
{
struct yagl_egl_onscreen *egl_onscreen = (struct yagl_egl_onscreen*)backend;
+ YAGL_LOG_NO_TS;
YAGL_LOG_FUNC_ENTER(yagl_egl_onscreen_destroy, NULL);
EGLContext ctx = EGL_NO_CONTEXT;
EGLContext global_ctx = EGL_NO_CONTEXT;
struct winsys_gl_info *ws_info = (struct winsys_gl_info*)wsi->ws_info;
+ YAGL_LOG_NO_TS;
YAGL_LOG_FUNC_ENTER(yagl_egl_onscreen_create, NULL);
#include "yagl_egl_surface_attribs.h"
#include "yagl_gles_driver.h"
#include "yagl_log.h"
-#include "yagl_tls.h"
#include "yagl_process.h"
#include "yagl_thread.h"
-static void yagl_egl_onscreen_context_destroy(struct yagl_eglb_context *ctx)
+static void yagl_egl_onscreen_context_destroy(struct yagl_thread_state *cur_ts, struct yagl_eglb_context *ctx)
{
struct yagl_egl_onscreen_context *egl_onscreen_ctx =
(struct yagl_egl_onscreen_context*)ctx;
YAGL_LOG_FUNC_ENTER(yagl_egl_onscreen_context_destroy, NULL);
if (egl_onscreen_ctx->fb) {
- yagl_ensure_ctx(egl_onscreen_ctx->fb_ctx_id);
+ yagl_ensure_ctx(cur_ts, egl_onscreen_ctx->fb_ctx_id);
egl_onscreen->gles_driver->DeleteFramebuffers(1, &egl_onscreen_ctx->fb);
- yagl_unensure_ctx(egl_onscreen_ctx->fb_ctx_id);
+ yagl_unensure_ctx(cur_ts, egl_onscreen_ctx->fb_ctx_id);
}
if (egl_onscreen_ctx->null_sfc != EGL_NO_SURFACE) {
}
struct yagl_egl_onscreen_context
- *yagl_egl_onscreen_context_create(struct yagl_egl_onscreen_display *dpy,
+ *yagl_egl_onscreen_context_create(struct yagl_thread_state *cur_ts,
+ struct yagl_egl_onscreen_display *dpy,
const struct yagl_egl_native_config *cfg,
struct yagl_egl_onscreen_context *share_context,
int version)
yagl_eglb_context_init(&ctx->base, &dpy->base);
ctx->base.destroy = &yagl_egl_onscreen_context_destroy;
+ ctx->base.ps = cur_ts->ps;
ctx->native_ctx = native_ctx;
return ctx;
}
-void yagl_egl_onscreen_context_setup(struct yagl_egl_onscreen_context *ctx)
+void yagl_egl_onscreen_context_setup(struct yagl_thread_state *cur_ts,
+ struct yagl_egl_onscreen_context *ctx)
{
struct yagl_egl_onscreen *egl_onscreen =
(struct yagl_egl_onscreen*)ctx->base.dpy->backend;
}
egl_onscreen->gles_driver->GenFramebuffers(1, &ctx->fb);
- ctx->fb_ctx_id = yagl_get_ctx_id();
+ ctx->fb_ctx_id = yagl_get_ctx_id(cur_ts);
}
bool yagl_egl_onscreen_context_setup_surfaceless(struct yagl_egl_onscreen_context *ctx)
};
struct yagl_egl_onscreen_context
- *yagl_egl_onscreen_context_create(struct yagl_egl_onscreen_display *dpy,
+ *yagl_egl_onscreen_context_create(struct yagl_thread_state *cur_ts,
+ struct yagl_egl_onscreen_display *dpy,
const struct yagl_egl_native_config *cfg,
struct yagl_egl_onscreen_context *share_context,
int version);
-void yagl_egl_onscreen_context_setup(struct yagl_egl_onscreen_context *ctx);
+void yagl_egl_onscreen_context_setup(struct yagl_thread_state *cur_ts,
+ struct yagl_egl_onscreen_context *ctx);
bool yagl_egl_onscreen_context_setup_surfaceless(struct yagl_egl_onscreen_context *ctx);
#include "yagl_egl_onscreen.h"
#include "yagl_egl_native_config.h"
#include "yagl_log.h"
-#include "yagl_tls.h"
#include "yagl_process.h"
#include "yagl_thread.h"
#include "yagl_object_map.h"
struct winsys_gl_surface *ws_sfc;
};
-static void yagl_egl_onscreen_image_destroy(struct yagl_object *obj)
+static void yagl_egl_onscreen_image_destroy(struct yagl_thread_state *cur_ts,
+ struct yagl_object *obj)
{
struct yagl_egl_onscreen_image *image = (struct yagl_egl_onscreen_image*)obj;
struct yagl_egl_onscreen *egl_onscreen =
(struct yagl_egl_onscreen*)dpy->backend;
struct yagl_egl_native_config *native_configs;
+ YAGL_LOG_NO_TS;
YAGL_LOG_FUNC_ENTER(yagl_egl_onscreen_display_config_enum,
"dpy = %p", dpy);
(struct yagl_egl_onscreen_display*)dpy;
struct yagl_egl_onscreen *egl_onscreen =
(struct yagl_egl_onscreen*)dpy->backend;
+ YAGL_LOG_NO_TS;
YAGL_LOG_FUNC_ENTER(yagl_egl_onscreen_display_config_cleanup,
"dpy = %p, cfg = %d",
}
static struct yagl_eglb_context
- *yagl_egl_onscreen_display_create_context(struct yagl_eglb_display *dpy,
+ *yagl_egl_onscreen_display_create_context(struct yagl_thread_state *cur_ts,
+ struct yagl_eglb_display *dpy,
const struct yagl_egl_native_config *cfg,
struct yagl_eglb_context *share_context,
int version)
struct yagl_egl_onscreen_display *egl_onscreen_dpy =
(struct yagl_egl_onscreen_display*)dpy;
struct yagl_egl_onscreen_context *ctx =
- yagl_egl_onscreen_context_create(egl_onscreen_dpy,
+ yagl_egl_onscreen_context_create(cur_ts,
+ egl_onscreen_dpy,
cfg,
(struct yagl_egl_onscreen_context*)share_context,
version);
}
static struct yagl_eglb_surface
- *yagl_egl_onscreen_display_create_window_surface(struct yagl_eglb_display *dpy,
+ *yagl_egl_onscreen_display_create_window_surface(struct yagl_thread_state *cur_ts,
+ struct yagl_eglb_display *dpy,
const struct yagl_egl_native_config *cfg,
const struct yagl_egl_window_attribs *attribs,
yagl_winsys_id id)
struct yagl_egl_onscreen_display *egl_onscreen_dpy =
(struct yagl_egl_onscreen_display*)dpy;
struct yagl_egl_onscreen_surface *sfc =
- yagl_egl_onscreen_surface_create_window(egl_onscreen_dpy,
+ yagl_egl_onscreen_surface_create_window(cur_ts,
+ egl_onscreen_dpy,
cfg,
attribs,
id);
}
static struct yagl_eglb_surface
- *yagl_egl_onscreen_display_create_pixmap_surface(struct yagl_eglb_display *dpy,
+ *yagl_egl_onscreen_display_create_pixmap_surface(struct yagl_thread_state *cur_ts,
+ struct yagl_eglb_display *dpy,
const struct yagl_egl_native_config *cfg,
const struct yagl_egl_pixmap_attribs *attribs,
yagl_winsys_id id)
struct yagl_egl_onscreen_display *egl_onscreen_dpy =
(struct yagl_egl_onscreen_display*)dpy;
struct yagl_egl_onscreen_surface *sfc =
- yagl_egl_onscreen_surface_create_pixmap(egl_onscreen_dpy,
+ yagl_egl_onscreen_surface_create_pixmap(cur_ts,
+ egl_onscreen_dpy,
cfg,
attribs,
id);
}
static struct yagl_eglb_surface
- *yagl_egl_onscreen_display_create_pbuffer_surface(struct yagl_eglb_display *dpy,
+ *yagl_egl_onscreen_display_create_pbuffer_surface(struct yagl_thread_state *cur_ts,
+ struct yagl_eglb_display *dpy,
const struct yagl_egl_native_config *cfg,
const struct yagl_egl_pbuffer_attribs *attribs,
yagl_winsys_id id)
struct yagl_egl_onscreen_display *egl_onscreen_dpy =
(struct yagl_egl_onscreen_display*)dpy;
struct yagl_egl_onscreen_surface *sfc =
- yagl_egl_onscreen_surface_create_pbuffer(egl_onscreen_dpy,
+ yagl_egl_onscreen_surface_create_pbuffer(cur_ts,
+ egl_onscreen_dpy,
cfg,
attribs,
id);
return sfc ? &sfc->base : NULL;
}
-static struct yagl_object *yagl_egl_onscreen_display_create_image(struct yagl_eglb_display *dpy,
+static struct yagl_object *yagl_egl_onscreen_display_create_image(struct yagl_thread_state *cur_ts,
+ struct yagl_eglb_display *dpy,
yagl_winsys_id buffer)
{
struct yagl_egl_onscreen *egl_onscreen =
(struct yagl_egl_onscreen_display*)dpy;
struct yagl_egl_onscreen *egl_onscreen =
(struct yagl_egl_onscreen*)dpy->backend;
+ YAGL_LOG_NO_TS;
YAGL_LOG_FUNC_ENTER(yagl_egl_onscreen_display_destroy,
"dpy = %p", dpy);
{
struct yagl_egl_onscreen_display *dpy;
EGLNativeDisplayType native_dpy;
+ YAGL_LOG_NO_TS;
YAGL_LOG_FUNC_ENTER(yagl_egl_onscreen_display_create, NULL);
#include "yagl_gles_driver.h"
#include "hw/vigs/winsys_gl.h"
-YAGL_DECLARE_TLS(struct yagl_egl_onscreen_ts*, egl_onscreen_ts);
-
-static void yagl_egl_onscreen_surface_invalidate(struct yagl_eglb_surface *sfc,
+static void yagl_egl_onscreen_surface_invalidate(struct yagl_thread_state *cur_ts,
+ struct yagl_eglb_surface *sfc,
yagl_winsys_id id)
{
struct yagl_egl_onscreen_surface *osfc =
if (((osfc->ws_sfc->base.width != ws_sfc->base.width) ||
(osfc->ws_sfc->base.height != ws_sfc->base.height)) &&
osfc->rb) {
- yagl_ensure_ctx(0);
+ yagl_ensure_ctx(cur_ts, 0);
egl_onscreen->gles_driver->DeleteRenderbuffers(1, &osfc->rb);
- yagl_unensure_ctx(0);
+ yagl_unensure_ctx(cur_ts, 0);
osfc->rb = 0;
}
osfc->ws_sfc->base.release(&osfc->ws_sfc->base);
osfc->ws_sfc = ws_sfc;
- if (egl_onscreen_ts->sfc_draw == osfc) {
+ if (cur_ts->egl_onscreen_ts->sfc_draw == osfc) {
GLuint cur_fb = 0;
yagl_egl_onscreen_surface_setup(osfc);
egl_onscreen->gles_driver->GetIntegerv(GL_DRAW_FRAMEBUFFER_BINDING,
(GLint*)&cur_fb);
- egl_onscreen->gles_driver->BindFramebuffer(GL_DRAW_FRAMEBUFFER,
- egl_onscreen_ts->ctx->fb);
+ if (egl_onscreen->gles_driver->BindFramebufferYAGL) {
+ egl_onscreen->gles_driver->BindFramebufferYAGL(cur_ts,
+ GL_DRAW_FRAMEBUFFER,
+ cur_ts->egl_onscreen_ts->ctx->fb);
+
+ yagl_egl_onscreen_surface_attach_to_framebuffer(osfc,
+ GL_DRAW_FRAMEBUFFER);
+
+ egl_onscreen->gles_driver->BindFramebufferYAGL(cur_ts,
+ GL_DRAW_FRAMEBUFFER,
+ cur_fb);
+ } else {
+ egl_onscreen->gles_driver->BindFramebuffer(GL_DRAW_FRAMEBUFFER,
+ cur_ts->egl_onscreen_ts->ctx->fb);
- yagl_egl_onscreen_surface_attach_to_framebuffer(osfc,
- GL_DRAW_FRAMEBUFFER);
+ yagl_egl_onscreen_surface_attach_to_framebuffer(osfc,
+ GL_DRAW_FRAMEBUFFER);
- egl_onscreen->gles_driver->BindFramebuffer(GL_DRAW_FRAMEBUFFER,
- cur_fb);
+ egl_onscreen->gles_driver->BindFramebuffer(GL_DRAW_FRAMEBUFFER,
+ cur_fb);
+ }
}
YAGL_LOG_FUNC_EXIT(NULL);
}
-static bool yagl_egl_onscreen_surface_query(struct yagl_eglb_surface *sfc,
- EGLint attribute,
- EGLint *value)
+static bool yagl_egl_onscreen_surface_query(struct yagl_thread_state *cur_ts,
+ struct yagl_eglb_surface *sfc,
+ EGLint attribute,
+ EGLint *value)
{
struct yagl_egl_onscreen_surface *osfc =
(struct yagl_egl_onscreen_surface*)sfc;
return true;
}
-static void yagl_egl_onscreen_surface_swap_buffers(struct yagl_eglb_surface *sfc)
+static void yagl_egl_onscreen_surface_swap_buffers(struct yagl_thread_state *cur_ts,
+ struct yagl_eglb_surface *sfc)
{
struct yagl_egl_onscreen_surface *osfc =
(struct yagl_egl_onscreen_surface*)sfc;
osfc->ws_sfc->base.set_dirty(&osfc->ws_sfc->base);
}
-static void yagl_egl_onscreen_surface_copy_buffers(struct yagl_eglb_surface *sfc)
+static void yagl_egl_onscreen_surface_copy_buffers(struct yagl_thread_state *cur_ts,
+ struct yagl_eglb_surface *sfc)
{
struct yagl_egl_onscreen_surface *osfc =
(struct yagl_egl_onscreen_surface*)sfc;
osfc->ws_sfc->base.set_dirty(&osfc->ws_sfc->base);
}
-static void yagl_egl_onscreen_surface_wait_gl(struct yagl_eglb_surface *sfc)
+static void yagl_egl_onscreen_surface_wait_gl(struct yagl_thread_state *cur_ts,
+ struct yagl_eglb_surface *sfc)
{
struct yagl_egl_onscreen_surface *osfc =
(struct yagl_egl_onscreen_surface*)sfc;
osfc->ws_sfc->base.set_dirty(&osfc->ws_sfc->base);
}
-static void yagl_egl_onscreen_surface_destroy(struct yagl_eglb_surface *sfc)
+static void yagl_egl_onscreen_surface_destroy(struct yagl_thread_state *cur_ts,
+ struct yagl_eglb_surface *sfc)
{
struct yagl_egl_onscreen_surface *osfc =
(struct yagl_egl_onscreen_surface*)sfc;
}
if (osfc->rb) {
- yagl_ensure_ctx(0);
+ yagl_ensure_ctx(cur_ts, 0);
egl_onscreen->gles_driver->DeleteRenderbuffers(1, &osfc->rb);
- yagl_unensure_ctx(0);
+ yagl_unensure_ctx(cur_ts, 0);
}
yagl_eglb_surface_cleanup(sfc);
}
struct yagl_egl_onscreen_surface
- *yagl_egl_onscreen_surface_create_window(struct yagl_egl_onscreen_display *dpy,
+ *yagl_egl_onscreen_surface_create_window(struct yagl_thread_state *cur_ts,
+ struct yagl_egl_onscreen_display *dpy,
const struct yagl_egl_native_config *cfg,
const struct yagl_egl_window_attribs *attribs,
yagl_winsys_id id)
}
struct yagl_egl_onscreen_surface
- *yagl_egl_onscreen_surface_create_pixmap(struct yagl_egl_onscreen_display *dpy,
+ *yagl_egl_onscreen_surface_create_pixmap(struct yagl_thread_state *cur_ts,
+ struct yagl_egl_onscreen_display *dpy,
const struct yagl_egl_native_config *cfg,
const struct yagl_egl_pixmap_attribs *attribs,
yagl_winsys_id id)
}
struct yagl_egl_onscreen_surface
- *yagl_egl_onscreen_surface_create_pbuffer(struct yagl_egl_onscreen_display *dpy,
- const struct yagl_egl_native_config *cfg,
- const struct yagl_egl_pbuffer_attribs *attribs,
- yagl_winsys_id id)
+ *yagl_egl_onscreen_surface_create_pbuffer(struct yagl_thread_state *cur_ts,
+ struct yagl_egl_onscreen_display *dpy,
+ const struct yagl_egl_native_config *cfg,
+ const struct yagl_egl_pbuffer_attribs *attribs,
+ yagl_winsys_id id)
{
struct yagl_egl_onscreen *egl_onscreen =
(struct yagl_egl_onscreen*)dpy->base.backend;
};
struct yagl_egl_onscreen_surface
- *yagl_egl_onscreen_surface_create_window(struct yagl_egl_onscreen_display *dpy,
+ *yagl_egl_onscreen_surface_create_window(struct yagl_thread_state *cur_ts,
+ struct yagl_egl_onscreen_display *dpy,
const struct yagl_egl_native_config *cfg,
const struct yagl_egl_window_attribs *attribs,
yagl_winsys_id id);
struct yagl_egl_onscreen_surface
- *yagl_egl_onscreen_surface_create_pixmap(struct yagl_egl_onscreen_display *dpy,
+ *yagl_egl_onscreen_surface_create_pixmap(struct yagl_thread_state *cur_ts,
+ struct yagl_egl_onscreen_display *dpy,
const struct yagl_egl_native_config *cfg,
const struct yagl_egl_pixmap_attribs *attribs,
yagl_winsys_id id);
struct yagl_egl_onscreen_surface
- *yagl_egl_onscreen_surface_create_pbuffer(struct yagl_egl_onscreen_display *dpy,
- const struct yagl_egl_native_config *cfg,
- const struct yagl_egl_pbuffer_attribs *attribs,
- yagl_winsys_id id);
+ *yagl_egl_onscreen_surface_create_pbuffer(struct yagl_thread_state *cur_ts,
+ struct yagl_egl_onscreen_display *dpy,
+ const struct yagl_egl_native_config *cfg,
+ const struct yagl_egl_pbuffer_attribs *attribs,
+ yagl_winsys_id id);
void yagl_egl_onscreen_surface_setup(struct yagl_egl_onscreen_surface *sfc);
}
struct yagl_compiled_transfer
- *yagl_compiled_transfer_create(target_ulong va,
+ *yagl_compiled_transfer_create(struct yagl_thread_state *cur_ts,
+ target_ulong va,
uint32_t len,
bool is_write)
{
QLIST_INSERT_HEAD(&cur_ts->t->compiled_transfers, ct, entry);
ct->in_list = true;
+ ct->ts = cur_ts;
return ct;
}
g_free(ct);
}
-void yagl_compiled_transfer_prepare(struct yagl_compiled_transfer *ct)
+void yagl_compiled_transfer_prepare(struct yagl_thread_state *cur_ts,
+ struct yagl_compiled_transfer *ct)
{
struct yagl_vector v;
target_ulong last_page_va = YAGL_TARGET_PAGE_VA(ct->va + ct->len - 1);
struct yagl_compiled_transfer
{
QLIST_ENTRY(yagl_compiled_transfer) entry;
+ struct yagl_thread_state *ts;
target_ulong va;
uint32_t len;
};
struct yagl_compiled_transfer
- *yagl_compiled_transfer_create(target_ulong va,
+ *yagl_compiled_transfer_create(struct yagl_thread_state *cur_ts,
+ target_ulong va,
uint32_t len,
bool is_write);
void yagl_compiled_transfer_destroy(struct yagl_compiled_transfer *ct);
-void yagl_compiled_transfer_prepare(struct yagl_compiled_transfer *ct);
+void yagl_compiled_transfer_prepare(struct yagl_thread_state *cur_ts,
+ struct yagl_compiled_transfer *ct);
void yagl_compiled_transfer_exec(struct yagl_compiled_transfer *ct, void* data);
#include "yagl_thread.h"
#include "yagl_egl_driver.h"
#include "yagl_drivers/gles_ogl/yagl_gles_ogl.h"
+#include "yagl_drivers/gles_offscreen/yagl_gles_offscreen.h"
#include "yagl_drivers/gles_onscreen/yagl_gles_onscreen.h"
#include "yagl_backends/egl_offscreen/yagl_egl_offscreen.h"
#include "yagl_backends/egl_onscreen/yagl_egl_onscreen.h"
#include "yagl_gles_driver.h"
#include "yagl_version.h"
-
#define PCI_VENDOR_ID_YAGL 0x19B1
#define PCI_DEVICE_ID_YAGL 0x1010
yagl_tid target_tid;
hwaddr buff_len = TARGET_PAGE_SIZE;
uint8_t *buff = NULL;
+ YAGL_LOG_NO_TS;
YAGL_LOG_FUNC_ENTER(yagl_device_operate,
"user_index = %d, buff_pa = %" PRIx64,
static void yagl_device_trigger(YaGLState *s, int user_index, bool sync)
{
+ YAGL_LOG_NO_TS;
+
YAGL_LOG_FUNC_ENTER(yagl_device_trigger, "%d, %d", user_index, sync);
if (s->users[user_index].activated) {
struct yagl_egl_driver *egl_driver = NULL;
struct yagl_egl_backend *egl_backend = NULL;
struct yagl_gles_driver *gles_driver = NULL;
+ YAGL_LOG_NO_TS;
if (s->protocol > 0) {
yagl_protocol_version = s->protocol;
gles_driver = yagl_gles_onscreen_create(gles_driver);
} else {
egl_backend = yagl_egl_offscreen_create(egl_driver, gles_driver);
+ gles_driver = yagl_gles_offscreen_create(gles_driver);
}
if (!egl_backend) {
{
YaGLState *s = YAGL_DEVICE_PCI(d);
int i;
+ YAGL_LOG_NO_TS;
YAGL_LOG_FUNC_ENTER(yagl_device_reset, NULL);
static void yagl_device_exit(PCIDevice *dev)
{
YaGLState *s = YAGL_DEVICE_PCI(dev);
-
+ YAGL_LOG_NO_TS;
YAGL_LOG_FUNC_ENTER(yagl_device_exit, NULL);
yagl_server_state_destroy(s->ss);
obj-$(CONFIG_DARWIN) += egl_cgl/
obj-y += gles_ogl/
obj-y += gles_onscreen/
+obj-y += gles_offscreen/
#include "yagl_egl_native_config.h"
#include "yagl_egl_surface_attribs.h"
#include "yagl_process.h"
-#include "yagl_tls.h"
#include "yagl_thread.h"
#define LIBGL_IMAGE_NAME \
CGLPixelFormatObj pixel_format;
int n;
unsigned int i;
+ YAGL_LOG_NO_TS;
YAGL_LOG_FUNC_ENTER(yagl_egl_cgl_get_gl_version, NULL);
static EGLNativeDisplayType yagl_egl_cgl_display_open(struct yagl_egl_driver *driver)
{
+ YAGL_LOG_NO_TS;
+
YAGL_LOG_FUNC_ENTER(yagl_egl_cgl_display_open, NULL);
YAGL_LOG_FUNC_EXIT("%p", (void*)1);
static void yagl_egl_cgl_display_close(struct yagl_egl_driver *driver,
EGLNativeDisplayType dpy)
{
+ YAGL_LOG_NO_TS;
+
YAGL_LOG_FUNC_ENTER(yagl_egl_cgl_display_close, "%p", dpy);
YAGL_LOG_FUNC_EXIT(NULL);
int stencil_size = 0;
int samples_per_pixel = 0;
CGLError error;
+ YAGL_LOG_NO_TS;
YAGL_LOG_FUNC_ENTER(yagl_egl_cgl_config_fill, NULL);
int n = 0, n_ms = 0;
int screen_idx, cfg_idx;
CGLError error;
+ YAGL_LOG_NO_TS;
YAGL_LOG_FUNC_ENTER(yagl_egl_cgl_config_enum, "%p", dpy);
EGLNativeDisplayType dpy,
const struct yagl_egl_native_config *cfg)
{
+ YAGL_LOG_NO_TS;
+
YAGL_LOG_FUNC_ENTER(yagl_egl_cgl_config_cleanup,
"dpy = %p, cfg = %d",
dpy,
{
CGLPBufferObj pbuffer = NULL;
CGLError error;
+ YAGL_LOG_NO_TS;
YAGL_LOG_FUNC_ENTER(yagl_egl_cgl_pbuffer_surface_create,
"dpy = %p, width = %d, height = %d",
EGLSurface sfc)
{
CGLError error;
+ YAGL_LOG_NO_TS;
YAGL_LOG_FUNC_ENTER(yagl_egl_cgl_pbuffer_surface_destroy,
"dpy = %p, sfc = %p",
struct yagl_egl_cgl_context *ctx = NULL;
CGLContextObj share_ctx;
CGLError error;
+ YAGL_LOG_NO_TS;
YAGL_LOG_FUNC_ENTER(yagl_egl_cgl_context_create,
"dpy = %p, share_context = %p, version = %d",
EGLContext ctx)
{
CGLError error;
+ YAGL_LOG_NO_TS;
YAGL_LOG_FUNC_ENTER(yagl_egl_cgl_context_destroy,
"dpy = %p, ctx = %p",
CGLPBufferObj draw_pbuffer = (CGLPBufferObj)draw;
CGLPBufferObj read_pbuffer = (CGLPBufferObj)read;
CGLError error;
+ YAGL_LOG_NO_TS;
YAGL_LOG_FUNC_ENTER(yagl_egl_cgl_make_current,
"dpy = %p, draw = %p, read = %p, ctx = %p",
static void yagl_egl_cgl_destroy(struct yagl_egl_driver *driver)
{
struct yagl_egl_cgl *egl_cgl = (struct yagl_egl_cgl*)driver;
+ YAGL_LOG_NO_TS;
YAGL_LOG_FUNC_ENTER(yagl_egl_cgl_destroy, NULL);
CGLError error;
struct yagl_egl_cgl *egl_cgl;
int n;
+ YAGL_LOG_NO_TS;
YAGL_LOG_FUNC_ENTER(yagl_egl_driver_create, NULL);
#include "yagl_egl_driver.h"
#include "yagl_dyn_lib.h"
#include "yagl_log.h"
-#include "yagl_tls.h"
#include "yagl_thread.h"
#include "yagl_process.h"
#include "yagl_egl_native_config.h"
#include <GL/glx.h>
#define YAGL_EGL_GLX_ENTER(func, format, ...) \
+ YAGL_LOG_NO_TS; \
YAGL_LOG_FUNC_ENTER(func, format,##__VA_ARGS__)
#define YAGL_EGL_GLX_GET_PROC(proc_type, proc_name) \
static void yagl_egl_glx_destroy(struct yagl_egl_driver *driver)
{
struct yagl_egl_glx *egl_glx = (struct yagl_egl_glx*)driver;
+ YAGL_LOG_NO_TS;
YAGL_LOG_FUNC_ENTER(yagl_egl_glx_destroy, NULL);
struct yagl_egl_driver *egl_driver;
struct yagl_egl_glx *egl_glx;
Display *x_display = display;
+ YAGL_LOG_NO_TS;
YAGL_LOG_FUNC_ENTER(yagl_egl_glx_create, NULL);
*
*/
-#include "yagl_types.h"
+#include "yagl_log.h"
#include <wingdi.h>
#include <GL/gl.h>
#include <GL/wglext.h>
#include "yagl_egl_driver.h"
#include "yagl_dyn_lib.h"
-#include "yagl_log.h"
#include "yagl_egl_native_config.h"
#include "yagl_egl_surface_attribs.h"
#include "yagl_process.h"
-#include "yagl_tls.h"
#include "yagl_thread.h"
#define YAGL_EGL_WGL_WIN_CLASS "YaGLwinClass"
GLint i, num_extensions = 0;
unsigned int j;
bool skip_compatibility_check = 1;
+ YAGL_LOG_NO_TS;
YAGL_EGL_WGL_ENTER(yagl_egl_wgl_get_gl_version, NULL);
yagl_egl_wgl_display_open(struct yagl_egl_driver *driver)
{
YaglEglWglDpy *dpy;
+ YAGL_LOG_NO_TS;
YAGL_EGL_WGL_ENTER(yagl_egl_wgl_display_open, NULL);
EGLNativeDisplayType egl_dpy)
{
YaglEglWglDpy *dpy = (YaglEglWglDpy *)egl_dpy;
+ YAGL_LOG_NO_TS;
YAGL_EGL_WGL_ENTER(yagl_egl_wgl_display_close, "%p", dpy);
WGL_PIXEL_TYPE_ARB, WGL_TYPE_RGBA_ARB,
0,
};
+ YAGL_LOG_NO_TS;
YAGL_EGL_WGL_ENTER(yagl_egl_wgl_config_enum, "display %p", dpy);
EGLNativeDisplayType dpy,
const struct yagl_egl_native_config *cfg)
{
+ YAGL_LOG_NO_TS;
+
YAGL_EGL_WGL_ENTER(yagl_egl_wgl_config_cleanup,
"dpy = %p, cfg = %d",
dpy, cfg->config_id);
};
HGLRC egl_wgl_ctx;
HDC dc;
+ YAGL_LOG_NO_TS;
YAGL_EGL_WGL_ENTER(yagl_egl_wgl_context_create,
"dpy = %p, share_context = %p, cfgid=%d",
YaglEglWglSurface *egl_read_sfc = egl_read_surf;
HGLRC glc = NULL;
BOOL res;
+ YAGL_LOG_NO_TS;
YAGL_EGL_WGL_ENTER(yagl_egl_wgl_make_current,
"dpy = %p, draw = %p, read = %p, ctx = %p",
EGLContext egl_glc)
{
YaglEglWglDriver *egl_wgl = (YaglEglWglDriver *)(driver);
+ YAGL_LOG_NO_TS;
YAGL_EGL_WGL_ENTER(yagl_egl_wgl_context_destroy,
"dpy = %p, ctx = %p",
WGL_TEXTURE_FORMAT_ARB, WGL_NO_TEXTURE_ARB,
0
};
+ YAGL_LOG_NO_TS;
YAGL_EGL_WGL_ENTER(yagl_egl_wgl_pbuffer_surface_create,
"dpy = %p, width = %d, height = %d, cfgid=%d",
{
YaglEglWglDriver *egl_wgl = (YaglEglWglDriver *)(driver);
YaglEglWglSurface *egl_sfc = surf;
+ YAGL_LOG_NO_TS;
YAGL_EGL_WGL_ENTER(yagl_egl_wgl_pbuffer_surface_destroy,
"dpy = %p, sfc = %p",
static void yagl_egl_wgl_destroy(struct yagl_egl_driver *driver)
{
YaglEglWglDriver *egl_wgl = (YaglEglWglDriver *)driver;
+ YAGL_LOG_NO_TS;
YAGL_LOG_FUNC_ENTER(yagl_egl_wgl_destroy, NULL);
HGLRC glc = NULL;
const char *ext_str = NULL;
bool ext_initialized = false;
+ YAGL_LOG_NO_TS;
YAGL_LOG_FUNC_ENTER(yagl_egl_wgl_init_ext, NULL);
YaglEglWglDriver *egl_wgl;
struct yagl_egl_driver *egl_driver;
WNDCLASSEXA yagl_win_class;
+ YAGL_LOG_NO_TS;
YAGL_LOG_FUNC_ENTER(yagl_egl_wgl_create, NULL);
HWND win = NULL;
HDC dc = NULL;
HGLRC glc;
+ YAGL_LOG_NO_TS;
YAGL_LOG_FUNC_ENTER(yagl_egl_wgl_extaddr_get, "%s", sym);
const char *sym)
{
void *proc = NULL;
+ YAGL_LOG_NO_TS;
YAGL_LOG_FUNC_ENTER(yagl_egl_wgl_get_procaddr,
"Retrieving %s address", sym);
--- /dev/null
+# GLES offscreen driver
+obj-y += yagl_gles_offscreen.o
+
--- /dev/null
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ * Lukasz Kostyra <l.kostyra@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#include <GL/gl.h>
+#include "yagl_gles_offscreen.h"
+#include "yagl_gles_driver.h"
+#include "yagl_log.h"
+#include "yagl_process.h"
+#include "yagl_thread.h"
+#include "yagl_backends/egl_offscreen/yagl_egl_offscreen_ts.h"
+
+struct yagl_gles_offscreen
+{
+ struct yagl_gles_driver base;
+
+ struct yagl_gles_driver *orig_driver;
+};
+
+static void YAGL_GLES_APIENTRY yagl_gles_offscreen_BindFramebufferYAGL(struct yagl_thread_state *cur_ts,
+ GLenum target,
+ GLuint framebuffer)
+{
+ cur_ts->egl_offscreen_ts->gles_driver->BindFramebuffer(target, framebuffer);
+}
+
+static void yagl_gles_offscreen_destroy(struct yagl_gles_driver *driver)
+{
+ struct yagl_gles_offscreen *gles_offscreen = (struct yagl_gles_offscreen*)driver;
+ YAGL_LOG_NO_TS;
+
+ YAGL_LOG_FUNC_ENTER(yagl_gles_offscreen_destroy, NULL);
+
+ gles_offscreen->orig_driver->destroy(gles_offscreen->orig_driver);
+ gles_offscreen->orig_driver = NULL;
+
+ yagl_gles_driver_cleanup(driver);
+ g_free(gles_offscreen);
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+}
+
+struct yagl_gles_driver
+ *yagl_gles_offscreen_create(struct yagl_gles_driver *orig_driver)
+{
+ struct yagl_gles_offscreen *driver = NULL;
+ YAGL_LOG_NO_TS;
+
+ YAGL_LOG_FUNC_ENTER(yagl_gles_offscreen_create, NULL);
+
+ driver = g_malloc0(sizeof(*driver));
+
+ /*
+ * Just copy over everything, then init our fields.
+ */
+ memcpy(&driver->base, orig_driver, sizeof(*orig_driver));
+ driver->orig_driver = orig_driver;
+
+ yagl_gles_driver_init(&driver->base, orig_driver->gl_version);
+
+ driver->base.BindFramebufferYAGL = &yagl_gles_offscreen_BindFramebufferYAGL;
+
+ driver->base.destroy = &yagl_gles_offscreen_destroy;
+
+ YAGL_LOG_FUNC_EXIT(NULL);
+
+ return &driver->base;
+}
--- /dev/null
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2020 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ * Lukasz Kostyra <l.kostyra@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#ifndef _QEMU_YAGL_GLES_OFFSCREEN_H
+#define _QEMU_YAGL_GLES_OFFSCREEN_H
+
+#include "yagl_types.h"
+
+struct yagl_gles_driver;
+
+/*
+ * Takes ownership of 'orig_driver'.
+ */
+struct yagl_gles_driver
+ *yagl_gles_offscreen_create(struct yagl_gles_driver *orig_driver);
+
+#endif
#include "yagl_dyn_lib.h"
#include "yagl_process.h"
#include "yagl_thread.h"
+#include "yagl_server.h"
static void yagl_gles_ogl_destroy(struct yagl_gles_driver *driver)
{
+ YAGL_LOG_NO_TS;
+
YAGL_LOG_FUNC_ENTER(yagl_gles_ogl_destroy, NULL);
yagl_gles_driver_cleanup(driver);
yagl_gl_version gl_version)
{
struct yagl_gles_driver *driver = NULL;
+ YAGL_LOG_NO_TS;
YAGL_LOG_FUNC_ENTER(yagl_gles_ogl_create, NULL);
#include "yagl_gles_onscreen.h"
#include "yagl_gles_driver.h"
#include "yagl_log.h"
-#include "yagl_tls.h"
#include "yagl_process.h"
#include "yagl_thread.h"
#include "yagl_backends/egl_onscreen/yagl_egl_onscreen_ts.h"
struct yagl_gles_driver *orig_driver;
};
-YAGL_DECLARE_TLS(struct yagl_egl_onscreen_ts*, egl_onscreen_ts);
-
-static void YAGL_GLES_APIENTRY yagl_gles_onscreen_BindFramebuffer(GLenum target,
+static void YAGL_GLES_APIENTRY yagl_gles_onscreen_BindFramebufferYAGL(struct yagl_thread_state *cur_ts,
+ GLenum target,
GLuint framebuffer)
{
- if (!egl_onscreen_ts || !egl_onscreen_ts->dpy) {
+ if (!cur_ts || !cur_ts->egl_onscreen_ts || !cur_ts->egl_onscreen_ts->dpy) {
return;
}
- assert(framebuffer != egl_onscreen_ts->ctx->fb);
+ assert(framebuffer != cur_ts->egl_onscreen_ts->ctx->fb);
if (framebuffer == 0) {
- framebuffer = egl_onscreen_ts->ctx->fb;
+ framebuffer = cur_ts->egl_onscreen_ts->ctx->fb;
}
- egl_onscreen_ts->gles_driver->BindFramebuffer(target, framebuffer);
+ cur_ts->egl_onscreen_ts->gles_driver->BindFramebuffer(target, framebuffer);
}
static void yagl_gles_onscreen_destroy(struct yagl_gles_driver *driver)
{
struct yagl_gles_onscreen *gles_onscreen = (struct yagl_gles_onscreen*)driver;
+ YAGL_LOG_NO_TS;
YAGL_LOG_FUNC_ENTER(yagl_gles_onscreen_destroy, NULL);
*yagl_gles_onscreen_create(struct yagl_gles_driver *orig_driver)
{
struct yagl_gles_onscreen *driver = NULL;
+ YAGL_LOG_NO_TS;
YAGL_LOG_FUNC_ENTER(yagl_gles_onscreen_create, NULL);
yagl_gles_driver_init(&driver->base, orig_driver->gl_version);
- driver->base.BindFramebuffer = &yagl_gles_onscreen_BindFramebuffer;
+ driver->base.BindFramebufferYAGL = &yagl_gles_onscreen_BindFramebufferYAGL;
driver->base.destroy = &yagl_gles_onscreen_destroy;
yagl_gl_version gl_version;
- void (*thread_init)(struct yagl_egl_backend */*backend*/);
+ void (*thread_init)(struct yagl_thread_state */*cur_ts*/, struct yagl_egl_backend */*backend*/);
- void (*batch_start)(struct yagl_egl_backend */*backend*/);
+ void (*batch_start)(struct yagl_thread_state */*cur_ts*/, struct yagl_egl_backend */*backend*/);
struct yagl_eglb_display *(*create_display)(struct yagl_egl_backend */*backend*/);
- bool (*make_current)(struct yagl_egl_backend */*backend*/,
+ bool (*make_current)(struct yagl_thread_state */*cur_ts*/,
+ struct yagl_egl_backend */*backend*/,
struct yagl_eglb_display */*dpy*/,
struct yagl_eglb_context */*ctx*/,
struct yagl_eglb_surface */*draw*/,
struct yagl_eglb_surface */*read*/);
- bool (*release_current)(struct yagl_egl_backend */*backend*/,
+ bool (*release_current)(struct yagl_thread_state */*cur_ts*/,
+ struct yagl_egl_backend */*backend*/,
bool /*force*/);
- void (*batch_end)(struct yagl_egl_backend */*backend*/);
+ void (*batch_end)(struct yagl_thread_state */*cur_ts*/, struct yagl_egl_backend */*backend*/);
- void (*thread_fini)(struct yagl_egl_backend */*backend*/);
+ void (*thread_fini)(struct yagl_thread_state */*cur_ts*/, struct yagl_egl_backend */*backend*/);
/*
* Make sure that some GL context is currently active. Can
* @{
*/
- void (*ensure_current)(struct yagl_egl_backend */*backend*/);
+ void (*ensure_current)(struct yagl_thread_state */*cur_ts*/,
+ struct yagl_egl_backend */*backend*/);
- void (*unensure_current)(struct yagl_egl_backend */*backend*/);
+ void (*unensure_current)(struct yagl_thread_state */*cur_ts*/,
+ struct yagl_egl_backend */*backend*/);
/*
* @}
struct yagl_egl_interface
{
- uint32_t (*get_ctx_id)(struct yagl_egl_interface */*iface*/);
+ uint32_t (*get_ctx_id)(struct yagl_thread_state */*cur_ts*/,
+ struct yagl_egl_interface */*iface*/);
- void (*ensure_ctx)(struct yagl_egl_interface */*iface*/, uint32_t /*ctx_id*/);
+ void (*ensure_ctx)(struct yagl_thread_state */*cur_ts*/,
+ struct yagl_egl_interface */*iface*/,
+ uint32_t /*ctx_id*/);
- void (*unensure_ctx)(struct yagl_egl_interface */*iface*/, uint32_t /*ctx_id*/);
+ void (*unensure_ctx)(struct yagl_thread_state */*cur_ts*/,
+ struct yagl_egl_interface */*iface*/,
+ uint32_t /*ctx_id*/);
};
#endif
struct yagl_eglb_context
{
struct yagl_eglb_display *dpy;
+ struct yagl_process_state *ps;
- void (*destroy)(struct yagl_eglb_context */*ctx*/);
+ void (*destroy)(struct yagl_thread_state */*cur_ts*/, struct yagl_eglb_context */*ctx*/);
};
void yagl_eglb_context_init(struct yagl_eglb_context *ctx,
void (*config_cleanup)(struct yagl_eglb_display */*dpy*/,
const struct yagl_egl_native_config */*cfg*/);
- struct yagl_eglb_context *(*create_context)(struct yagl_eglb_display */*dpy*/,
+ struct yagl_eglb_context *(*create_context)(struct yagl_thread_state */*cur_ts*/,
+ struct yagl_eglb_display */*dpy*/,
const struct yagl_egl_native_config */*cfg*/,
struct yagl_eglb_context */*share_context*/,
int /*version*/);
/*
* 'pixels' are locked in target's memory, no page fault possible.
*/
- struct yagl_eglb_surface *(*create_offscreen_surface)(struct yagl_eglb_display */*dpy*/,
+ struct yagl_eglb_surface *(*create_offscreen_surface)(struct yagl_thread_state */*cur_ts*/,
+ struct yagl_eglb_display */*dpy*/,
const struct yagl_egl_native_config */*cfg*/,
EGLenum /*type*/,
const void */*attribs*/,
uint32_t /*bpp*/,
target_ulong /*pixels*/);
- struct yagl_eglb_surface *(*create_onscreen_window_surface)(struct yagl_eglb_display */*dpy*/,
+ struct yagl_eglb_surface *(*create_onscreen_window_surface)(struct yagl_thread_state */*cur_ts*/,
+ struct yagl_eglb_display */*dpy*/,
const struct yagl_egl_native_config */*cfg*/,
const struct yagl_egl_window_attribs */*attribs*/,
yagl_winsys_id /*id*/);
- struct yagl_eglb_surface *(*create_onscreen_pixmap_surface)(struct yagl_eglb_display */*dpy*/,
+ struct yagl_eglb_surface *(*create_onscreen_pixmap_surface)(struct yagl_thread_state */*cur_ts*/,
+ struct yagl_eglb_display */*dpy*/,
const struct yagl_egl_native_config */*cfg*/,
const struct yagl_egl_pixmap_attribs */*attribs*/,
yagl_winsys_id /*id*/);
- struct yagl_eglb_surface *(*create_onscreen_pbuffer_surface)(struct yagl_eglb_display */*dpy*/,
+ struct yagl_eglb_surface *(*create_onscreen_pbuffer_surface)(struct yagl_thread_state */*cur_ts*/,
+ struct yagl_eglb_display */*dpy*/,
const struct yagl_egl_native_config */*cfg*/,
const struct yagl_egl_pbuffer_attribs */*attribs*/,
yagl_winsys_id /*id*/);
- struct yagl_object *(*create_image)(struct yagl_eglb_display */*dpy*/,
+ struct yagl_object *(*create_image)(struct yagl_thread_state */*cur_ts*/,
+ struct yagl_eglb_display */*dpy*/,
yagl_winsys_id /*buffer*/);
void (*destroy)(struct yagl_eglb_display */*dpy*/);
* Surface has been invalidated on target, update it
* from 'id'.
*/
- void (*invalidate)(struct yagl_eglb_surface */*sfc*/,
+ void (*invalidate)(struct yagl_thread_state */*cur_ts*/,
+ struct yagl_eglb_surface */*sfc*/,
yagl_winsys_id /*id*/);
/*
* 'sfc' and 'with' must be of same type, but can have
* different formats.
*/
- void (*replace)(struct yagl_eglb_surface */*sfc*/,
+ void (*replace)(struct yagl_thread_state */*cur_ts*/,
+ struct yagl_eglb_surface */*sfc*/,
struct yagl_eglb_surface */*with*/);
/*
* Can be called for surfaces that were reset.
*/
- bool (*query)(struct yagl_eglb_surface */*sfc*/,
+ bool (*query)(struct yagl_thread_state */*cur_ts*/,
+ struct yagl_eglb_surface */*sfc*/,
EGLint /*attribute*/,
EGLint */*value*/);
- void (*swap_buffers)(struct yagl_eglb_surface */*sfc*/);
+ void (*swap_buffers)(struct yagl_thread_state */*cur_ts*/,
+ struct yagl_eglb_surface */*sfc*/);
- void (*copy_buffers)(struct yagl_eglb_surface */*sfc*/);
+ void (*copy_buffers)(struct yagl_thread_state */*cur_ts*/,
+ struct yagl_eglb_surface */*sfc*/);
- void (*wait_gl)(struct yagl_eglb_surface */*sfc*/);
+ void (*wait_gl)(struct yagl_thread_state */*cur_ts*/,
+ struct yagl_eglb_surface */*sfc*/);
- void (*destroy)(struct yagl_eglb_surface */*sfc*/);
+ void (*destroy)(struct yagl_thread_state */*cur_ts*/,
+ struct yagl_eglb_surface */*sfc*/);
};
void yagl_eglb_surface_init(struct yagl_eglb_surface *sfc,
{
}
-uint32_t yagl_get_ctx_id(void)
+uint32_t yagl_get_ctx_id(struct yagl_thread_state *cur_ts)
{
assert(cur_ts);
- return cur_ts->ps->egl_iface->get_ctx_id(cur_ts->ps->egl_iface);
+ return cur_ts->ps->egl_iface->get_ctx_id(cur_ts, cur_ts->ps->egl_iface);
}
-void yagl_ensure_ctx(uint32_t ctx_id)
+void yagl_ensure_ctx(struct yagl_thread_state *cur_ts, uint32_t ctx_id)
{
- assert(cur_ts);
- cur_ts->ps->egl_iface->ensure_ctx(cur_ts->ps->egl_iface, ctx_id);
+ cur_ts->ps->egl_iface->ensure_ctx(cur_ts, cur_ts->ps->egl_iface, ctx_id);
}
-void yagl_unensure_ctx(uint32_t ctx_id)
+void yagl_unensure_ctx(struct yagl_thread_state *cur_ts, uint32_t ctx_id)
{
- assert(cur_ts);
- cur_ts->ps->egl_iface->unensure_ctx(cur_ts->ps->egl_iface, ctx_id);
+ cur_ts->ps->egl_iface->unensure_ctx(cur_ts, cur_ts->ps->egl_iface, ctx_id);
}
YAGL_GLES_DRIVER_FUNC9(CopyTexSubImage3D, GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei, target, level, xoffset, yoffset, zoffset, x, y, width, height);
YAGL_GLES_DRIVER_FUNC2(GenFramebuffers, GLsizei, GLuint*, n, framebuffers)
YAGL_GLES_DRIVER_FUNC2(BindFramebuffer, GLenum, GLuint, target, framebuffer)
+ YAGL_GLES_DRIVER_FUNC3(BindFramebufferYAGL, struct yagl_thread_state *, GLenum, GLuint, cur_ts, target, framebuffer)
YAGL_GLES_DRIVER_FUNC5(FramebufferTexture2D, GLenum, GLenum, GLenum, GLuint, GLint, target, attachment, textarget, texture, level)
YAGL_GLES_DRIVER_FUNC4(FramebufferRenderbuffer, GLenum, GLenum, GLenum, GLuint, target, attachment, renderbuffertarget, renderbuffer)
YAGL_GLES_DRIVER_FUNC2(DeleteFramebuffers, GLsizei, const GLuint*, n, framebuffers)
* @{
*/
-uint32_t yagl_get_ctx_id(void);
-void yagl_ensure_ctx(uint32_t ctx_id);
-void yagl_unensure_ctx(uint32_t ctx_id);
+uint32_t yagl_get_ctx_id(struct yagl_thread_state *cur_ts);
+void yagl_ensure_ctx(struct yagl_thread_state *cur_ts, uint32_t ctx_id);
+void yagl_unensure_ctx(struct yagl_thread_state *cur_ts, uint32_t ctx_id);
/*
* @}
#define _QEMU_YAGL_LOG_H
#include "yagl_types.h"
+#include "yagl_util.h"
//#define YAGL_LOG_DISABLE
bool yagl_log_is_enabled_for_func_tracing(void);
+// a helper to allow logging where acquiring PID/TID is not possible
+// ie. on a main server thread. This could be replaced with getting
+// PID/TID via getpid()/gettid()/Windows equivalents.
+#define YAGL_LOG_NO_TS struct yagl_thread_state *cur_ts = NULL
+
#ifndef YAGL_LOG_DISABLE
#define YAGL_LOG_EVENT(log_level, pid, tid, facility, format, ...) \
do \
} \
} while(0)
-// TODO _yagl_log_current_pid/tid must be restored to proper form
-// PID/TID must be read in a different way than via global cur_ts
-#define YAGL_LOG_FUNC_SET(func) \
- const char* _yagl_log_current_func = #func; \
- yagl_pid _yagl_log_current_pid = 0; \
- yagl_tid _yagl_log_current_tid = 0
+#define YAGL_LOG_FUNC_SET_TS(__func, __ts) \
+ const char* _yagl_log_current_func = #__func; \
+ yagl_pid _yagl_log_current_pid = (__ts ? __ts->ps->id : yagl_get_pid()); \
+ yagl_tid _yagl_log_current_tid = (__ts ? __ts->id : yagl_get_tid())
+
+#define YAGL_LOG_FUNC_SET(__func) YAGL_LOG_FUNC_SET_TS(__func, cur_ts)
+
+#define YAGL_LOG_FUNC_ENTER_TS(func, __ts, format, ...) \
+ YAGL_LOG_FUNC_SET_TS(func, __ts); \
+ do \
+ { \
+ if ( yagl_log_is_enabled_for_func_tracing() && \
+ yagl_log_is_enabled_for_facility(_yagl_log_current_func) ) \
+ { \
+ yagl_log_func_enter(_yagl_log_current_pid, _yagl_log_current_tid, _yagl_log_current_func, __LINE__, format,##__VA_ARGS__); \
+ } \
+ } while(0)
#define YAGL_LOG_FUNC_ENTER(func, format, ...) \
YAGL_LOG_FUNC_SET(func); \
#include "yagl_log.h"
#include "exec/cpu-all.h"
-bool yagl_mem_put(target_ulong va, const void* data, uint32_t len)
+bool yagl_mem_put(struct yagl_thread_state* cur_ts, target_ulong va, const void* data, uint32_t len)
{
int ret;
return ret != -1;
}
-bool yagl_mem_get(target_ulong va, uint32_t len, void* data)
+bool yagl_mem_get(struct yagl_thread_state* cur_ts, target_ulong va, uint32_t len, void* data)
{
int ret;
#include "yagl_types.h"
-bool yagl_mem_put(target_ulong va, const void *data, uint32_t len);
+bool yagl_mem_put(struct yagl_thread_state* cur_ts, target_ulong va, const void *data, uint32_t len);
-bool yagl_mem_get(target_ulong va, uint32_t len, void *data);
+bool yagl_mem_get(struct yagl_thread_state* cur_ts, target_ulong va, uint32_t len, void *data);
#endif
#include "yagl_object_map.h"
-static void yagl_object_map_entry_destroy_func(gpointer data)
+static gboolean yagl_object_map_entry_remove_all_func(gpointer key,
+ gpointer value,
+ gpointer user_data)
{
- struct yagl_object *item = data;
+ struct yagl_object *item = value;
+ struct yagl_thread_state *cur_ts = user_data;
- item->destroy(item);
+ item->destroy(cur_ts, item);
+ return TRUE;
}
struct yagl_object_map *yagl_object_map_create(void)
{
struct yagl_object_map *object_map = g_malloc0(sizeof(struct yagl_object_map));
- object_map->entries = g_hash_table_new_full(g_direct_hash,
- g_direct_equal,
- NULL,
- &yagl_object_map_entry_destroy_func);
+ object_map->entries = g_hash_table_new(g_direct_hash,
+ g_direct_equal);
assert(object_map->entries);
return object_map;
}
-void yagl_object_map_destroy(struct yagl_object_map *object_map)
+void yagl_object_map_destroy(struct yagl_thread_state *cur_ts,
+ struct yagl_object_map *object_map)
{
+ yagl_object_map_remove_all(cur_ts, object_map);
+
g_hash_table_destroy(object_map->entries);
object_map->entries = NULL;
assert(g_hash_table_size(object_map->entries) > size);
}
-void yagl_object_map_remove(struct yagl_object_map *object_map,
+void yagl_object_map_remove(struct yagl_thread_state *cur_ts,
+ struct yagl_object_map *object_map,
yagl_object_name local_name)
{
guint size = g_hash_table_size(object_map->entries);
+ // TODO g_hash_table_steal_extended is introduced in fairly new glib 2.58
+ // and would be better suitable here. For now - lookup the value,
+ // call the destructor and remove it from the hash table.
+ struct yagl_object *item = g_hash_table_lookup(object_map->entries,
+ GUINT_TO_POINTER(local_name));
+
+ item->destroy(cur_ts, item);
+
g_hash_table_remove(object_map->entries, GUINT_TO_POINTER(local_name));
assert(g_hash_table_size(object_map->entries) < size);
}
-void yagl_object_map_remove_all(struct yagl_object_map *object_map)
+void yagl_object_map_remove_all(struct yagl_thread_state *cur_ts,
+ struct yagl_object_map *object_map)
{
- g_hash_table_remove_all(object_map->entries);
+ g_hash_table_foreach_remove(object_map->entries,
+ &yagl_object_map_entry_remove_all_func,
+ (gpointer)cur_ts);
}
yagl_object_name yagl_object_map_get(struct yagl_object_map *object_map,
#include "yagl_types.h"
#include <glib.h>
+struct yagl_object;
+
+typedef void (*yagl_object_destroy_func)(struct yagl_thread_state */*cur_ts*/, struct yagl_object */*obj*/);
+
struct yagl_object
{
yagl_object_name global_name;
- void (*destroy)(struct yagl_object */*obj*/);
+ yagl_object_destroy_func destroy;
};
struct yagl_object_map
{
GHashTable *entries;
+ // TODO object map is per process, might be touched by multiple threads - add mutex
};
struct yagl_object_map *yagl_object_map_create(void);
-void yagl_object_map_destroy(struct yagl_object_map *object_map);
+void yagl_object_map_destroy(struct yagl_thread_state *cur_ts,
+ struct yagl_object_map *object_map);
void yagl_object_map_add(struct yagl_object_map *object_map,
yagl_object_name local_name,
struct yagl_object *obj);
-void yagl_object_map_remove(struct yagl_object_map *object_map,
+void yagl_object_map_remove(struct yagl_thread_state *cur_ts,
+ struct yagl_object_map *object_map,
yagl_object_name local_name);
-void yagl_object_map_remove_all(struct yagl_object_map *object_map);
+void yagl_object_map_remove_all(struct yagl_thread_state *cur_ts,
+ struct yagl_object_map *object_map);
yagl_object_name yagl_object_map_get(struct yagl_object_map *object_map,
yagl_object_name local_name);
#include "yagl_log.h"
#include "yagl_stats.h"
#include "yagl_object_map.h"
-#include "sysemu/hw_accel.h"
+#include "sysemu/kvm.h"
+#include "sysemu/hax.h"
+#include "sysemu/whpx.h"
struct yagl_process_state
*yagl_process_state_create(struct yagl_server_state *ss,
ps->object_map = yagl_object_map_create();
QLIST_INIT(&ps->threads);
- cpu_synchronize_state(current_cpu);
- CPUX86State *env = current_cpu->env_ptr;
- memcpy(&ps->cr[0],
- &((CPUX86State *)current_cpu->env_ptr)->cr[0],
- sizeof(ps->cr));
- ps->hflags = env->hflags;
-
+#if defined (CONFIG_KVM) || defined (CONFIG_HAX) || defined (CONFIG_WHPX)
+ if (kvm_enabled() || hax_enabled() || whpx_enabled()) {
+ if (kvm_enabled()) {
+ kvm_cpu_synchronize_state(current_cpu);
+ } else if (hax_enabled()) {
+#ifdef CONFIG_HAX
+ hax_cpu_synchronize_state(current_cpu);
+#endif
+ } else {
+#ifdef CONFIG_WHPX
+ whpx_cpu_synchronize_state(current_cpu);
+#endif
+ }
+ CPUX86State *env = current_cpu->env_ptr;
+ memcpy(&ps->cr[0],
+ &((CPUX86State *)current_cpu->env_ptr)->cr[0],
+ sizeof(ps->cr));
+ ps->hflags = env->hflags;
+ }
+#endif
+
return ps;
}
void yagl_process_state_destroy(struct yagl_process_state *ps)
{
- struct yagl_thread_state *ts, *next;
-
- if (ps == NULL) {
- return;
- }
+ struct yagl_thread_state *ts = NULL, *next = NULL;
+ YAGL_LOG_NO_TS;
YAGL_LOG_FUNC_ENTER(yagl_process_state_destroy, NULL);
assert(QLIST_EMPTY(&ps->threads));
- yagl_object_map_destroy(ps->object_map);
- ps->object_map = NULL;
+ yagl_object_map_destroy(NULL, ps->object_map);
g_free(ps);
void yagl_process_register_egl_interface(struct yagl_process_state *ps,
struct yagl_egl_interface *egl_iface)
{
+ YAGL_LOG_NO_TS;
+
YAGL_LOG_FUNC_ENTER(yagl_process_register_egl_interface, NULL);
assert(egl_iface);
void yagl_process_unregister_egl_interface(struct yagl_process_state *ps)
{
+ YAGL_LOG_NO_TS;
+
YAGL_LOG_FUNC_ENTER(yagl_process_unregister_egl_interface, NULL);
assert(ps->egl_iface);
++ref->count;
}
-void yagl_ref_release(struct yagl_ref *ref)
+void yagl_ref_release(struct yagl_thread_state *cur_ts, struct yagl_ref *ref)
{
assert(ref);
assert(ref->count > 0);
if (--ref->count == 0)
{
assert(ref->destroy);
- ref->destroy(ref);
+ ref->destroy(cur_ts, ref);
}
}
struct yagl_ref;
-typedef void (*yagl_ref_destroy_func)(struct yagl_ref */*ref*/);
+typedef void (*yagl_ref_destroy_func)(struct yagl_thread_state */*cur_ts*/, struct yagl_ref */*ref*/);
struct yagl_ref
{
/*
* Decrements ref count and releases when 0.
*/
-void yagl_ref_release(struct yagl_ref *ref);
+void yagl_ref_release(struct yagl_thread_state *cur_ts, struct yagl_ref *ref);
#endif
}
}
-void yagl_resource_release(struct yagl_resource *res)
+void yagl_resource_release(struct yagl_thread_state *cur_ts, struct yagl_resource *res)
{
if (res) {
- yagl_ref_release(&res->ref);
+ yagl_ref_release(cur_ts, &res->ref);
}
}
void yagl_resource_acquire(struct yagl_resource *res);
/*
- * Passing NULL won't hurt, this is for convenience.
+ * Passing NULL res won't hurt, this is for convenience.
*/
-void yagl_resource_release(struct yagl_resource *res);
+void yagl_resource_release(struct yagl_thread_state *cur_ts, struct yagl_resource *res);
#endif
list->count = 0;
}
-void yagl_resource_list_cleanup(struct yagl_resource_list *list)
+void yagl_resource_list_cleanup(struct yagl_thread_state *cur_ts, struct yagl_resource_list *list)
{
struct yagl_resource *res, *next;
QTAILQ_FOREACH_SAFE(res, &list->resources, entry, next) {
QTAILQ_REMOVE(&list->resources, res, entry);
- yagl_resource_release(res);
+ yagl_resource_release(cur_ts, res);
}
assert(QTAILQ_EMPTY(&list->resources));
return NULL;
}
-bool yagl_resource_list_remove(struct yagl_resource_list *list,
+bool yagl_resource_list_remove(struct yagl_thread_state *cur_ts,
+ struct yagl_resource_list *list,
yagl_host_handle handle)
{
struct yagl_resource *res;
QTAILQ_FOREACH(res, &list->resources, entry) {
if (res->handle == handle) {
QTAILQ_REMOVE(&list->resources, res, entry);
- yagl_resource_release(res);
+ yagl_resource_release(cur_ts, res);
return true;
}
}
* Release all resources in the list and empty the list. The
* list should be initialized again in order to be used after this.
*/
-void yagl_resource_list_cleanup(struct yagl_resource_list *list);
+void yagl_resource_list_cleanup(struct yagl_thread_state *cur_ts, struct yagl_resource_list *list);
int yagl_resource_list_get_count(struct yagl_resource_list *list);
* Removes a resource from the end of the list, this also releases
* the resource.
*/
-bool yagl_resource_list_remove(struct yagl_resource_list *list,
+bool yagl_resource_list_remove(struct yagl_thread_state *cur_ts,
+ struct yagl_resource_list *list,
yagl_host_handle handle);
#endif
{
struct yagl_process_state *ps, *next;
- if (ss == NULL) {
- return;
- }
-
work_queue_wait(ss->render_queue);
QLIST_FOREACH_SAFE(ps, &ss->processes, entry, next) {
struct yagl_process_state *ps = NULL;
struct yagl_thread_state *ts = NULL;
uint8_t **pages;
+ YAGL_LOG_NO_TS;
YAGL_LOG_FUNC_ENTER(yagl_server_dispatch_init, NULL);
yagl_tid target_tid,
uint8_t *buff)
{
- struct yagl_thread_state *ts;
+ struct yagl_thread_state *ts = NULL;
uint32_t i, count = 0;
uint8_t **pages = NULL;
+ YAGL_LOG_NO_TS;
YAGL_LOG_FUNC_ENTER(yagl_server_dispatch_update, NULL);
bool sync)
{
struct yagl_thread_state *ts;
+ YAGL_LOG_NO_TS;
YAGL_LOG_FUNC_ENTER(yagl_server_dispatch_batch, NULL);
struct yagl_thread_state *ts =
yagl_server_find_thread(ss, target_pid, target_tid);
struct yagl_process_state *ps = NULL;
+ YAGL_LOG_NO_TS;
YAGL_LOG_FUNC_ENTER(yagl_server_dispatch_exit, NULL);
#include "sysemu/kvm.h"
#include "sysemu/hax.h"
-YAGL_DEFINE_TLS(struct yagl_thread_state*, cur_ts);
-
struct yagl_thread_work_item
{
struct work_queue_item base;
static void yagl_thread_work(struct work_queue_item *wq_item)
{
struct yagl_thread_work_item *item = (struct yagl_thread_work_item*)wq_item;
+ struct yagl_thread_state *ts = item->ts;
int i;
uint32_t num_calls = 0;
- struct yagl_transport *t = item->ts->t;
- struct winsys_interface *wsi = item->ts->ps->ss->wsi;
-
- cur_ts = item->ts;
+ struct yagl_transport *t = ts->t;
+ struct winsys_interface *wsi = ts->ps->ss->wsi;
- YAGL_LOG_FUNC_SET(yagl_thread_work);
+ YAGL_LOG_FUNC_SET_TS(yagl_thread_work, ts);
YAGL_LOG_TRACE("batch started");
for (i = 0; i < YAGL_NUM_APIS; ++i) {
- if (cur_ts->ps->api_states[i]) {
- cur_ts->ps->api_states[i]->batch_start(cur_ts->ps->api_states[i]);
+ if (ts->ps->api_states[i]) {
+ ts->ps->api_states[i]->batch_start(ts, ts->ps->api_states[i]);
}
}
break;
}
- api_ps = cur_ts->ps->api_states[api_id - 1];
+ api_ps = ts->ps->api_states[api_id - 1];
if (!api_ps) {
YAGL_LOG_CRITICAL("uninitialized api - %u. host logic error", api_id);
YAGL_LOG_TRACE("batch ended: %u calls", num_calls);
for (i = 0; i < YAGL_NUM_APIS; ++i) {
- if (cur_ts->ps->api_states[i]) {
- cur_ts->ps->api_states[i]->batch_end(cur_ts->ps->api_states[i]);
+ if (ts->ps->api_states[i]) {
+ ts->ps->api_states[i]->batch_end(ts, ts->ps->api_states[i]);
}
}
- cur_ts = NULL;
-
- --item->ts->num_in_progress;
+ --ts->num_in_progress;
if (wsi && item->fence_seq) {
wsi->fence_ack(wsi, item->fence_seq);
ts->ps = ps;
ts->id = id;
ts->t = yagl_transport_create();
-
- cur_ts = ts;
+ ts->t->ts = ts;
if (is_first) {
/*
*/
for (i = 0; i < YAGL_NUM_APIS; ++i) {
- if (ts->ps->ss->apis[i]) {
- ts->ps->api_states[i] = ts->ps->ss->apis[i]->process_init(ts->ps->ss->apis[i]);
- assert(ts->ps->api_states[i]);
+ if (ps->ss->apis[i]) {
+ ps->api_states[i] = ps->ss->apis[i]->process_init(ps, ps->ss->apis[i]);
+ assert(ps->api_states[i]);
}
}
}
*/
for (i = 0; i < YAGL_NUM_APIS; ++i) {
- if (ts->ps->api_states[i]) {
- ts->ps->api_states[i]->thread_init(ts->ps->api_states[i]);
+ if (ps->api_states[i]) {
+ ps->api_states[i]->thread_init(ts, ps->api_states[i]);
}
}
{
int i;
- cur_ts = ts;
-
/*
* Fini APIs (thread).
*/
for (i = 0; i < YAGL_NUM_APIS; ++i) {
if (ts->ps->api_states[i]) {
- ts->ps->api_states[i]->thread_fini(ts->ps->api_states[i]);
+ ts->ps->api_states[i]->thread_fini(ts, ts->ps->api_states[i]);
}
}
* First, remove all objects.
*/
- yagl_object_map_remove_all(ts->ps->object_map);
+ yagl_object_map_remove_all(ts, ts->ps->object_map);
/*
* Destroy APIs (process).
for (i = 0; i < YAGL_NUM_APIS; ++i) {
if (ts->ps->api_states[i]) {
- ts->ps->api_states[i]->destroy(ts->ps->api_states[i]);
+ ts->ps->api_states[i]->destroy(ts, ts->ps->api_states[i]);
ts->ps->api_states[i] = NULL;
}
}
}
- cur_ts = NULL;
-
yagl_thread_set_buffer(ts, NULL);
yagl_transport_destroy(ts->t);
#include "yagl_types.h"
#include "yagl_event.h"
-#include "yagl_tls.h"
#include "hw/vigs/work_queue.h"
#include "qemu/queue.h"
#include "qemu/thread.h"
* Fake TLS.
* @{
*/
- void *egl_api_ts;
- void *gles_api_ts;
- void *egl_offscreen_ts;
- void *egl_onscreen_ts;
+ struct yagl_egl_api_ts *egl_api_ts;
+ struct yagl_gles_api_ts *gles_api_ts;
+ struct yagl_egl_offscreen_ts *egl_offscreen_ts;
+ struct yagl_egl_onscreen_ts *egl_onscreen_ts;
/*
* @}
*/
};
-YAGL_DECLARE_TLS(struct yagl_thread_state*, cur_ts);
-
struct yagl_thread_state
*yagl_thread_state_create(struct yagl_process_state *ps,
yagl_tid id,
uint32_t size = yagl_transport_uint32_t_at(t,
YAGL_TRANSPORT_BATCH_HEADER_SIZE + *batch_size + ((2 * i + 1) * 8));
- if (!yagl_mem_get(va, size, tmp)) {
+ if (!yagl_mem_get(t->ts, va, size, tmp)) {
yagl_transport_uint32_t_to(t, 0, yagl_call_result_retry);
g_free(batch_data);
return NULL;
struct yagl_transport_in_array *in_array = &t->in_arrays[i];
if ((*in_array->count > 0) && t->direct) {
- if (!yagl_mem_put(in_array->va,
+ if (!yagl_mem_put(t->ts,
+ in_array->va,
yagl_vector_data(&in_array->v),
*in_array->count * in_array->el_size)) {
yagl_transport_uint32_t_to(t, 0, yagl_call_result_retry);
}
QLIST_FOREACH_SAFE(ct, &t->compiled_transfers, entry, tmp) {
- yagl_compiled_transfer_prepare(ct);
+ yagl_compiled_transfer_prepare(t->ts, ct);
}
t->direct = false;
}
}
-const char **yagl_transport_get_out_string_array(const char *data,
+const char **yagl_transport_get_out_string_array(struct yagl_transport *t,
+ const char *data,
int32_t data_count,
int32_t *array_count)
{
struct yagl_vector v;
char *tmp;
- YAGL_LOG_FUNC_SET(yagl_transport_get_out_string_array);
+ YAGL_LOG_FUNC_SET_TS(yagl_transport_get_out_string_array, t->ts);
if (!data) {
*array_count = 0;
*/
uint8_t **pages;
+ struct yagl_thread_state *ts;
/*
* @}
int32_t *maxcount,
int32_t **count);
-const char **yagl_transport_get_out_string_array(const char *data,
+const char **yagl_transport_get_out_string_array(struct yagl_transport *t,
+ const char *data,
int32_t data_count,
int32_t *array_count);
#ifndef _QEMU_YAGL_TYPES_H
#define _QEMU_YAGL_TYPES_H
-#ifdef __USE_MINGW_ANSI_STDIO
-#undef __USE_MINGW_ANSI_STDIO
-#endif
-
#include "qemu/osdep.h"
#include "qemu-common.h"
#include "cpu.h"
typedef uint32_t yagl_winsys_id;
struct yagl_transport;
+struct yagl_thread_state;
+struct yagl_process_state;
/*
* YaGL supported render types.
--- /dev/null
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2020 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ * Lukasz Kostyra <l.kostyra@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#include "yagl_util.h"
+
+#ifdef CONFIG_WIN32
+#include <windows.h>
+#else
+#include <unistd.h>
+#include <sys/syscall.h>
+
+#ifdef CONFIG_DARWIN
+#define SYSCALL_GET_TID SYS_thread_selfid
+#else
+#define SYSCALL_GET_TID SYS_gettid
+#endif
+
+#endif
+
+yagl_pid yagl_get_pid(void)
+{
+#ifdef CONFIG_WIN32
+ return (yagl_pid)GetCurrentProcessId();
+#else
+ return (yagl_pid)getpid();
+#endif
+}
+
+yagl_tid yagl_get_tid(void)
+{
+#ifdef CONFIG_WIN32
+ return (yagl_tid)GetCurrentThreadId();
+#else
+ return (yagl_tid)syscall(SYSCALL_GET_TID);
+#endif
+}
\ No newline at end of file
--- /dev/null
+/*
+ * yagl
+ *
+ * Copyright (c) 2000 - 2020 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ * Jinhyung Jo <jinhyung.jo@samsung.com>
+ * YeongKyoon Lee <yeongkyoon.lee@samsung.com>
+ * Lukasz Kostyra <l.kostyra@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#ifndef _QEMU_YAGL_UTIL_H
+#define _QEMU_YAGL_UTIL_H
+
+#include "yagl_types.h"
+
+yagl_pid yagl_get_pid(void);
+
+yagl_tid yagl_get_tid(void);
+
+#endif // _QEMU_YAGL_UTIL_H
%.o: %.dtrace
$(call quiet-command,dtrace -o $@ -G -s $<,"GEN","$(TARGET_DIR)$@")
-ifdef CONFIG_WIN32
-DSO_OBJ_CFLAGS := -DBUILD_DSO
-else
DSO_OBJ_CFLAGS := -fPIC -DBUILD_DSO
-endif
module-common.o: CFLAGS += $(DSO_OBJ_CFLAGS)
%$(DSOSUF): QEMU_LDFLAGS += $(LDFLAGS_SHARED)
%$(DSOSUF): %.mo
# test
test()
{
- TIZEN_PLATFORM_VER="6.5"
- QEMU_VERSION="5.0.1.2"
+ TIZEN_PLATFORM_VER="7.0"
+ QEMU_VERSION="5.0.1.3"
BUILD_TARGET="ubuntu-64"
# emulator
EMULATOR_COMMON_DIR=./package/$TIZEN_PLATFORM_VER-emulator-qemu-common.package.${TARGET_OS}/data/platforms/tizen-$TIZEN_PLATFORM_VER/common
$CONFIGURE_APPEND"
CONFIGURE_APPEND_WIN="
+ --extra-ldflags=-static-libgcc
+ --extra-ldflags=-static-libstdc++
--audio-drv-list=dsound
+ --enable-sdl
--enable-hax
--enable-whpx
+ --extra-cflags="-D__USE_MINGW_ANSI_STDIO=1"
--extra-cflags=-Wno-error=undef
--extra-cflags=-Wno-error=unknown-pragmas
--extra-cflags=-Wno-error=redundant-decls"
--extra-ldflags=-rdynamic
--extra-ldflags=-Wl,-rpath,'\$\$ORIGIN'
--audio-drv-list=alsa
- --enable-sdl
--enable-kvm
$CONFIGURE_APPEND
"
int main(int argc, char *argv[])
{
if (!check_integrity_level_and_respawn()) {
+ LOG_INFO("check_integrity_level_and_respawn Success!\n");
init_error_handler();
return emulator_main(argc, argv, NULL);
}
*/
#include <png.h>
-#ifdef __USE_MINGW_ANSI_STDIO
-#undef __USE_MINGW_ANSI_STDIO
-#endif
#include "emulator_common.h"
#include "emul_state.h"
m->no_cdrom = 1;
m->no_sdcard = 1;
m->default_boot_order = "c";
+#ifdef CONFIG_HAX
compat_props_add(m->compat_props, hw_compat_2_6, hw_compat_2_6_len);
+#endif
}
DEFINE_PC_MACHINE(maru, "maru-x86-machine", maru_x86_board_init,
*/
#include <pthread.h>
-#ifdef __USE_MINGW_ANSI_STDIO
-#undef __USE_MINGW_ANSI_STDIO
-#endif
#include "qemu/osdep.h"
#include "qemu/iov.h"
#include "hw/maru_device_ids.h"
*/
#include <pthread.h>
-#ifdef __USE_MINGW_ANSI_STDIO
-#undef __USE_MINGW_ANSI_STDIO
-#endif
#include "qemu/osdep.h"
#include "hw/pci/pci.h"
#include "hw/qdev-properties.h"
*/
#include <pthread.h>
-#ifdef __USE_MINGW_ANSI_STDIO
-#undef __USE_MINGW_ANSI_STDIO
-#endif
#include "qemu/osdep.h"
#include "hw/pci/pci.h"
#include <string.h>
#include <sys/types.h>
#include <dirent.h>
-#ifdef __USE_MINGW_ANSI_STDIO
-#undef __USE_MINGW_ANSI_STDIO
-#endif
#include "qemu/osdep.h"
#include "qemu-common.h"
#include "qemu/queue.h"
LOG_INFO("Respawning success. Waiting for child process.\n");
bResult = true;
WaitForSingleObject(ProcInfo.hProcess, INFINITE);
+ LOG_INFO("Respawn successfull. Elevated Process.\n");
CleanExit:
if (ProcInfo.hProcess != NULL) {