YaGL: Transport improved 80/11080/1
authorStanislav Vorobiov <s.vorobiov@samsung.com>
Wed, 18 Sep 2013 14:20:18 +0000 (18:20 +0400)
committerStanislav Vorobiov <s.vorobiov@samsung.com>
Thu, 17 Oct 2013 08:04:20 +0000 (12:04 +0400)
The improvements are:

* All transport related things are now inside yagl_transport, the code
  is now concentrated in a single place instead of being scattered
  all over
* No more direct memory access and page walks from API implementation
  code, this is now done inside yagl_transport, thus, API
  implementation is transport agnostic now, function prototypes
  exactly match those of target
* Target arrays can now be accessed via pointer, again, all details
  are handled by yagl_transport. For output arrays API implementation
  also receives number of elements in an array, for input
  arrays it receives maximum number of elements and is able
  to specify how much elements are actually written in order not to
  waste bandwith by transferring excess data

Change-Id: If2689c9f8452ca2d15fe54b123fa2ac9e01a61be

56 files changed:
Makefile.target
hw/yagl_apis/egl/yagl_egl_api_ps.c
hw/yagl_apis/egl/yagl_egl_api_ps.h
hw/yagl_apis/egl/yagl_egl_calls.c
hw/yagl_apis/egl/yagl_egl_calls.h
hw/yagl_apis/egl/yagl_egl_display.c
hw/yagl_apis/egl/yagl_egl_display.h
hw/yagl_apis/egl/yagl_host_egl_calls.c
hw/yagl_apis/egl/yagl_host_egl_calls.h
hw/yagl_apis/gles/yagl_gles_array.c
hw/yagl_apis/gles/yagl_gles_array.h
hw/yagl_apis/gles/yagl_gles_buffer.c
hw/yagl_apis/gles/yagl_gles_buffer.h
hw/yagl_apis/gles/yagl_gles_context.c
hw/yagl_apis/gles/yagl_gles_context.h
hw/yagl_apis/gles/yagl_host_gles_calls.c
hw/yagl_apis/gles/yagl_host_gles_calls.h
hw/yagl_apis/gles1/yagl_gles1_calls.c
hw/yagl_apis/gles1/yagl_gles1_calls.h
hw/yagl_apis/gles1/yagl_host_gles1_calls.c
hw/yagl_apis/gles1/yagl_host_gles1_calls.h
hw/yagl_apis/gles2/yagl_gles2_calls.c
hw/yagl_apis/gles2/yagl_gles2_calls.h
hw/yagl_apis/gles2/yagl_gles2_shader.c
hw/yagl_apis/gles2/yagl_gles2_shader.h
hw/yagl_apis/gles2/yagl_host_gles2_calls.c
hw/yagl_apis/gles2/yagl_host_gles2_calls.h
hw/yagl_backends/egl_offscreen/yagl_egl_offscreen_image.c
hw/yagl_client_image.h
hw/yagl_device.c
hw/yagl_eglb_image.h
hw/yagl_log.c
hw/yagl_marshal.h [deleted file]
hw/yagl_marshal_egl.h [deleted file]
hw/yagl_marshal_gl.h [deleted file]
hw/yagl_mem.c
hw/yagl_mem.h
hw/yagl_mem_egl.c [deleted file]
hw/yagl_mem_egl.h [deleted file]
hw/yagl_mem_gl.c [deleted file]
hw/yagl_mem_gl.h [deleted file]
hw/yagl_mem_transfer.c [deleted file]
hw/yagl_mem_transfer.h [deleted file]
hw/yagl_server.c
hw/yagl_server.h
hw/yagl_stats.c
hw/yagl_stats.h
hw/yagl_thread.c
hw/yagl_thread.h
hw/yagl_transport.c [new file with mode: 0644]
hw/yagl_transport.h [new file with mode: 0644]
hw/yagl_transport_egl.h [new file with mode: 0644]
hw/yagl_transport_gl1.h [new file with mode: 0644]
hw/yagl_transport_gl2.h [new file with mode: 0644]
hw/yagl_types.h
hw/yagl_version.h

index 43e34b1..9fba593 100644 (file)
@@ -189,15 +189,13 @@ obj-y += yagl_thread.o
 obj-y += yagl_server.o
 obj-y += yagl_ref.o
 obj-y += yagl_mem.o
-obj-y += yagl_mem_egl.o
-obj-y += yagl_mem_gl.o
-obj-y += yagl_mem_transfer.o
 obj-y += yagl_event.o
 obj-y += yagl_handle_gen.o
 obj-y += yagl_dyn_lib.o
 obj-y += yagl_api.o
 obj-y += yagl_vector.o
 obj-y += yagl_avl.o
+obj-y += yagl_transport.o
 obj-y += yagl_range_list.o
 obj-y += yagl_egl_backend.o
 obj-y += yagl_eglb_display.o
index 0c0d71f..6bbed44 100644 (file)
@@ -51,7 +51,7 @@ struct yagl_egl_display *yagl_egl_api_ps_display_get(struct yagl_egl_api_ps *egl
 }
 
 struct yagl_egl_display *yagl_egl_api_ps_display_add(struct yagl_egl_api_ps *egl_api_ps,
-                                                     target_ulong display_id)
+                                                     uint32_t display_id)
 {
     struct yagl_egl_display *dpy;
 
index d6ff9d3..d486883 100644 (file)
@@ -37,6 +37,6 @@ struct yagl_egl_display *yagl_egl_api_ps_display_get(struct yagl_egl_api_ps *egl
                                                      yagl_host_handle handle);
 
 struct yagl_egl_display *yagl_egl_api_ps_display_add(struct yagl_egl_api_ps *egl_api_ps,
-                                                     target_ulong display_id);
+                                                     uint32_t display_id);
 
 #endif
index 2499d4e..574b5a6 100644 (file)
@@ -1,9 +1,9 @@
 /*
- * Generated by gen-yagl-calls.sh, do not modify!
+ * Generated by gen-yagl-calls.py, do not modify!
  */
 #include "yagl_egl_calls.h"
 #include "yagl_host_egl_calls.h"
-#include "yagl_marshal_egl.h"
+#include "yagl_transport_egl.h"
 #include "yagl_thread.h"
 #include "yagl_process.h"
 #include "yagl_log.h"
 /*
  * eglGetError dispatcher. id = 1
  */
-static bool yagl_func_eglGetError(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_eglGetError(struct yagl_transport *t)
 {
+    EGLint *retval;
+    yagl_transport_get_in_arg(t, (void**)&retval);
     YAGL_LOG_FUNC_ENTER_SPLIT0(eglGetError);
-    EGLint retval;
-    bool res = yagl_host_eglGetError(&retval);
-    if (!res) {
-        YAGL_LOG_FUNC_EXIT(NULL);
-        return false;
-    }
-    YAGL_LOG_FUNC_EXIT_SPLIT(EGLint, retval);
-    yagl_marshal_put_EGLint(&in_buff, retval);
+    *retval = yagl_host_eglGetError();
+    YAGL_LOG_FUNC_EXIT_SPLIT(EGLint, *retval);
+
     return true;
 }
 
 /*
  * eglGetDisplay dispatcher. id = 2
  */
-static bool yagl_func_eglGetDisplay(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_eglGetDisplay(struct yagl_transport *t)
 {
-    target_ulong display_id = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT1(eglGetDisplay, target_ulong, display_id);
-    yagl_host_handle retval;
-    bool res = yagl_host_eglGetDisplay(&retval, display_id);
-    if (!res) {
-        YAGL_LOG_FUNC_EXIT(NULL);
-        return false;
-    }
-    YAGL_LOG_FUNC_EXIT_SPLIT(yagl_host_handle, retval);
-    yagl_marshal_put_host_handle(&in_buff, retval);
+    uint32_t display_id;
+    yagl_host_handle *retval;
+    display_id = yagl_transport_get_out_uint32_t(t);
+    yagl_transport_get_in_arg(t, (void**)&retval);
+    YAGL_LOG_FUNC_ENTER_SPLIT1(eglGetDisplay, uint32_t, display_id);
+    *retval = yagl_host_eglGetDisplay(display_id);
+    YAGL_LOG_FUNC_EXIT_SPLIT(yagl_host_handle, *retval);
+
     return true;
 }
 
 /*
  * eglInitialize dispatcher. id = 3
  */
-static bool yagl_func_eglInitialize(uint8_t **out_buff,
-    uint8_t *in_buff)
-{
-    yagl_host_handle dpy = yagl_marshal_get_host_handle(out_buff);
-    target_ulong major = yagl_marshal_get_ptr(out_buff);
-    target_ulong minor = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT3(eglInitialize, yagl_host_handle, target_ulong, target_ulong, dpy, major, minor);
-    EGLBoolean retval;
-    bool res = yagl_host_eglInitialize(&retval, dpy, major, minor);
-    if (!res) {
-        YAGL_LOG_FUNC_EXIT(NULL);
-        return false;
-    }
-    YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, retval);
-    yagl_marshal_put_EGLBoolean(&in_buff, retval);
+static bool yagl_func_eglInitialize(struct yagl_transport *t)
+{
+    yagl_host_handle dpy;
+    EGLint *major;
+    EGLint *minor;
+    EGLBoolean *retval;
+    dpy = yagl_transport_get_out_yagl_host_handle(t);
+    yagl_transport_get_in_arg(t, (void**)&major);
+    yagl_transport_get_in_arg(t, (void**)&minor);
+    yagl_transport_get_in_arg(t, (void**)&retval);
+    YAGL_LOG_FUNC_ENTER_SPLIT3(eglInitialize, yagl_host_handle, void*, void*, dpy, major, minor);
+    *retval = yagl_host_eglInitialize(dpy, major, minor);
+    YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, *retval);
+
     return true;
 }
 
 /*
  * eglTerminate dispatcher. id = 4
  */
-static bool yagl_func_eglTerminate(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_eglTerminate(struct yagl_transport *t)
 {
-    yagl_host_handle dpy = yagl_marshal_get_host_handle(out_buff);
+    yagl_host_handle dpy;
+    EGLBoolean *retval;
+    dpy = yagl_transport_get_out_yagl_host_handle(t);
+    yagl_transport_get_in_arg(t, (void**)&retval);
     YAGL_LOG_FUNC_ENTER_SPLIT1(eglTerminate, yagl_host_handle, dpy);
-    EGLBoolean retval;
-    bool res = yagl_host_eglTerminate(&retval, dpy);
-    if (!res) {
-        YAGL_LOG_FUNC_EXIT(NULL);
-        return false;
-    }
-    YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, retval);
-    yagl_marshal_put_EGLBoolean(&in_buff, retval);
+    *retval = yagl_host_eglTerminate(dpy);
+    YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, *retval);
+
     return true;
 }
 
 /*
  * eglGetConfigs dispatcher. id = 5
  */
-static bool yagl_func_eglGetConfigs(uint8_t **out_buff,
-    uint8_t *in_buff)
-{
-    yagl_host_handle dpy = yagl_marshal_get_host_handle(out_buff);
-    target_ulong configs = yagl_marshal_get_ptr(out_buff);
-    EGLint config_size = yagl_marshal_get_EGLint(out_buff);
-    target_ulong num_config = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT4(eglGetConfigs, yagl_host_handle, target_ulong, EGLint, target_ulong, dpy, configs, config_size, num_config);
-    EGLBoolean retval;
-    bool res = yagl_host_eglGetConfigs(&retval, dpy, configs, config_size, num_config);
-    if (!res) {
-        YAGL_LOG_FUNC_EXIT(NULL);
+static bool yagl_func_eglGetConfigs(struct yagl_transport *t)
+{
+    yagl_host_handle dpy;
+    yagl_host_handle *configs;
+    int32_t configs_maxcount;
+    int32_t *configs_count;
+    EGLBoolean *retval;
+    dpy = yagl_transport_get_out_yagl_host_handle(t);
+    if (!yagl_transport_get_in_array(t, sizeof(yagl_host_handle), (void**)&configs, &configs_maxcount, &configs_count)) {
         return false;
     }
-    YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, retval);
-    yagl_marshal_put_EGLBoolean(&in_buff, retval);
+    yagl_transport_get_in_arg(t, (void**)&retval);
+    YAGL_LOG_FUNC_ENTER_SPLIT2(eglGetConfigs, yagl_host_handle, void*, dpy, configs);
+    *configs_count = 0;
+    *retval = yagl_host_eglGetConfigs(dpy, configs, configs_maxcount, configs_count);
+    YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, *retval);
+
     return true;
 }
 
 /*
  * eglChooseConfig dispatcher. id = 6
  */
-static bool yagl_func_eglChooseConfig(uint8_t **out_buff,
-    uint8_t *in_buff)
-{
-    yagl_host_handle dpy = yagl_marshal_get_host_handle(out_buff);
-    target_ulong attrib_list = yagl_marshal_get_ptr(out_buff);
-    target_ulong configs = yagl_marshal_get_ptr(out_buff);
-    EGLint config_size = yagl_marshal_get_EGLint(out_buff);
-    target_ulong num_config = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT5(eglChooseConfig, yagl_host_handle, target_ulong, target_ulong, EGLint, target_ulong, dpy, attrib_list, configs, config_size, num_config);
-    EGLBoolean retval;
-    bool res = yagl_host_eglChooseConfig(&retval, dpy, attrib_list, configs, config_size, num_config);
-    if (!res) {
-        YAGL_LOG_FUNC_EXIT(NULL);
+static bool yagl_func_eglChooseConfig(struct yagl_transport *t)
+{
+    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;
+    EGLBoolean *retval;
+    dpy = yagl_transport_get_out_yagl_host_handle(t);
+    if (!yagl_transport_get_out_array(t, sizeof(EGLint), (const void**)&attrib_list, &attrib_list_count)) {
+        return false;
+    }
+    if (!yagl_transport_get_in_array(t, sizeof(yagl_host_handle), (void**)&configs, &configs_maxcount, &configs_count)) {
         return false;
     }
-    YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, retval);
-    yagl_marshal_put_EGLBoolean(&in_buff, retval);
+    yagl_transport_get_in_arg(t, (void**)&retval);
+    YAGL_LOG_FUNC_ENTER_SPLIT3(eglChooseConfig, yagl_host_handle, void*, void*, dpy, attrib_list, configs);
+    *configs_count = 0;
+    *retval = yagl_host_eglChooseConfig(dpy, attrib_list, attrib_list_count, configs, configs_maxcount, configs_count);
+    YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, *retval);
+
     return true;
 }
 
 /*
  * eglGetConfigAttrib dispatcher. id = 7
  */
-static bool yagl_func_eglGetConfigAttrib(uint8_t **out_buff,
-    uint8_t *in_buff)
-{
-    yagl_host_handle dpy = yagl_marshal_get_host_handle(out_buff);
-    yagl_host_handle config = yagl_marshal_get_host_handle(out_buff);
-    EGLint attribute = yagl_marshal_get_EGLint(out_buff);
-    target_ulong value = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT4(eglGetConfigAttrib, yagl_host_handle, yagl_host_handle, EGLint, target_ulong, dpy, config, attribute, value);
-    EGLBoolean retval;
-    bool res = yagl_host_eglGetConfigAttrib(&retval, dpy, config, attribute, value);
-    if (!res) {
-        YAGL_LOG_FUNC_EXIT(NULL);
-        return false;
-    }
-    YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, retval);
-    yagl_marshal_put_EGLBoolean(&in_buff, retval);
+static bool yagl_func_eglGetConfigAttrib(struct yagl_transport *t)
+{
+    yagl_host_handle dpy;
+    yagl_host_handle config;
+    EGLint attribute;
+    EGLint *value;
+    EGLBoolean *retval;
+    dpy = yagl_transport_get_out_yagl_host_handle(t);
+    config = yagl_transport_get_out_yagl_host_handle(t);
+    attribute = yagl_transport_get_out_EGLint(t);
+    yagl_transport_get_in_arg(t, (void**)&value);
+    yagl_transport_get_in_arg(t, (void**)&retval);
+    YAGL_LOG_FUNC_ENTER_SPLIT4(eglGetConfigAttrib, yagl_host_handle, yagl_host_handle, EGLint, void*, dpy, config, attribute, value);
+    *retval = yagl_host_eglGetConfigAttrib(dpy, config, attribute, value);
+    YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, *retval);
+
     return true;
 }
 
 /*
  * eglDestroySurface dispatcher. id = 8
  */
-static bool yagl_func_eglDestroySurface(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_eglDestroySurface(struct yagl_transport *t)
 {
-    yagl_host_handle dpy = yagl_marshal_get_host_handle(out_buff);
-    yagl_host_handle surface = yagl_marshal_get_host_handle(out_buff);
+    yagl_host_handle dpy;
+    yagl_host_handle surface;
+    EGLBoolean *retval;
+    dpy = yagl_transport_get_out_yagl_host_handle(t);
+    surface = yagl_transport_get_out_yagl_host_handle(t);
+    yagl_transport_get_in_arg(t, (void**)&retval);
     YAGL_LOG_FUNC_ENTER_SPLIT2(eglDestroySurface, yagl_host_handle, yagl_host_handle, dpy, surface);
-    EGLBoolean retval;
-    bool res = yagl_host_eglDestroySurface(&retval, dpy, surface);
-    if (!res) {
-        YAGL_LOG_FUNC_EXIT(NULL);
-        return false;
-    }
-    YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, retval);
-    yagl_marshal_put_EGLBoolean(&in_buff, retval);
+    *retval = yagl_host_eglDestroySurface(dpy, surface);
+    YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, *retval);
+
     return true;
 }
 
 /*
  * eglQuerySurface dispatcher. id = 9
  */
-static bool yagl_func_eglQuerySurface(uint8_t **out_buff,
-    uint8_t *in_buff)
-{
-    yagl_host_handle dpy = yagl_marshal_get_host_handle(out_buff);
-    yagl_host_handle surface = yagl_marshal_get_host_handle(out_buff);
-    EGLint attribute = yagl_marshal_get_EGLint(out_buff);
-    target_ulong value = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT4(eglQuerySurface, yagl_host_handle, yagl_host_handle, EGLint, target_ulong, dpy, surface, attribute, value);
-    EGLBoolean retval;
-    bool res = yagl_host_eglQuerySurface(&retval, dpy, surface, attribute, value);
-    if (!res) {
-        YAGL_LOG_FUNC_EXIT(NULL);
-        return false;
-    }
-    YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, retval);
-    yagl_marshal_put_EGLBoolean(&in_buff, retval);
+static bool yagl_func_eglQuerySurface(struct yagl_transport *t)
+{
+    yagl_host_handle dpy;
+    yagl_host_handle surface;
+    EGLint attribute;
+    EGLint *value;
+    EGLBoolean *retval;
+    dpy = yagl_transport_get_out_yagl_host_handle(t);
+    surface = yagl_transport_get_out_yagl_host_handle(t);
+    attribute = yagl_transport_get_out_EGLint(t);
+    yagl_transport_get_in_arg(t, (void**)&value);
+    yagl_transport_get_in_arg(t, (void**)&retval);
+    YAGL_LOG_FUNC_ENTER_SPLIT4(eglQuerySurface, yagl_host_handle, yagl_host_handle, EGLint, void*, dpy, surface, attribute, value);
+    *retval = yagl_host_eglQuerySurface(dpy, surface, attribute, value);
+    YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, *retval);
+
     return true;
 }
 
 /*
  * eglBindAPI dispatcher. id = 10
  */
-static bool yagl_func_eglBindAPI(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_eglBindAPI(struct yagl_transport *t)
 {
-    EGLenum api = yagl_marshal_get_EGLenum(out_buff);
+    EGLenum api;
+    EGLBoolean *retval;
+    api = yagl_transport_get_out_EGLenum(t);
+    yagl_transport_get_in_arg(t, (void**)&retval);
     YAGL_LOG_FUNC_ENTER_SPLIT1(eglBindAPI, EGLenum, api);
-    EGLBoolean retval;
-    bool res = yagl_host_eglBindAPI(&retval, api);
-    if (!res) {
-        YAGL_LOG_FUNC_EXIT(NULL);
-        return false;
-    }
-    YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, retval);
-    yagl_marshal_put_EGLBoolean(&in_buff, retval);
+    *retval = yagl_host_eglBindAPI(api);
+    YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, *retval);
+
     return true;
 }
 
 /*
  * eglWaitClient dispatcher. id = 11
  */
-static bool yagl_func_eglWaitClient(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_eglWaitClient(struct yagl_transport *t)
 {
+    EGLBoolean *retval;
+    yagl_transport_get_in_arg(t, (void**)&retval);
     YAGL_LOG_FUNC_ENTER_SPLIT0(eglWaitClient);
-    EGLBoolean retval;
-    bool res = yagl_host_eglWaitClient(&retval);
-    if (!res) {
-        YAGL_LOG_FUNC_EXIT(NULL);
-        return false;
-    }
-    YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, retval);
-    yagl_marshal_put_EGLBoolean(&in_buff, retval);
+    *retval = yagl_host_eglWaitClient();
+    YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, *retval);
+
     return true;
 }
 
 /*
  * eglReleaseThread dispatcher. id = 12
  */
-static bool yagl_func_eglReleaseThread(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_eglReleaseThread(struct yagl_transport *t)
 {
+    EGLBoolean *retval;
+    yagl_transport_get_in_arg(t, (void**)&retval);
     YAGL_LOG_FUNC_ENTER_SPLIT0(eglReleaseThread);
-    EGLBoolean retval;
-    bool res = yagl_host_eglReleaseThread(&retval);
-    if (!res) {
-        YAGL_LOG_FUNC_EXIT(NULL);
-        return false;
-    }
-    YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, retval);
-    yagl_marshal_put_EGLBoolean(&in_buff, retval);
-    return true;
-}
+    *retval = yagl_host_eglReleaseThread();
+    YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, *retval);
 
-/*
- * eglCreatePbufferFromClientBuffer dispatcher. id = 13
- */
-static bool yagl_func_eglCreatePbufferFromClientBuffer(uint8_t **out_buff,
-    uint8_t *in_buff)
-{
-    yagl_host_handle dpy = yagl_marshal_get_host_handle(out_buff);
-    EGLenum buftype = yagl_marshal_get_EGLenum(out_buff);
-    yagl_host_handle buffer = yagl_marshal_get_host_handle(out_buff);
-    yagl_host_handle config = yagl_marshal_get_host_handle(out_buff);
-    target_ulong attrib_list = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT5(eglCreatePbufferFromClientBuffer, yagl_host_handle, EGLenum, yagl_host_handle, yagl_host_handle, target_ulong, dpy, buftype, buffer, config, attrib_list);
-    yagl_host_handle retval;
-    bool res = yagl_host_eglCreatePbufferFromClientBuffer(&retval, dpy, buftype, buffer, config, attrib_list);
-    if (!res) {
-        YAGL_LOG_FUNC_EXIT(NULL);
-        return false;
-    }
-    YAGL_LOG_FUNC_EXIT_SPLIT(yagl_host_handle, retval);
-    yagl_marshal_put_host_handle(&in_buff, retval);
     return true;
 }
 
 /*
- * eglSurfaceAttrib dispatcher. id = 14
+ * eglSurfaceAttrib dispatcher. id = 13
  */
-static bool yagl_func_eglSurfaceAttrib(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_eglSurfaceAttrib(struct yagl_transport *t)
 {
-    yagl_host_handle dpy = yagl_marshal_get_host_handle(out_buff);
-    yagl_host_handle surface = yagl_marshal_get_host_handle(out_buff);
-    EGLint attribute = yagl_marshal_get_EGLint(out_buff);
-    EGLint value = yagl_marshal_get_EGLint(out_buff);
+    yagl_host_handle dpy;
+    yagl_host_handle surface;
+    EGLint attribute;
+    EGLint value;
+    EGLBoolean *retval;
+    dpy = yagl_transport_get_out_yagl_host_handle(t);
+    surface = yagl_transport_get_out_yagl_host_handle(t);
+    attribute = yagl_transport_get_out_EGLint(t);
+    value = yagl_transport_get_out_EGLint(t);
+    yagl_transport_get_in_arg(t, (void**)&retval);
     YAGL_LOG_FUNC_ENTER_SPLIT4(eglSurfaceAttrib, yagl_host_handle, yagl_host_handle, EGLint, EGLint, dpy, surface, attribute, value);
-    EGLBoolean retval;
-    bool res = yagl_host_eglSurfaceAttrib(&retval, dpy, surface, attribute, value);
-    if (!res) {
-        YAGL_LOG_FUNC_EXIT(NULL);
-        return false;
-    }
-    YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, retval);
-    yagl_marshal_put_EGLBoolean(&in_buff, retval);
+    *retval = yagl_host_eglSurfaceAttrib(dpy, surface, attribute, value);
+    YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, *retval);
+
     return true;
 }
 
 /*
- * eglBindTexImage dispatcher. id = 15
+ * eglBindTexImage dispatcher. id = 14
  */
-static bool yagl_func_eglBindTexImage(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_eglBindTexImage(struct yagl_transport *t)
 {
-    yagl_host_handle dpy = yagl_marshal_get_host_handle(out_buff);
-    yagl_host_handle surface = yagl_marshal_get_host_handle(out_buff);
-    EGLint buffer = yagl_marshal_get_EGLint(out_buff);
+    yagl_host_handle dpy;
+    yagl_host_handle surface;
+    EGLint buffer;
+    EGLBoolean *retval;
+    dpy = yagl_transport_get_out_yagl_host_handle(t);
+    surface = yagl_transport_get_out_yagl_host_handle(t);
+    buffer = yagl_transport_get_out_EGLint(t);
+    yagl_transport_get_in_arg(t, (void**)&retval);
     YAGL_LOG_FUNC_ENTER_SPLIT3(eglBindTexImage, yagl_host_handle, yagl_host_handle, EGLint, dpy, surface, buffer);
-    EGLBoolean retval;
-    bool res = yagl_host_eglBindTexImage(&retval, dpy, surface, buffer);
-    if (!res) {
-        YAGL_LOG_FUNC_EXIT(NULL);
-        return false;
-    }
-    YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, retval);
-    yagl_marshal_put_EGLBoolean(&in_buff, retval);
+    *retval = yagl_host_eglBindTexImage(dpy, surface, buffer);
+    YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, *retval);
+
     return true;
 }
 
 /*
- * eglReleaseTexImage dispatcher. id = 16
+ * eglReleaseTexImage dispatcher. id = 15
  */
-static bool yagl_func_eglReleaseTexImage(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_eglReleaseTexImage(struct yagl_transport *t)
 {
-    yagl_host_handle dpy = yagl_marshal_get_host_handle(out_buff);
-    yagl_host_handle surface = yagl_marshal_get_host_handle(out_buff);
-    EGLint buffer = yagl_marshal_get_EGLint(out_buff);
+    yagl_host_handle dpy;
+    yagl_host_handle surface;
+    EGLint buffer;
+    EGLBoolean *retval;
+    dpy = yagl_transport_get_out_yagl_host_handle(t);
+    surface = yagl_transport_get_out_yagl_host_handle(t);
+    buffer = yagl_transport_get_out_EGLint(t);
+    yagl_transport_get_in_arg(t, (void**)&retval);
     YAGL_LOG_FUNC_ENTER_SPLIT3(eglReleaseTexImage, yagl_host_handle, yagl_host_handle, EGLint, dpy, surface, buffer);
-    EGLBoolean retval;
-    bool res = yagl_host_eglReleaseTexImage(&retval, dpy, surface, buffer);
-    if (!res) {
-        YAGL_LOG_FUNC_EXIT(NULL);
-        return false;
-    }
-    YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, retval);
-    yagl_marshal_put_EGLBoolean(&in_buff, retval);
+    *retval = yagl_host_eglReleaseTexImage(dpy, surface, buffer);
+    YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, *retval);
+
     return true;
 }
 
 /*
- * eglCreateContext dispatcher. id = 17
+ * eglCreateContext dispatcher. id = 16
  */
-static bool yagl_func_eglCreateContext(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_eglCreateContext(struct yagl_transport *t)
 {
-    yagl_host_handle dpy = yagl_marshal_get_host_handle(out_buff);
-    yagl_host_handle config = yagl_marshal_get_host_handle(out_buff);
-    yagl_host_handle share_context = yagl_marshal_get_host_handle(out_buff);
-    target_ulong attrib_list = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT4(eglCreateContext, yagl_host_handle, yagl_host_handle, yagl_host_handle, target_ulong, dpy, config, share_context, attrib_list);
-    yagl_host_handle retval;
-    bool res = yagl_host_eglCreateContext(&retval, dpy, config, share_context, attrib_list);
-    if (!res) {
-        YAGL_LOG_FUNC_EXIT(NULL);
+    yagl_host_handle dpy;
+    yagl_host_handle config;
+    yagl_host_handle share_context;
+    const EGLint *attrib_list;
+    int32_t attrib_list_count;
+    yagl_host_handle *retval;
+    dpy = yagl_transport_get_out_yagl_host_handle(t);
+    config = yagl_transport_get_out_yagl_host_handle(t);
+    share_context = yagl_transport_get_out_yagl_host_handle(t);
+    if (!yagl_transport_get_out_array(t, sizeof(EGLint), (const void**)&attrib_list, &attrib_list_count)) {
         return false;
     }
-    YAGL_LOG_FUNC_EXIT_SPLIT(yagl_host_handle, retval);
-    yagl_marshal_put_host_handle(&in_buff, retval);
+    yagl_transport_get_in_arg(t, (void**)&retval);
+    YAGL_LOG_FUNC_ENTER_SPLIT4(eglCreateContext, yagl_host_handle, yagl_host_handle, yagl_host_handle, void*, dpy, config, share_context, attrib_list);
+    *retval = yagl_host_eglCreateContext(dpy, config, share_context, attrib_list, attrib_list_count);
+    YAGL_LOG_FUNC_EXIT_SPLIT(yagl_host_handle, *retval);
+
     return true;
 }
 
 /*
- * eglDestroyContext dispatcher. id = 18
+ * eglDestroyContext dispatcher. id = 17
  */
-static bool yagl_func_eglDestroyContext(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_eglDestroyContext(struct yagl_transport *t)
 {
-    yagl_host_handle dpy = yagl_marshal_get_host_handle(out_buff);
-    yagl_host_handle ctx = yagl_marshal_get_host_handle(out_buff);
+    yagl_host_handle dpy;
+    yagl_host_handle ctx;
+    EGLBoolean *retval;
+    dpy = yagl_transport_get_out_yagl_host_handle(t);
+    ctx = yagl_transport_get_out_yagl_host_handle(t);
+    yagl_transport_get_in_arg(t, (void**)&retval);
     YAGL_LOG_FUNC_ENTER_SPLIT2(eglDestroyContext, yagl_host_handle, yagl_host_handle, dpy, ctx);
-    EGLBoolean retval;
-    bool res = yagl_host_eglDestroyContext(&retval, dpy, ctx);
-    if (!res) {
-        YAGL_LOG_FUNC_EXIT(NULL);
-        return false;
-    }
-    YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, retval);
-    yagl_marshal_put_EGLBoolean(&in_buff, retval);
+    *retval = yagl_host_eglDestroyContext(dpy, ctx);
+    YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, *retval);
+
     return true;
 }
 
 /*
- * eglMakeCurrent dispatcher. id = 19
+ * eglMakeCurrent dispatcher. id = 18
  */
-static bool yagl_func_eglMakeCurrent(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_eglMakeCurrent(struct yagl_transport *t)
 {
-    yagl_host_handle dpy = yagl_marshal_get_host_handle(out_buff);
-    yagl_host_handle draw = yagl_marshal_get_host_handle(out_buff);
-    yagl_host_handle read = yagl_marshal_get_host_handle(out_buff);
-    yagl_host_handle ctx = yagl_marshal_get_host_handle(out_buff);
+    yagl_host_handle dpy;
+    yagl_host_handle draw;
+    yagl_host_handle read;
+    yagl_host_handle ctx;
+    EGLBoolean *retval;
+    dpy = yagl_transport_get_out_yagl_host_handle(t);
+    draw = yagl_transport_get_out_yagl_host_handle(t);
+    read = yagl_transport_get_out_yagl_host_handle(t);
+    ctx = yagl_transport_get_out_yagl_host_handle(t);
+    yagl_transport_get_in_arg(t, (void**)&retval);
     YAGL_LOG_FUNC_ENTER_SPLIT4(eglMakeCurrent, yagl_host_handle, yagl_host_handle, yagl_host_handle, yagl_host_handle, dpy, draw, read, ctx);
-    EGLBoolean retval;
-    bool res = yagl_host_eglMakeCurrent(&retval, dpy, draw, read, ctx);
-    if (!res) {
-        YAGL_LOG_FUNC_EXIT(NULL);
-        return false;
-    }
-    YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, retval);
-    yagl_marshal_put_EGLBoolean(&in_buff, retval);
+    *retval = yagl_host_eglMakeCurrent(dpy, draw, read, ctx);
+    YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, *retval);
+
     return true;
 }
 
 /*
- * eglQueryContext dispatcher. id = 20
+ * eglQueryContext dispatcher. id = 19
  */
-static bool yagl_func_eglQueryContext(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_eglQueryContext(struct yagl_transport *t)
 {
-    yagl_host_handle dpy = yagl_marshal_get_host_handle(out_buff);
-    yagl_host_handle ctx = yagl_marshal_get_host_handle(out_buff);
-    EGLint attribute = yagl_marshal_get_EGLint(out_buff);
-    target_ulong value = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT4(eglQueryContext, yagl_host_handle, yagl_host_handle, EGLint, target_ulong, dpy, ctx, attribute, value);
-    EGLBoolean retval;
-    bool res = yagl_host_eglQueryContext(&retval, dpy, ctx, attribute, value);
-    if (!res) {
-        YAGL_LOG_FUNC_EXIT(NULL);
-        return false;
-    }
-    YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, retval);
-    yagl_marshal_put_EGLBoolean(&in_buff, retval);
+    yagl_host_handle dpy;
+    yagl_host_handle ctx;
+    EGLint attribute;
+    EGLint *value;
+    EGLBoolean *retval;
+    dpy = yagl_transport_get_out_yagl_host_handle(t);
+    ctx = yagl_transport_get_out_yagl_host_handle(t);
+    attribute = yagl_transport_get_out_EGLint(t);
+    yagl_transport_get_in_arg(t, (void**)&value);
+    yagl_transport_get_in_arg(t, (void**)&retval);
+    YAGL_LOG_FUNC_ENTER_SPLIT4(eglQueryContext, yagl_host_handle, yagl_host_handle, EGLint, void*, dpy, ctx, attribute, value);
+    *retval = yagl_host_eglQueryContext(dpy, ctx, attribute, value);
+    YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, *retval);
+
     return true;
 }
 
 /*
- * eglSwapBuffers dispatcher. id = 21
+ * eglSwapBuffers dispatcher. id = 20
  */
-static bool yagl_func_eglSwapBuffers(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_eglSwapBuffers(struct yagl_transport *t)
 {
-    yagl_host_handle dpy = yagl_marshal_get_host_handle(out_buff);
-    yagl_host_handle surface = yagl_marshal_get_host_handle(out_buff);
+    yagl_host_handle dpy;
+    yagl_host_handle surface;
+    EGLBoolean *retval;
+    dpy = yagl_transport_get_out_yagl_host_handle(t);
+    surface = yagl_transport_get_out_yagl_host_handle(t);
+    yagl_transport_get_in_arg(t, (void**)&retval);
     YAGL_LOG_FUNC_ENTER_SPLIT2(eglSwapBuffers, yagl_host_handle, yagl_host_handle, dpy, surface);
-    EGLBoolean retval;
-    bool res = yagl_host_eglSwapBuffers(&retval, dpy, surface);
-    if (!res) {
-        YAGL_LOG_FUNC_EXIT(NULL);
-        return false;
-    }
-    YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, retval);
-    yagl_marshal_put_EGLBoolean(&in_buff, retval);
+    *retval = yagl_host_eglSwapBuffers(dpy, surface);
+    YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, *retval);
+
     return true;
 }
 
 /*
- * eglCopyBuffers dispatcher. id = 22
+ * eglCopyBuffers dispatcher. id = 21
  */
-static bool yagl_func_eglCopyBuffers(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_eglCopyBuffers(struct yagl_transport *t)
 {
-    yagl_host_handle dpy = yagl_marshal_get_host_handle(out_buff);
-    yagl_host_handle surface = yagl_marshal_get_host_handle(out_buff);
+    yagl_host_handle dpy;
+    yagl_host_handle surface;
+    EGLBoolean *retval;
+    dpy = yagl_transport_get_out_yagl_host_handle(t);
+    surface = yagl_transport_get_out_yagl_host_handle(t);
+    yagl_transport_get_in_arg(t, (void**)&retval);
     YAGL_LOG_FUNC_ENTER_SPLIT2(eglCopyBuffers, yagl_host_handle, yagl_host_handle, dpy, surface);
-    EGLBoolean retval;
-    bool res = yagl_host_eglCopyBuffers(&retval, dpy, surface);
-    if (!res) {
-        YAGL_LOG_FUNC_EXIT(NULL);
-        return false;
-    }
-    YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, retval);
-    yagl_marshal_put_EGLBoolean(&in_buff, retval);
+    *retval = yagl_host_eglCopyBuffers(dpy, surface);
+    YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, *retval);
+
     return true;
 }
 
 /*
- * eglCreateImageKHR dispatcher. id = 23
+ * eglCreateImageKHR dispatcher. id = 22
  */
-static bool yagl_func_eglCreateImageKHR(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_eglCreateImageKHR(struct yagl_transport *t)
 {
-    yagl_host_handle dpy = yagl_marshal_get_host_handle(out_buff);
-    yagl_host_handle ctx = yagl_marshal_get_host_handle(out_buff);
-    EGLenum target = yagl_marshal_get_EGLenum(out_buff);
-    yagl_winsys_id buffer = yagl_marshal_get_yagl_winsys_id(out_buff);
-    target_ulong attrib_list = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT5(eglCreateImageKHR, yagl_host_handle, yagl_host_handle, EGLenum, yagl_winsys_id, target_ulong, dpy, ctx, target, buffer, attrib_list);
-    yagl_host_handle retval;
-    bool res = yagl_host_eglCreateImageKHR(&retval, dpy, ctx, target, buffer, attrib_list);
-    if (!res) {
-        YAGL_LOG_FUNC_EXIT(NULL);
+    yagl_host_handle dpy;
+    yagl_host_handle ctx;
+    EGLenum target;
+    yagl_winsys_id buffer;
+    const EGLint *attrib_list;
+    int32_t attrib_list_count;
+    yagl_host_handle *retval;
+    dpy = yagl_transport_get_out_yagl_host_handle(t);
+    ctx = yagl_transport_get_out_yagl_host_handle(t);
+    target = yagl_transport_get_out_EGLenum(t);
+    buffer = yagl_transport_get_out_yagl_winsys_id(t);
+    if (!yagl_transport_get_out_array(t, sizeof(EGLint), (const void**)&attrib_list, &attrib_list_count)) {
         return false;
     }
-    YAGL_LOG_FUNC_EXIT_SPLIT(yagl_host_handle, retval);
-    yagl_marshal_put_host_handle(&in_buff, retval);
+    yagl_transport_get_in_arg(t, (void**)&retval);
+    YAGL_LOG_FUNC_ENTER_SPLIT5(eglCreateImageKHR, yagl_host_handle, yagl_host_handle, EGLenum, yagl_winsys_id, void*, dpy, ctx, target, buffer, attrib_list);
+    *retval = yagl_host_eglCreateImageKHR(dpy, ctx, target, buffer, attrib_list, attrib_list_count);
+    YAGL_LOG_FUNC_EXIT_SPLIT(yagl_host_handle, *retval);
+
     return true;
 }
 
 /*
- * eglDestroyImageKHR dispatcher. id = 24
+ * eglDestroyImageKHR dispatcher. id = 23
  */
-static bool yagl_func_eglDestroyImageKHR(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_eglDestroyImageKHR(struct yagl_transport *t)
 {
-    yagl_host_handle dpy = yagl_marshal_get_host_handle(out_buff);
-    yagl_host_handle image = yagl_marshal_get_host_handle(out_buff);
+    yagl_host_handle dpy;
+    yagl_host_handle image;
+    EGLBoolean *retval;
+    dpy = yagl_transport_get_out_yagl_host_handle(t);
+    image = yagl_transport_get_out_yagl_host_handle(t);
+    yagl_transport_get_in_arg(t, (void**)&retval);
     YAGL_LOG_FUNC_ENTER_SPLIT2(eglDestroyImageKHR, yagl_host_handle, yagl_host_handle, dpy, image);
-    EGLBoolean retval;
-    bool res = yagl_host_eglDestroyImageKHR(&retval, dpy, image);
-    if (!res) {
-        YAGL_LOG_FUNC_EXIT(NULL);
-        return false;
-    }
-    YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, retval);
-    yagl_marshal_put_EGLBoolean(&in_buff, retval);
+    *retval = yagl_host_eglDestroyImageKHR(dpy, image);
+    YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, *retval);
+
     return true;
 }
 
 /*
- * eglCreateWindowSurfaceOffscreenYAGL dispatcher. id = 25
+ * eglCreateWindowSurfaceOffscreenYAGL dispatcher. id = 24
  */
-static bool yagl_func_eglCreateWindowSurfaceOffscreenYAGL(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_eglCreateWindowSurfaceOffscreenYAGL(struct yagl_transport *t)
 {
-    yagl_host_handle dpy = yagl_marshal_get_host_handle(out_buff);
-    yagl_host_handle config = yagl_marshal_get_host_handle(out_buff);
-    uint32_t width = yagl_marshal_get_uint32_t(out_buff);
-    uint32_t height = yagl_marshal_get_uint32_t(out_buff);
-    uint32_t bpp = yagl_marshal_get_uint32_t(out_buff);
-    target_ulong pixels = yagl_marshal_get_ptr(out_buff);
-    target_ulong attrib_list = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT7(eglCreateWindowSurfaceOffscreenYAGL, yagl_host_handle, yagl_host_handle, uint32_t, uint32_t, uint32_t, target_ulong, target_ulong, dpy, config, width, height, bpp, pixels, attrib_list);
-    yagl_host_handle retval;
-    bool res = yagl_host_eglCreateWindowSurfaceOffscreenYAGL(&retval, dpy, config, width, height, bpp, pixels, attrib_list);
-    if (!res) {
-        YAGL_LOG_FUNC_EXIT(NULL);
+    yagl_host_handle dpy;
+    yagl_host_handle config;
+    uint32_t width;
+    uint32_t height;
+    uint32_t bpp;
+    target_ulong pixels;
+    const EGLint *attrib_list;
+    int32_t attrib_list_count;
+    yagl_host_handle *retval;
+    dpy = yagl_transport_get_out_yagl_host_handle(t);
+    config = yagl_transport_get_out_yagl_host_handle(t);
+    width = yagl_transport_get_out_uint32_t(t);
+    height = yagl_transport_get_out_uint32_t(t);
+    bpp = yagl_transport_get_out_uint32_t(t);
+    pixels = yagl_transport_get_out_va(t);
+    if (!yagl_transport_get_out_array(t, sizeof(EGLint), (const void**)&attrib_list, &attrib_list_count)) {
         return false;
     }
-    YAGL_LOG_FUNC_EXIT_SPLIT(yagl_host_handle, retval);
-    yagl_marshal_put_host_handle(&in_buff, retval);
+    yagl_transport_get_in_arg(t, (void**)&retval);
+    YAGL_LOG_FUNC_ENTER_SPLIT7(eglCreateWindowSurfaceOffscreenYAGL, yagl_host_handle, yagl_host_handle, uint32_t, uint32_t, uint32_t, target_ulong, void*, dpy, config, width, height, bpp, pixels, attrib_list);
+    *retval = yagl_host_eglCreateWindowSurfaceOffscreenYAGL(dpy, config, width, height, bpp, pixels, attrib_list, attrib_list_count);
+    YAGL_LOG_FUNC_EXIT_SPLIT(yagl_host_handle, *retval);
+
     return true;
 }
 
 /*
- * eglCreatePbufferSurfaceOffscreenYAGL dispatcher. id = 26
+ * eglCreatePbufferSurfaceOffscreenYAGL dispatcher. id = 25
  */
-static bool yagl_func_eglCreatePbufferSurfaceOffscreenYAGL(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_eglCreatePbufferSurfaceOffscreenYAGL(struct yagl_transport *t)
 {
-    yagl_host_handle dpy = yagl_marshal_get_host_handle(out_buff);
-    yagl_host_handle config = yagl_marshal_get_host_handle(out_buff);
-    uint32_t width = yagl_marshal_get_uint32_t(out_buff);
-    uint32_t height = yagl_marshal_get_uint32_t(out_buff);
-    uint32_t bpp = yagl_marshal_get_uint32_t(out_buff);
-    target_ulong pixels = yagl_marshal_get_ptr(out_buff);
-    target_ulong attrib_list = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT7(eglCreatePbufferSurfaceOffscreenYAGL, yagl_host_handle, yagl_host_handle, uint32_t, uint32_t, uint32_t, target_ulong, target_ulong, dpy, config, width, height, bpp, pixels, attrib_list);
-    yagl_host_handle retval;
-    bool res = yagl_host_eglCreatePbufferSurfaceOffscreenYAGL(&retval, dpy, config, width, height, bpp, pixels, attrib_list);
-    if (!res) {
-        YAGL_LOG_FUNC_EXIT(NULL);
+    yagl_host_handle dpy;
+    yagl_host_handle config;
+    uint32_t width;
+    uint32_t height;
+    uint32_t bpp;
+    target_ulong pixels;
+    const EGLint *attrib_list;
+    int32_t attrib_list_count;
+    yagl_host_handle *retval;
+    dpy = yagl_transport_get_out_yagl_host_handle(t);
+    config = yagl_transport_get_out_yagl_host_handle(t);
+    width = yagl_transport_get_out_uint32_t(t);
+    height = yagl_transport_get_out_uint32_t(t);
+    bpp = yagl_transport_get_out_uint32_t(t);
+    pixels = yagl_transport_get_out_va(t);
+    if (!yagl_transport_get_out_array(t, sizeof(EGLint), (const void**)&attrib_list, &attrib_list_count)) {
         return false;
     }
-    YAGL_LOG_FUNC_EXIT_SPLIT(yagl_host_handle, retval);
-    yagl_marshal_put_host_handle(&in_buff, retval);
+    yagl_transport_get_in_arg(t, (void**)&retval);
+    YAGL_LOG_FUNC_ENTER_SPLIT7(eglCreatePbufferSurfaceOffscreenYAGL, yagl_host_handle, yagl_host_handle, uint32_t, uint32_t, uint32_t, target_ulong, void*, dpy, config, width, height, bpp, pixels, attrib_list);
+    *retval = yagl_host_eglCreatePbufferSurfaceOffscreenYAGL(dpy, config, width, height, bpp, pixels, attrib_list, attrib_list_count);
+    YAGL_LOG_FUNC_EXIT_SPLIT(yagl_host_handle, *retval);
+
     return true;
 }
 
 /*
- * eglCreatePixmapSurfaceOffscreenYAGL dispatcher. id = 27
+ * eglCreatePixmapSurfaceOffscreenYAGL dispatcher. id = 26
  */
-static bool yagl_func_eglCreatePixmapSurfaceOffscreenYAGL(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_eglCreatePixmapSurfaceOffscreenYAGL(struct yagl_transport *t)
 {
-    yagl_host_handle dpy = yagl_marshal_get_host_handle(out_buff);
-    yagl_host_handle config = yagl_marshal_get_host_handle(out_buff);
-    uint32_t width = yagl_marshal_get_uint32_t(out_buff);
-    uint32_t height = yagl_marshal_get_uint32_t(out_buff);
-    uint32_t bpp = yagl_marshal_get_uint32_t(out_buff);
-    target_ulong pixels = yagl_marshal_get_ptr(out_buff);
-    target_ulong attrib_list = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT7(eglCreatePixmapSurfaceOffscreenYAGL, yagl_host_handle, yagl_host_handle, uint32_t, uint32_t, uint32_t, target_ulong, target_ulong, dpy, config, width, height, bpp, pixels, attrib_list);
-    yagl_host_handle retval;
-    bool res = yagl_host_eglCreatePixmapSurfaceOffscreenYAGL(&retval, dpy, config, width, height, bpp, pixels, attrib_list);
-    if (!res) {
-        YAGL_LOG_FUNC_EXIT(NULL);
+    yagl_host_handle dpy;
+    yagl_host_handle config;
+    uint32_t width;
+    uint32_t height;
+    uint32_t bpp;
+    target_ulong pixels;
+    const EGLint *attrib_list;
+    int32_t attrib_list_count;
+    yagl_host_handle *retval;
+    dpy = yagl_transport_get_out_yagl_host_handle(t);
+    config = yagl_transport_get_out_yagl_host_handle(t);
+    width = yagl_transport_get_out_uint32_t(t);
+    height = yagl_transport_get_out_uint32_t(t);
+    bpp = yagl_transport_get_out_uint32_t(t);
+    pixels = yagl_transport_get_out_va(t);
+    if (!yagl_transport_get_out_array(t, sizeof(EGLint), (const void**)&attrib_list, &attrib_list_count)) {
         return false;
     }
-    YAGL_LOG_FUNC_EXIT_SPLIT(yagl_host_handle, retval);
-    yagl_marshal_put_host_handle(&in_buff, retval);
+    yagl_transport_get_in_arg(t, (void**)&retval);
+    YAGL_LOG_FUNC_ENTER_SPLIT7(eglCreatePixmapSurfaceOffscreenYAGL, yagl_host_handle, yagl_host_handle, uint32_t, uint32_t, uint32_t, target_ulong, void*, dpy, config, width, height, bpp, pixels, attrib_list);
+    *retval = yagl_host_eglCreatePixmapSurfaceOffscreenYAGL(dpy, config, width, height, bpp, pixels, attrib_list, attrib_list_count);
+    YAGL_LOG_FUNC_EXIT_SPLIT(yagl_host_handle, *retval);
+
     return true;
 }
 
 /*
- * eglResizeOffscreenSurfaceYAGL dispatcher. id = 28
+ * eglResizeOffscreenSurfaceYAGL dispatcher. id = 27
  */
-static bool yagl_func_eglResizeOffscreenSurfaceYAGL(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_eglResizeOffscreenSurfaceYAGL(struct yagl_transport *t)
 {
-    yagl_host_handle dpy = yagl_marshal_get_host_handle(out_buff);
-    yagl_host_handle surface = yagl_marshal_get_host_handle(out_buff);
-    uint32_t width = yagl_marshal_get_uint32_t(out_buff);
-    uint32_t height = yagl_marshal_get_uint32_t(out_buff);
-    uint32_t bpp = yagl_marshal_get_uint32_t(out_buff);
-    target_ulong pixels = yagl_marshal_get_ptr(out_buff);
+    yagl_host_handle dpy;
+    yagl_host_handle surface;
+    uint32_t width;
+    uint32_t height;
+    uint32_t bpp;
+    target_ulong pixels;
+    EGLBoolean *retval;
+    dpy = yagl_transport_get_out_yagl_host_handle(t);
+    surface = yagl_transport_get_out_yagl_host_handle(t);
+    width = yagl_transport_get_out_uint32_t(t);
+    height = yagl_transport_get_out_uint32_t(t);
+    bpp = yagl_transport_get_out_uint32_t(t);
+    pixels = yagl_transport_get_out_va(t);
+    yagl_transport_get_in_arg(t, (void**)&retval);
     YAGL_LOG_FUNC_ENTER_SPLIT6(eglResizeOffscreenSurfaceYAGL, yagl_host_handle, yagl_host_handle, uint32_t, uint32_t, uint32_t, target_ulong, dpy, surface, width, height, bpp, pixels);
-    EGLBoolean retval;
-    bool res = yagl_host_eglResizeOffscreenSurfaceYAGL(&retval, dpy, surface, width, height, bpp, pixels);
-    if (!res) {
-        YAGL_LOG_FUNC_EXIT(NULL);
-        return false;
-    }
-    YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, retval);
-    yagl_marshal_put_EGLBoolean(&in_buff, retval);
+    *retval = yagl_host_eglResizeOffscreenSurfaceYAGL(dpy, surface, width, height, bpp, pixels);
+    YAGL_LOG_FUNC_EXIT_SPLIT(EGLBoolean, *retval);
+
     return true;
 }
 
 /*
- * eglUpdateOffscreenImageYAGL dispatcher. id = 29
+ * eglUpdateOffscreenImageYAGL dispatcher. id = 28
  */
-static bool yagl_func_eglUpdateOffscreenImageYAGL(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_eglUpdateOffscreenImageYAGL(struct yagl_transport *t)
 {
-    yagl_host_handle dpy = yagl_marshal_get_host_handle(out_buff);
-    yagl_host_handle image = yagl_marshal_get_host_handle(out_buff);
-    uint32_t width = yagl_marshal_get_uint32_t(out_buff);
-    uint32_t height = yagl_marshal_get_uint32_t(out_buff);
-    uint32_t bpp = yagl_marshal_get_uint32_t(out_buff);
-    target_ulong pixels = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT6(eglUpdateOffscreenImageYAGL, yagl_host_handle, yagl_host_handle, uint32_t, uint32_t, uint32_t, target_ulong, dpy, image, width, height, bpp, pixels);
-    bool res = yagl_host_eglUpdateOffscreenImageYAGL(dpy, image, width, height, bpp, pixels);
+    yagl_host_handle dpy;
+    yagl_host_handle image;
+    uint32_t width;
+    uint32_t height;
+    uint32_t bpp;
+    const void *pixels;
+    int32_t pixels_count;
+    dpy = yagl_transport_get_out_yagl_host_handle(t);
+    image = yagl_transport_get_out_yagl_host_handle(t);
+    width = yagl_transport_get_out_uint32_t(t);
+    height = yagl_transport_get_out_uint32_t(t);
+    bpp = yagl_transport_get_out_uint32_t(t);
+    if (!yagl_transport_get_out_array(t, 1, (const void**)&pixels, &pixels_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT6(eglUpdateOffscreenImageYAGL, yagl_host_handle, yagl_host_handle, uint32_t, uint32_t, uint32_t, void*, dpy, image, width, height, bpp, pixels);
+    (void)yagl_host_eglUpdateOffscreenImageYAGL(dpy, image, width, height, bpp, pixels, pixels_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * eglCreateWindowSurfaceOnscreenYAGL dispatcher. id = 30
+ * eglCreateWindowSurfaceOnscreenYAGL dispatcher. id = 29
  */
-static bool yagl_func_eglCreateWindowSurfaceOnscreenYAGL(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_eglCreateWindowSurfaceOnscreenYAGL(struct yagl_transport *t)
 {
-    yagl_host_handle dpy = yagl_marshal_get_host_handle(out_buff);
-    yagl_host_handle config = yagl_marshal_get_host_handle(out_buff);
-    yagl_winsys_id win = yagl_marshal_get_yagl_winsys_id(out_buff);
-    target_ulong attrib_list = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT4(eglCreateWindowSurfaceOnscreenYAGL, yagl_host_handle, yagl_host_handle, yagl_winsys_id, target_ulong, dpy, config, win, attrib_list);
-    yagl_host_handle retval;
-    bool res = yagl_host_eglCreateWindowSurfaceOnscreenYAGL(&retval, dpy, config, win, attrib_list);
-    if (!res) {
-        YAGL_LOG_FUNC_EXIT(NULL);
+    yagl_host_handle dpy;
+    yagl_host_handle config;
+    yagl_winsys_id win;
+    const EGLint *attrib_list;
+    int32_t attrib_list_count;
+    yagl_host_handle *retval;
+    dpy = yagl_transport_get_out_yagl_host_handle(t);
+    config = yagl_transport_get_out_yagl_host_handle(t);
+    win = yagl_transport_get_out_yagl_winsys_id(t);
+    if (!yagl_transport_get_out_array(t, sizeof(EGLint), (const void**)&attrib_list, &attrib_list_count)) {
         return false;
     }
-    YAGL_LOG_FUNC_EXIT_SPLIT(yagl_host_handle, retval);
-    yagl_marshal_put_host_handle(&in_buff, retval);
+    yagl_transport_get_in_arg(t, (void**)&retval);
+    YAGL_LOG_FUNC_ENTER_SPLIT4(eglCreateWindowSurfaceOnscreenYAGL, yagl_host_handle, yagl_host_handle, yagl_winsys_id, void*, dpy, config, win, attrib_list);
+    *retval = yagl_host_eglCreateWindowSurfaceOnscreenYAGL(dpy, config, win, attrib_list, attrib_list_count);
+    YAGL_LOG_FUNC_EXIT_SPLIT(yagl_host_handle, *retval);
+
     return true;
 }
 
 /*
- * eglCreatePbufferSurfaceOnscreenYAGL dispatcher. id = 31
+ * eglCreatePbufferSurfaceOnscreenYAGL dispatcher. id = 30
  */
-static bool yagl_func_eglCreatePbufferSurfaceOnscreenYAGL(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_eglCreatePbufferSurfaceOnscreenYAGL(struct yagl_transport *t)
 {
-    yagl_host_handle dpy = yagl_marshal_get_host_handle(out_buff);
-    yagl_host_handle config = yagl_marshal_get_host_handle(out_buff);
-    yagl_winsys_id buffer = yagl_marshal_get_yagl_winsys_id(out_buff);
-    target_ulong attrib_list = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT4(eglCreatePbufferSurfaceOnscreenYAGL, yagl_host_handle, yagl_host_handle, yagl_winsys_id, target_ulong, dpy, config, buffer, attrib_list);
-    yagl_host_handle retval;
-    bool res = yagl_host_eglCreatePbufferSurfaceOnscreenYAGL(&retval, dpy, config, buffer, attrib_list);
-    if (!res) {
-        YAGL_LOG_FUNC_EXIT(NULL);
+    yagl_host_handle dpy;
+    yagl_host_handle config;
+    yagl_winsys_id buffer;
+    const EGLint *attrib_list;
+    int32_t attrib_list_count;
+    yagl_host_handle *retval;
+    dpy = yagl_transport_get_out_yagl_host_handle(t);
+    config = yagl_transport_get_out_yagl_host_handle(t);
+    buffer = yagl_transport_get_out_yagl_winsys_id(t);
+    if (!yagl_transport_get_out_array(t, sizeof(EGLint), (const void**)&attrib_list, &attrib_list_count)) {
         return false;
     }
-    YAGL_LOG_FUNC_EXIT_SPLIT(yagl_host_handle, retval);
-    yagl_marshal_put_host_handle(&in_buff, retval);
+    yagl_transport_get_in_arg(t, (void**)&retval);
+    YAGL_LOG_FUNC_ENTER_SPLIT4(eglCreatePbufferSurfaceOnscreenYAGL, yagl_host_handle, yagl_host_handle, yagl_winsys_id, void*, dpy, config, buffer, attrib_list);
+    *retval = yagl_host_eglCreatePbufferSurfaceOnscreenYAGL(dpy, config, buffer, attrib_list, attrib_list_count);
+    YAGL_LOG_FUNC_EXIT_SPLIT(yagl_host_handle, *retval);
+
     return true;
 }
 
 /*
- * eglCreatePixmapSurfaceOnscreenYAGL dispatcher. id = 32
+ * eglCreatePixmapSurfaceOnscreenYAGL dispatcher. id = 31
  */
-static bool yagl_func_eglCreatePixmapSurfaceOnscreenYAGL(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_eglCreatePixmapSurfaceOnscreenYAGL(struct yagl_transport *t)
 {
-    yagl_host_handle dpy = yagl_marshal_get_host_handle(out_buff);
-    yagl_host_handle config = yagl_marshal_get_host_handle(out_buff);
-    yagl_winsys_id pixmap = yagl_marshal_get_yagl_winsys_id(out_buff);
-    target_ulong attrib_list = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT4(eglCreatePixmapSurfaceOnscreenYAGL, yagl_host_handle, yagl_host_handle, yagl_winsys_id, target_ulong, dpy, config, pixmap, attrib_list);
-    yagl_host_handle retval;
-    bool res = yagl_host_eglCreatePixmapSurfaceOnscreenYAGL(&retval, dpy, config, pixmap, attrib_list);
-    if (!res) {
-        YAGL_LOG_FUNC_EXIT(NULL);
+    yagl_host_handle dpy;
+    yagl_host_handle config;
+    yagl_winsys_id pixmap;
+    const EGLint *attrib_list;
+    int32_t attrib_list_count;
+    yagl_host_handle *retval;
+    dpy = yagl_transport_get_out_yagl_host_handle(t);
+    config = yagl_transport_get_out_yagl_host_handle(t);
+    pixmap = yagl_transport_get_out_yagl_winsys_id(t);
+    if (!yagl_transport_get_out_array(t, sizeof(EGLint), (const void**)&attrib_list, &attrib_list_count)) {
         return false;
     }
-    YAGL_LOG_FUNC_EXIT_SPLIT(yagl_host_handle, retval);
-    yagl_marshal_put_host_handle(&in_buff, retval);
+    yagl_transport_get_in_arg(t, (void**)&retval);
+    YAGL_LOG_FUNC_ENTER_SPLIT4(eglCreatePixmapSurfaceOnscreenYAGL, yagl_host_handle, yagl_host_handle, yagl_winsys_id, void*, dpy, config, pixmap, attrib_list);
+    *retval = yagl_host_eglCreatePixmapSurfaceOnscreenYAGL(dpy, config, pixmap, attrib_list, attrib_list_count);
+    YAGL_LOG_FUNC_EXIT_SPLIT(yagl_host_handle, *retval);
+
     return true;
 }
 
 /*
- * eglInvalidateOnscreenSurfaceYAGL dispatcher. id = 33
+ * eglInvalidateOnscreenSurfaceYAGL dispatcher. id = 32
  */
-static bool yagl_func_eglInvalidateOnscreenSurfaceYAGL(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_eglInvalidateOnscreenSurfaceYAGL(struct yagl_transport *t)
 {
-    yagl_host_handle dpy = yagl_marshal_get_host_handle(out_buff);
-    yagl_host_handle surface = yagl_marshal_get_host_handle(out_buff);
-    yagl_winsys_id buffer = yagl_marshal_get_yagl_winsys_id(out_buff);
+    yagl_host_handle dpy;
+    yagl_host_handle surface;
+    yagl_winsys_id buffer;
+    dpy = yagl_transport_get_out_yagl_host_handle(t);
+    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);
-    bool res = yagl_host_eglInvalidateOnscreenSurfaceYAGL(dpy, surface, buffer);
+    (void)yagl_host_eglInvalidateOnscreenSurfaceYAGL(dpy, surface, buffer);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
-const uint32_t yagl_egl_api_num_funcs = 33;
+const uint32_t yagl_egl_api_num_funcs = 32;
 
 yagl_api_func yagl_egl_api_funcs[] = {
     &yagl_func_eglGetError,
@@ -718,7 +715,6 @@ yagl_api_func yagl_egl_api_funcs[] = {
     &yagl_func_eglBindAPI,
     &yagl_func_eglWaitClient,
     &yagl_func_eglReleaseThread,
-    &yagl_func_eglCreatePbufferFromClientBuffer,
     &yagl_func_eglSurfaceAttrib,
     &yagl_func_eglBindTexImage,
     &yagl_func_eglReleaseTexImage,
@@ -738,5 +734,5 @@ yagl_api_func yagl_egl_api_funcs[] = {
     &yagl_func_eglCreateWindowSurfaceOnscreenYAGL,
     &yagl_func_eglCreatePbufferSurfaceOnscreenYAGL,
     &yagl_func_eglCreatePixmapSurfaceOnscreenYAGL,
-    &yagl_func_eglInvalidateOnscreenSurfaceYAGL
+    &yagl_func_eglInvalidateOnscreenSurfaceYAGL,
 };
index edb7b1c..306506c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Generated by gen-yagl-calls.sh, do not modify!
+ * Generated by gen-yagl-calls.py, do not modify!
  */
 #ifndef _QEMU_YAGL_EGL_CALLS_H_
 #define _QEMU_YAGL_EGL_CALLS_H_
index 055a3f9..504a072 100644 (file)
@@ -12,7 +12,7 @@
 
 struct yagl_egl_display
     *yagl_egl_display_create(struct yagl_egl_backend *backend,
-                             target_ulong display_id)
+                             uint32_t display_id)
 {
     struct yagl_eglb_display *backend_dpy;
     struct yagl_egl_display *dpy;
@@ -117,22 +117,17 @@ void yagl_egl_display_terminate(struct yagl_egl_display *dpy)
     yagl_resource_list_cleanup(&tmp_list);
 }
 
-int yagl_egl_display_get_config_count(struct yagl_egl_display *dpy)
+int32_t yagl_egl_display_get_config_count(struct yagl_egl_display *dpy)
 {
-    int ret;
-
-    ret = yagl_resource_list_get_count(&dpy->configs);
-
-    return ret;
+    return yagl_resource_list_get_count(&dpy->configs);
 }
 
-yagl_host_handle
-    *yagl_egl_display_get_config_handles(struct yagl_egl_display *dpy,
-                                         int *num_configs)
+void yagl_egl_display_get_config_handles(struct yagl_egl_display *dpy,
+                                         yagl_host_handle *handles,
+                                         int32_t *num_configs)
 {
-    yagl_host_handle *handles = g_malloc(*num_configs * sizeof(yagl_host_handle));
     struct yagl_resource *res;
-    int i = 0;
+    int32_t i = 0;
 
     QTAILQ_FOREACH(res, &dpy->configs.resources, entry) {
         if (i >= *num_configs) {
@@ -143,30 +138,22 @@ yagl_host_handle
     }
 
     *num_configs = i;
-
-    return handles;
 }
 
-yagl_host_handle
-    *yagl_egl_display_choose_configs(struct yagl_egl_display *dpy,
+void yagl_egl_display_choose_configs(struct yagl_egl_display *dpy,
                                      const struct yagl_egl_native_config *dummy,
-                                     int *num_configs,
-                                     bool count_only)
+                                     yagl_host_handle *handles,
+                                     int32_t *num_configs)
 {
-    yagl_host_handle *handles = NULL;
     struct yagl_resource *res;
-    int i = 0;
-
-    if (!count_only) {
-        handles = g_malloc(*num_configs * sizeof(yagl_host_handle));
-    }
+    int32_t i = 0;
 
     QTAILQ_FOREACH(res, &dpy->configs.resources, entry) {
-        if (!count_only && (i >= *num_configs)) {
+        if (handles && (i >= *num_configs)) {
             break;
         }
         if (yagl_egl_config_is_chosen_by((struct yagl_egl_config*)res, dummy)) {
-            if (!count_only) {
+            if (handles) {
                 handles[i] = res->handle;
             }
             ++i;
@@ -174,8 +161,6 @@ yagl_host_handle
     }
 
     *num_configs = i;
-
-    return handles;
 }
 
 struct yagl_egl_config
index 6e3fae7..8c0085e 100644 (file)
@@ -20,7 +20,7 @@ struct yagl_egl_display
 
     struct yagl_egl_backend *backend;
 
-    target_ulong display_id;
+    uint32_t display_id;
 
     yagl_host_handle handle;
 
@@ -39,7 +39,7 @@ struct yagl_egl_display
 
 struct yagl_egl_display
     *yagl_egl_display_create(struct yagl_egl_backend *backend,
-                             target_ulong display_id);
+                             uint32_t display_id);
 
 void yagl_egl_display_destroy(struct yagl_egl_display *dpy);
 
@@ -54,33 +54,30 @@ void yagl_egl_display_terminate(struct yagl_egl_display *dpy);
  * @{
  */
 
-int yagl_egl_display_get_config_count(struct yagl_egl_display *dpy);
+int32_t yagl_egl_display_get_config_count(struct yagl_egl_display *dpy);
 
 /*
  * Gets at most '*num_configs' config handles and updates
  * 'num_configs' with number of configs actually returned.
  * The configs themselves are not acquired.
- * Use 'g_free' to free up the returned handles array.
  */
-yagl_host_handle
-    *yagl_egl_display_get_config_handles(struct yagl_egl_display *dpy,
-                                         int *num_configs);
+void yagl_egl_display_get_config_handles(struct yagl_egl_display *dpy,
+                                         yagl_host_handle *handles,
+                                         int32_t *num_configs);
 
 /*
  * Gets at most '*num_configs' config handles and updates
  * 'num_configs' with number of configs actually returned.
  * The configs themselves are not acquired.
- * Use 'g_free' to free up the returned handles array.
  *
  * 'dummy' is used for matching, only handles of configs that matched
- * 'dummy' will be returned. if 'count_only' is true then no handles are
- * returned (return value is NULL), but 'num_configs' is still updated.
+ * 'dummy' will be returned. if 'handles' is NULL then no handles are
+ * returned, but 'num_configs' is still updated.
  */
-yagl_host_handle
-    *yagl_egl_display_choose_configs(struct yagl_egl_display *dpy,
+void yagl_egl_display_choose_configs(struct yagl_egl_display *dpy,
                                      const struct yagl_egl_native_config *dummy,
-                                     int *num_configs,
-                                     bool count_only);
+                                     yagl_host_handle *handles,
+                                     int32_t *num_configs);
 
 struct yagl_egl_config
     *yagl_egl_display_acquire_config(struct yagl_egl_display *dpy,
index a963765..c36934a 100644 (file)
@@ -17,7 +17,6 @@
 #include "yagl_eglb_image.h"
 #include "yagl_log.h"
 #include "yagl_tls.h"
-#include "yagl_mem_egl.h"
 #include "yagl_thread.h"
 #include "yagl_process.h"
 #include "yagl_client_interface.h"
@@ -347,171 +346,101 @@ struct yagl_api_ps *yagl_host_egl_process_init(struct yagl_api *api)
     return &egl_api_ps->base;
 }
 
-bool yagl_host_eglGetError(EGLint* retval)
+EGLint yagl_host_eglGetError(void)
 {
-    *retval = egl_api_ts->error;
+    EGLint res = egl_api_ts->error;
 
     egl_api_ts->error = EGL_SUCCESS;
 
-    return true;
+    return res;
 }
 
-bool yagl_host_eglGetDisplay(yagl_host_handle* retval,
-    target_ulong /* void* */ display_id)
+yagl_host_handle yagl_host_eglGetDisplay(uint32_t display_id)
 {
     struct yagl_egl_display *dpy;
 
     dpy = yagl_egl_api_ps_display_add(egl_api_ts->api_ps, display_id);
 
-    *retval = (dpy ? dpy->handle : 0);
-
-    return true;
+    return (dpy ? dpy->handle : 0);
 }
 
-bool yagl_host_eglInitialize(EGLBoolean* retval,
-    yagl_host_handle dpy_,
-    target_ulong /* EGLint* */ major,
-    target_ulong /* EGLint* */ minor)
+EGLBoolean yagl_host_eglInitialize(yagl_host_handle dpy_,
+    EGLint *major,
+    EGLint *minor)
 {
     struct yagl_egl_display *dpy;
 
     YAGL_LOG_FUNC_SET(eglInitialize);
 
-    if (!yagl_mem_prepare_EGLint(cur_ts->mt1, major) ||
-        !yagl_mem_prepare_EGLint(cur_ts->mt2, minor)) {
-        return false;
-    }
-
     dpy = yagl_egl_api_ps_display_get(egl_api_ts->api_ps, dpy_);
 
     if (!dpy) {
         YAGL_SET_ERR(EGL_BAD_DISPLAY);
-        *retval = EGL_FALSE;
-        return true;
+        return EGL_FALSE;
     }
 
     yagl_egl_display_initialize(dpy);
 
     if (major) {
-        yagl_mem_put_EGLint(cur_ts->mt1, YAGL_EGL_VERSION_MAJOR);
+        *major = YAGL_EGL_VERSION_MAJOR;
     }
 
     if (minor) {
-        yagl_mem_put_EGLint(cur_ts->mt2, YAGL_EGL_VERSION_MINOR);
+        *minor = YAGL_EGL_VERSION_MINOR;
     }
 
-    *retval = EGL_TRUE;
-    return true;
+    return EGL_TRUE;
 }
 
-bool yagl_host_eglTerminate(EGLBoolean* retval,
-    yagl_host_handle dpy_)
+EGLBoolean yagl_host_eglTerminate(yagl_host_handle dpy_)
 {
     struct yagl_egl_display *dpy = NULL;
 
-    *retval = EGL_FALSE;
-
     if (!yagl_validate_display(dpy_, &dpy)) {
-        goto out;
+        return EGL_FALSE;
     }
 
     yagl_egl_display_terminate(dpy);
 
-    *retval = EGL_TRUE;
-
-out:
-    return true;
+    return EGL_TRUE;
 }
 
-bool yagl_host_eglGetConfigs(EGLBoolean* retval,
-    yagl_host_handle dpy_,
-    target_ulong /* EGLConfig^* */ configs_,
-    EGLint config_size,
-    target_ulong /* EGLint* */ num_config_)
+EGLBoolean yagl_host_eglGetConfigs(yagl_host_handle dpy_,
+    yagl_host_handle *configs, int32_t configs_maxcount, int32_t *configs_count)
 {
-    bool res = true;
     struct yagl_egl_display *dpy = NULL;
-    yagl_host_handle *configs = NULL;
-    EGLint num_config = config_size;
-
-    YAGL_LOG_FUNC_SET(eglGetConfigs);
-
-    *retval = EGL_FALSE;
 
     if (!yagl_validate_display(dpy_, &dpy)) {
-        goto out;
-    }
-
-    if (!num_config_) {
-        YAGL_SET_ERR(EGL_BAD_PARAMETER);
-        goto out;
+        return EGL_FALSE;
     }
 
-    if (configs_) {
-        configs = yagl_egl_display_get_config_handles(dpy, &num_config);
+    if (configs) {
+        *configs_count = configs_maxcount;
+        yagl_egl_display_get_config_handles(dpy, configs, configs_count);
     } else {
-        num_config = yagl_egl_display_get_config_count(dpy);
-    }
-
-    if (!yagl_mem_prepare(cur_ts->mt1, configs_, num_config * sizeof(*configs)) ||
-        !yagl_mem_prepare_EGLint(cur_ts->mt2, num_config_)) {
-        res = false;
-        goto out;
+        *configs_count = yagl_egl_display_get_config_count(dpy);
     }
 
-    if (configs_) {
-        yagl_mem_put(cur_ts->mt1, configs);
-    }
-
-    yagl_mem_put_EGLint(cur_ts->mt2, num_config);
-
-    *retval = EGL_TRUE;
-
-out:
-    g_free(configs);
-
-    return res;
+    return EGL_TRUE;
 }
 
-bool yagl_host_eglChooseConfig(EGLBoolean* retval,
-    yagl_host_handle dpy_,
-    target_ulong /* const EGLint* */ attrib_list_,
-    target_ulong /* EGLConfig^* */ configs_,
-    EGLint config_size,
-    target_ulong /* EGLint* */ num_config_)
+EGLBoolean yagl_host_eglChooseConfig(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)
 {
-    bool res = true;
+    EGLBoolean res = EGL_FALSE;
     struct yagl_egl_display *dpy = NULL;
-    EGLint *attrib_list = NULL;
     struct yagl_egl_native_config dummy;
-    yagl_host_handle *configs = NULL;
-    EGLint num_config = config_size;
     int i = 0;
 
     YAGL_LOG_FUNC_SET(eglChooseConfig);
 
-    *retval = EGL_FALSE;
-
     yagl_egl_native_config_init(&dummy);
 
     if (!yagl_validate_display(dpy_, &dpy)) {
         goto out;
     }
 
-    if (!num_config_) {
-        YAGL_SET_ERR(EGL_BAD_PARAMETER);
-        goto out;
-    }
-
-    if (attrib_list_) {
-        attrib_list = yagl_mem_get_attrib_list(attrib_list_);
-
-        if (!attrib_list) {
-            res = false;
-            goto out;
-        }
-    }
-
     /*
      * Selection defaults.
      */
@@ -718,19 +647,13 @@ bool yagl_host_eglChooseConfig(EGLBoolean* retval,
             YAGL_LOG_DEBUG("requesting config with id = %d", config_id);
 
             if (handle) {
-                if (!yagl_mem_prepare_host_handle(cur_ts->mt1, configs_) ||
-                    !yagl_mem_prepare_EGLint(cur_ts->mt2, num_config_)) {
-                    res = false;
-                    goto out;
+                if (configs) {
+                    *configs = handle;
                 }
 
-                if (configs_) {
-                    yagl_mem_put_host_handle(cur_ts->mt1, handle);
-                }
-
-                yagl_mem_put_EGLint(cur_ts->mt2, 1);
+                *configs_count = 1;
 
-                *retval = EGL_TRUE;
+                res = EGL_TRUE;
                 goto out;
             } else {
                 YAGL_SET_ERR(EGL_BAD_ATTRIBUTE);
@@ -739,49 +662,29 @@ bool yagl_host_eglChooseConfig(EGLBoolean* retval,
         }
     }
 
-    configs = yagl_egl_display_choose_configs(dpy,
-                                              &dummy,
-                                              &num_config,
-                                              (configs_ == 0));
+    *configs_count = configs_maxcount;
+    yagl_egl_display_choose_configs(dpy, &dummy, configs, configs_count);
 
-    YAGL_LOG_DEBUG("chosen %d configs", num_config);
+    YAGL_LOG_DEBUG("chosen %d configs", *configs_count);
 
-    if (!yagl_mem_prepare(cur_ts->mt1, configs_, num_config * sizeof(*configs)) ||
-        !yagl_mem_prepare_EGLint(cur_ts->mt2, num_config_)) {
-        res = false;
-        goto out;
-    }
-
-    if (configs_) {
-        yagl_mem_put(cur_ts->mt1, configs);
-    }
-
-    yagl_mem_put_EGLint(cur_ts->mt2, num_config);
-
-    *retval = EGL_TRUE;
+    res = EGL_TRUE;
 
 out:
-    g_free(configs);
-    g_free(attrib_list);
-
     return res;
 }
 
-bool yagl_host_eglGetConfigAttrib(EGLBoolean* retval,
-    yagl_host_handle dpy_,
+EGLBoolean yagl_host_eglGetConfigAttrib(yagl_host_handle dpy_,
     yagl_host_handle config_,
     EGLint attribute,
-    target_ulong /* EGLint* */ value_)
+    EGLint *value)
 {
-    bool res = true;
+    EGLBoolean res = EGL_FALSE;
     struct yagl_egl_display *dpy = NULL;
     struct yagl_egl_config *config = NULL;
-    EGLint value = 0;
+    EGLint tmp;
 
     YAGL_LOG_FUNC_SET(eglGetConfigAttrib);
 
-    *retval = EGL_FALSE;
-
     if (!yagl_validate_display(dpy_, &dpy)) {
         goto out;
     }
@@ -790,21 +693,16 @@ bool yagl_host_eglGetConfigAttrib(EGLBoolean* retval,
         goto out;
     }
 
-    if (!yagl_egl_config_get_attrib(config, attribute, &value)) {
+    if (!yagl_egl_config_get_attrib(config, attribute, &tmp)) {
         YAGL_SET_ERR(EGL_BAD_ATTRIBUTE);
         goto out;
     }
 
-    if (!yagl_mem_prepare_EGLint(cur_ts->mt1, value_)) {
-        res = false;
-        goto out;
-    }
-
-    if (value_) {
-        yagl_mem_put_EGLint(cur_ts->mt1, value);
+    if (value) {
+        *value = tmp;
     }
 
-    *retval = EGL_TRUE;
+    res = EGL_TRUE;
 
 out:
     yagl_egl_config_release(config);
@@ -812,17 +710,15 @@ out:
     return res;
 }
 
-bool yagl_host_eglDestroySurface(EGLBoolean* retval,
-    yagl_host_handle dpy_,
+EGLBoolean yagl_host_eglDestroySurface(yagl_host_handle dpy_,
     yagl_host_handle surface_)
 {
+    EGLBoolean res = EGL_FALSE;
     struct yagl_egl_display *dpy = NULL;
     struct yagl_egl_surface *surface = NULL;
 
     YAGL_LOG_FUNC_SET(eglDestroySurface);
 
-    *retval = EGL_FALSE;
-
     if (!yagl_validate_display(dpy_, &dpy)) {
         goto out;
     }
@@ -836,29 +732,26 @@ bool yagl_host_eglDestroySurface(EGLBoolean* retval,
         goto out;
     }
 
-    *retval = EGL_TRUE;
+    res = EGL_TRUE;
 
 out:
     yagl_egl_surface_release(surface);
 
-    return true;
+    return res;
 }
 
-bool yagl_host_eglQuerySurface(EGLBoolean* retval,
-    yagl_host_handle dpy_,
+EGLBoolean yagl_host_eglQuerySurface(yagl_host_handle dpy_,
     yagl_host_handle surface_,
     EGLint attribute,
-    target_ulong /* EGLint* */ value_)
+    EGLint *value)
 {
-    bool res = true;
+    EGLBoolean res = EGL_FALSE;
     struct yagl_egl_display *dpy = NULL;
     struct yagl_egl_surface *surface = NULL;
-    EGLint value = 0;
+    EGLint tmp;
 
     YAGL_LOG_FUNC_SET(eglQuerySurface);
 
-    *retval = EGL_FALSE;
-
     if (!yagl_validate_display(dpy_, &dpy)) {
         goto out;
     }
@@ -869,91 +762,83 @@ bool yagl_host_eglQuerySurface(EGLBoolean* retval,
 
     switch (attribute) {
     case EGL_CONFIG_ID:
-        value = surface->cfg->native.config_id;
+        if (value) {
+            *value = surface->cfg->native.config_id;
+        }
         break;
     case EGL_LARGEST_PBUFFER:
-        if (surface->backend_sfc->type == EGL_PBUFFER_BIT) {
-            value = surface->backend_sfc->attribs.pbuffer.largest;
-        } else {
-            /*
-             * That's right 'value_', not 'value', when an attribute is not
-             * applicable we shouldn't write back anything.
-             */
-            value_ = 0;
+        if ((surface->backend_sfc->type == EGL_PBUFFER_BIT) && value) {
+            *value = surface->backend_sfc->attribs.pbuffer.largest;
         }
         break;
     case EGL_TEXTURE_FORMAT:
-        if (surface->backend_sfc->type == EGL_PBUFFER_BIT) {
-            value = surface->backend_sfc->attribs.pbuffer.tex_format;
-        } else {
-            value_ = 0;
+        if ((surface->backend_sfc->type == EGL_PBUFFER_BIT) && value) {
+            *value = surface->backend_sfc->attribs.pbuffer.tex_format;
         }
         break;
     case EGL_TEXTURE_TARGET:
-        if (surface->backend_sfc->type == EGL_PBUFFER_BIT) {
-            value = surface->backend_sfc->attribs.pbuffer.tex_target;
-        } else {
-            value_ = 0;
+        if ((surface->backend_sfc->type == EGL_PBUFFER_BIT) && value) {
+            *value = surface->backend_sfc->attribs.pbuffer.tex_target;
         }
         break;
     case EGL_MIPMAP_TEXTURE:
-        if (surface->backend_sfc->type == EGL_PBUFFER_BIT) {
-            value = surface->backend_sfc->attribs.pbuffer.tex_mipmap;
-        } else {
-            value_ = 0;
+        if ((surface->backend_sfc->type == EGL_PBUFFER_BIT) && value) {
+            *value = surface->backend_sfc->attribs.pbuffer.tex_mipmap;
         }
         break;
     case EGL_MIPMAP_LEVEL:
-        if (surface->backend_sfc->type == EGL_PBUFFER_BIT) {
-            value = 0;
-        } else {
-            value_ = 0;
+        if ((surface->backend_sfc->type == EGL_PBUFFER_BIT) && value) {
+            *value = 0;
         }
         break;
     case EGL_RENDER_BUFFER:
         switch (surface->backend_sfc->type) {
         case EGL_PBUFFER_BIT:
         case EGL_WINDOW_BIT:
-            value = EGL_BACK_BUFFER;
+            if (value) {
+                *value = EGL_BACK_BUFFER;
+            }
             break;
         case EGL_PIXMAP_BIT:
-            value = EGL_SINGLE_BUFFER;
+            if (value) {
+                *value = EGL_SINGLE_BUFFER;
+            }
             break;
         default:
-            assert(0);
-            value_ = 0;
+            break;
         }
         break;
     case EGL_HORIZONTAL_RESOLUTION:
     case EGL_VERTICAL_RESOLUTION:
     case EGL_PIXEL_ASPECT_RATIO:
-        value = EGL_UNKNOWN;
+        if (value) {
+            *value = EGL_UNKNOWN;
+        }
         break;
     case EGL_SWAP_BEHAVIOR:
-        value = EGL_BUFFER_PRESERVED;
+        if (value) {
+            *value = EGL_BUFFER_PRESERVED;
+        }
         break;
     case EGL_MULTISAMPLE_RESOLVE:
-        value = EGL_MULTISAMPLE_RESOLVE_DEFAULT;
+        if (value) {
+            *value = EGL_MULTISAMPLE_RESOLVE_DEFAULT;
+        }
         break;
     default:
         if (!surface->backend_sfc->query(surface->backend_sfc,
                                          attribute,
-                                         &value)) {
+                                         &tmp)) {
             YAGL_SET_ERR(EGL_BAD_ATTRIBUTE);
             goto out;
         }
+        if (value) {
+            *value = tmp;
+        }
+        break;
     }
 
-    if (!yagl_mem_prepare_EGLint(cur_ts->mt1, value_)) {
-        res = false;
-        goto out;
-    }
-
-    if (value_) {
-        yagl_mem_put_EGLint(cur_ts->mt1, value);
-    }
-
-    *retval = EGL_TRUE;
+    res = EGL_TRUE;
 
 out:
     yagl_egl_surface_release(surface);
@@ -961,29 +846,24 @@ out:
     return res;
 }
 
-bool yagl_host_eglBindAPI(EGLBoolean* retval,
-    EGLenum api)
+EGLBoolean yagl_host_eglBindAPI(EGLenum api)
 {
     YAGL_LOG_FUNC_SET(eglBindAPI);
 
     if (!yagl_egl_is_api_valid(api)) {
         YAGL_SET_ERR(EGL_BAD_PARAMETER);
-        *retval = EGL_FALSE;
-        return true;
+        return EGL_FALSE;
     }
 
     egl_api_ts->api = api;
 
-    *retval = EGL_TRUE;
-    return true;
+    return EGL_TRUE;
 }
 
-bool yagl_host_eglWaitClient(EGLBoolean* retval)
+EGLBoolean yagl_host_eglWaitClient(void)
 {
     struct yagl_egl_surface *sfc = NULL;
 
-    *retval = EGL_TRUE;
-
     if (!egl_api_ts->context) {
         goto out;
     }
@@ -997,14 +877,14 @@ bool yagl_host_eglWaitClient(EGLBoolean* retval)
     sfc->backend_sfc->wait_gl(sfc->backend_sfc);
 
 out:
-    return true;
+    return EGL_TRUE;
 }
 
-bool yagl_host_eglReleaseThread(EGLBoolean* retval)
+EGLBoolean yagl_host_eglReleaseThread(void)
 {
-    YAGL_LOG_FUNC_SET(eglReleaseThread);
+    EGLBoolean res = EGL_FALSE;
 
-    *retval = EGL_FALSE;
+    YAGL_LOG_FUNC_SET(eglReleaseThread);
 
     if (egl_api_ts->context) {
         if (!yagl_egl_release_current_context(egl_api_ts->context->dpy)) {
@@ -1015,33 +895,21 @@ bool yagl_host_eglReleaseThread(EGLBoolean* retval)
 
     yagl_egl_api_ts_reset(egl_api_ts);
 
-    *retval = EGL_TRUE;
+    res = EGL_TRUE;
 
 out:
-    return true;
-}
-
-bool yagl_host_eglCreatePbufferFromClientBuffer(yagl_host_handle* retval,
-    yagl_host_handle dpy,
-    EGLenum buftype,
-    yagl_host_handle buffer,
-    yagl_host_handle config,
-    target_ulong /* const EGLint* */ attrib_list)
-{
-    YAGL_UNIMPLEMENTED(eglCreatePbufferFromClientBuffer, 0);
+    return res;
 }
 
-bool yagl_host_eglSurfaceAttrib(EGLBoolean* retval,
-    yagl_host_handle dpy_,
+EGLBoolean yagl_host_eglSurfaceAttrib(yagl_host_handle dpy_,
     yagl_host_handle surface_,
     EGLint attribute,
     EGLint value)
 {
+    EGLBoolean res = EGL_FALSE;
     struct yagl_egl_display *dpy = NULL;
     struct yagl_egl_surface *surface = NULL;
 
-    *retval = EGL_FALSE;
-
     if (!yagl_validate_display(dpy_, &dpy)) {
         goto out;
     }
@@ -1054,19 +922,19 @@ bool yagl_host_eglSurfaceAttrib(EGLBoolean* retval,
      * TODO: implement.
      */
 
-    *retval = EGL_TRUE;
+    res = EGL_TRUE;
 
 out:
     yagl_egl_surface_release(surface);
 
-    return true;
+    return res;
 }
 
-bool yagl_host_eglBindTexImage(EGLBoolean* retval,
-    yagl_host_handle dpy_,
+EGLBoolean yagl_host_eglBindTexImage(yagl_host_handle dpy_,
     yagl_host_handle surface_,
     EGLint buffer)
 {
+    EGLBoolean res = EGL_FALSE;
     struct yagl_egl_display *dpy = NULL;
     struct yagl_egl_surface *surface = NULL;
 
@@ -1074,12 +942,10 @@ bool yagl_host_eglBindTexImage(EGLBoolean* retval,
 
     if (!egl_api_ts->context) {
         YAGL_LOG_WARN("No context");
-        *retval = EGL_TRUE;
+        res = EGL_TRUE;
         goto out;
     }
 
-    *retval = EGL_FALSE;
-
     if (!yagl_validate_display(dpy_, &dpy)) {
         goto out;
     }
@@ -1113,26 +979,24 @@ bool yagl_host_eglBindTexImage(EGLBoolean* retval,
         goto out;
     }
 
-    *retval = EGL_TRUE;
+    res = EGL_TRUE;
 
 out:
     yagl_egl_surface_release(surface);
 
-    return true;
+    return res;
 }
 
-bool yagl_host_eglReleaseTexImage(EGLBoolean* retval,
-    yagl_host_handle dpy_,
+EGLBoolean yagl_host_eglReleaseTexImage(yagl_host_handle dpy_,
     yagl_host_handle surface_,
     EGLint buffer)
 {
+    EGLBoolean res = EGL_FALSE;
     struct yagl_egl_display *dpy = NULL;
     struct yagl_egl_surface *surface = NULL;
 
     YAGL_LOG_FUNC_SET(eglReleaseTexImage);
 
-    *retval = EGL_FALSE;
-
     if (!yagl_validate_display(dpy_, &dpy)) {
         goto out;
     }
@@ -1166,22 +1030,20 @@ bool yagl_host_eglReleaseTexImage(EGLBoolean* retval,
         goto out;
     }
 
-    *retval = EGL_TRUE;
+    res = EGL_TRUE;
 
 out:
     yagl_egl_surface_release(surface);
 
-    return true;
+    return res;
 }
 
-bool yagl_host_eglCreateContext(yagl_host_handle* retval,
-    yagl_host_handle dpy_,
+yagl_host_handle yagl_host_eglCreateContext(yagl_host_handle dpy_,
     yagl_host_handle config_,
     yagl_host_handle share_context_,
-    target_ulong /* const EGLint* */ attrib_list_)
+    const EGLint *attrib_list, int32_t attrib_list_count)
 {
-    bool res = true;
-    EGLint *attrib_list = NULL;
+    yagl_host_handle res = 0;
     struct yagl_egl_display *dpy = NULL;
     struct yagl_egl_config *config = NULL;
     yagl_client_api client_api;
@@ -1193,17 +1055,6 @@ bool yagl_host_eglCreateContext(yagl_host_handle* retval,
 
     YAGL_LOG_FUNC_SET(eglCreateContext);
 
-    *retval = 0;
-
-    if (attrib_list_) {
-        attrib_list = yagl_mem_get_attrib_list(attrib_list_);
-
-        if (!attrib_list) {
-            res = false;
-            goto out;
-        }
-    }
-
     if (!yagl_validate_display(dpy_, &dpy)) {
         goto out;
     }
@@ -1261,7 +1112,7 @@ bool yagl_host_eglCreateContext(yagl_host_handle* retval,
     yagl_egl_display_add_context(dpy, ctx);
     yagl_egl_context_release(ctx);
 
-    *retval = ctx->res.handle;
+    res = ctx->res.handle;
 
 out:
     if (client_ctx) {
@@ -1270,22 +1121,19 @@ out:
     yagl_sharegroup_release(sg);
     yagl_egl_context_release(share_context);
     yagl_egl_config_release(config);
-    g_free(attrib_list);
 
     return res;
 }
 
-bool yagl_host_eglDestroyContext(EGLBoolean* retval,
-    yagl_host_handle dpy_,
+EGLBoolean yagl_host_eglDestroyContext(yagl_host_handle dpy_,
     yagl_host_handle ctx_)
 {
+    EGLBoolean res = EGL_FALSE;
     struct yagl_egl_display *dpy = NULL;
     struct yagl_egl_context *ctx = NULL;
 
     YAGL_LOG_FUNC_SET(eglDestroyContext);
 
-    *retval = EGL_FALSE;
-
     if (!yagl_validate_display(dpy_, &dpy)) {
         goto out;
     }
@@ -1295,7 +1143,7 @@ bool yagl_host_eglDestroyContext(EGLBoolean* retval,
     }
 
     if (yagl_egl_display_remove_context(dpy, ctx->res.handle)) {
-        *retval = EGL_TRUE;
+        res = EGL_TRUE;
     } else {
         YAGL_SET_ERR(EGL_BAD_CONTEXT);
     }
@@ -1303,15 +1151,15 @@ bool yagl_host_eglDestroyContext(EGLBoolean* retval,
 out:
     yagl_egl_context_release(ctx);
 
-    return true;
+    return res;
 }
 
-bool yagl_host_eglMakeCurrent(EGLBoolean* retval,
-    yagl_host_handle dpy_,
+EGLBoolean yagl_host_eglMakeCurrent(yagl_host_handle dpy_,
     yagl_host_handle draw_,
     yagl_host_handle read_,
     yagl_host_handle ctx_)
 {
+    EGLBoolean res = EGL_FALSE;
     bool bad_match = ctx_ ? (!draw_ ^ !read_) : (draw_ || read_);
     bool release_context = !draw_ && !read_ && !ctx_;
     struct yagl_egl_display *dpy = NULL;
@@ -1322,8 +1170,6 @@ bool yagl_host_eglMakeCurrent(EGLBoolean* retval,
 
     YAGL_LOG_FUNC_SET(eglMakeCurrent);
 
-    *retval = EGL_FALSE;
-
     if (bad_match) {
         YAGL_SET_ERR(EGL_BAD_MATCH);
         goto out;
@@ -1424,7 +1270,7 @@ bool yagl_host_eglMakeCurrent(EGLBoolean* retval,
                    read_,
                    ctx_);
 
-    *retval = EGL_TRUE;
+    res = EGL_TRUE;
 
 out:
     yagl_egl_surface_release(read);
@@ -1432,24 +1278,20 @@ out:
     yagl_egl_context_release(ctx);
     yagl_egl_context_release(prev_ctx);
 
-    return true;
+    return res;
 }
 
-bool yagl_host_eglQueryContext(EGLBoolean* retval,
-    yagl_host_handle dpy_,
+EGLBoolean yagl_host_eglQueryContext(yagl_host_handle dpy_,
     yagl_host_handle ctx_,
     EGLint attribute,
-    target_ulong /* EGLint* */ value_)
+    EGLint *value)
 {
-    bool res = true;
+    EGLBoolean res = EGL_FALSE;
     struct yagl_egl_display *dpy = NULL;
     struct yagl_egl_context *ctx = NULL;
-    EGLint value = 0;
 
     YAGL_LOG_FUNC_SET(eglQueryContext);
 
-    *retval = EGL_FALSE;
-
     if (!yagl_validate_display(dpy_, &dpy)) {
         goto out;
     }
@@ -1460,38 +1302,53 @@ bool yagl_host_eglQueryContext(EGLBoolean* retval,
 
     switch (attribute) {
     case EGL_CONFIG_ID:
-        value = ctx->cfg->native.config_id;
+        if (value) {
+            *value = ctx->cfg->native.config_id;
+        }
         break;
     case EGL_CONTEXT_CLIENT_TYPE:
         switch (ctx->backend_ctx->client_ctx->client_api) {
         case yagl_client_api_gles1:
         case yagl_client_api_gles2:
-            value = EGL_OPENGL_ES_API;
+            if (value) {
+                *value = EGL_OPENGL_ES_API;
+            }
             break;
         case yagl_client_api_ogl:
-            value = EGL_OPENGL_API;
+            if (value) {
+                *value = EGL_OPENGL_API;
+            }
             break;
         case yagl_client_api_ovg:
-            value = EGL_OPENVG_API;
+            if (value) {
+                *value = EGL_OPENVG_API;
+            }
             break;
         default:
-            assert(false);
-            value = EGL_NONE;
+            if (value) {
+                *value = EGL_NONE;
+            }
             break;
         }
         break;
     case EGL_CONTEXT_CLIENT_VERSION:
         switch (ctx->backend_ctx->client_ctx->client_api) {
         case yagl_client_api_gles1:
-            value = 1;
+            if (value) {
+                *value = 1;
+            }
             break;
         case yagl_client_api_gles2:
-            value = 2;
+            if (value) {
+                *value = 2;
+            }
             break;
         case yagl_client_api_ogl:
         case yagl_client_api_ovg:
         default:
-            value = 0;
+            if (value) {
+                *value = 0;
+            }
             break;
         }
         break;
@@ -1500,17 +1357,23 @@ bool yagl_host_eglQueryContext(EGLBoolean* retval,
             switch (ctx->draw->backend_sfc->type) {
             case EGL_PBUFFER_BIT:
             case EGL_WINDOW_BIT:
-                value = EGL_BACK_BUFFER;
+                if (value) {
+                    *value = EGL_BACK_BUFFER;
+                }
                 break;
             case EGL_PIXMAP_BIT:
-                value = EGL_SINGLE_BUFFER;
+                if (value) {
+                    *value = EGL_SINGLE_BUFFER;
+                }
                 break;
             default:
-                assert(0);
-                value = EGL_NONE;
+                if (value) {
+                    *value = EGL_NONE;
+                }
+                break;
             }
-        } else {
-            value = EGL_NONE;
+        } else if (value) {
+            *value = EGL_NONE;
         }
         break;
     default:
@@ -1518,16 +1381,7 @@ bool yagl_host_eglQueryContext(EGLBoolean* retval,
         goto out;
     }
 
-    if (!yagl_mem_prepare_EGLint(cur_ts->mt1, value_)) {
-        res = false;
-        goto out;
-    }
-
-    if (value_) {
-        yagl_mem_put_EGLint(cur_ts->mt1, value);
-    }
-
-    *retval = EGL_TRUE;
+    res = EGL_TRUE;
 
 out:
     yagl_egl_context_release(ctx);
@@ -1535,17 +1389,15 @@ out:
     return res;
 }
 
-bool yagl_host_eglSwapBuffers(EGLBoolean* retval,
-    yagl_host_handle dpy_,
+EGLBoolean yagl_host_eglSwapBuffers(yagl_host_handle dpy_,
     yagl_host_handle surface_)
 {
+    EGLBoolean res = EGL_FALSE;
     struct yagl_egl_display *dpy = NULL;
     struct yagl_egl_surface *surface = NULL;
 
     YAGL_LOG_FUNC_SET(eglSwapBuffers);
 
-    *retval = EGL_FALSE;
-
     if (!yagl_validate_display(dpy_, &dpy)) {
         goto out;
     }
@@ -1559,25 +1411,23 @@ bool yagl_host_eglSwapBuffers(EGLBoolean* retval,
         goto out;
     }
 
-    *retval = EGL_TRUE;
+    res = EGL_TRUE;
 
 out:
     yagl_egl_surface_release(surface);
 
-    return true;
+    return res;
 }
 
-bool yagl_host_eglCopyBuffers(EGLBoolean* retval,
-    yagl_host_handle dpy_,
+EGLBoolean yagl_host_eglCopyBuffers(yagl_host_handle dpy_,
     yagl_host_handle surface_)
 {
+    EGLBoolean res = EGL_FALSE;
     struct yagl_egl_display *dpy = NULL;
     struct yagl_egl_surface *surface = NULL;
 
     YAGL_LOG_FUNC_SET(eglCopyBuffers);
 
-    *retval = EGL_FALSE;
-
     if (!yagl_validate_display(dpy_, &dpy)) {
         goto out;
     }
@@ -1591,28 +1441,26 @@ bool yagl_host_eglCopyBuffers(EGLBoolean* retval,
         goto out;
     }
 
-    *retval = EGL_TRUE;
+    res = EGL_TRUE;
 
 out:
     yagl_egl_surface_release(surface);
 
-    return true;
+    return res;
 }
 
-bool yagl_host_eglCreateImageKHR(yagl_host_handle* retval,
-    yagl_host_handle dpy_,
+yagl_host_handle yagl_host_eglCreateImageKHR(yagl_host_handle dpy_,
     yagl_host_handle ctx,
     EGLenum target,
     yagl_winsys_id buffer,
-    target_ulong /* const EGLint* */ attrib_list_)
+    const EGLint *attrib_list, int32_t attrib_list_count)
 {
+    yagl_host_handle res = 0;
     struct yagl_egl_display *dpy = NULL;
     struct yagl_egl_image *image = NULL;
 
     YAGL_LOG_FUNC_SET(eglCreateImageKHR);
 
-    *retval = 0;
-
     if (!yagl_validate_display(dpy_, &dpy)) {
         goto out;
     }
@@ -1627,23 +1475,21 @@ bool yagl_host_eglCreateImageKHR(yagl_host_handle* retval,
     yagl_egl_display_add_image(dpy, image);
     yagl_egl_image_release(image);
 
-    *retval = image->res.handle;
+    res = image->res.handle;
 
 out:
-    return true;
+    return res;
 }
 
-bool yagl_host_eglDestroyImageKHR(EGLBoolean* retval,
-    yagl_host_handle dpy_,
+EGLBoolean yagl_host_eglDestroyImageKHR(yagl_host_handle dpy_,
     yagl_host_handle image_)
 {
+    EGLBoolean res = EGL_FALSE;
     struct yagl_egl_display *dpy = NULL;
     struct yagl_egl_image *image = NULL;
 
     YAGL_LOG_FUNC_SET(eglDestroyImageKHR);
 
-    *retval = EGL_FALSE;
-
     if (!yagl_validate_display(dpy_, &dpy)) {
         goto out;
     }
@@ -1653,7 +1499,7 @@ bool yagl_host_eglDestroyImageKHR(EGLBoolean* retval,
     }
 
     if (yagl_egl_display_remove_image(dpy, image->res.handle)) {
-        *retval = EGL_TRUE;
+        res = EGL_TRUE;
     } else {
         YAGL_SET_ERR(EGL_BAD_PARAMETER);
     }
@@ -1661,20 +1507,18 @@ bool yagl_host_eglDestroyImageKHR(EGLBoolean* retval,
 out:
     yagl_egl_image_release(image);
 
-    return true;
+    return res;
 }
 
-bool yagl_host_eglCreateWindowSurfaceOffscreenYAGL(yagl_host_handle* retval,
-    yagl_host_handle dpy_,
+yagl_host_handle yagl_host_eglCreateWindowSurfaceOffscreenYAGL(yagl_host_handle dpy_,
     yagl_host_handle config_,
     uint32_t width,
     uint32_t height,
     uint32_t bpp,
-    target_ulong /* void* */ pixels_,
-    target_ulong /* const EGLint* */ attrib_list_)
+    target_ulong pixels,
+    const EGLint *attrib_list, int32_t attrib_list_count)
 {
-    bool res = true;
-    EGLint *attrib_list = NULL;
+    yagl_host_handle res = 0;
     struct yagl_eglb_surface *backend_sfc = NULL;
     struct yagl_egl_window_attribs attribs;
     int i = 0;
@@ -1684,17 +1528,6 @@ bool yagl_host_eglCreateWindowSurfaceOffscreenYAGL(yagl_host_handle* retval,
 
     YAGL_LOG_FUNC_SET(eglCreateWindowSurfaceOffscreenYAGL);
 
-    *retval = 0;
-
-    if (attrib_list_) {
-        attrib_list = yagl_mem_get_attrib_list(attrib_list_);
-
-        if (!attrib_list) {
-            res = false;
-            goto out;
-        }
-    }
-
     yagl_egl_window_attribs_init(&attribs);
 
     if (!yagl_egl_is_attrib_list_empty(attrib_list)) {
@@ -1732,7 +1565,7 @@ bool yagl_host_eglCreateWindowSurfaceOffscreenYAGL(yagl_host_handle* retval,
                                                              width,
                                                              height,
                                                              bpp,
-                                                             pixels_);
+                                                             pixels);
 
     if (!backend_sfc) {
         YAGL_SET_ERR(EGL_BAD_NATIVE_WINDOW);
@@ -1754,29 +1587,26 @@ bool yagl_host_eglCreateWindowSurfaceOffscreenYAGL(yagl_host_handle* retval,
     yagl_egl_display_add_surface(dpy, surface);
     yagl_egl_surface_release(surface);
 
-    *retval = surface->res.handle;
+    res = surface->res.handle;
 
 out:
     yagl_egl_config_release(config);
     if (backend_sfc) {
         backend_sfc->destroy(backend_sfc);
     }
-    g_free(attrib_list);
 
     return res;
 }
 
-bool yagl_host_eglCreatePbufferSurfaceOffscreenYAGL(yagl_host_handle* retval,
-    yagl_host_handle dpy_,
+yagl_host_handle yagl_host_eglCreatePbufferSurfaceOffscreenYAGL(yagl_host_handle dpy_,
     yagl_host_handle config_,
     uint32_t width,
     uint32_t height,
     uint32_t bpp,
-    target_ulong /* void* */ pixels_,
-    target_ulong /* const EGLint* */ attrib_list_)
+    target_ulong pixels,
+    const EGLint *attrib_list, int32_t attrib_list_count)
 {
-    bool res = true;
-    EGLint *attrib_list = NULL;
+    yagl_host_handle res = 0;
     struct yagl_eglb_surface *backend_sfc = NULL;
     struct yagl_egl_pbuffer_attribs attribs;
     struct yagl_egl_display *dpy = NULL;
@@ -1786,17 +1616,6 @@ bool yagl_host_eglCreatePbufferSurfaceOffscreenYAGL(yagl_host_handle* retval,
 
     YAGL_LOG_FUNC_SET(eglCreatePbufferSurfaceOffscreenYAGL);
 
-    *retval = 0;
-
-    if (attrib_list_) {
-        attrib_list = yagl_mem_get_attrib_list(attrib_list_);
-
-        if (!attrib_list) {
-            res = false;
-            goto out;
-        }
-    }
-
     yagl_egl_pbuffer_attribs_init(&attribs);
 
     if (!yagl_egl_is_attrib_list_empty(attrib_list)) {
@@ -1864,7 +1683,7 @@ bool yagl_host_eglCreatePbufferSurfaceOffscreenYAGL(yagl_host_handle* retval,
                                                              width,
                                                              height,
                                                              bpp,
-                                                             pixels_);
+                                                             pixels);
 
     if (!backend_sfc) {
         YAGL_SET_ERR(EGL_BAD_ALLOC);
@@ -1886,29 +1705,26 @@ bool yagl_host_eglCreatePbufferSurfaceOffscreenYAGL(yagl_host_handle* retval,
     yagl_egl_display_add_surface(dpy, surface);
     yagl_egl_surface_release(surface);
 
-    *retval = surface->res.handle;
+    res = surface->res.handle;
 
 out:
     yagl_egl_config_release(config);
     if (backend_sfc) {
         backend_sfc->destroy(backend_sfc);
     }
-    g_free(attrib_list);
 
     return res;
 }
 
-bool yagl_host_eglCreatePixmapSurfaceOffscreenYAGL(yagl_host_handle* retval,
-    yagl_host_handle dpy_,
+yagl_host_handle yagl_host_eglCreatePixmapSurfaceOffscreenYAGL(yagl_host_handle dpy_,
     yagl_host_handle config_,
     uint32_t width,
     uint32_t height,
     uint32_t bpp,
-    target_ulong /* void* */ pixels_,
-    target_ulong /* const EGLint* */ attrib_list_)
+    target_ulong pixels,
+    const EGLint *attrib_list, int32_t attrib_list_count)
 {
-    bool res = true;
-    EGLint *attrib_list = NULL;
+    yagl_host_handle res = 0;
     struct yagl_eglb_surface *backend_sfc = NULL;
     struct yagl_egl_pixmap_attribs attribs;
     struct yagl_egl_display *dpy = NULL;
@@ -1917,17 +1733,6 @@ bool yagl_host_eglCreatePixmapSurfaceOffscreenYAGL(yagl_host_handle* retval,
 
     YAGL_LOG_FUNC_SET(eglCreatePixmapSurfaceOffscreenYAGL);
 
-    *retval = 0;
-
-    if (attrib_list_) {
-        attrib_list = yagl_mem_get_attrib_list(attrib_list_);
-
-        if (!attrib_list) {
-            res = false;
-            goto out;
-        }
-    }
-
     yagl_egl_pixmap_attribs_init(&attribs);
 
     if (!yagl_egl_is_attrib_list_empty(attrib_list)) {
@@ -1956,7 +1761,7 @@ bool yagl_host_eglCreatePixmapSurfaceOffscreenYAGL(yagl_host_handle* retval,
                                                              width,
                                                              height,
                                                              bpp,
-                                                             pixels_);
+                                                             pixels);
 
     if (!backend_sfc) {
         YAGL_SET_ERR(EGL_BAD_NATIVE_PIXMAP);
@@ -1978,26 +1783,25 @@ bool yagl_host_eglCreatePixmapSurfaceOffscreenYAGL(yagl_host_handle* retval,
     yagl_egl_display_add_surface(dpy, surface);
     yagl_egl_surface_release(surface);
 
-    *retval = surface->res.handle;
+    res = surface->res.handle;
 
 out:
     yagl_egl_config_release(config);
     if (backend_sfc) {
         backend_sfc->destroy(backend_sfc);
     }
-    g_free(attrib_list);
 
     return res;
 }
 
-bool yagl_host_eglResizeOffscreenSurfaceYAGL(EGLBoolean* retval,
-    yagl_host_handle dpy_,
+EGLBoolean yagl_host_eglResizeOffscreenSurfaceYAGL(yagl_host_handle dpy_,
     yagl_host_handle surface_,
     uint32_t width,
     uint32_t height,
     uint32_t bpp,
-    target_ulong /* void* */ pixels_)
+    target_ulong pixels)
 {
+    EGLBoolean res = EGL_FALSE;
     struct yagl_egl_display *dpy = NULL;
     struct yagl_egl_surface *surface = NULL;
     struct yagl_eglb_surface *backend_sfc = NULL;
@@ -2006,8 +1810,6 @@ bool yagl_host_eglResizeOffscreenSurfaceYAGL(EGLBoolean* retval,
 
     YAGL_LOG_FUNC_SET(eglResizeOffscreenSurfaceYAGL);
 
-    *retval = EGL_FALSE;
-
     if (!yagl_validate_display(dpy_, &dpy)) {
         goto out;
     }
@@ -2029,7 +1831,7 @@ bool yagl_host_eglResizeOffscreenSurfaceYAGL(EGLBoolean* retval,
                                                              width,
                                                              height,
                                                              bpp,
-                                                             pixels_);
+                                                             pixels);
 
     if (!backend_sfc) {
         YAGL_SET_ERR(EGL_BAD_ALLOC);
@@ -2066,7 +1868,7 @@ bool yagl_host_eglResizeOffscreenSurfaceYAGL(EGLBoolean* retval,
 
     backend_sfc = NULL;
 
-    *retval = EGL_TRUE;
+    res = EGL_TRUE;
 
 out:
     if (backend_sfc) {
@@ -2074,17 +1876,16 @@ out:
     }
     yagl_egl_surface_release(surface);
 
-    return true;
+    return res;
 }
 
-bool yagl_host_eglUpdateOffscreenImageYAGL(yagl_host_handle dpy_,
+void yagl_host_eglUpdateOffscreenImageYAGL(yagl_host_handle dpy_,
     yagl_host_handle image_,
     uint32_t width,
     uint32_t height,
     uint32_t bpp,
-    target_ulong /* const void* */ pixels)
+    const void *pixels, int32_t pixels_count)
 {
-    bool res = true;
     struct yagl_egl_display *dpy = NULL;
     struct yagl_egl_image *image = NULL;
 
@@ -2104,26 +1905,22 @@ bool yagl_host_eglUpdateOffscreenImageYAGL(yagl_host_handle dpy_,
         goto out;
     }
 
-    res = image->backend_image->update_offscreen(image->backend_image,
-                                                 width,
-                                                 height,
-                                                 bpp,
-                                                 pixels);
+    image->backend_image->update_offscreen(image->backend_image,
+                                           width,
+                                           height,
+                                           bpp,
+                                           pixels);
 
 out:
     yagl_egl_image_release(image);
-
-    return res;
 }
 
-bool yagl_host_eglCreateWindowSurfaceOnscreenYAGL(yagl_host_handle* retval,
-    yagl_host_handle dpy_,
+yagl_host_handle yagl_host_eglCreateWindowSurfaceOnscreenYAGL(yagl_host_handle dpy_,
     yagl_host_handle config_,
     yagl_winsys_id win,
-    target_ulong /* const EGLint* */ attrib_list_)
+    const EGLint *attrib_list, int32_t attrib_list_count)
 {
-    bool res = true;
-    EGLint *attrib_list = NULL;
+    yagl_host_handle res = 0;
     struct yagl_eglb_surface *backend_sfc = NULL;
     struct yagl_egl_window_attribs attribs;
     int i = 0;
@@ -2133,17 +1930,6 @@ bool yagl_host_eglCreateWindowSurfaceOnscreenYAGL(yagl_host_handle* retval,
 
     YAGL_LOG_FUNC_SET(eglCreateWindowSurfaceOnscreenYAGL);
 
-    *retval = 0;
-
-    if (attrib_list_) {
-        attrib_list = yagl_mem_get_attrib_list(attrib_list_);
-
-        if (!attrib_list) {
-            res = false;
-            goto out;
-        }
-    }
-
     yagl_egl_window_attribs_init(&attribs);
 
     if (!yagl_egl_is_attrib_list_empty(attrib_list)) {
@@ -2200,26 +1986,23 @@ bool yagl_host_eglCreateWindowSurfaceOnscreenYAGL(yagl_host_handle* retval,
     yagl_egl_display_add_surface(dpy, surface);
     yagl_egl_surface_release(surface);
 
-    *retval = surface->res.handle;
+    res = surface->res.handle;
 
 out:
     yagl_egl_config_release(config);
     if (backend_sfc) {
         backend_sfc->destroy(backend_sfc);
     }
-    g_free(attrib_list);
 
     return res;
 }
 
-bool yagl_host_eglCreatePbufferSurfaceOnscreenYAGL(yagl_host_handle* retval,
-    yagl_host_handle dpy_,
+yagl_host_handle yagl_host_eglCreatePbufferSurfaceOnscreenYAGL(yagl_host_handle dpy_,
     yagl_host_handle config_,
     yagl_winsys_id buffer,
-    target_ulong /* const EGLint* */ attrib_list_)
+    const EGLint *attrib_list, int32_t attrib_list_count)
 {
-    bool res = true;
-    EGLint *attrib_list = NULL;
+    yagl_host_handle res = 0;
     struct yagl_eglb_surface *backend_sfc = NULL;
     struct yagl_egl_pbuffer_attribs attribs;
     struct yagl_egl_display *dpy = NULL;
@@ -2229,17 +2012,6 @@ bool yagl_host_eglCreatePbufferSurfaceOnscreenYAGL(yagl_host_handle* retval,
 
     YAGL_LOG_FUNC_SET(eglCreatePbufferSurfaceOnscreenYAGL);
 
-    *retval = 0;
-
-    if (attrib_list_) {
-        attrib_list = yagl_mem_get_attrib_list(attrib_list_);
-
-        if (!attrib_list) {
-            res = false;
-            goto out;
-        }
-    }
-
     yagl_egl_pbuffer_attribs_init(&attribs);
 
     if (!yagl_egl_is_attrib_list_empty(attrib_list)) {
@@ -2325,26 +2097,23 @@ bool yagl_host_eglCreatePbufferSurfaceOnscreenYAGL(yagl_host_handle* retval,
     yagl_egl_display_add_surface(dpy, surface);
     yagl_egl_surface_release(surface);
 
-    *retval = surface->res.handle;
+    res = surface->res.handle;
 
 out:
     yagl_egl_config_release(config);
     if (backend_sfc) {
         backend_sfc->destroy(backend_sfc);
     }
-    g_free(attrib_list);
 
     return res;
 }
 
-bool yagl_host_eglCreatePixmapSurfaceOnscreenYAGL(yagl_host_handle* retval,
-    yagl_host_handle dpy_,
+yagl_host_handle yagl_host_eglCreatePixmapSurfaceOnscreenYAGL(yagl_host_handle dpy_,
     yagl_host_handle config_,
     yagl_winsys_id pixmap,
-    target_ulong /* const EGLint* */ attrib_list_)
+    const EGLint *attrib_list, int32_t attrib_list_count)
 {
-    bool res = true;
-    EGLint *attrib_list = NULL;
+    yagl_host_handle res = 0;
     struct yagl_eglb_surface *backend_sfc = NULL;
     struct yagl_egl_pixmap_attribs attribs;
     struct yagl_egl_display *dpy = NULL;
@@ -2353,17 +2122,6 @@ bool yagl_host_eglCreatePixmapSurfaceOnscreenYAGL(yagl_host_handle* retval,
 
     YAGL_LOG_FUNC_SET(eglCreatePixmapSurfaceOnscreenYAGL);
 
-    *retval = 0;
-
-    if (attrib_list_) {
-        attrib_list = yagl_mem_get_attrib_list(attrib_list_);
-
-        if (!attrib_list) {
-            res = false;
-            goto out;
-        }
-    }
-
     yagl_egl_pixmap_attribs_init(&attribs);
 
     if (!yagl_egl_is_attrib_list_empty(attrib_list)) {
@@ -2411,19 +2169,18 @@ bool yagl_host_eglCreatePixmapSurfaceOnscreenYAGL(yagl_host_handle* retval,
     yagl_egl_display_add_surface(dpy, surface);
     yagl_egl_surface_release(surface);
 
-    *retval = surface->res.handle;
+    res = surface->res.handle;
 
 out:
     yagl_egl_config_release(config);
     if (backend_sfc) {
         backend_sfc->destroy(backend_sfc);
     }
-    g_free(attrib_list);
 
     return res;
 }
 
-bool yagl_host_eglInvalidateOnscreenSurfaceYAGL(yagl_host_handle dpy_,
+void yagl_host_eglInvalidateOnscreenSurfaceYAGL(yagl_host_handle dpy_,
     yagl_host_handle surface_,
     yagl_winsys_id buffer)
 {
@@ -2442,6 +2199,4 @@ bool yagl_host_eglInvalidateOnscreenSurfaceYAGL(yagl_host_handle dpy_,
 
 out:
     yagl_egl_surface_release(surface);
-
-    return true;
 }
index aa8e524..ce4063f 100644 (file)
 
 struct yagl_api_ps *yagl_host_egl_process_init(struct yagl_api *api);
 
-bool yagl_host_eglGetError(EGLint* retval);
-bool yagl_host_eglGetDisplay(yagl_host_handle* retval,
-    target_ulong /* void* */ display_id);
-bool yagl_host_eglInitialize(EGLBoolean* retval,
-    yagl_host_handle dpy_,
-    target_ulong /* EGLint* */ major,
-    target_ulong /* EGLint* */ minor);
-bool yagl_host_eglTerminate(EGLBoolean* retval,
-    yagl_host_handle dpy_);
-bool yagl_host_eglGetConfigs(EGLBoolean* retval,
-    yagl_host_handle dpy_,
-    target_ulong /* EGLConfig^* */ configs_,
-    EGLint config_size,
-    target_ulong /* EGLint* */ num_config_);
-bool yagl_host_eglChooseConfig(EGLBoolean* retval,
-    yagl_host_handle dpy_,
-    target_ulong /* const EGLint* */ attrib_list_,
-    target_ulong /* EGLConfig^* */ configs_,
-    EGLint config_size,
-    target_ulong /* EGLint* */ num_config_);
-bool yagl_host_eglGetConfigAttrib(EGLBoolean* retval,
-    yagl_host_handle dpy_,
-    yagl_host_handle config_,
+EGLint yagl_host_eglGetError(void);
+yagl_host_handle yagl_host_eglGetDisplay(uint32_t display_id);
+EGLBoolean yagl_host_eglInitialize(yagl_host_handle dpy,
+    EGLint *major,
+    EGLint *minor);
+EGLBoolean yagl_host_eglTerminate(yagl_host_handle dpy);
+EGLBoolean yagl_host_eglGetConfigs(yagl_host_handle dpy,
+    yagl_host_handle *configs, int32_t configs_maxcount, int32_t *configs_count);
+EGLBoolean yagl_host_eglChooseConfig(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);
+EGLBoolean yagl_host_eglGetConfigAttrib(yagl_host_handle dpy,
+    yagl_host_handle config,
     EGLint attribute,
-    target_ulong /* EGLint* */ value_);
-bool yagl_host_eglDestroySurface(EGLBoolean* retval,
-    yagl_host_handle dpy_,
-    yagl_host_handle surface_);
-bool yagl_host_eglQuerySurface(EGLBoolean* retval,
-    yagl_host_handle dpy_,
-    yagl_host_handle surface_,
+    EGLint *value);
+EGLBoolean yagl_host_eglDestroySurface(yagl_host_handle dpy,
+    yagl_host_handle surface);
+EGLBoolean yagl_host_eglQuerySurface(yagl_host_handle dpy,
+    yagl_host_handle surface,
     EGLint attribute,
-    target_ulong /* EGLint* */ value_);
-bool yagl_host_eglBindAPI(EGLBoolean* retval,
-    EGLenum api);
-bool yagl_host_eglWaitClient(EGLBoolean* retval);
-bool yagl_host_eglReleaseThread(EGLBoolean* retval);
-bool yagl_host_eglCreatePbufferFromClientBuffer(yagl_host_handle* retval,
-    yagl_host_handle dpy,
-    EGLenum buftype,
-    yagl_host_handle buffer,
-    yagl_host_handle config,
-    target_ulong /* const EGLint* */ attrib_list);
-bool yagl_host_eglSurfaceAttrib(EGLBoolean* retval,
-    yagl_host_handle dpy_,
-    yagl_host_handle surface_,
+    EGLint *value);
+EGLBoolean yagl_host_eglBindAPI(EGLenum api);
+EGLBoolean yagl_host_eglWaitClient(void);
+EGLBoolean yagl_host_eglReleaseThread(void);
+EGLBoolean yagl_host_eglSurfaceAttrib(yagl_host_handle dpy,
+    yagl_host_handle surface,
     EGLint attribute,
     EGLint value);
-bool yagl_host_eglBindTexImage(EGLBoolean* retval,
-    yagl_host_handle dpy_,
-    yagl_host_handle surface_,
+EGLBoolean yagl_host_eglBindTexImage(yagl_host_handle dpy,
+    yagl_host_handle surface,
     EGLint buffer);
-bool yagl_host_eglReleaseTexImage(EGLBoolean* retval,
-    yagl_host_handle dpy_,
-    yagl_host_handle surface_,
+EGLBoolean yagl_host_eglReleaseTexImage(yagl_host_handle dpy,
+    yagl_host_handle surface,
     EGLint buffer);
-bool yagl_host_eglCreateContext(yagl_host_handle* retval,
-    yagl_host_handle dpy_,
-    yagl_host_handle config_,
-    yagl_host_handle share_context_,
-    target_ulong /* const EGLint* */ attrib_list_);
-bool yagl_host_eglDestroyContext(EGLBoolean* retval,
-    yagl_host_handle dpy_,
-    yagl_host_handle ctx_);
-bool yagl_host_eglMakeCurrent(EGLBoolean* retval,
-    yagl_host_handle dpy_,
-    yagl_host_handle draw_,
-    yagl_host_handle read_,
-    yagl_host_handle ctx_);
-bool yagl_host_eglQueryContext(EGLBoolean* retval,
-    yagl_host_handle dpy_,
-    yagl_host_handle ctx_,
+yagl_host_handle yagl_host_eglCreateContext(yagl_host_handle dpy,
+    yagl_host_handle config,
+    yagl_host_handle share_context,
+    const EGLint *attrib_list, int32_t attrib_list_count);
+EGLBoolean yagl_host_eglDestroyContext(yagl_host_handle dpy,
+    yagl_host_handle ctx);
+EGLBoolean yagl_host_eglMakeCurrent(yagl_host_handle dpy,
+    yagl_host_handle draw,
+    yagl_host_handle read,
+    yagl_host_handle ctx);
+EGLBoolean yagl_host_eglQueryContext(yagl_host_handle dpy,
+    yagl_host_handle ctx,
     EGLint attribute,
-    target_ulong /* EGLint* */ value_);
-bool yagl_host_eglSwapBuffers(EGLBoolean* retval,
-    yagl_host_handle dpy_,
-    yagl_host_handle surface_);
-bool yagl_host_eglCopyBuffers(EGLBoolean* retval,
-    yagl_host_handle dpy_,
-    yagl_host_handle surface_);
-bool yagl_host_eglCreateImageKHR(yagl_host_handle* retval,
-    yagl_host_handle dpy_,
+    EGLint *value);
+EGLBoolean yagl_host_eglSwapBuffers(yagl_host_handle dpy,
+    yagl_host_handle surface);
+EGLBoolean yagl_host_eglCopyBuffers(yagl_host_handle dpy,
+    yagl_host_handle surface);
+yagl_host_handle yagl_host_eglCreateImageKHR(yagl_host_handle dpy,
     yagl_host_handle ctx,
     EGLenum target,
     yagl_winsys_id buffer,
-    target_ulong /* const EGLint* */ attrib_list_);
-bool yagl_host_eglDestroyImageKHR(EGLBoolean* retval,
-    yagl_host_handle dpy_,
-    yagl_host_handle image_);
-bool yagl_host_eglCreateWindowSurfaceOffscreenYAGL(yagl_host_handle* retval,
-    yagl_host_handle dpy_,
-    yagl_host_handle config_,
+    const EGLint *attrib_list, int32_t attrib_list_count);
+EGLBoolean yagl_host_eglDestroyImageKHR(yagl_host_handle dpy,
+    yagl_host_handle image);
+yagl_host_handle yagl_host_eglCreateWindowSurfaceOffscreenYAGL(yagl_host_handle dpy,
+    yagl_host_handle config,
     uint32_t width,
     uint32_t height,
     uint32_t bpp,
-    target_ulong /* void* */ pixels_,
-    target_ulong /* const EGLint* */ attrib_list_);
-bool yagl_host_eglCreatePbufferSurfaceOffscreenYAGL(yagl_host_handle* retval,
-    yagl_host_handle dpy_,
-    yagl_host_handle config_,
+    target_ulong pixels,
+    const EGLint *attrib_list, int32_t attrib_list_count);
+yagl_host_handle yagl_host_eglCreatePbufferSurfaceOffscreenYAGL(yagl_host_handle dpy,
+    yagl_host_handle config,
     uint32_t width,
     uint32_t height,
     uint32_t bpp,
-    target_ulong /* void* */ pixels_,
-    target_ulong /* const EGLint* */ attrib_list_);
-bool yagl_host_eglCreatePixmapSurfaceOffscreenYAGL(yagl_host_handle* retval,
-    yagl_host_handle dpy_,
-    yagl_host_handle config_,
+    target_ulong pixels,
+    const EGLint *attrib_list, int32_t attrib_list_count);
+yagl_host_handle yagl_host_eglCreatePixmapSurfaceOffscreenYAGL(yagl_host_handle dpy,
+    yagl_host_handle config,
     uint32_t width,
     uint32_t height,
     uint32_t bpp,
-    target_ulong /* void* */ pixels_,
-    target_ulong /* const EGLint* */ attrib_list_);
-bool yagl_host_eglResizeOffscreenSurfaceYAGL(EGLBoolean* retval,
-    yagl_host_handle dpy_,
-    yagl_host_handle surface_,
+    target_ulong pixels,
+    const EGLint *attrib_list, int32_t attrib_list_count);
+EGLBoolean yagl_host_eglResizeOffscreenSurfaceYAGL(yagl_host_handle dpy,
+    yagl_host_handle surface,
     uint32_t width,
     uint32_t height,
     uint32_t bpp,
-    target_ulong /* void* */ pixels_);
-bool yagl_host_eglUpdateOffscreenImageYAGL(yagl_host_handle dpy_,
-    yagl_host_handle image_,
+    target_ulong pixels);
+void yagl_host_eglUpdateOffscreenImageYAGL(yagl_host_handle dpy,
+    yagl_host_handle image,
     uint32_t width,
     uint32_t height,
     uint32_t bpp,
-    target_ulong /* const void* */ pixels);
-bool yagl_host_eglCreateWindowSurfaceOnscreenYAGL(yagl_host_handle* retval,
-    yagl_host_handle dpy_,
-    yagl_host_handle config_,
+    const void *pixels, int32_t pixels_count);
+yagl_host_handle yagl_host_eglCreateWindowSurfaceOnscreenYAGL(yagl_host_handle dpy,
+    yagl_host_handle config,
     yagl_winsys_id win,
-    target_ulong /* const EGLint* */ attrib_list_);
-bool yagl_host_eglCreatePbufferSurfaceOnscreenYAGL(yagl_host_handle* retval,
-    yagl_host_handle dpy_,
-    yagl_host_handle config_,
+    const EGLint *attrib_list, int32_t attrib_list_count);
+yagl_host_handle yagl_host_eglCreatePbufferSurfaceOnscreenYAGL(yagl_host_handle dpy,
+    yagl_host_handle config,
     yagl_winsys_id buffer,
-    target_ulong /* const EGLint* */ attrib_list_);
-bool yagl_host_eglCreatePixmapSurfaceOnscreenYAGL(yagl_host_handle* retval,
-    yagl_host_handle dpy_,
-    yagl_host_handle config_,
+    const EGLint *attrib_list, int32_t attrib_list_count);
+yagl_host_handle yagl_host_eglCreatePixmapSurfaceOnscreenYAGL(yagl_host_handle dpy,
+    yagl_host_handle config,
     yagl_winsys_id pixmap,
-    target_ulong /* const EGLint* */ attrib_list_);
-bool yagl_host_eglInvalidateOnscreenSurfaceYAGL(yagl_host_handle dpy_,
-    yagl_host_handle surface_,
+    const EGLint *attrib_list, int32_t attrib_list_count);
+void yagl_host_eglInvalidateOnscreenSurfaceYAGL(yagl_host_handle dpy,
+    yagl_host_handle surface,
     yagl_winsys_id buffer);
 
 #endif
index 26e80e5..4c0b55c 100644 (file)
@@ -205,67 +205,65 @@ bool yagl_gles_array_update_vbo(struct yagl_gles_array *array,
     return true;
 }
 
-bool yagl_gles_array_transfer(struct yagl_gles_array *array,
+void yagl_gles_array_transfer(struct yagl_gles_array *array,
                               uint32_t first,
-                              uint32_t count)
+                              const void *data,
+                              uint32_t size)
 {
     uint32_t host_data_size;
 
-    if (!array->enabled) {
-        return true;
+    if (!array->enabled || array->vbo || !array->target_data) {
+        return;
     }
 
-    if (array->vbo) {
-        yagl_gles_buffer_transfer(array->vbo,
-                                  array->type,
-                                  GL_ARRAY_BUFFER,
-                                  array->need_convert);
-    } else {
-        if (!array->target_data) {
-            return true;
-        }
-
-        /*
-         * We must take 'first' into account since we're going to
-         * feed 'host_data' to glVertexAttribPointer or whatever, so
-         * the data before 'first' can be garbage, the host won't touch it,
-         * what matters is data starting at 'first' and 'count' elements long.
-         *
-         * Nokia dgles has an implementation of this where there's an extra
-         * variable called 'delta' = first * stride, which is being subtracted
-         * from 'host_data', thus, giving host implementation a bad pointer which
-         * it will increment according to GL rules and will get to what we need.
-         * Though works, I find this approach awkward, so I'll keep with
-         * overallocating for now...
-         */
-
-        host_data_size = (first + count) * array->stride;
-
-        if (host_data_size > array->host_data_size) {
-            array->host_data_size = host_data_size;
-            g_free(array->host_data);
-            array->host_data = g_malloc(array->host_data_size);
-        }
+    /*
+     * We must take 'first' into account since we're going to
+     * feed 'host_data' to glVertexAttribPointer or whatever, so
+     * the data before 'first' can be garbage, the host won't touch it,
+     * what matters is data starting at 'first' and 'count' elements long.
+     *
+     * Nokia dgles has an implementation of this where there's an extra
+     * variable called 'delta' = first * stride, which is being subtracted
+     * from 'host_data', thus, giving host implementation a bad pointer which
+     * it will increment according to GL rules and will get to what we need.
+     * Though works, I find this approach awkward, so I'll keep with
+     * overallocating for now...
+     */
+
+    host_data_size = first * array->stride + size;
+
+    if (host_data_size > array->host_data_size) {
+        array->host_data_size = host_data_size;
+        g_free(array->host_data);
+        array->host_data = g_malloc(array->host_data_size);
+    }
 
-        if (!yagl_mem_get(array->target_data + (first * array->stride),
-                          (count * array->stride),
-                          array->host_data + (first * array->stride))) {
-            return false;
-        }
+    memcpy(array->host_data + (first * array->stride), data, size);
 
-        if (array->need_convert) {
-            switch (array->type) {
-            case GL_BYTE:
-                yagl_gles1_array_byte_to_short(array, first, count);
-                break;
-            case GL_FIXED:
-                yagl_gles1_array_fixed_to_float(array, first, count);
-                break;
-            }
+    if (array->need_convert) {
+        switch (array->type) {
+        case GL_BYTE:
+            yagl_gles1_array_byte_to_short(array, first, (size / array->stride));
+            break;
+        case GL_FIXED:
+            yagl_gles1_array_fixed_to_float(array, first, (size / array->stride));
+            break;
         }
     }
 
     array->apply(array);
+}
 
-    return true;
+void yagl_gles_array_transfer_vbo(struct yagl_gles_array *array)
+{
+    if (!array->enabled || !array->vbo) {
+        return;
+    }
+
+    yagl_gles_buffer_transfer(array->vbo,
+                              array->type,
+                              GL_ARRAY_BUFFER,
+                              array->need_convert);
+
+    array->apply(array);
 }
index abe6591..eb109a1 100644 (file)
@@ -114,15 +114,17 @@ bool yagl_gles_array_update_vbo(struct yagl_gles_array *array,
                                 GLint offset);
 
 /*
- * Transfers and applies 'count' array elements starting from 'first' element.
+ * Transfers 'size' bytes starting from 'first' element.
  * Transferred data is kept in 'host_data'.
- * On error returns false.
- *
- * Note that the current thread MUST be in sync with target while making this
- * call, since this call might transfer data from target to host.
  */
-bool yagl_gles_array_transfer(struct yagl_gles_array *array,
+void yagl_gles_array_transfer(struct yagl_gles_array *array,
                               uint32_t first,
-                              uint32_t count);
+                              const void *data,
+                              uint32_t size);
+
+/*
+ * Transfers 'vbo' if this array uses 'vbo'.
+ */
+void yagl_gles_array_transfer_vbo(struct yagl_gles_array *array);
 
 #endif
index 7cfd895..998710e 100644 (file)
@@ -191,7 +191,7 @@ void yagl_gles_buffer_release(struct yagl_gles_buffer *buffer)
 
 void yagl_gles_buffer_set_data(struct yagl_gles_buffer *buffer,
                                GLint size,
-                               void *data,
+                               const void *data,
                                GLenum usage)
 {
     if (size > 0) {
@@ -225,7 +225,7 @@ void yagl_gles_buffer_set_data(struct yagl_gles_buffer *buffer,
 bool yagl_gles_buffer_update_data(struct yagl_gles_buffer *buffer,
                                   GLint offset,
                                   GLint size,
-                                  void *data)
+                                  const void *data)
 {
     if ((offset < 0) || (size < 0) || ((offset + size) > buffer->size)) {
         return false;
index b3804d0..205207f 100644 (file)
@@ -71,13 +71,13 @@ void yagl_gles_buffer_release(struct yagl_gles_buffer *buffer);
 
 void yagl_gles_buffer_set_data(struct yagl_gles_buffer *buffer,
                                GLint size,
-                               void *data,
+                               const void *data,
                                GLenum usage);
 
 bool yagl_gles_buffer_update_data(struct yagl_gles_buffer *buffer,
                                   GLint offset,
                                   GLint size,
-                                  void *data);
+                                  const void *data);
 
 bool yagl_gles_buffer_get_minmax_index(struct yagl_gles_buffer *buffer,
                                        GLenum type,
index c0cd1f8..bb43a13 100644 (file)
@@ -370,19 +370,13 @@ struct yagl_gles_array
     return NULL;
 }
 
-bool yagl_gles_context_transfer_arrays(struct yagl_gles_context *ctx,
-                                       uint32_t first,
-                                       uint32_t count)
+void yagl_gles_context_transfer_arrays_vbo(struct yagl_gles_context *ctx)
 {
     int i;
 
     for (i = 0; i < ctx->num_arrays; ++i) {
-        if (!yagl_gles_array_transfer(&ctx->arrays[i], first, count)) {
-            return false;
-        }
+        yagl_gles_array_transfer_vbo(&ctx->arrays[i]);
     }
-
-    return true;
 }
 
 bool yagl_gles_context_set_active_texture(struct yagl_gles_context *ctx,
index 0d3f2e6..a6e0aa5 100644 (file)
@@ -151,18 +151,7 @@ void *yagl_gles_context_malloc0(struct yagl_gles_context *ctx, GLsizei size);
 struct yagl_gles_array
     *yagl_gles_context_get_array(struct yagl_gles_context *ctx, GLuint index);
 
-/*
- * For all arrays: transfers and applies 'count' array elements starting
- * from 'first' element.
- * On error returns false, some arrays might not get
- * transferred on error.
- *
- * Note that the current thread MUST be in sync with target while making this
- * call, since this call might transfer data from target to host.
- */
-bool yagl_gles_context_transfer_arrays(struct yagl_gles_context *ctx,
-                                       uint32_t first,
-                                       uint32_t count);
+void yagl_gles_context_transfer_arrays_vbo(struct yagl_gles_context *ctx);
 
 bool yagl_gles_context_set_active_texture(struct yagl_gles_context *ctx,
                                           GLenum texture);
index 2c0add5..650e4da 100644 (file)
@@ -10,9 +10,9 @@
 #include "yagl_gles_image.h"
 #include "yagl_gles_framebuffer.h"
 #include "yagl_gles_renderbuffer.h"
+#include "yagl_gles_array.h"
 #include "yagl_tls.h"
 #include "yagl_log.h"
-#include "yagl_mem_gl.h"
 #include "yagl_process.h"
 #include "yagl_thread.h"
 #include "yagl_sharegroup.h"
     if (!ctx) { \
         YAGL_LOG_WARN("no current context"); \
         ret_expr; \
-        return true; \
     }
 
-#define YAGL_GET_CTX_RET(func, ret) YAGL_GET_CTX_IMPL(func, *retval = ret)
+#define YAGL_GET_CTX_RET(func, ret) YAGL_GET_CTX_IMPL(func, return ret)
 
-#define YAGL_GET_CTX(func) YAGL_GET_CTX_IMPL(func,)
+#define YAGL_GET_CTX(func) YAGL_GET_CTX_IMPL(func, return)
 
 #define YAGL_UNIMPLEMENTED_RET(func, ret) \
     YAGL_GET_CTX_RET(func, ret); \
@@ -205,7 +204,7 @@ static bool yagl_get_integer(struct yagl_gles_context *ctx,
     return true;
 }
 
-bool yagl_host_glActiveTexture(GLenum texture)
+void yagl_host_glActiveTexture(GLenum texture)
 {
     YAGL_GET_CTX(glActiveTexture);
 
@@ -214,11 +213,9 @@ bool yagl_host_glActiveTexture(GLenum texture)
     } else {
         YAGL_SET_ERR(GL_INVALID_ENUM);
     }
-
-    return true;
 }
 
-bool yagl_host_glBindBuffer(GLenum target,
+void yagl_host_glBindBuffer(GLenum target,
     GLuint buffer)
 {
     struct yagl_gles_buffer *buffer_obj = NULL;
@@ -252,11 +249,9 @@ bool yagl_host_glBindBuffer(GLenum target,
 
 out:
     yagl_gles_buffer_release(buffer_obj);
-
-    return true;
 }
 
-bool yagl_host_glBindTexture(GLenum target,
+void yagl_host_glBindTexture(GLenum target,
     GLuint texture)
 {
     struct yagl_gles_texture *texture_obj = NULL;
@@ -296,30 +291,24 @@ bool yagl_host_glBindTexture(GLenum target,
 
 out:
     yagl_gles_texture_release(texture_obj);
-
-    return true;
 }
 
-bool yagl_host_glBlendFunc(GLenum sfactor,
+void yagl_host_glBlendFunc(GLenum sfactor,
     GLenum dfactor)
 {
     YAGL_GET_CTX(glBlendFunc);
 
     ctx->driver->BlendFunc(sfactor, dfactor);
-
-    return true;
 }
 
-bool yagl_host_glBlendEquation(GLenum mode)
+void yagl_host_glBlendEquation(GLenum mode)
 {
     YAGL_GET_CTX(glBlendEquation);
 
     ctx->driver->BlendEquation(mode);
-
-    return true;
 }
 
-bool yagl_host_glBlendFuncSeparate(GLenum srcRGB,
+void yagl_host_glBlendFuncSeparate(GLenum srcRGB,
     GLenum dstRGB,
     GLenum srcAlpha,
     GLenum dstAlpha)
@@ -330,28 +319,21 @@ bool yagl_host_glBlendFuncSeparate(GLenum srcRGB,
                                    dstRGB,
                                    srcAlpha,
                                    dstAlpha);
-
-    return true;
 }
 
-bool yagl_host_glBlendEquationSeparate(GLenum modeRGB,
+void yagl_host_glBlendEquationSeparate(GLenum modeRGB,
     GLenum modeAlpha)
 {
     YAGL_GET_CTX(glBlendEquationSeparate);
 
     ctx->driver->BlendEquationSeparate(modeRGB, modeAlpha);
-
-    return true;
 }
 
-bool yagl_host_glBufferData(GLenum target,
-    GLsizeiptr size,
-    target_ulong /* const GLvoid* */ data_,
+void yagl_host_glBufferData(GLenum target,
+    const GLvoid *data, int32_t data_count,
     GLenum usage)
 {
-    bool res = true;
     struct yagl_gles_buffer *buffer_obj = NULL;
-    GLvoid *data = NULL;
 
     YAGL_GET_CTX(glBufferData);
 
@@ -360,7 +342,7 @@ bool yagl_host_glBufferData(GLenum target,
         goto out;
     }
 
-    if (size < 0) {
+    if (data_count < 0) {
         YAGL_SET_ERR(GL_INVALID_VALUE);
         goto out;
     }
@@ -377,32 +359,17 @@ bool yagl_host_glBufferData(GLenum target,
         goto out;
     }
 
-    if (data_ && (size > 0)) {
-        data = yagl_gles_context_malloc(ctx, size);
-        if (!yagl_mem_get(data_,
-                          size,
-                          data)) {
-            res = false;
-            goto out;
-        }
-    }
-
-    yagl_gles_buffer_set_data(buffer_obj, size, data, usage);
+    yagl_gles_buffer_set_data(buffer_obj, data_count, data, usage);
 
 out:
     yagl_gles_buffer_release(buffer_obj);
-
-    return res;
 }
 
-bool yagl_host_glBufferSubData(GLenum target,
-    GLintptr offset,
-    GLsizeiptr size,
-    target_ulong /* const GLvoid* */ data_)
+void yagl_host_glBufferSubData(GLenum target,
+    GLsizei offset,
+    const GLvoid *data, int32_t data_count)
 {
-    bool res = true;
     struct yagl_gles_buffer *buffer_obj = NULL;
-    GLvoid *data = NULL;
 
     YAGL_GET_CTX(glBufferSubData);
 
@@ -411,7 +378,7 @@ bool yagl_host_glBufferSubData(GLenum target,
         goto out;
     }
 
-    if ((offset < 0) || (size < 0)) {
+    if ((offset < 0) || (data_count < 0)) {
         YAGL_SET_ERR(GL_INVALID_VALUE);
         goto out;
     }
@@ -423,39 +390,27 @@ bool yagl_host_glBufferSubData(GLenum target,
         goto out;
     }
 
-    if (size == 0) {
-        goto out;
-    }
-
-    data = yagl_gles_context_malloc(ctx, size);
-    if (!yagl_mem_get(data_,
-                      size,
-                      data)) {
-        res = false;
+    if (data_count == 0) {
         goto out;
     }
 
-    if (!yagl_gles_buffer_update_data(buffer_obj, offset, size, data)) {
+    if (!yagl_gles_buffer_update_data(buffer_obj, offset, data_count, data)) {
         YAGL_SET_ERR(GL_INVALID_VALUE);
         goto out;
     }
 
 out:
     yagl_gles_buffer_release(buffer_obj);
-
-    return res;
 }
 
-bool yagl_host_glClear(GLbitfield mask)
+void yagl_host_glClear(GLbitfield mask)
 {
     YAGL_GET_CTX(glClear);
 
     ctx->driver->Clear(mask);
-
-    return true;
 }
 
-bool yagl_host_glClearColor(GLclampf red,
+void yagl_host_glClearColor(GLclampf red,
     GLclampf green,
     GLclampf blue,
     GLclampf alpha)
@@ -463,29 +418,23 @@ bool yagl_host_glClearColor(GLclampf red,
     YAGL_GET_CTX(glClearColor);
 
     ctx->driver->ClearColor(red, green, blue, alpha);
-
-    return true;
 }
 
-bool yagl_host_glClearDepthf(GLclampf depth)
+void yagl_host_glClearDepthf(GLclampf depth)
 {
     YAGL_GET_CTX(glClearDepthf);
 
     ctx->driver->ClearDepth(depth);
-
-    return true;
 }
 
-bool yagl_host_glClearStencil(GLint s)
+void yagl_host_glClearStencil(GLint s)
 {
     YAGL_GET_CTX(glClearStencil);
 
     ctx->driver->ClearStencil(s);
-
-    return true;
 }
 
-bool yagl_host_glColorMask(GLboolean red,
+void yagl_host_glColorMask(GLboolean red,
     GLboolean green,
     GLboolean blue,
     GLboolean alpha)
@@ -493,35 +442,20 @@ bool yagl_host_glColorMask(GLboolean red,
     YAGL_GET_CTX(glColorMask);
 
     ctx->driver->ColorMask(red, green, blue, alpha);
-
-    return true;
 }
 
-bool yagl_host_glCompressedTexImage2D(GLenum target,
+void yagl_host_glCompressedTexImage2D(GLenum target,
     GLint level,
     GLenum internalformat,
     GLsizei width,
     GLsizei height,
     GLint border,
-    GLsizei imageSize,
-    target_ulong /* const GLvoid* */ data_)
+    const GLvoid *data, int32_t data_count)
 {
-    bool res = true;
-    GLvoid *data = NULL;
     GLenum err_code;
 
     YAGL_GET_CTX(glCompressedTexImage2D);
 
-    if (data_ && (imageSize > 0)) {
-        data = yagl_gles_context_malloc(ctx, imageSize);
-        if (!yagl_mem_get(data_,
-                          imageSize,
-                          data)) {
-            res = false;
-            goto out;
-        }
-    }
-
     if (target == GL_TEXTURE_2D) {
         struct yagl_gles_texture_target_state *tex_target_state =
             yagl_gles_context_get_active_texture_target_state(ctx,
@@ -548,46 +482,29 @@ bool yagl_host_glCompressedTexImage2D(GLenum target,
                                          width,
                                          height,
                                          border,
-                                         imageSize,
+                                         data_count,
                                          data);
 
     if (err_code != GL_NO_ERROR) {
         YAGL_SET_ERR(err_code);
     }
-
-out:
-    return res;
 }
 
-bool yagl_host_glCompressedTexSubImage2D(GLenum target,
+void yagl_host_glCompressedTexSubImage2D(GLenum target,
     GLint level,
     GLint xoffset,
     GLint yoffset,
     GLsizei width,
     GLsizei height,
     GLenum format,
-    GLsizei imageSize,
-    target_ulong /* const GLvoid* */ data_)
+    const GLvoid *data, int32_t data_count)
 {
-    bool res = true;
-    GLvoid *data = NULL;
-
     YAGL_GET_CTX(glCompressedTexSubImage2D);
 
     if (ctx->base.client_api == yagl_client_api_gles1) {
         /* No formats are supported by this call in GLES1 API */
         YAGL_SET_ERR(GL_INVALID_OPERATION);
-        return true;
-    }
-
-    if (data_ && (imageSize > 0)) {
-        data = yagl_gles_context_malloc(ctx, imageSize);
-        if (!yagl_mem_get(data_,
-                          imageSize,
-                          data)) {
-            res = false;
-            goto out;
-        }
+        return;
     }
 
     ctx->driver->CompressedTexSubImage2D(target,
@@ -597,14 +514,11 @@ bool yagl_host_glCompressedTexSubImage2D(GLenum target,
                                          width,
                                          height,
                                          format,
-                                         imageSize,
+                                         data_count,
                                          data);
-
-out:
-    return res;
 }
 
-bool yagl_host_glCopyTexImage2D(GLenum target,
+void yagl_host_glCopyTexImage2D(GLenum target,
     GLint level,
     GLenum internalformat,
     GLint x,
@@ -618,12 +532,12 @@ bool yagl_host_glCopyTexImage2D(GLenum target,
     if (ctx->base.client_api == yagl_client_api_gles1 &&
         target != GL_TEXTURE_2D) {
         YAGL_SET_ERR(GL_INVALID_ENUM);
-        return true;
+        return;
     }
 
     if (border != 0) {
         YAGL_SET_ERR(GL_INVALID_VALUE);
-        return true;
+        return;
     }
 
     ctx->driver->CopyTexImage2D(target,
@@ -634,11 +548,9 @@ bool yagl_host_glCopyTexImage2D(GLenum target,
                                 width,
                                 height,
                                 border);
-
-    return true;
 }
 
-bool yagl_host_glCopyTexSubImage2D(GLenum target,
+void yagl_host_glCopyTexSubImage2D(GLenum target,
     GLint level,
     GLint xoffset,
     GLint yoffset,
@@ -652,7 +564,7 @@ bool yagl_host_glCopyTexSubImage2D(GLenum target,
     if (ctx->base.client_api == yagl_client_api_gles1 &&
         target != GL_TEXTURE_2D) {
         YAGL_SET_ERR(GL_INVALID_ENUM);
-        return true;
+        return;
     }
 
     ctx->driver->CopyTexSubImage2D(target,
@@ -663,49 +575,31 @@ bool yagl_host_glCopyTexSubImage2D(GLenum target,
                                    y,
                                    width,
                                    height);
-
-    return true;
 }
 
-bool yagl_host_glCullFace(GLenum mode)
+void yagl_host_glCullFace(GLenum mode)
 {
     YAGL_GET_CTX(glCullFace);
 
     ctx->driver->CullFace(mode);
-
-    return true;
 }
 
-bool yagl_host_glDeleteBuffers(GLsizei n,
-    target_ulong /* const GLuint* */ buffers_)
+void yagl_host_glDeleteBuffers(const GLuint *buffers, int32_t buffers_count)
 {
-    bool res = true;
-    GLuint *buffer_names = NULL;
     GLsizei i;
     struct yagl_gles_buffer *buffer_obj = NULL;
 
     YAGL_GET_CTX(glDeleteBuffers);
 
-    if (n < 0) {
+    if (buffers_count < 0) {
         YAGL_SET_ERR(GL_INVALID_VALUE);
-        goto out;
-    }
-
-    buffer_names = yagl_gles_context_malloc0(ctx, n * sizeof(*buffer_names));
-
-    if (buffers_) {
-        if (!yagl_mem_get(buffers_,
-                          n * sizeof(*buffer_names),
-                          buffer_names)) {
-            res = false;
-            goto out;
-        }
+        return;
     }
 
-    if (buffer_names) {
-        for (i = 0; i < n; ++i) {
+    if (buffers) {
+        for (i = 0; i < buffers_count; ++i) {
             buffer_obj = (struct yagl_gles_buffer*)yagl_sharegroup_acquire_object(ctx->base.sg,
-                YAGL_NS_BUFFER, buffer_names[i]);
+                YAGL_NS_BUFFER, buffers[i]);
 
             if (buffer_obj) {
                 yagl_gles_context_unbind_buffer(ctx, buffer_obj);
@@ -713,85 +607,59 @@ bool yagl_host_glDeleteBuffers(GLsizei n,
 
             yagl_sharegroup_remove(ctx->base.sg,
                                    YAGL_NS_BUFFER,
-                                   buffer_names[i]);
+                                   buffers[i]);
 
             yagl_gles_buffer_release(buffer_obj);
         }
     }
-
-out:
-    return res;
 }
 
-bool yagl_host_glDeleteTextures(GLsizei n,
-    target_ulong /* const GLuint* */ textures_)
+void yagl_host_glDeleteTextures(const GLuint *textures, int32_t textures_count)
 {
-    bool res = true;
-    GLuint *texture_names = NULL;
     GLsizei i;
 
     YAGL_GET_CTX(glDeleteTextures);
 
-    if (n < 0) {
+    if (textures_count < 0) {
         YAGL_SET_ERR(GL_INVALID_VALUE);
-        goto out;
-    }
-
-    texture_names = yagl_gles_context_malloc0(ctx, n * sizeof(*texture_names));
-
-    if (textures_) {
-        if (!yagl_mem_get(textures_,
-                          n * sizeof(*texture_names),
-                          texture_names)) {
-            res = false;
-            goto out;
-        }
+        return;
     }
 
-    if (texture_names) {
-        for (i = 0; i < n; ++i) {
-            yagl_gles_context_unbind_texture(ctx, texture_names[i]);
+    if (textures) {
+        for (i = 0; i < textures_count; ++i) {
+            yagl_gles_context_unbind_texture(ctx, textures[i]);
 
             yagl_sharegroup_remove(ctx->base.sg,
                                    YAGL_NS_TEXTURE,
-                                   texture_names[i]);
+                                   textures[i]);
 
         }
     }
-
-out:
-    return res;
 }
 
-bool yagl_host_glDepthFunc(GLenum func)
+void yagl_host_glDepthFunc(GLenum func)
 {
     YAGL_GET_CTX(glDepthFunc);
 
     ctx->driver->DepthFunc(func);
-
-    return true;
 }
 
-bool yagl_host_glDepthMask(GLboolean flag)
+void yagl_host_glDepthMask(GLboolean flag)
 {
     YAGL_GET_CTX(glDepthMask);
 
     ctx->driver->DepthMask(flag);
-
-    return true;
 }
 
-bool yagl_host_glDepthRangef(GLclampf zNear,
+void yagl_host_glDepthRangef(GLclampf zNear,
     GLclampf zFar)
 {
     YAGL_GET_CTX(glDepthRangef);
 
     ctx->driver->DepthRange(zNear, zFar);
-
-    return true;
 }
 
-bool yagl_host_glDisable(GLenum cap)
+void yagl_host_glDisable(GLenum cap)
 {
     YAGL_GET_CTX(glDisable);
 
@@ -801,11 +669,9 @@ bool yagl_host_glDisable(GLenum cap)
         yagl_gles_context_active_texture_set_enabled(ctx,
             yagl_gles_texture_target_2d, false);
     }
-
-    return true;
 }
 
-bool yagl_host_glDrawArrays(GLenum mode,
+void yagl_host_glDrawArrays(GLenum mode,
     GLint first,
     GLsizei count)
 {
@@ -813,132 +679,152 @@ bool yagl_host_glDrawArrays(GLenum mode,
 
     if ((first < 0) || (count < 0)) {
         YAGL_SET_ERR(GL_INVALID_VALUE);
-        return true;
+        return;
     }
 
     if (count == 0) {
-        return true;
+        return;
     }
 
-    if (!yagl_gles_context_transfer_arrays(ctx, first, count)) {
-        return false;
-    }
+    yagl_gles_context_transfer_arrays_vbo(ctx);
 
     ctx->draw_arrays(ctx, mode, first, count);
+}
 
-    return true;
+void yagl_host_glTransferArrayYAGL(GLuint indx,
+    GLint first,
+    const GLvoid *data, int32_t data_count)
+{
+    YAGL_GET_CTX(glTransferArrayYAGL);
+
+    if (((int)indx < ctx->num_arrays) &&
+        data &&
+        (first >= 0) &&
+        (data_count > 0)) {
+        yagl_gles_array_transfer(&ctx->arrays[indx], first, data, data_count);
+    }
 }
 
-/*
- * Be sure to support 'glGetVertexAttribRangeYAGL' together with
- * this function.
- */
-bool yagl_host_glDrawElements(GLenum mode,
-    GLsizei count,
+void yagl_host_glDrawElementsIndicesYAGL(GLenum mode,
     GLenum type,
-    target_ulong /* const GLvoid* */ indices_)
+    const GLvoid *indices, int32_t indices_count)
 {
-    bool res = true;
-    GLvoid *indices = NULL;
     int index_size = 0;
-    uint32_t first_idx = UINT32_MAX, last_idx = 0;
-    int i;
+
+    YAGL_GET_CTX(glDrawElements);
+
+    if (ctx->ebo) {
+        YAGL_SET_ERR(GL_INVALID_OPERATION);
+        return;
+    }
+
+    if (indices_count < 0) {
+        YAGL_SET_ERR(GL_INVALID_VALUE);
+        return;
+    }
+
+    if (indices_count == 0) {
+        return;
+    }
+
+    if (!yagl_gles_get_index_size(type, &index_size)) {
+        YAGL_SET_ERR(GL_INVALID_VALUE);
+        return;
+    }
+
+    if (!indices) {
+        YAGL_SET_ERR(GL_INVALID_VALUE);
+        return;
+    }
+
+    yagl_gles_context_transfer_arrays_vbo(ctx);
+
+    ctx->draw_elements(ctx,
+                       mode,
+                       (indices_count / index_size),
+                       type,
+                       indices);
+}
+
+void yagl_host_glDrawElementsOffsetYAGL(GLenum mode,
+    GLenum type,
+    GLsizei offset,
+    GLsizei count)
+{
     yagl_object_name old_buffer_name = 0;
-    bool ebo_bound = false;
 
     YAGL_GET_CTX(glDrawElements);
 
+    if (!ctx->ebo) {
+        YAGL_SET_ERR(GL_INVALID_OPERATION);
+        return;
+    }
+
     if (count < 0) {
         YAGL_SET_ERR(GL_INVALID_VALUE);
-        goto out;
+        return;
     }
 
     if (count == 0) {
-        goto out;
+        return;
     }
 
-    if (ctx->ebo) {
-        if (!yagl_gles_buffer_get_minmax_index(ctx->ebo,
-                                               type,
-                                               indices_,
-                                               count,
-                                               &first_idx,
-                                               &last_idx)) {
-            YAGL_SET_ERR(GL_INVALID_VALUE);
-            goto out;
-        }
-        yagl_gles_buffer_bind(ctx->ebo,
+    yagl_gles_buffer_bind(ctx->ebo,
+                          type,
+                          false,
+                          GL_ELEMENT_ARRAY_BUFFER,
+                          &old_buffer_name);
+
+    yagl_gles_buffer_transfer(ctx->ebo,
                               type,
-                              false,
                               GL_ELEMENT_ARRAY_BUFFER,
-                              &old_buffer_name);
-        yagl_gles_buffer_transfer(ctx->ebo,
-                                  type,
-                                  GL_ELEMENT_ARRAY_BUFFER,
-                                  false);
-        ebo_bound = true;
-    } else {
-        if (!yagl_gles_get_index_size(type, &index_size)) {
-            YAGL_SET_ERR(GL_INVALID_VALUE);
-            goto out;
-        }
+                              false);
 
-        if (indices_) {
-            indices = yagl_gles_context_malloc0(ctx, index_size * count);
-            if (!yagl_mem_get(indices_,
-                              index_size * count,
-                              indices)) {
-                res = false;
-                goto out;
-            }
-        } else {
-            YAGL_SET_ERR(GL_INVALID_VALUE);
-            goto out;
-        }
-
-        for (i = 0; i < count; ++i) {
-            uint32_t idx = 0;
-            switch (type) {
-            case GL_UNSIGNED_BYTE:
-                idx = ((uint8_t*)indices)[i];
-                break;
-            case GL_UNSIGNED_SHORT:
-                idx = ((uint16_t*)indices)[i];
-                break;
-            default:
-                assert(0);
-                break;
-            }
-            if (idx < first_idx) {
-                first_idx = idx;
-            }
-            if (idx > last_idx) {
-                last_idx = idx;
-            }
-        }
-    }
-
-    if (!yagl_gles_context_transfer_arrays(ctx, first_idx, (last_idx + 1 - first_idx))) {
-        res = false;
-        goto out;
-    }
+    yagl_gles_context_transfer_arrays_vbo(ctx);
 
     ctx->draw_elements(ctx,
                        mode,
                        count,
                        type,
-                       (ctx->ebo ? (GLvoid *)(uintptr_t)indices_ : indices));
+                       (const GLvoid*)offset);
 
-out:
-    if (ebo_bound) {
-        ctx->driver->BindBuffer(GL_ELEMENT_ARRAY_BUFFER,
-                                old_buffer_name);
+    ctx->driver->BindBuffer(GL_ELEMENT_ARRAY_BUFFER,
+                            old_buffer_name);
+}
+
+void yagl_host_glGetVertexAttribRangeYAGL(GLenum type,
+    GLsizei offset,
+    GLsizei count,
+    GLint *range_first,
+    GLsizei *range_count)
+{
+    uint32_t first_idx = UINT32_MAX, last_idx = 0;
+
+    YAGL_GET_CTX(glGetVertexAttribRangesYAGL);
+
+    if (!ctx->ebo) {
+        return;
     }
 
-    return res;
+    if (!yagl_gles_buffer_get_minmax_index(ctx->ebo,
+                                           type,
+                                           offset,
+                                           count,
+                                           &first_idx,
+                                           &last_idx)) {
+        return;
+    }
+
+    if (range_first) {
+        *range_first = (GLint)first_idx;
+    }
+
+    if (range_count) {
+        *range_count = (GLsizei)(last_idx + 1 - first_idx);
+    }
 }
 
-bool yagl_host_glEnable(GLenum cap)
+void yagl_host_glEnable(GLenum cap)
 {
     YAGL_GET_CTX(glEnable);
 
@@ -948,51 +834,37 @@ bool yagl_host_glEnable(GLenum cap)
         yagl_gles_context_active_texture_set_enabled(ctx,
             yagl_gles_texture_target_2d, true);
     }
-
-    return true;
 }
 
-bool yagl_host_glFlush(void)
+void yagl_host_glFlush(void)
 {
     YAGL_GET_CTX(glFlush);
 
     ctx->driver->Flush();
-
-    return true;
 }
 
-bool yagl_host_glFrontFace(GLenum mode)
+void yagl_host_glFrontFace(GLenum mode)
 {
     YAGL_GET_CTX(glFrontFace);
 
     ctx->driver->FrontFace(mode);
-
-    return true;
 }
 
-bool yagl_host_glGenBuffers(GLsizei n,
-    target_ulong /* GLuint* */ buffers_)
+void yagl_host_glGenBuffers(GLuint *buffer_names, int32_t buffers_maxcount, int32_t *buffers_count)
 {
-    bool res = true;
     struct yagl_gles_buffer **buffers = NULL;
     GLsizei i;
-    GLuint *buffer_names = NULL;
 
     YAGL_GET_CTX(glGenBuffers);
 
-    if (n < 0) {
+    if (buffers_maxcount < 0) {
         YAGL_SET_ERR(GL_INVALID_VALUE);
         goto out;
     }
 
-    if (!yagl_mem_prepare(cur_ts->mt1, buffers_, n * sizeof(*buffer_names))) {
-        res = false;
-        goto out;
-    }
-
-    buffers = g_malloc0(n * sizeof(*buffers));
+    buffers = g_malloc0(buffers_maxcount * sizeof(*buffers));
 
-    for (i = 0; i < n; ++i) {
+    for (i = 0; i < buffers_maxcount; ++i) {
         buffers[i] = yagl_gles_buffer_create(ctx->driver);
 
         if (!buffers[i]) {
@@ -1000,51 +872,40 @@ bool yagl_host_glGenBuffers(GLsizei n,
         }
     }
 
-    buffer_names = g_malloc(n * sizeof(*buffer_names));
+    for (i = 0; i < buffers_maxcount; ++i) {
+        yagl_object_name tmp = yagl_sharegroup_add(ctx->base.sg,
+                                                   YAGL_NS_BUFFER,
+                                                   &buffers[i]->base);
 
-    for (i = 0; i < n; ++i) {
-        buffer_names[i] = yagl_sharegroup_add(ctx->base.sg,
-                                              YAGL_NS_BUFFER,
-                                              &buffers[i]->base);
+        if (buffer_names) {
+            buffer_names[i] = tmp;
+        }
     }
 
-    if (buffers_) {
-        yagl_mem_put(cur_ts->mt1, buffer_names);
-    }
+    *buffers_count = buffers_maxcount;
 
 out:
-    g_free(buffer_names);
-    for (i = 0; i < n; ++i) {
+    for (i = 0; i < buffers_maxcount; ++i) {
         yagl_gles_buffer_release(buffers[i]);
     }
     g_free(buffers);
-
-    return res;
 }
 
-bool yagl_host_glGenTextures(GLsizei n,
-    target_ulong /* GLuint* */ textures_)
+void yagl_host_glGenTextures(GLuint *texture_names, int32_t textures_maxcount, int32_t *textures_count)
 {
-    bool res = true;
     struct yagl_gles_texture **textures = NULL;
     GLsizei i;
-    GLuint *texture_names = NULL;
 
     YAGL_GET_CTX(glGenTextures);
 
-    if (n < 0) {
+    if (textures_maxcount < 0) {
         YAGL_SET_ERR(GL_INVALID_VALUE);
         goto out;
     }
 
-    if (!yagl_mem_prepare(cur_ts->mt1, textures_, n * sizeof(*texture_names))) {
-        res = false;
-        goto out;
-    }
-
-    textures = g_malloc0(n * sizeof(*textures));
+    textures = g_malloc0(textures_maxcount * sizeof(*textures));
 
-    for (i = 0; i < n; ++i) {
+    for (i = 0; i < textures_maxcount; ++i) {
         textures[i] = yagl_gles_texture_create(ctx->driver);
 
         if (!textures[i]) {
@@ -1052,50 +913,40 @@ bool yagl_host_glGenTextures(GLsizei n,
         }
     }
 
-    texture_names = g_malloc(n * sizeof(*texture_names));
+    for (i = 0; i < textures_maxcount; ++i) {
+        yagl_object_name tmp = yagl_sharegroup_add(ctx->base.sg,
+                                                   YAGL_NS_TEXTURE,
+                                                   &textures[i]->base);
 
-    for (i = 0; i < n; ++i) {
-        texture_names[i] = yagl_sharegroup_add(ctx->base.sg,
-                                               YAGL_NS_TEXTURE,
-                                               &textures[i]->base);
+        if (texture_names) {
+            texture_names[i] = tmp;
+        }
     }
 
-    if (textures_) {
-        yagl_mem_put(cur_ts->mt1, texture_names);
-    }
+    *textures_count = textures_maxcount;
 
 out:
-    g_free(texture_names);
-    for (i = 0; i < n; ++i) {
+    for (i = 0; i < textures_maxcount; ++i) {
         yagl_gles_texture_release(textures[i]);
     }
     g_free(textures);
-
-    return res;
 }
 
-bool yagl_host_glGetBooleanv(GLenum pname,
-    target_ulong /* GLboolean* */ params_)
+void yagl_host_glGetBooleanv(GLenum pname,
+    GLboolean *params, int32_t params_maxcount, int32_t *params_count)
 {
-    bool res = true;
-    int count = 0;
-    GLboolean *params = NULL;
-
     YAGL_GET_CTX(glGetBooleanv);
 
-    if (!ctx->get_param_count(ctx, pname, &count)) {
+    if (!ctx->get_param_count(ctx, pname, params_count)) {
         YAGL_LOG_ERROR("Bad pname = 0x%X", pname);
         YAGL_SET_ERR(GL_INVALID_ENUM);
-        goto out;
+        return;
     }
 
-    if (!yagl_mem_prepare(cur_ts->mt1, params_, count * sizeof(*params))) {
-        res = false;
-        goto out;
+    if (!params) {
+        return;
     }
 
-    params = yagl_gles_context_malloc0(ctx, count * sizeof(*params));
-
     if (!ctx->get_booleanv(ctx, pname, params)) {
         GLint param;
 
@@ -1105,30 +956,17 @@ bool yagl_host_glGetBooleanv(GLenum pname,
             ctx->driver->GetBooleanv(pname, params);
         }
     }
-
-    if (params_) {
-        yagl_mem_put(cur_ts->mt1, params);
-    }
-
-out:
-    return res;
 }
 
-bool yagl_host_glGetBufferParameteriv(GLenum target,
+void yagl_host_glGetBufferParameteriv(GLenum target,
     GLenum pname,
-    target_ulong /* GLint* */ params_)
+    GLint *param)
 {
-    bool res = true;
     struct yagl_gles_buffer *buffer_obj = NULL;
-    GLint param = 0;
+    GLint tmp = 0;
 
     YAGL_GET_CTX(glGetBufferParameteriv);
 
-    if (!yagl_mem_prepare_GLint(cur_ts->mt1, params_)) {
-        res = false;
-        goto out;
-    }
-
     if (!yagl_gles_is_buffer_target_valid(target)) {
         YAGL_SET_ERR(GL_INVALID_ENUM);
         goto out;
@@ -1143,56 +981,45 @@ bool yagl_host_glGetBufferParameteriv(GLenum target,
 
     if (!yagl_gles_buffer_get_parameter(buffer_obj,
                                         pname,
-                                        &param)) {
+                                        &tmp)) {
         YAGL_SET_ERR(GL_INVALID_ENUM);
         goto out;
     }
 
-    if (params_) {
-        yagl_mem_put_GLint(cur_ts->mt1, param);
+    if (param) {
+        *param = tmp;
     }
 
 out:
     yagl_gles_buffer_release(buffer_obj);
-
-    return res;
 }
 
-bool yagl_host_glGetError(GLenum* retval)
+GLenum yagl_host_glGetError(void)
 {
-    YAGL_GET_CTX_RET(glGetError, GL_NO_ERROR);
+    GLenum ret;
 
-    *retval = yagl_gles_context_get_error(ctx);
+    YAGL_GET_CTX_RET(glGetError, GL_NO_ERROR);
 
-    if (*retval == GL_NO_ERROR) {
-        *retval = ctx->driver->GetError();
-    }
+    ret = yagl_gles_context_get_error(ctx);
 
-    return true;
+    return (ret == GL_NO_ERROR) ? ctx->driver->GetError() : ret;
 }
 
-bool yagl_host_glGetFloatv(GLenum pname,
-    target_ulong /* GLfloat* */ params_)
+void yagl_host_glGetFloatv(GLenum pname,
+    GLfloat *params, int32_t params_maxcount, int32_t *params_count)
 {
-    bool res = true;
-    int count = 0;
-    GLfloat *params = NULL;
-
     YAGL_GET_CTX(glGetFloatv);
 
-    if (!ctx->get_param_count(ctx, pname, &count)) {
+    if (!ctx->get_param_count(ctx, pname, params_count)) {
         YAGL_LOG_ERROR("Bad pname = 0x%X", pname);
         YAGL_SET_ERR(GL_INVALID_ENUM);
-        goto out;
+        return;
     }
 
-    if (!yagl_mem_prepare(cur_ts->mt1, params_, count * sizeof(*params))) {
-        res = false;
-        goto out;
+    if (!params) {
+        return;
     }
 
-    params = yagl_gles_context_malloc0(ctx, count * sizeof(*params));
-
     if (!ctx->get_floatv(ctx, pname, params)) {
         GLint param;
 
@@ -1202,258 +1029,209 @@ bool yagl_host_glGetFloatv(GLenum pname,
             ctx->driver->GetFloatv(pname, params);
         }
     }
-
-    if (params_) {
-        yagl_mem_put(cur_ts->mt1, params);
-    }
-
-out:
-    return res;
 }
 
-bool yagl_host_glGetIntegerv(GLenum pname,
-    target_ulong /* GLint* */ params_)
+void yagl_host_glGetIntegerv(GLenum pname,
+    GLint *params, int32_t params_maxcount, int32_t *params_count)
 {
-    bool res = true;
-    int count = 0;
-    GLint *params = NULL;
-
     YAGL_GET_CTX(glGetIntegerv);
 
-    if (!ctx->get_param_count(ctx, pname, &count)) {
+    if (!ctx->get_param_count(ctx, pname, params_count)) {
         YAGL_LOG_ERROR("Bad pname = 0x%X", pname);
         YAGL_SET_ERR(GL_INVALID_ENUM);
-        goto out;
+        return;
     }
 
-    if (!yagl_mem_prepare(cur_ts->mt1, params_, count * sizeof(*params))) {
-        res = false;
-        goto out;
+    if (!params) {
+        return;
     }
 
-    params = yagl_gles_context_malloc0(ctx, count * sizeof(*params));
-
     if (!ctx->get_integerv(ctx, pname, params)) {
         if (!yagl_get_integer(ctx, pname, params)) {
             ctx->driver->GetIntegerv(pname, params);
         }
     }
-
-    if (params_) {
-        yagl_mem_put(cur_ts->mt1, params);
-    }
-
-out:
-    return res;
 }
 
-bool yagl_host_glGetTexParameterfv(GLenum target,
+void yagl_host_glGetTexParameterfv(GLenum target,
     GLenum pname,
-    target_ulong /* GLfloat* */ params_)
+    GLfloat *param)
 {
     GLfloat params[10];
 
     YAGL_GET_CTX(glGetTexParameterfv);
 
-    if (!yagl_mem_prepare_GLfloat(cur_ts->mt1, params_)) {
-        return false;
-    }
-
     ctx->driver->GetTexParameterfv(target,
                                    pname,
                                    params);
 
-    if (params_) {
-        yagl_mem_put_GLfloat(cur_ts->mt1, params[0]);
+    if (param) {
+        *param = params[0];
     }
-
-    return true;
 }
 
-bool yagl_host_glGetTexParameteriv(GLenum target,
+void yagl_host_glGetTexParameteriv(GLenum target,
     GLenum pname,
-    target_ulong /* GLint* */ params_)
+    GLint *param)
 {
     GLint params[10];
 
     YAGL_GET_CTX(glGetTexParameteriv);
 
-    if (!yagl_mem_prepare_GLint(cur_ts->mt1, params_)) {
-        return false;
-    }
-
     ctx->driver->GetTexParameteriv(target,
                                    pname,
                                    params);
 
-    if (params_) {
-        yagl_mem_put_GLint(cur_ts->mt1, params[0]);
+    if (param) {
+        *param = params[0];
     }
-
-    return true;
 }
 
-bool yagl_host_glHint(GLenum target,
+void yagl_host_glHint(GLenum target,
     GLenum mode)
 {
     YAGL_GET_CTX(glHint);
 
     ctx->driver->Hint(target, mode);
-
-    return true;
 }
 
-bool yagl_host_glIsBuffer(GLboolean* retval, GLuint buffer)
+GLboolean yagl_host_glIsBuffer(GLuint buffer)
 {
+    GLboolean res = GL_FALSE;
     struct yagl_gles_buffer *buffer_obj = NULL;
 
     YAGL_GET_CTX_RET(glIsBuffer, GL_FALSE);
 
-    *retval = GL_FALSE;
-
     buffer_obj = (struct yagl_gles_buffer*)yagl_sharegroup_acquire_object(ctx->base.sg,
         YAGL_NS_BUFFER, buffer);
 
     if (buffer_obj && yagl_gles_buffer_was_bound(buffer_obj)) {
-        *retval = GL_TRUE;
+        res = GL_TRUE;
     }
 
     yagl_gles_buffer_release(buffer_obj);
 
-    return true;
+    return res;
 }
 
-bool yagl_host_glIsEnabled(GLboolean* retval, GLenum cap)
+GLboolean yagl_host_glIsEnabled(GLenum cap)
 {
+    GLboolean res = GL_FALSE;
+
     YAGL_GET_CTX_RET(glIsEnabled, GL_FALSE);
 
-    if (!ctx->is_enabled(ctx, retval, cap)) {
-        *retval = ctx->driver->IsEnabled(cap);
+    if (!ctx->is_enabled(ctx, &res, cap)) {
+        res = ctx->driver->IsEnabled(cap);
     }
 
-    return true;
+    return res;
 }
 
-bool yagl_host_glIsTexture(GLboolean* retval, GLuint texture)
+GLboolean yagl_host_glIsTexture(GLuint texture)
 {
+    GLboolean res = GL_FALSE;
     struct yagl_gles_texture *texture_obj = NULL;
 
     YAGL_GET_CTX_RET(glIsTexture, GL_FALSE);
 
-    *retval = GL_FALSE;
-
     texture_obj = (struct yagl_gles_texture*)yagl_sharegroup_acquire_object(ctx->base.sg,
         YAGL_NS_TEXTURE, texture);
 
     if (texture_obj && (yagl_gles_texture_get_target(texture_obj) != 0)) {
-        *retval = GL_TRUE;
+        res = GL_TRUE;
     }
 
     yagl_gles_texture_release(texture_obj);
 
-    return true;
+    return res;
 }
 
-bool yagl_host_glLineWidth(GLfloat width)
+void yagl_host_glLineWidth(GLfloat width)
 {
     YAGL_GET_CTX(glLineWidth);
 
     ctx->driver->LineWidth(width);
-
-    return true;
 }
 
-bool yagl_host_glPixelStorei(GLenum pname,
+void yagl_host_glPixelStorei(GLenum pname,
     GLint param)
 {
     YAGL_GET_CTX(glPixelStorei);
 
     ctx->driver->PixelStorei(pname, param);
-
-    return true;
 }
 
-bool yagl_host_glPolygonOffset(GLfloat factor,
+void yagl_host_glPolygonOffset(GLfloat factor,
     GLfloat units)
 {
     YAGL_GET_CTX(glPolygonOffset);
 
     ctx->driver->PolygonOffset(factor, units);
-
-    return true;
 }
 
-bool yagl_host_glReadPixels(GLint x,
+void yagl_host_glReadPixels(GLint x,
     GLint y,
     GLsizei width,
     GLsizei height,
     GLenum format,
     GLenum type,
-    target_ulong /* GLvoid* */ pixels_)
+    GLvoid *pixels, int32_t pixels_maxcount, int32_t *pixels_count)
 {
-    bool res = true;
     yagl_object_name current_pbo = 0;
-    GLvoid *pixels = NULL;
+    GLint err;
     GLsizei stride = 0;
     GLenum actual_type = yagl_get_actual_type(type);
 
     YAGL_GET_CTX(glReadPixels);
 
-    if (pixels_ && (width > 0) && (height > 0)) {
-        GLint err = yagl_get_stride(ctx,
-                                    GL_PACK_ALIGNMENT,
-                                    width,
-                                    format,
-                                    type,
-                                    &stride);
+    if (!pixels || (width <= 0) || (height <= 0)) {
+        return;
+    }
 
-        if (err != GL_NO_ERROR) {
-            YAGL_SET_ERR(err);
-            goto out;
-        }
-        if (!yagl_mem_prepare(cur_ts->mt1, pixels_, stride * height)) {
-            res = false;
-            goto out;
-        }
-        pixels = yagl_gles_context_malloc(ctx, stride * height);
-        ctx->driver->GetIntegerv(GL_PIXEL_PACK_BUFFER_BINDING_ARB,
-                                 (GLint*)&current_pbo);
-        if (current_pbo != 0) {
-            ctx->driver->BindBuffer(GL_PIXEL_PACK_BUFFER_ARB,
-                                    0);
-        }
+    err = yagl_get_stride(ctx,
+                          GL_PACK_ALIGNMENT,
+                          width,
+                          format,
+                          type,
+                          &stride);
 
-        ctx->driver->ReadPixels(x,
-                                y,
-                                width,
-                                height,
-                                format,
-                                actual_type,
-                                pixels);
-
-        if (current_pbo != 0) {
-            ctx->driver->BindBuffer(GL_PIXEL_PACK_BUFFER_ARB,
-                                    current_pbo);
-        }
+    if (err != GL_NO_ERROR) {
+        YAGL_SET_ERR(err);
+        return;
+    }
 
-        yagl_mem_put(cur_ts->mt1, pixels);
+    ctx->driver->GetIntegerv(GL_PIXEL_PACK_BUFFER_BINDING_ARB,
+                             (GLint*)&current_pbo);
+    if (current_pbo != 0) {
+        ctx->driver->BindBuffer(GL_PIXEL_PACK_BUFFER_ARB,
+                                0);
     }
 
-out:
-    return res;
+    *pixels_count = stride * height;
+
+    ctx->driver->ReadPixels(x,
+                            y,
+                            width,
+                            height,
+                            format,
+                            actual_type,
+                            pixels);
+
+    if (current_pbo != 0) {
+        ctx->driver->BindBuffer(GL_PIXEL_PACK_BUFFER_ARB,
+                                current_pbo);
+    }
 }
 
-bool yagl_host_glSampleCoverage(GLclampf value,
+void yagl_host_glSampleCoverage(GLclampf value,
     GLboolean invert)
 {
     YAGL_GET_CTX(glSampleCoverage);
 
     ctx->driver->SampleCoverage(value, invert);
-
-    return true;
 }
 
-bool yagl_host_glScissor(GLint x,
+void yagl_host_glScissor(GLint x,
     GLint y,
     GLsizei width,
     GLsizei height)
@@ -1461,42 +1239,34 @@ bool yagl_host_glScissor(GLint x,
     YAGL_GET_CTX(glScissor);
 
     ctx->driver->Scissor(x, y, width, height);
-
-    return true;
 }
 
-bool yagl_host_glStencilFunc(GLenum func,
+void yagl_host_glStencilFunc(GLenum func,
     GLint ref,
     GLuint mask)
 {
     YAGL_GET_CTX(glStencilFunc);
 
     ctx->driver->StencilFunc(func, ref, mask);
-
-    return true;
 }
 
-bool yagl_host_glStencilMask(GLuint mask)
+void yagl_host_glStencilMask(GLuint mask)
 {
     YAGL_GET_CTX(glStencilMask);
 
     ctx->driver->StencilMask(mask);
-
-    return true;
 }
 
-bool yagl_host_glStencilOp(GLenum fail,
+void yagl_host_glStencilOp(GLenum fail,
     GLenum zfail,
     GLenum zpass)
 {
     YAGL_GET_CTX(glStencilOp);
 
     ctx->driver->StencilOp(fail, zfail, zpass);
-
-    return true;
 }
 
-bool yagl_host_glTexImage2D(GLenum target,
+void yagl_host_glTexImage2D(GLenum target,
     GLint level,
     GLint internalformat,
     GLsizei width,
@@ -1504,17 +1274,15 @@ bool yagl_host_glTexImage2D(GLenum target,
     GLint border,
     GLenum format,
     GLenum type,
-    target_ulong /* const GLvoid* */ pixels_)
+    const GLvoid *pixels, int32_t pixels_count)
 {
-    bool res = true;
-    GLvoid *pixels = NULL;
     GLsizei stride = 0;
     GLenum actual_type = yagl_get_actual_type(type);
     GLint actual_internalformat = yagl_get_actual_internalformat(internalformat);
 
     YAGL_GET_CTX(glTexImage2D);
 
-    if (pixels_ && (width > 0) && (height > 0)) {
+    if (pixels && (width > 0) && (height > 0)) {
         GLint err = yagl_get_stride(ctx,
                                     GL_UNPACK_ALIGNMENT,
                                     width,
@@ -1524,15 +1292,10 @@ bool yagl_host_glTexImage2D(GLenum target,
 
         if (err != GL_NO_ERROR) {
             YAGL_SET_ERR(err);
-            goto out;
-        }
-        pixels = yagl_gles_context_malloc(ctx, stride * height);
-        if (!yagl_mem_get(pixels_,
-                          stride * height,
-                          pixels)) {
-            res = false;
-            goto out;
+            return;
         }
+    } else {
+        pixels = NULL;
     }
 
     if (target == GL_TEXTURE_2D) {
@@ -1563,86 +1326,65 @@ bool yagl_host_glTexImage2D(GLenum target,
                             format,
                             actual_type,
                             pixels);
-
-out:
-    return res;
 }
 
-bool yagl_host_glTexParameterf(GLenum target,
+void yagl_host_glTexParameterf(GLenum target,
     GLenum pname,
     GLfloat param)
 {
     YAGL_GET_CTX(glTexParameterf);
 
     ctx->driver->TexParameterf(target, pname, param);
-
-    return true;
 }
 
-bool yagl_host_glTexParameterfv(GLenum target,
+void yagl_host_glTexParameterfv(GLenum target,
     GLenum pname,
-    target_ulong /* const GLfloat* */ params_)
+    const GLfloat *params, int32_t params_count)
 {
-    bool res = true;
-    GLfloat params[10];
+    GLfloat tmp[10];
 
     YAGL_GET_CTX(glTexParameterfv);
 
-    memset(params, 0, sizeof(params));
+    memset(tmp, 0, sizeof(tmp));
 
-    if (params_) {
-        if (!yagl_mem_get_GLfloat(params_, params)) {
-            res = false;
-            goto out;
-        }
+    if (params) {
+        tmp[0] = *params;
     }
 
     ctx->driver->TexParameterfv(target,
                                 pname,
-                                (params_ ? params : NULL));
-
-out:
-    return res;
+                                (params ? tmp : NULL));
 }
 
-bool yagl_host_glTexParameteri(GLenum target,
+void yagl_host_glTexParameteri(GLenum target,
     GLenum pname,
     GLint param)
 {
     YAGL_GET_CTX(glTexParameteri);
 
     ctx->driver->TexParameteri(target, pname, param);
-
-    return true;
 }
 
-bool yagl_host_glTexParameteriv(GLenum target,
+void yagl_host_glTexParameteriv(GLenum target,
     GLenum pname,
-    target_ulong /* const GLint* */ params_)
+    const GLint *params, int32_t params_count)
 {
-    bool res = true;
-    GLint params[10];
+    GLint tmp[10];
 
     YAGL_GET_CTX(glTexParameteriv);
 
-    memset(params, 0, sizeof(params));
+    memset(tmp, 0, sizeof(tmp));
 
-    if (params_) {
-        if (!yagl_mem_get_GLint(params_, params)) {
-            res = false;
-            goto out;
-        }
+    if (params) {
+        tmp[0] = *params;
     }
 
     ctx->driver->TexParameteriv(target,
                                 pname,
-                                (params_ ? params : NULL));
-
-out:
-    return res;
+                                (params ? tmp : NULL));
 }
 
-bool yagl_host_glTexSubImage2D(GLenum target,
+void yagl_host_glTexSubImage2D(GLenum target,
     GLint level,
     GLint xoffset,
     GLint yoffset,
@@ -1650,16 +1392,14 @@ bool yagl_host_glTexSubImage2D(GLenum target,
     GLsizei height,
     GLenum format,
     GLenum type,
-    target_ulong /* const GLvoid* */ pixels_)
+    const GLvoid *pixels, int32_t pixels_count)
 {
-    bool res = true;
-    GLvoid *pixels = NULL;
     GLsizei stride = 0;
     GLenum actual_type = yagl_get_actual_type(type);
 
     YAGL_GET_CTX(glTexSubImage2D);
 
-    if (pixels_ && (width > 0) && (height > 0)) {
+    if (pixels && (width > 0) && (height > 0)) {
         GLint err = yagl_get_stride(ctx,
                                     GL_UNPACK_ALIGNMENT,
                                     width,
@@ -1669,15 +1409,10 @@ bool yagl_host_glTexSubImage2D(GLenum target,
 
         if (err != GL_NO_ERROR) {
             YAGL_SET_ERR(err);
-            goto out;
-        }
-        pixels = yagl_gles_context_malloc(ctx, stride * height);
-        if (!yagl_mem_get(pixels_,
-                          stride * height,
-                          pixels)) {
-            res = false;
-            goto out;
+            return;
         }
+    } else {
+        pixels = NULL;
     }
 
     /*
@@ -1704,12 +1439,9 @@ bool yagl_host_glTexSubImage2D(GLenum target,
         ctx->driver->PixelStorei(GL_UNPACK_ROW_LENGTH,
                                  0);
     }
-
-out:
-    return res;
 }
 
-bool yagl_host_glViewport(GLint x,
+void yagl_host_glViewport(GLint x,
     GLint y,
     GLsizei width,
     GLsizei height)
@@ -1717,11 +1449,9 @@ bool yagl_host_glViewport(GLint x,
     YAGL_GET_CTX(glViewport);
 
     ctx->driver->Viewport(x, y, width, height);
-
-    return true;
 }
 
-bool yagl_host_glEGLImageTargetTexture2DOES(GLenum target,
+void yagl_host_glEGLImageTargetTexture2DOES(GLenum target,
     yagl_host_handle image_)
 {
     struct yagl_gles_image *image = NULL;
@@ -1754,144 +1484,38 @@ bool yagl_host_glEGLImageTargetTexture2DOES(GLenum target,
 
 out:
     yagl_gles_image_release(image);
-
-    return true;
-}
-
-bool yagl_host_glGetExtensionStringYAGL(GLuint* retval, target_ulong /* GLchar* */ str_)
-{
-    bool res = true;
-    GLchar *str = NULL;
-    GLuint str_len;
-
-    YAGL_GET_CTX_RET(glGetExtensionStringYAGL, 1);
-
-    str = ctx->get_extensions(ctx);
-
-    str_len = strlen(str);
-
-    if (!yagl_mem_prepare(cur_ts->mt1, str_, str_len + 1)) {
-        res = false;
-        goto out;
-    }
-
-    if (str_) {
-        yagl_mem_put(cur_ts->mt1, str);
-    }
-
-    *retval = str_len + 1;
-
-out:
-    g_free(str);
-
-    return res;
 }
 
-bool yagl_host_glGetVertexAttribRangeYAGL(GLsizei count,
-    GLenum type,
-    target_ulong /* const GLvoid* */ indices_,
-    target_ulong /* GLint* */ range_first_,
-    target_ulong /* GLsizei* */ range_count_)
+void yagl_host_glGetExtensionStringYAGL(GLchar *str, int32_t str_maxcount, int32_t *str_count)
 {
-    bool res = true;
-    GLvoid *indices = NULL;
-    int index_size = 0;
-    uint32_t first_idx = UINT32_MAX, last_idx = 0;
-    int i;
+    GLchar *tmp = NULL;
 
-    YAGL_GET_CTX(glGetVertexAttribRangesYAGL);
+    YAGL_GET_CTX(glGetExtensionStringYAGL);
 
-    if (!yagl_mem_prepare_GLint(cur_ts->mt1, range_first_) ||
-        !yagl_mem_prepare_GLsizei(cur_ts->mt2, range_count_)) {
-        res = false;
-        goto out;
-    }
-
-    if (ctx->ebo) {
-        if (!yagl_gles_buffer_get_minmax_index(ctx->ebo,
-                                               type,
-                                               indices_,
-                                               count,
-                                               &first_idx,
-                                               &last_idx)) {
-            goto out;
-        }
-    } else {
-        if (!yagl_gles_get_index_size(type, &index_size)) {
-            goto out;
-        }
+    tmp = ctx->get_extensions(ctx);
 
-        if (indices_) {
-            indices = yagl_gles_context_malloc0(ctx, index_size * count);
-            if (!yagl_mem_get(indices_,
-                              index_size * count,
-                              indices)) {
-                res = false;
-                goto out;
-            }
-        } else {
-            goto out;
-        }
+    *str_count = strlen(tmp) + 1;
 
-        for (i = 0; i < count; ++i) {
-            uint32_t idx = 0;
-            switch (type) {
-            case GL_UNSIGNED_BYTE:
-                idx = ((uint8_t*)indices)[i];
-                break;
-            case GL_UNSIGNED_SHORT:
-                idx = ((uint16_t*)indices)[i];
-                break;
-            default:
-                assert(0);
-                break;
-            }
-            if (idx < first_idx) {
-                first_idx = idx;
-            }
-            if (idx > last_idx) {
-                last_idx = idx;
-            }
-        }
+    if (str) {
+        memcpy(str, tmp, MIN(*str_count, str_maxcount));
     }
 
-    if (range_first_) {
-        yagl_mem_put_GLint(cur_ts->mt1, (GLint)first_idx);
-    }
-
-    if (range_count_) {
-        yagl_mem_put_GLsizei(cur_ts->mt2, (GLsizei)(last_idx + 1 - first_idx));
-    }
-
-out:
-    return res;
+    g_free(tmp);
 }
 
-bool yagl_host_glEGLUpdateOffscreenImageYAGL(struct yagl_client_image *image,
+void yagl_host_glEGLUpdateOffscreenImageYAGL(struct yagl_client_image *image,
     uint32_t width,
     uint32_t height,
     uint32_t bpp,
-    target_ulong /* const void* */ pixels_)
+    const void *pixels)
 {
     struct yagl_gles_image *gles_image = (struct yagl_gles_image*)image;
-    bool res = true;
-    void *pixels = NULL;
     GLenum format = 0;
     GLuint cur_tex = 0;
     GLsizei unpack_alignment = 0;
 
     YAGL_GET_CTX(glEGLUpdateOffscreenImageYAGL);
 
-    if (pixels_ && (width > 0) && (height > 0) && (bpp > 0)) {
-        pixels = yagl_gles_context_malloc(ctx, width * height * bpp);
-        if (!yagl_mem_get(pixels_,
-                          width * height * bpp,
-                          pixels)) {
-            res = false;
-            goto out;
-        }
-    }
-
     switch (bpp) {
     case 3:
         format = GL_RGB;
@@ -1901,7 +1525,7 @@ bool yagl_host_glEGLUpdateOffscreenImageYAGL(struct yagl_client_image *image,
         break;
     default:
         YAGL_LOG_ERROR("bad bpp - %u", bpp);
-        goto out;
+        return;
     }
 
     ctx->driver->GetIntegerv(GL_TEXTURE_BINDING_2D,
@@ -1934,33 +1558,28 @@ bool yagl_host_glEGLUpdateOffscreenImageYAGL(struct yagl_client_image *image,
 
     ctx->driver->BindTexture(GL_TEXTURE_2D,
                              cur_tex);
-
-out:
-    return res;
 }
 
-bool yagl_host_glIsRenderbuffer(GLboolean* retval,
-    GLuint renderbuffer)
+GLboolean yagl_host_glIsRenderbuffer(GLuint renderbuffer)
 {
+    GLboolean res = GL_FALSE;
     struct yagl_gles_renderbuffer *renderbuffer_obj = NULL;
 
     YAGL_GET_CTX_RET(glIsRenderbuffer, GL_FALSE);
 
-    *retval = GL_FALSE;
-
     renderbuffer_obj = (struct yagl_gles_renderbuffer*)yagl_sharegroup_acquire_object(ctx->base.sg,
         YAGL_NS_RENDERBUFFER, renderbuffer);
 
     if (renderbuffer_obj && yagl_gles_renderbuffer_was_bound(renderbuffer_obj)) {
-        *retval = GL_TRUE;
+        res = GL_TRUE;
     }
 
     yagl_gles_renderbuffer_release(renderbuffer_obj);
 
-    return true;
+    return res;
 }
 
-bool yagl_host_glBindRenderbuffer(GLenum target,
+void yagl_host_glBindRenderbuffer(GLenum target,
     GLuint renderbuffer)
 {
     struct yagl_gles_renderbuffer *renderbuffer_obj = NULL;
@@ -1998,72 +1617,45 @@ bool yagl_host_glBindRenderbuffer(GLenum target,
 
 out:
     yagl_gles_renderbuffer_release(renderbuffer_obj);
-
-    return true;
 }
 
-bool yagl_host_glDeleteRenderbuffers(GLsizei n,
-    target_ulong /* const GLuint* */ renderbuffers_)
+void yagl_host_glDeleteRenderbuffers(const GLuint *renderbuffers, int32_t renderbuffers_count)
 {
-    bool res = true;
-    GLuint *renderbuffer_names = NULL;
     GLsizei i;
 
     YAGL_GET_CTX(glDeleteRenderbuffers);
 
-    if (n < 0) {
+    if (renderbuffers_count < 0) {
         YAGL_SET_ERR(GL_INVALID_VALUE);
-        goto out;
+        return;
     }
 
-    renderbuffer_names = yagl_gles_context_malloc0(ctx, n * sizeof(*renderbuffer_names));
-
-    if (renderbuffers_) {
-        if (!yagl_mem_get(renderbuffers_,
-                          n * sizeof(*renderbuffer_names),
-                          renderbuffer_names)) {
-            res = false;
-            goto out;
-        }
-    }
-
-    if (renderbuffer_names) {
-        for (i = 0; i < n; ++i) {
-            yagl_gles_context_unbind_renderbuffer(ctx, renderbuffer_names[i]);
+    if (renderbuffers) {
+        for (i = 0; i < renderbuffers_count; ++i) {
+            yagl_gles_context_unbind_renderbuffer(ctx, renderbuffers[i]);
 
             yagl_sharegroup_remove(ctx->base.sg,
                                    YAGL_NS_RENDERBUFFER,
-                                   renderbuffer_names[i]);
+                                   renderbuffers[i]);
         }
     }
-
-out:
-    return res;
 }
 
-bool yagl_host_glGenRenderbuffers(GLsizei n,
-    target_ulong /* GLuint* */ renderbuffers_)
+void yagl_host_glGenRenderbuffers(GLuint *renderbuffer_names, int32_t renderbuffers_maxcount, int32_t *renderbuffers_count)
 {
-    bool res = true;
     struct yagl_gles_renderbuffer **renderbuffers = NULL;
     GLsizei i;
-    GLuint *renderbuffer_names = NULL;
 
     YAGL_GET_CTX(glGenRenderbuffers);
 
-    if (n < 0) {
+    if (renderbuffers_maxcount < 0) {
         YAGL_SET_ERR(GL_INVALID_VALUE);
         goto out;
     }
 
-    if (!yagl_mem_prepare(cur_ts->mt1, renderbuffers_, n * sizeof(*renderbuffer_names))) {
-        res = false;
-        goto out;
-    }
+    renderbuffers = g_malloc0(renderbuffers_maxcount * sizeof(*renderbuffers));
 
-    renderbuffers = g_malloc0(n * sizeof(*renderbuffers));
-
-    for (i = 0; i < n; ++i) {
+    for (i = 0; i < renderbuffers_maxcount; ++i) {
         renderbuffers[i] = yagl_gles_renderbuffer_create(ctx->driver);
 
         if (!renderbuffers[i]) {
@@ -2071,29 +1663,26 @@ bool yagl_host_glGenRenderbuffers(GLsizei n,
         }
     }
 
-    renderbuffer_names = g_malloc(n * sizeof(*renderbuffer_names));
+    for (i = 0; i < renderbuffers_maxcount; ++i) {
+        yagl_object_name tmp = yagl_sharegroup_add(ctx->base.sg,
+                                                   YAGL_NS_RENDERBUFFER,
+                                                   &renderbuffers[i]->base);
 
-    for (i = 0; i < n; ++i) {
-        renderbuffer_names[i] = yagl_sharegroup_add(ctx->base.sg,
-                                                    YAGL_NS_RENDERBUFFER,
-                                                    &renderbuffers[i]->base);
+        if (renderbuffer_names) {
+            renderbuffer_names[i] = tmp;
+        }
     }
 
-    if (renderbuffers_) {
-        yagl_mem_put(cur_ts->mt1, renderbuffer_names);
-    }
+    *renderbuffers_count = renderbuffers_maxcount;
 
 out:
-    g_free(renderbuffer_names);
-    for (i = 0; i < n; ++i) {
+    for (i = 0; i < renderbuffers_maxcount; ++i) {
         yagl_gles_renderbuffer_release(renderbuffers[i]);
     }
     g_free(renderbuffers);
-
-    return res;
 }
 
-bool yagl_host_glRenderbufferStorage(GLenum target,
+void yagl_host_glRenderbufferStorage(GLenum target,
     GLenum internalformat,
     GLsizei width,
     GLsizei height)
@@ -2104,55 +1693,45 @@ bool yagl_host_glRenderbufferStorage(GLenum target,
                                      internalformat,
                                      width,
                                      height);
-
-    return true;
 }
 
-bool yagl_host_glGetRenderbufferParameteriv(GLenum target,
+void yagl_host_glGetRenderbufferParameteriv(GLenum target,
     GLenum pname,
-    target_ulong /* GLint* */ params_)
+    GLint *param)
 {
     GLint params[10];
 
     YAGL_GET_CTX(glGetRenderbufferParameteriv);
 
-    if (!yagl_mem_prepare_GLint(cur_ts->mt1, params_)) {
-        return false;
-    }
-
     ctx->driver->GetRenderbufferParameteriv(target,
                                             pname,
                                             params);
 
-    if (params_) {
-        yagl_mem_put_GLint(cur_ts->mt1, params[0]);
+    if (param) {
+        *param = params[0];
     }
-
-    return true;
 }
 
-bool yagl_host_glIsFramebuffer(GLboolean* retval,
-    GLuint framebuffer)
+GLboolean yagl_host_glIsFramebuffer(GLuint framebuffer)
 {
+    GLboolean res = GL_FALSE;
     struct yagl_gles_framebuffer *framebuffer_obj = NULL;
 
     YAGL_GET_CTX_RET(glIsFramebuffer, GL_FALSE);
 
-    *retval = GL_FALSE;
-
     framebuffer_obj = (struct yagl_gles_framebuffer*)yagl_sharegroup_acquire_object(ctx->base.sg,
         YAGL_NS_FRAMEBUFFER, framebuffer);
 
     if (framebuffer_obj && yagl_gles_framebuffer_was_bound(framebuffer_obj)) {
-        *retval = GL_TRUE;
+        res = GL_TRUE;
     }
 
     yagl_gles_framebuffer_release(framebuffer_obj);
 
-    return true;
+    return res;
 }
 
-bool yagl_host_glBindFramebuffer(GLenum target,
+void yagl_host_glBindFramebuffer(GLenum target,
     GLuint framebuffer)
 {
     struct yagl_gles_framebuffer *framebuffer_obj = NULL;
@@ -2190,73 +1769,46 @@ bool yagl_host_glBindFramebuffer(GLenum target,
 
 out:
     yagl_gles_framebuffer_release(framebuffer_obj);
-
-    return true;
 }
 
 
-bool yagl_host_glDeleteFramebuffers(GLsizei n,
-    target_ulong /* const GLuint* */ framebuffers_)
+void yagl_host_glDeleteFramebuffers(const GLuint *framebuffers, int32_t framebuffers_count)
 {
-    bool res = true;
-    GLuint *framebuffer_names = NULL;
     GLsizei i;
 
     YAGL_GET_CTX(glDeleteFramebuffers);
 
-    if (n < 0) {
+    if (framebuffers_count < 0) {
         YAGL_SET_ERR(GL_INVALID_VALUE);
-        goto out;
-    }
-
-    framebuffer_names = yagl_gles_context_malloc0(ctx, n * sizeof(*framebuffer_names));
-
-    if (framebuffers_) {
-        if (!yagl_mem_get(framebuffers_,
-                          n * sizeof(*framebuffer_names),
-                          framebuffer_names)) {
-            res = false;
-            goto out;
-        }
+        return;
     }
 
-    if (framebuffer_names) {
-        for (i = 0; i < n; ++i) {
-            yagl_gles_context_unbind_framebuffer(ctx, framebuffer_names[i]);
+    if (framebuffers) {
+        for (i = 0; i < framebuffers_count; ++i) {
+            yagl_gles_context_unbind_framebuffer(ctx, framebuffers[i]);
 
             yagl_sharegroup_remove(ctx->base.sg,
                                    YAGL_NS_FRAMEBUFFER,
-                                   framebuffer_names[i]);
+                                   framebuffers[i]);
         }
     }
-
-out:
-    return res;
 }
 
-bool yagl_host_glGenFramebuffers(GLsizei n,
-    target_ulong /* GLuint* */ framebuffers_)
+void yagl_host_glGenFramebuffers(GLuint *framebuffer_names, int32_t framebuffers_maxcount, int32_t *framebuffers_count)
 {
-    bool res = true;
     struct yagl_gles_framebuffer **framebuffers = NULL;
     GLsizei i;
-    GLuint *framebuffer_names = NULL;
 
     YAGL_GET_CTX(glGenFramebuffers);
 
-    if (n < 0) {
+    if (framebuffers_maxcount < 0) {
         YAGL_SET_ERR(GL_INVALID_VALUE);
         goto out;
     }
 
-    if (!yagl_mem_prepare(cur_ts->mt1, framebuffers_, n * sizeof(*framebuffer_names))) {
-        res = false;
-        goto out;
-    }
-
-    framebuffers = g_malloc0(n * sizeof(*framebuffers));
+    framebuffers = g_malloc0(framebuffers_maxcount * sizeof(*framebuffers));
 
-    for (i = 0; i < n; ++i) {
+    for (i = 0; i < framebuffers_maxcount; ++i) {
         framebuffers[i] = yagl_gles_framebuffer_create(ctx->driver);
 
         if (!framebuffers[i]) {
@@ -2264,39 +1816,33 @@ bool yagl_host_glGenFramebuffers(GLsizei n,
         }
     }
 
-    framebuffer_names = g_malloc(n * sizeof(*framebuffer_names));
-
-    for (i = 0; i < n; ++i) {
-        framebuffer_names[i] = yagl_sharegroup_add(ctx->base.sg,
+    for (i = 0; i < framebuffers_maxcount; ++i) {
+        yagl_object_name tmp = yagl_sharegroup_add(ctx->base.sg,
                                                    YAGL_NS_FRAMEBUFFER,
                                                    &framebuffers[i]->base);
-    }
 
-    if (framebuffers_) {
-        yagl_mem_put(cur_ts->mt1, framebuffer_names);
+        if (framebuffer_names) {
+            framebuffer_names[i] = tmp;
+        }
     }
 
+    *framebuffers_count = framebuffers_maxcount;
+
 out:
-    g_free(framebuffer_names);
-    for (i = 0; i < n; ++i) {
+    for (i = 0; i < framebuffers_maxcount; ++i) {
         yagl_gles_framebuffer_release(framebuffers[i]);
     }
     g_free(framebuffers);
-
-    return res;
 }
 
-bool yagl_host_glCheckFramebufferStatus(GLenum* retval,
-    GLenum target)
+GLenum yagl_host_glCheckFramebufferStatus(GLenum target)
 {
     YAGL_GET_CTX_RET(glCheckFramebufferStatus, 0);
 
-    *retval = ctx->driver->CheckFramebufferStatus(target);
-
-    return true;
+    return ctx->driver->CheckFramebufferStatus(target);
 }
 
-bool yagl_host_glFramebufferTexture2D(GLenum target,
+void yagl_host_glFramebufferTexture2D(GLenum target,
     GLenum attachment,
     GLenum textarget,
     GLuint texture,
@@ -2338,11 +1884,9 @@ bool yagl_host_glFramebufferTexture2D(GLenum target,
 out:
     yagl_gles_texture_release(texture_obj);
     yagl_gles_framebuffer_release(framebuffer_obj);
-
-    return true;
 }
 
-bool yagl_host_glFramebufferRenderbuffer(GLenum target,
+void yagl_host_glFramebufferRenderbuffer(GLenum target,
     GLenum attachment,
     GLenum renderbuffertarget,
     GLuint renderbuffer)
@@ -2382,27 +1926,18 @@ bool yagl_host_glFramebufferRenderbuffer(GLenum target,
 out:
     yagl_gles_renderbuffer_release(renderbuffer_obj);
     yagl_gles_framebuffer_release(framebuffer_obj);
-
-    return true;
 }
 
-
-bool yagl_host_glGetFramebufferAttachmentParameteriv(GLenum target,
+void yagl_host_glGetFramebufferAttachmentParameteriv(GLenum target,
     GLenum attachment,
     GLenum pname,
-    target_ulong /* GLint* */ params_)
+    GLint *param)
 {
-    bool res = true;
     struct yagl_gles_framebuffer *framebuffer_obj = NULL;
-    GLint param = 0;
+    GLint tmp = 0;
 
     YAGL_GET_CTX(glGetFramebufferAttachmentParameteriv);
 
-    if (!yagl_mem_prepare_GLint(cur_ts->mt1, params_)) {
-        res = false;
-        goto out;
-    }
-
     framebuffer_obj = yagl_gles_context_acquire_binded_framebuffer(ctx, target);
 
     if (!framebuffer_obj) {
@@ -2413,26 +1948,22 @@ bool yagl_host_glGetFramebufferAttachmentParameteriv(GLenum target,
     if (!yagl_gles_framebuffer_get_attachment_parameter(framebuffer_obj,
                                                         attachment,
                                                         pname,
-                                                        &param)) {
+                                                        &tmp)) {
         YAGL_SET_ERR(GL_INVALID_ENUM);
         goto out;
     }
 
-    if (params_) {
-        yagl_mem_put_GLint(cur_ts->mt1, param);
+    if (param) {
+        *param = tmp;
     }
 
 out:
     yagl_gles_framebuffer_release(framebuffer_obj);
-
-    return res;
 }
 
-bool yagl_host_glGenerateMipmap(GLenum target)
+void yagl_host_glGenerateMipmap(GLenum target)
 {
     YAGL_GET_CTX(glGenerateMipmap);
 
     ctx->driver->GenerateMipmap(target);
-
-    return true;
 }
index 1cb85f8..1a494bc 100644 (file)
@@ -5,57 +5,58 @@
 
 struct yagl_client_image;
 
-bool yagl_host_glActiveTexture(GLenum texture);
-bool yagl_host_glBindBuffer(GLenum target,
+void yagl_host_glActiveTexture(GLenum texture);
+void yagl_host_glBindBuffer(GLenum target,
     GLuint buffer);
-bool yagl_host_glBindTexture(GLenum target,
+void yagl_host_glBindFramebuffer(GLenum target,
+    GLuint framebuffer);
+void yagl_host_glBindRenderbuffer(GLenum target,
+    GLuint renderbuffer);
+void yagl_host_glBindTexture(GLenum target,
     GLuint texture);
-bool yagl_host_glBlendEquation(GLenum mode);
-bool yagl_host_glBlendEquationSeparate(GLenum modeRGB,
+void yagl_host_glBlendEquation(GLenum mode);
+void yagl_host_glBlendEquationSeparate(GLenum modeRGB,
     GLenum modeAlpha);
-bool yagl_host_glBlendFunc(GLenum sfactor,
+void yagl_host_glBlendFunc(GLenum sfactor,
     GLenum dfactor);
-bool yagl_host_glBlendFuncSeparate(GLenum srcRGB,
+void yagl_host_glBlendFuncSeparate(GLenum srcRGB,
     GLenum dstRGB,
     GLenum srcAlpha,
     GLenum dstAlpha);
-bool yagl_host_glBufferData(GLenum target,
-    GLsizeiptr size,
-    target_ulong /* const GLvoid* */ data_,
+void yagl_host_glBufferData(GLenum target,
+    const GLvoid *data, int32_t data_count,
     GLenum usage);
-bool yagl_host_glBufferSubData(GLenum target,
-    GLintptr offset,
-    GLsizeiptr size,
-    target_ulong /* const GLvoid* */ data_);
-bool yagl_host_glClear(GLbitfield mask);
-bool yagl_host_glClearColor(GLclampf red,
+void yagl_host_glBufferSubData(GLenum target,
+    GLsizei offset,
+    const GLvoid *data, int32_t data_count);
+GLenum yagl_host_glCheckFramebufferStatus(GLenum target);
+void yagl_host_glClear(GLbitfield mask);
+void yagl_host_glClearColor(GLclampf red,
     GLclampf green,
     GLclampf blue,
     GLclampf alpha);
-bool yagl_host_glClearDepthf(GLclampf depth);
-bool yagl_host_glClearStencil(GLint s);
-bool yagl_host_glColorMask(GLboolean red,
+void yagl_host_glClearDepthf(GLclampf depth);
+void yagl_host_glClearStencil(GLint s);
+void yagl_host_glColorMask(GLboolean red,
     GLboolean green,
     GLboolean blue,
     GLboolean alpha);
-bool yagl_host_glCompressedTexImage2D(GLenum target,
+void yagl_host_glCompressedTexImage2D(GLenum target,
     GLint level,
     GLenum internalformat,
     GLsizei width,
     GLsizei height,
     GLint border,
-    GLsizei imageSize,
-    target_ulong /* const GLvoid* */ data_);
-bool yagl_host_glCompressedTexSubImage2D(GLenum target,
+    const GLvoid *data, int32_t data_count);
+void yagl_host_glCompressedTexSubImage2D(GLenum target,
     GLint level,
     GLint xoffset,
     GLint yoffset,
     GLsizei width,
     GLsizei height,
     GLenum format,
-    GLsizei imageSize,
-    target_ulong /* const GLvoid* */ data_);
-bool yagl_host_glCopyTexImage2D(GLenum target,
+    const GLvoid *data, int32_t data_count);
+void yagl_host_glCopyTexImage2D(GLenum target,
     GLint level,
     GLenum internalformat,
     GLint x,
@@ -63,7 +64,7 @@ bool yagl_host_glCopyTexImage2D(GLenum target,
     GLsizei width,
     GLsizei height,
     GLint border);
-bool yagl_host_glCopyTexSubImage2D(GLenum target,
+void yagl_host_glCopyTexSubImage2D(GLenum target,
     GLint level,
     GLint xoffset,
     GLint yoffset,
@@ -71,77 +72,98 @@ bool yagl_host_glCopyTexSubImage2D(GLenum target,
     GLint y,
     GLsizei width,
     GLsizei height);
-bool yagl_host_glCullFace(GLenum mode);
-bool yagl_host_glDeleteBuffers(GLsizei n,
-    target_ulong /* const GLuint* */ buffers_);
-bool yagl_host_glDeleteTextures(GLsizei n,
-    target_ulong /* const GLuint* */ textures_);
-bool yagl_host_glDepthFunc(GLenum func);
-bool yagl_host_glDepthMask(GLboolean flag);
-bool yagl_host_glDepthRangef(GLclampf zNear,
+void yagl_host_glCullFace(GLenum mode);
+void yagl_host_glDeleteBuffers(const GLuint *buffers, int32_t buffers_count);
+void yagl_host_glDeleteFramebuffers(const GLuint *framebuffers, int32_t framebuffers_count);
+void yagl_host_glDeleteRenderbuffers(const GLuint *renderbuffers, int32_t renderbuffers_count);
+void yagl_host_glDeleteTextures(const GLuint *textures, int32_t textures_count);
+void yagl_host_glDepthFunc(GLenum func);
+void yagl_host_glDepthMask(GLboolean flag);
+void yagl_host_glDepthRangef(GLclampf zNear,
     GLclampf zFar);
-bool yagl_host_glDisable(GLenum cap);
-bool yagl_host_glDrawArrays(GLenum mode,
+void yagl_host_glDisable(GLenum cap);
+void yagl_host_glDrawArrays(GLenum mode,
     GLint first,
     GLsizei count);
-bool yagl_host_glDrawElements(GLenum mode,
-    GLsizei count,
-    GLenum type,
-    target_ulong /* const GLvoid* */ indices_);
-bool yagl_host_glEnable(GLenum cap);
-bool yagl_host_glFlush(void);
-bool yagl_host_glFrontFace(GLenum mode);
-bool yagl_host_glGenBuffers(GLsizei n,
-    target_ulong /* GLuint* */ buffers_);
-bool yagl_host_glGenTextures(GLsizei n,
-    target_ulong /* GLuint* */ textures_);
-bool yagl_host_glGetBooleanv(GLenum pname,
-    target_ulong /* GLboolean* */ params_);
-bool yagl_host_glGetBufferParameteriv(GLenum target,
+void yagl_host_glEGLImageTargetTexture2DOES(GLenum target,
+    yagl_host_handle image);
+void yagl_host_glEnable(GLenum cap);
+void yagl_host_glFlush(void);
+void yagl_host_glFramebufferTexture2D(GLenum target,
+    GLenum attachment,
+    GLenum textarget,
+    GLuint texture,
+    GLint level);
+void yagl_host_glFramebufferRenderbuffer(GLenum target,
+    GLenum attachment,
+    GLenum renderbuffertarget,
+    GLuint renderbuffer);
+void yagl_host_glFrontFace(GLenum mode);
+void yagl_host_glGenBuffers(GLuint *buffers, int32_t buffers_maxcount, int32_t *buffers_count);
+void yagl_host_glGenerateMipmap(GLenum target);
+void yagl_host_glGenFramebuffers(GLuint *framebuffers, int32_t framebuffers_maxcount, int32_t *framebuffers_count);
+void yagl_host_glGenRenderbuffers(GLuint *renderbuffers, int32_t renderbuffers_maxcount, int32_t *renderbuffers_count);
+void yagl_host_glGenTextures(GLuint *textures, int32_t textures_maxcount, int32_t *textures_count);
+void yagl_host_glGetBooleanv(GLenum pname,
+    GLboolean *params, int32_t params_maxcount, int32_t *params_count);
+void yagl_host_glGetBufferParameteriv(GLenum target,
+    GLenum pname,
+    GLint *param);
+GLenum yagl_host_glGetError(void);
+void yagl_host_glGetFloatv(GLenum pname,
+    GLfloat *params, int32_t params_maxcount, int32_t *params_count);
+void yagl_host_glGetFramebufferAttachmentParameteriv(GLenum target,
+    GLenum attachment,
     GLenum pname,
-    target_ulong /* GLint* */ params_);
-bool yagl_host_glGetError(GLenum* retval);
-bool yagl_host_glGetFloatv(GLenum pname,
-    target_ulong /* GLfloat* */ params_);
-bool yagl_host_glGetIntegerv(GLenum pname,
-    target_ulong /* GLint* */ params_);
-bool yagl_host_glGetTexParameterfv(GLenum target,
+    GLint *param);
+void yagl_host_glGetIntegerv(GLenum pname,
+    GLint *params, int32_t params_maxcount, int32_t *params_count);
+void yagl_host_glGetRenderbufferParameteriv(GLenum target,
     GLenum pname,
-    target_ulong /* GLfloat* */ params_);
-bool yagl_host_glGetTexParameteriv(GLenum target,
+    GLint *param);
+void yagl_host_glGetTexParameterfv(GLenum target,
     GLenum pname,
-    target_ulong /* GLint* */ params_);
-bool yagl_host_glHint(GLenum target,
+    GLfloat *param);
+void yagl_host_glGetTexParameteriv(GLenum target,
+    GLenum pname,
+    GLint *param);
+void yagl_host_glHint(GLenum target,
     GLenum mode);
-bool yagl_host_glIsBuffer(GLboolean* retval, GLuint buffer);
-bool yagl_host_glIsEnabled(GLboolean* retval, GLenum cap);
-bool yagl_host_glIsTexture(GLboolean* retval, GLuint texture);
-bool yagl_host_glLineWidth(GLfloat width);
-bool yagl_host_glPixelStorei(GLenum pname,
+GLboolean yagl_host_glIsBuffer(GLuint buffer);
+GLboolean yagl_host_glIsEnabled(GLenum cap);
+GLboolean yagl_host_glIsFramebuffer(GLuint framebuffer);
+GLboolean yagl_host_glIsRenderbuffer(GLuint renderbuffer);
+GLboolean yagl_host_glIsTexture(GLuint texture);
+void yagl_host_glLineWidth(GLfloat width);
+void yagl_host_glPixelStorei(GLenum pname,
     GLint param);
-bool yagl_host_glPolygonOffset(GLfloat factor,
+void yagl_host_glPolygonOffset(GLfloat factor,
     GLfloat units);
-bool yagl_host_glReadPixels(GLint x,
+void yagl_host_glReadPixels(GLint x,
     GLint y,
     GLsizei width,
     GLsizei height,
     GLenum format,
     GLenum type,
-    target_ulong /* GLvoid* */ pixels_);
-bool yagl_host_glSampleCoverage(GLclampf value,
+    GLvoid *pixels, int32_t pixels_maxcount, int32_t *pixels_count);
+void yagl_host_glRenderbufferStorage(GLenum target,
+    GLenum internalformat,
+    GLsizei width,
+    GLsizei height);
+void yagl_host_glSampleCoverage(GLclampf value,
     GLboolean invert);
-bool yagl_host_glScissor(GLint x,
+void yagl_host_glScissor(GLint x,
     GLint y,
     GLsizei width,
     GLsizei height);
-bool yagl_host_glStencilFunc(GLenum func,
+void yagl_host_glStencilFunc(GLenum func,
     GLint ref,
     GLuint mask);
-bool yagl_host_glStencilMask(GLuint mask);
-bool yagl_host_glStencilOp(GLenum fail,
+void yagl_host_glStencilMask(GLuint mask);
+void yagl_host_glStencilOp(GLenum fail,
     GLenum zfail,
     GLenum zpass);
-bool yagl_host_glTexImage2D(GLenum target,
+void yagl_host_glTexImage2D(GLenum target,
     GLint level,
     GLint internalformat,
     GLsizei width,
@@ -149,20 +171,20 @@ bool yagl_host_glTexImage2D(GLenum target,
     GLint border,
     GLenum format,
     GLenum type,
-    target_ulong /* const GLvoid* */ pixels_);
-bool yagl_host_glTexParameterf(GLenum target,
+    const GLvoid *pixels, int32_t pixels_count);
+void yagl_host_glTexParameterf(GLenum target,
     GLenum pname,
     GLfloat param);
-bool yagl_host_glTexParameterfv(GLenum target,
+void yagl_host_glTexParameterfv(GLenum target,
     GLenum pname,
-    target_ulong /* const GLfloat* */ params_);
-bool yagl_host_glTexParameteri(GLenum target,
+    const GLfloat *params, int32_t params_count);
+void yagl_host_glTexParameteri(GLenum target,
     GLenum pname,
     GLint param);
-bool yagl_host_glTexParameteriv(GLenum target,
+void yagl_host_glTexParameteriv(GLenum target,
     GLenum pname,
-    target_ulong /* const GLint* */ params_);
-bool yagl_host_glTexSubImage2D(GLenum target,
+    const GLint *params, int32_t params_count);
+void yagl_host_glTexSubImage2D(GLenum target,
     GLint level,
     GLint xoffset,
     GLint yoffset,
@@ -170,62 +192,32 @@ bool yagl_host_glTexSubImage2D(GLenum target,
     GLsizei height,
     GLenum format,
     GLenum type,
-    target_ulong /* const GLvoid* */ pixels_);
-bool yagl_host_glViewport(GLint x,
+    const GLvoid *pixels, int32_t pixels_count);
+void yagl_host_glViewport(GLint x,
     GLint y,
     GLsizei width,
     GLsizei height);
-bool yagl_host_glEGLImageTargetTexture2DOES(GLenum target,
-    yagl_host_handle image_);
-bool yagl_host_glGetExtensionStringYAGL(GLuint* retval, target_ulong /* GLchar* */ str_);
-bool yagl_host_glGetVertexAttribRangeYAGL(GLsizei count,
+
+void yagl_host_glTransferArrayYAGL(GLuint indx,
+    GLint first,
+    const GLvoid *data, int32_t data_count);
+void yagl_host_glDrawElementsIndicesYAGL(GLenum mode,
+    GLenum type,
+    const GLvoid *indices, int32_t indices_count);
+void yagl_host_glDrawElementsOffsetYAGL(GLenum mode,
     GLenum type,
-    target_ulong /* const GLvoid* */ indices_,
-    target_ulong /* GLint* */ range_first_,
-    target_ulong /* GLsizei* */ range_count_);
-bool yagl_host_glEGLUpdateOffscreenImageYAGL(struct yagl_client_image *image,
+    GLsizei offset,
+    GLsizei count);
+void yagl_host_glGetExtensionStringYAGL(GLchar *str, int32_t str_maxcount, int32_t *str_count);
+void yagl_host_glGetVertexAttribRangeYAGL(GLenum type,
+    GLsizei offset,
+    GLsizei count,
+    GLint *range_first,
+    GLsizei *range_count);
+void yagl_host_glEGLUpdateOffscreenImageYAGL(struct yagl_client_image *image,
     uint32_t width,
     uint32_t height,
     uint32_t bpp,
-    target_ulong /* const void* */ pixels_);
-bool yagl_host_glIsRenderbuffer(GLboolean* retval,
-    GLuint renderbuffer);
-bool yagl_host_glBindRenderbuffer(GLenum target,
-    GLuint renderbuffer);
-bool yagl_host_glDeleteRenderbuffers(GLsizei n,
-    target_ulong /* const GLuint* */ renderbuffers_);
-bool yagl_host_glGenRenderbuffers(GLsizei n,
-    target_ulong /* GLuint* */ renderbuffers_);
-bool yagl_host_glRenderbufferStorage(GLenum target,
-    GLenum internalformat,
-    GLsizei width,
-    GLsizei height);
-bool yagl_host_glGetRenderbufferParameteriv(GLenum target,
-    GLenum pname,
-    target_ulong /* GLint* */ params_);
-bool yagl_host_glIsFramebuffer(GLboolean* retval,
-    GLuint framebuffer);
-bool yagl_host_glBindFramebuffer(GLenum target,
-    GLuint framebuffer);
-bool yagl_host_glDeleteFramebuffers(GLsizei n,
-    target_ulong /* const GLuint* */ framebuffers_);
-bool yagl_host_glGenFramebuffers(GLsizei n,
-    target_ulong /* GLuint* */ framebuffers_);
-bool yagl_host_glCheckFramebufferStatus(GLenum* retval,
-    GLenum target);
-bool yagl_host_glFramebufferTexture2D(GLenum target,
-    GLenum attachment,
-    GLenum textarget,
-    GLuint texture,
-    GLint level);
-bool yagl_host_glFramebufferRenderbuffer(GLenum target,
-    GLenum attachment,
-    GLenum renderbuffertarget,
-    GLuint renderbuffer);
-bool yagl_host_glGetFramebufferAttachmentParameteriv(GLenum target,
-    GLenum attachment,
-    GLenum pname,
-    target_ulong /* GLint* */ params_);
-bool yagl_host_glGenerateMipmap(GLenum target);
+    const void *pixels);
 
 #endif
index 7b32497..c8cc70e 100644 (file)
@@ -1,9 +1,9 @@
 /*
- * Generated by gen-yagl-calls.sh, do not modify!
+ * Generated by gen-yagl-calls.py, do not modify!
  */
 #include "yagl_gles1_calls.h"
 #include "yagl_host_gles1_calls.h"
-#include "yagl_marshal_gl.h"
+#include "yagl_transport_gl1.h"
 #include "yagl_thread.h"
 #include "yagl_process.h"
 #include "yagl_log.h"
 /*
  * glActiveTexture dispatcher. id = 1
  */
-static bool yagl_func_glActiveTexture(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glActiveTexture(struct yagl_transport *t)
 {
-    GLenum texture = yagl_marshal_get_GLenum(out_buff);
+    GLenum texture;
+    texture = yagl_transport_get_out_GLenum(t);
     YAGL_LOG_FUNC_ENTER_SPLIT1(glActiveTexture, GLenum, texture);
-    bool res = yagl_host_glActiveTexture(texture);
+    (void)yagl_host_glActiveTexture(texture);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
  * glBindBuffer dispatcher. id = 2
  */
-static bool yagl_func_glBindBuffer(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glBindBuffer(struct yagl_transport *t)
 {
-    GLenum target = yagl_marshal_get_GLenum(out_buff);
-    GLuint buffer = yagl_marshal_get_GLuint(out_buff);
+    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);
-    bool res = yagl_host_glBindBuffer(target, buffer);
+    (void)yagl_host_glBindBuffer(target, buffer);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
  * glBindFramebuffer dispatcher. id = 3
  */
-static bool yagl_func_glBindFramebuffer(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glBindFramebuffer(struct yagl_transport *t)
 {
-    GLenum target = yagl_marshal_get_GLenum(out_buff);
-    GLuint framebuffer = yagl_marshal_get_GLuint(out_buff);
+    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);
-    bool res = yagl_host_glBindFramebuffer(target, framebuffer);
+    (void)yagl_host_glBindFramebuffer(target, framebuffer);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
  * glBindRenderbuffer dispatcher. id = 4
  */
-static bool yagl_func_glBindRenderbuffer(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glBindRenderbuffer(struct yagl_transport *t)
 {
-    GLenum target = yagl_marshal_get_GLenum(out_buff);
-    GLuint renderbuffer = yagl_marshal_get_GLuint(out_buff);
+    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);
-    bool res = yagl_host_glBindRenderbuffer(target, renderbuffer);
+    (void)yagl_host_glBindRenderbuffer(target, renderbuffer);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
  * glBindTexture dispatcher. id = 5
  */
-static bool yagl_func_glBindTexture(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glBindTexture(struct yagl_transport *t)
 {
-    GLenum target = yagl_marshal_get_GLenum(out_buff);
-    GLuint texture = yagl_marshal_get_GLuint(out_buff);
+    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);
-    bool res = yagl_host_glBindTexture(target, texture);
+    (void)yagl_host_glBindTexture(target, texture);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
  * glBlendEquation dispatcher. id = 6
  */
-static bool yagl_func_glBlendEquation(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glBlendEquation(struct yagl_transport *t)
 {
-    GLenum mode = yagl_marshal_get_GLenum(out_buff);
+    GLenum mode;
+    mode = yagl_transport_get_out_GLenum(t);
     YAGL_LOG_FUNC_ENTER_SPLIT1(glBlendEquation, GLenum, mode);
-    bool res = yagl_host_glBlendEquation(mode);
+    (void)yagl_host_glBlendEquation(mode);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
  * glBlendEquationSeparate dispatcher. id = 7
  */
-static bool yagl_func_glBlendEquationSeparate(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glBlendEquationSeparate(struct yagl_transport *t)
 {
-    GLenum modeRGB = yagl_marshal_get_GLenum(out_buff);
-    GLenum modeAlpha = yagl_marshal_get_GLenum(out_buff);
+    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);
-    bool res = yagl_host_glBlendEquationSeparate(modeRGB, modeAlpha);
+    (void)yagl_host_glBlendEquationSeparate(modeRGB, modeAlpha);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
  * glBlendFunc dispatcher. id = 8
  */
-static bool yagl_func_glBlendFunc(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glBlendFunc(struct yagl_transport *t)
 {
-    GLenum sfactor = yagl_marshal_get_GLenum(out_buff);
-    GLenum dfactor = yagl_marshal_get_GLenum(out_buff);
+    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);
-    bool res = yagl_host_glBlendFunc(sfactor, dfactor);
+    (void)yagl_host_glBlendFunc(sfactor, dfactor);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
  * glBlendFuncSeparate dispatcher. id = 9
  */
-static bool yagl_func_glBlendFuncSeparate(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glBlendFuncSeparate(struct yagl_transport *t)
 {
-    GLenum srcRGB = yagl_marshal_get_GLenum(out_buff);
-    GLenum dstRGB = yagl_marshal_get_GLenum(out_buff);
-    GLenum srcAlpha = yagl_marshal_get_GLenum(out_buff);
-    GLenum dstAlpha = yagl_marshal_get_GLenum(out_buff);
+    GLenum srcRGB;
+    GLenum dstRGB;
+    GLenum srcAlpha;
+    GLenum dstAlpha;
+    srcRGB = yagl_transport_get_out_GLenum(t);
+    dstRGB = yagl_transport_get_out_GLenum(t);
+    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);
-    bool res = yagl_host_glBlendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha);
+    (void)yagl_host_glBlendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
  * glBufferData dispatcher. id = 10
  */
-static bool yagl_func_glBufferData(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glBufferData(struct yagl_transport *t)
 {
-    GLenum target = yagl_marshal_get_GLenum(out_buff);
-    GLsizeiptr size = yagl_marshal_get_GLsizeiptr(out_buff);
-    target_ulong data = yagl_marshal_get_ptr(out_buff);
-    GLenum usage = yagl_marshal_get_GLenum(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT4(glBufferData, GLenum, GLsizeiptr, target_ulong, GLenum, target, size, data, usage);
-    bool res = yagl_host_glBufferData(target, size, data, usage);
+    GLenum target;
+    const GLvoid *data;
+    int32_t data_count;
+    GLenum usage;
+    target = yagl_transport_get_out_GLenum(t);
+    if (!yagl_transport_get_out_array(t, 1, (const void**)&data, &data_count)) {
+        return false;
+    }
+    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);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
  * glBufferSubData dispatcher. id = 11
  */
-static bool yagl_func_glBufferSubData(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glBufferSubData(struct yagl_transport *t)
 {
-    GLenum target = yagl_marshal_get_GLenum(out_buff);
-    GLintptr offset = yagl_marshal_get_GLintptr(out_buff);
-    GLsizeiptr size = yagl_marshal_get_GLsizeiptr(out_buff);
-    target_ulong data = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT4(glBufferSubData, GLenum, GLintptr, GLsizeiptr, target_ulong, target, offset, size, data);
-    bool res = yagl_host_glBufferSubData(target, offset, size, data);
+    GLenum target;
+    GLsizei offset;
+    const GLvoid *data;
+    int32_t data_count;
+    target = yagl_transport_get_out_GLenum(t);
+    offset = yagl_transport_get_out_GLsizei(t);
+    if (!yagl_transport_get_out_array(t, 1, (const void**)&data, &data_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT3(glBufferSubData, GLenum, GLsizei, void*, target, offset, data);
+    (void)yagl_host_glBufferSubData(target, offset, data, data_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
  * glCheckFramebufferStatus dispatcher. id = 12
  */
-static bool yagl_func_glCheckFramebufferStatus(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glCheckFramebufferStatus(struct yagl_transport *t)
 {
-    GLenum target = yagl_marshal_get_GLenum(out_buff);
+    GLenum target;
+    GLenum *retval;
+    target = yagl_transport_get_out_GLenum(t);
+    yagl_transport_get_in_arg(t, (void**)&retval);
     YAGL_LOG_FUNC_ENTER_SPLIT1(glCheckFramebufferStatus, GLenum, target);
-    GLenum retval;
-    bool res = yagl_host_glCheckFramebufferStatus(&retval, target);
-    if (!res) {
-        YAGL_LOG_FUNC_EXIT(NULL);
-        return false;
-    }
-    YAGL_LOG_FUNC_EXIT_SPLIT(GLenum, retval);
-    yagl_marshal_put_GLenum(&in_buff, retval);
+    *retval = yagl_host_glCheckFramebufferStatus(target);
+    YAGL_LOG_FUNC_EXIT_SPLIT(GLenum, *retval);
+
     return true;
 }
 
 /*
  * glClear dispatcher. id = 13
  */
-static bool yagl_func_glClear(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glClear(struct yagl_transport *t)
 {
-    GLbitfield mask = yagl_marshal_get_GLbitfield(out_buff);
+    GLbitfield mask;
+    mask = yagl_transport_get_out_GLbitfield(t);
     YAGL_LOG_FUNC_ENTER_SPLIT1(glClear, GLbitfield, mask);
-    bool res = yagl_host_glClear(mask);
+    (void)yagl_host_glClear(mask);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
  * glClearColor dispatcher. id = 14
  */
-static bool yagl_func_glClearColor(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glClearColor(struct yagl_transport *t)
 {
-    GLclampf red = yagl_marshal_get_GLclampf(out_buff);
-    GLclampf green = yagl_marshal_get_GLclampf(out_buff);
-    GLclampf blue = yagl_marshal_get_GLclampf(out_buff);
-    GLclampf alpha = yagl_marshal_get_GLclampf(out_buff);
+    GLclampf red;
+    GLclampf green;
+    GLclampf blue;
+    GLclampf alpha;
+    red = yagl_transport_get_out_GLclampf(t);
+    green = yagl_transport_get_out_GLclampf(t);
+    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);
-    bool res = yagl_host_glClearColor(red, green, blue, alpha);
+    (void)yagl_host_glClearColor(red, green, blue, alpha);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
  * glClearDepthf dispatcher. id = 15
  */
-static bool yagl_func_glClearDepthf(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glClearDepthf(struct yagl_transport *t)
 {
-    GLclampf depth = yagl_marshal_get_GLclampf(out_buff);
+    GLclampf depth;
+    depth = yagl_transport_get_out_GLclampf(t);
     YAGL_LOG_FUNC_ENTER_SPLIT1(glClearDepthf, GLclampf, depth);
-    bool res = yagl_host_glClearDepthf(depth);
+    (void)yagl_host_glClearDepthf(depth);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
  * glClearStencil dispatcher. id = 16
  */
-static bool yagl_func_glClearStencil(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glClearStencil(struct yagl_transport *t)
 {
-    GLint s = yagl_marshal_get_GLint(out_buff);
+    GLint s;
+    s = yagl_transport_get_out_GLint(t);
     YAGL_LOG_FUNC_ENTER_SPLIT1(glClearStencil, GLint, s);
-    bool res = yagl_host_glClearStencil(s);
+    (void)yagl_host_glClearStencil(s);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
  * glColorMask dispatcher. id = 17
  */
-static bool yagl_func_glColorMask(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glColorMask(struct yagl_transport *t)
 {
-    GLboolean red = yagl_marshal_get_GLboolean(out_buff);
-    GLboolean green = yagl_marshal_get_GLboolean(out_buff);
-    GLboolean blue = yagl_marshal_get_GLboolean(out_buff);
-    GLboolean alpha = yagl_marshal_get_GLboolean(out_buff);
+    GLboolean red;
+    GLboolean green;
+    GLboolean blue;
+    GLboolean alpha;
+    red = yagl_transport_get_out_GLboolean(t);
+    green = yagl_transport_get_out_GLboolean(t);
+    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);
-    bool res = yagl_host_glColorMask(red, green, blue, alpha);
+    (void)yagl_host_glColorMask(red, green, blue, alpha);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
  * glCompressedTexImage2D dispatcher. id = 18
  */
-static bool yagl_func_glCompressedTexImage2D(uint8_t **out_buff,
-    uint8_t *in_buff)
-{
-    GLenum target = yagl_marshal_get_GLenum(out_buff);
-    GLint level = yagl_marshal_get_GLint(out_buff);
-    GLenum internalformat = yagl_marshal_get_GLenum(out_buff);
-    GLsizei width = yagl_marshal_get_GLsizei(out_buff);
-    GLsizei height = yagl_marshal_get_GLsizei(out_buff);
-    GLint border = yagl_marshal_get_GLint(out_buff);
-    GLsizei imageSize = yagl_marshal_get_GLsizei(out_buff);
-    target_ulong data = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT8(glCompressedTexImage2D, GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, target_ulong, target, level, internalformat, width, height, border, imageSize, data);
-    bool res = yagl_host_glCompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data);
+static bool yagl_func_glCompressedTexImage2D(struct yagl_transport *t)
+{
+    GLenum target;
+    GLint level;
+    GLenum internalformat;
+    GLsizei width;
+    GLsizei height;
+    GLint border;
+    const GLvoid *data;
+    int32_t data_count;
+    target = yagl_transport_get_out_GLenum(t);
+    level = yagl_transport_get_out_GLint(t);
+    internalformat = yagl_transport_get_out_GLenum(t);
+    width = yagl_transport_get_out_GLsizei(t);
+    height = yagl_transport_get_out_GLsizei(t);
+    border = yagl_transport_get_out_GLint(t);
+    if (!yagl_transport_get_out_array(t, 1, (const void**)&data, &data_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT7(glCompressedTexImage2D, GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, void*, target, level, internalformat, width, height, border, data);
+    (void)yagl_host_glCompressedTexImage2D(target, level, internalformat, width, height, border, data, data_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
  * glCompressedTexSubImage2D dispatcher. id = 19
  */
-static bool yagl_func_glCompressedTexSubImage2D(uint8_t **out_buff,
-    uint8_t *in_buff)
-{
-    GLenum target = yagl_marshal_get_GLenum(out_buff);
-    GLint level = yagl_marshal_get_GLint(out_buff);
-    GLint xoffset = yagl_marshal_get_GLint(out_buff);
-    GLint yoffset = yagl_marshal_get_GLint(out_buff);
-    GLsizei width = yagl_marshal_get_GLsizei(out_buff);
-    GLsizei height = yagl_marshal_get_GLsizei(out_buff);
-    GLenum format = yagl_marshal_get_GLenum(out_buff);
-    GLsizei imageSize = yagl_marshal_get_GLsizei(out_buff);
-    target_ulong data = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT9(glCompressedTexSubImage2D, GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, target_ulong, target, level, xoffset, yoffset, width, height, format, imageSize, data);
-    bool res = yagl_host_glCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data);
+static bool yagl_func_glCompressedTexSubImage2D(struct yagl_transport *t)
+{
+    GLenum target;
+    GLint level;
+    GLint xoffset;
+    GLint yoffset;
+    GLsizei width;
+    GLsizei height;
+    GLenum format;
+    const GLvoid *data;
+    int32_t data_count;
+    target = yagl_transport_get_out_GLenum(t);
+    level = yagl_transport_get_out_GLint(t);
+    xoffset = yagl_transport_get_out_GLint(t);
+    yoffset = yagl_transport_get_out_GLint(t);
+    width = yagl_transport_get_out_GLsizei(t);
+    height = yagl_transport_get_out_GLsizei(t);
+    format = yagl_transport_get_out_GLenum(t);
+    if (!yagl_transport_get_out_array(t, 1, (const void**)&data, &data_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT8(glCompressedTexSubImage2D, GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, void*, target, level, xoffset, yoffset, width, height, format, data);
+    (void)yagl_host_glCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, data, data_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
  * glCopyTexImage2D dispatcher. id = 20
  */
-static bool yagl_func_glCopyTexImage2D(uint8_t **out_buff,
-    uint8_t *in_buff)
-{
-    GLenum target = yagl_marshal_get_GLenum(out_buff);
-    GLint level = yagl_marshal_get_GLint(out_buff);
-    GLenum internalformat = yagl_marshal_get_GLenum(out_buff);
-    GLint x = yagl_marshal_get_GLint(out_buff);
-    GLint y = yagl_marshal_get_GLint(out_buff);
-    GLsizei width = yagl_marshal_get_GLsizei(out_buff);
-    GLsizei height = yagl_marshal_get_GLsizei(out_buff);
-    GLint border = yagl_marshal_get_GLint(out_buff);
+static bool yagl_func_glCopyTexImage2D(struct yagl_transport *t)
+{
+    GLenum target;
+    GLint level;
+    GLenum internalformat;
+    GLint x;
+    GLint y;
+    GLsizei width;
+    GLsizei height;
+    GLint border;
+    target = yagl_transport_get_out_GLenum(t);
+    level = yagl_transport_get_out_GLint(t);
+    internalformat = yagl_transport_get_out_GLenum(t);
+    x = yagl_transport_get_out_GLint(t);
+    y = yagl_transport_get_out_GLint(t);
+    width = yagl_transport_get_out_GLsizei(t);
+    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);
-    bool res = yagl_host_glCopyTexImage2D(target, level, internalformat, x, y, width, height, border);
+    (void)yagl_host_glCopyTexImage2D(target, level, internalformat, x, y, width, height, border);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
  * glCopyTexSubImage2D dispatcher. id = 21
  */
-static bool yagl_func_glCopyTexSubImage2D(uint8_t **out_buff,
-    uint8_t *in_buff)
-{
-    GLenum target = yagl_marshal_get_GLenum(out_buff);
-    GLint level = yagl_marshal_get_GLint(out_buff);
-    GLint xoffset = yagl_marshal_get_GLint(out_buff);
-    GLint yoffset = yagl_marshal_get_GLint(out_buff);
-    GLint x = yagl_marshal_get_GLint(out_buff);
-    GLint y = yagl_marshal_get_GLint(out_buff);
-    GLsizei width = yagl_marshal_get_GLsizei(out_buff);
-    GLsizei height = yagl_marshal_get_GLsizei(out_buff);
+static bool yagl_func_glCopyTexSubImage2D(struct yagl_transport *t)
+{
+    GLenum target;
+    GLint level;
+    GLint xoffset;
+    GLint yoffset;
+    GLint x;
+    GLint y;
+    GLsizei width;
+    GLsizei height;
+    target = yagl_transport_get_out_GLenum(t);
+    level = yagl_transport_get_out_GLint(t);
+    xoffset = yagl_transport_get_out_GLint(t);
+    yoffset = yagl_transport_get_out_GLint(t);
+    x = yagl_transport_get_out_GLint(t);
+    y = yagl_transport_get_out_GLint(t);
+    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);
-    bool res = yagl_host_glCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height);
+    (void)yagl_host_glCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
  * glCullFace dispatcher. id = 22
  */
-static bool yagl_func_glCullFace(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glCullFace(struct yagl_transport *t)
 {
-    GLenum mode = yagl_marshal_get_GLenum(out_buff);
+    GLenum mode;
+    mode = yagl_transport_get_out_GLenum(t);
     YAGL_LOG_FUNC_ENTER_SPLIT1(glCullFace, GLenum, mode);
-    bool res = yagl_host_glCullFace(mode);
+    (void)yagl_host_glCullFace(mode);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
  * glDeleteBuffers dispatcher. id = 23
  */
-static bool yagl_func_glDeleteBuffers(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glDeleteBuffers(struct yagl_transport *t)
 {
-    GLsizei n = yagl_marshal_get_GLsizei(out_buff);
-    target_ulong buffers = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT2(glDeleteBuffers, GLsizei, target_ulong, n, buffers);
-    bool res = yagl_host_glDeleteBuffers(n, buffers);
+    const GLuint *buffers;
+    int32_t buffers_count;
+    if (!yagl_transport_get_out_array(t, sizeof(GLuint), (const void**)&buffers, &buffers_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT1(glDeleteBuffers, void*, buffers);
+    (void)yagl_host_glDeleteBuffers(buffers, buffers_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
  * glDeleteFramebuffers dispatcher. id = 24
  */
-static bool yagl_func_glDeleteFramebuffers(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glDeleteFramebuffers(struct yagl_transport *t)
 {
-    GLsizei n = yagl_marshal_get_GLsizei(out_buff);
-    target_ulong framebuffers = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT2(glDeleteFramebuffers, GLsizei, target_ulong, n, framebuffers);
-    bool res = yagl_host_glDeleteFramebuffers(n, framebuffers);
+    const GLuint *framebuffers;
+    int32_t framebuffers_count;
+    if (!yagl_transport_get_out_array(t, sizeof(GLuint), (const void**)&framebuffers, &framebuffers_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT1(glDeleteFramebuffers, void*, framebuffers);
+    (void)yagl_host_glDeleteFramebuffers(framebuffers, framebuffers_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
  * glDeleteRenderbuffers dispatcher. id = 25
  */
-static bool yagl_func_glDeleteRenderbuffers(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glDeleteRenderbuffers(struct yagl_transport *t)
 {
-    GLsizei n = yagl_marshal_get_GLsizei(out_buff);
-    target_ulong renderbuffers = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT2(glDeleteRenderbuffers, GLsizei, target_ulong, n, renderbuffers);
-    bool res = yagl_host_glDeleteRenderbuffers(n, renderbuffers);
+    const GLuint *renderbuffers;
+    int32_t renderbuffers_count;
+    if (!yagl_transport_get_out_array(t, sizeof(GLuint), (const void**)&renderbuffers, &renderbuffers_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT1(glDeleteRenderbuffers, void*, renderbuffers);
+    (void)yagl_host_glDeleteRenderbuffers(renderbuffers, renderbuffers_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
  * glDeleteTextures dispatcher. id = 26
  */
-static bool yagl_func_glDeleteTextures(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glDeleteTextures(struct yagl_transport *t)
 {
-    GLsizei n = yagl_marshal_get_GLsizei(out_buff);
-    target_ulong textures = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT2(glDeleteTextures, GLsizei, target_ulong, n, textures);
-    bool res = yagl_host_glDeleteTextures(n, textures);
+    const GLuint *textures;
+    int32_t textures_count;
+    if (!yagl_transport_get_out_array(t, sizeof(GLuint), (const void**)&textures, &textures_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT1(glDeleteTextures, void*, textures);
+    (void)yagl_host_glDeleteTextures(textures, textures_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
  * glDepthFunc dispatcher. id = 27
  */
-static bool yagl_func_glDepthFunc(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glDepthFunc(struct yagl_transport *t)
 {
-    GLenum func = yagl_marshal_get_GLenum(out_buff);
+    GLenum func;
+    func = yagl_transport_get_out_GLenum(t);
     YAGL_LOG_FUNC_ENTER_SPLIT1(glDepthFunc, GLenum, func);
-    bool res = yagl_host_glDepthFunc(func);
+    (void)yagl_host_glDepthFunc(func);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
  * glDepthMask dispatcher. id = 28
  */
-static bool yagl_func_glDepthMask(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glDepthMask(struct yagl_transport *t)
 {
-    GLboolean flag = yagl_marshal_get_GLboolean(out_buff);
+    GLboolean flag;
+    flag = yagl_transport_get_out_GLboolean(t);
     YAGL_LOG_FUNC_ENTER_SPLIT1(glDepthMask, GLboolean, flag);
-    bool res = yagl_host_glDepthMask(flag);
+    (void)yagl_host_glDepthMask(flag);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
  * glDepthRangef dispatcher. id = 29
  */
-static bool yagl_func_glDepthRangef(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glDepthRangef(struct yagl_transport *t)
 {
-    GLclampf zNear = yagl_marshal_get_GLclampf(out_buff);
-    GLclampf zFar = yagl_marshal_get_GLclampf(out_buff);
+    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);
-    bool res = yagl_host_glDepthRangef(zNear, zFar);
+    (void)yagl_host_glDepthRangef(zNear, zFar);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
  * glDisable dispatcher. id = 30
  */
-static bool yagl_func_glDisable(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glDisable(struct yagl_transport *t)
 {
-    GLenum cap = yagl_marshal_get_GLenum(out_buff);
+    GLenum cap;
+    cap = yagl_transport_get_out_GLenum(t);
     YAGL_LOG_FUNC_ENTER_SPLIT1(glDisable, GLenum, cap);
-    bool res = yagl_host_glDisable(cap);
+    (void)yagl_host_glDisable(cap);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
  * glDrawArrays dispatcher. id = 31
  */
-static bool yagl_func_glDrawArrays(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glDrawArrays(struct yagl_transport *t)
 {
-    GLenum mode = yagl_marshal_get_GLenum(out_buff);
-    GLint first = yagl_marshal_get_GLint(out_buff);
-    GLsizei count = yagl_marshal_get_GLsizei(out_buff);
+    GLenum mode;
+    GLint first;
+    GLsizei count;
+    mode = yagl_transport_get_out_GLenum(t);
+    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);
-    bool res = yagl_host_glDrawArrays(mode, first, count);
+    (void)yagl_host_glDrawArrays(mode, first, count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
-}
 
-/*
- * glDrawElements dispatcher. id = 32
- */
-static bool yagl_func_glDrawElements(uint8_t **out_buff,
-    uint8_t *in_buff)
-{
-    GLenum mode = yagl_marshal_get_GLenum(out_buff);
-    GLsizei count = yagl_marshal_get_GLsizei(out_buff);
-    GLenum type = yagl_marshal_get_GLenum(out_buff);
-    target_ulong indices = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT4(glDrawElements, GLenum, GLsizei, GLenum, target_ulong, mode, count, type, indices);
-    bool res = yagl_host_glDrawElements(mode, count, type, indices);
-    YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+    return true;
 }
 
 /*
- * glEGLImageTargetTexture2DOES dispatcher. id = 33
+ * glEGLImageTargetTexture2DOES dispatcher. id = 32
  */
-static bool yagl_func_glEGLImageTargetTexture2DOES(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glEGLImageTargetTexture2DOES(struct yagl_transport *t)
 {
-    GLenum target = yagl_marshal_get_GLenum(out_buff);
-    yagl_host_handle image = yagl_marshal_get_host_handle(out_buff);
+    GLenum target;
+    yagl_host_handle image;
+    target = yagl_transport_get_out_GLenum(t);
+    image = yagl_transport_get_out_yagl_host_handle(t);
     YAGL_LOG_FUNC_ENTER_SPLIT2(glEGLImageTargetTexture2DOES, GLenum, yagl_host_handle, target, image);
-    bool res = yagl_host_glEGLImageTargetTexture2DOES(target, image);
+    (void)yagl_host_glEGLImageTargetTexture2DOES(target, image);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glEnable dispatcher. id = 34
+ * glEnable dispatcher. id = 33
  */
-static bool yagl_func_glEnable(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glEnable(struct yagl_transport *t)
 {
-    GLenum cap = yagl_marshal_get_GLenum(out_buff);
+    GLenum cap;
+    cap = yagl_transport_get_out_GLenum(t);
     YAGL_LOG_FUNC_ENTER_SPLIT1(glEnable, GLenum, cap);
-    bool res = yagl_host_glEnable(cap);
+    (void)yagl_host_glEnable(cap);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glFlush dispatcher. id = 35
+ * glFlush dispatcher. id = 34
  */
-static bool yagl_func_glFlush(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glFlush(struct yagl_transport *t)
 {
     YAGL_LOG_FUNC_ENTER_SPLIT0(glFlush);
-    bool res = yagl_host_glFlush();
+    (void)yagl_host_glFlush();
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glFramebufferTexture2D dispatcher. id = 36
+ * glFramebufferTexture2D dispatcher. id = 35
  */
-static bool yagl_func_glFramebufferTexture2D(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glFramebufferTexture2D(struct yagl_transport *t)
 {
-    GLenum target = yagl_marshal_get_GLenum(out_buff);
-    GLenum attachment = yagl_marshal_get_GLenum(out_buff);
-    GLenum textarget = yagl_marshal_get_GLenum(out_buff);
-    GLuint texture = yagl_marshal_get_GLuint(out_buff);
-    GLint level = yagl_marshal_get_GLint(out_buff);
+    GLenum target;
+    GLenum attachment;
+    GLenum textarget;
+    GLuint texture;
+    GLint level;
+    target = yagl_transport_get_out_GLenum(t);
+    attachment = yagl_transport_get_out_GLenum(t);
+    textarget = yagl_transport_get_out_GLenum(t);
+    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);
-    bool res = yagl_host_glFramebufferTexture2D(target, attachment, textarget, texture, level);
+    (void)yagl_host_glFramebufferTexture2D(target, attachment, textarget, texture, level);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glFramebufferRenderbuffer dispatcher. id = 37
+ * glFramebufferRenderbuffer dispatcher. id = 36
  */
-static bool yagl_func_glFramebufferRenderbuffer(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glFramebufferRenderbuffer(struct yagl_transport *t)
 {
-    GLenum target = yagl_marshal_get_GLenum(out_buff);
-    GLenum attachment = yagl_marshal_get_GLenum(out_buff);
-    GLenum renderbuffertarget = yagl_marshal_get_GLenum(out_buff);
-    GLuint renderbuffer = yagl_marshal_get_GLuint(out_buff);
+    GLenum target;
+    GLenum attachment;
+    GLenum renderbuffertarget;
+    GLuint renderbuffer;
+    target = yagl_transport_get_out_GLenum(t);
+    attachment = yagl_transport_get_out_GLenum(t);
+    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);
-    bool res = yagl_host_glFramebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer);
+    (void)yagl_host_glFramebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glFrontFace dispatcher. id = 38
+ * glFrontFace dispatcher. id = 37
  */
-static bool yagl_func_glFrontFace(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glFrontFace(struct yagl_transport *t)
 {
-    GLenum mode = yagl_marshal_get_GLenum(out_buff);
+    GLenum mode;
+    mode = yagl_transport_get_out_GLenum(t);
     YAGL_LOG_FUNC_ENTER_SPLIT1(glFrontFace, GLenum, mode);
-    bool res = yagl_host_glFrontFace(mode);
+    (void)yagl_host_glFrontFace(mode);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glGenBuffers dispatcher. id = 39
+ * glGenBuffers dispatcher. id = 38
  */
-static bool yagl_func_glGenBuffers(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glGenBuffers(struct yagl_transport *t)
 {
-    GLsizei n = yagl_marshal_get_GLsizei(out_buff);
-    target_ulong buffers = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT2(glGenBuffers, GLsizei, target_ulong, n, buffers);
-    bool res = yagl_host_glGenBuffers(n, buffers);
+    GLuint *buffers;
+    int32_t buffers_maxcount;
+    int32_t *buffers_count;
+    if (!yagl_transport_get_in_array(t, sizeof(GLuint), (void**)&buffers, &buffers_maxcount, &buffers_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT1(glGenBuffers, void*, buffers);
+    *buffers_count = 0;
+    (void)yagl_host_glGenBuffers(buffers, buffers_maxcount, buffers_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glGenerateMipmap dispatcher. id = 40
+ * glGenerateMipmap dispatcher. id = 39
  */
-static bool yagl_func_glGenerateMipmap(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glGenerateMipmap(struct yagl_transport *t)
 {
-    GLenum target = yagl_marshal_get_GLenum(out_buff);
+    GLenum target;
+    target = yagl_transport_get_out_GLenum(t);
     YAGL_LOG_FUNC_ENTER_SPLIT1(glGenerateMipmap, GLenum, target);
-    bool res = yagl_host_glGenerateMipmap(target);
+    (void)yagl_host_glGenerateMipmap(target);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glGenFramebuffers dispatcher. id = 41
+ * glGenFramebuffers dispatcher. id = 40
  */
-static bool yagl_func_glGenFramebuffers(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glGenFramebuffers(struct yagl_transport *t)
 {
-    GLsizei n = yagl_marshal_get_GLsizei(out_buff);
-    target_ulong framebuffers = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT2(glGenFramebuffers, GLsizei, target_ulong, n, framebuffers);
-    bool res = yagl_host_glGenFramebuffers(n, framebuffers);
+    GLuint *framebuffers;
+    int32_t framebuffers_maxcount;
+    int32_t *framebuffers_count;
+    if (!yagl_transport_get_in_array(t, sizeof(GLuint), (void**)&framebuffers, &framebuffers_maxcount, &framebuffers_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT1(glGenFramebuffers, void*, framebuffers);
+    *framebuffers_count = 0;
+    (void)yagl_host_glGenFramebuffers(framebuffers, framebuffers_maxcount, framebuffers_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glGenRenderbuffers dispatcher. id = 42
+ * glGenRenderbuffers dispatcher. id = 41
  */
-static bool yagl_func_glGenRenderbuffers(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glGenRenderbuffers(struct yagl_transport *t)
 {
-    GLsizei n = yagl_marshal_get_GLsizei(out_buff);
-    target_ulong renderbuffers = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT2(glGenRenderbuffers, GLsizei, target_ulong, n, renderbuffers);
-    bool res = yagl_host_glGenRenderbuffers(n, renderbuffers);
+    GLuint *renderbuffers;
+    int32_t renderbuffers_maxcount;
+    int32_t *renderbuffers_count;
+    if (!yagl_transport_get_in_array(t, sizeof(GLuint), (void**)&renderbuffers, &renderbuffers_maxcount, &renderbuffers_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT1(glGenRenderbuffers, void*, renderbuffers);
+    *renderbuffers_count = 0;
+    (void)yagl_host_glGenRenderbuffers(renderbuffers, renderbuffers_maxcount, renderbuffers_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glGenTextures dispatcher. id = 43
+ * glGenTextures dispatcher. id = 42
  */
-static bool yagl_func_glGenTextures(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glGenTextures(struct yagl_transport *t)
 {
-    GLsizei n = yagl_marshal_get_GLsizei(out_buff);
-    target_ulong textures = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT2(glGenTextures, GLsizei, target_ulong, n, textures);
-    bool res = yagl_host_glGenTextures(n, textures);
+    GLuint *textures;
+    int32_t textures_maxcount;
+    int32_t *textures_count;
+    if (!yagl_transport_get_in_array(t, sizeof(GLuint), (void**)&textures, &textures_maxcount, &textures_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT1(glGenTextures, void*, textures);
+    *textures_count = 0;
+    (void)yagl_host_glGenTextures(textures, textures_maxcount, textures_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glGetBooleanv dispatcher. id = 44
+ * glGetBooleanv dispatcher. id = 43
  */
-static bool yagl_func_glGetBooleanv(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glGetBooleanv(struct yagl_transport *t)
 {
-    GLenum pname = yagl_marshal_get_GLenum(out_buff);
-    target_ulong params = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT2(glGetBooleanv, GLenum, target_ulong, pname, params);
-    bool res = yagl_host_glGetBooleanv(pname, params);
+    GLenum pname;
+    GLboolean *params;
+    int32_t params_maxcount;
+    int32_t *params_count;
+    pname = yagl_transport_get_out_GLenum(t);
+    if (!yagl_transport_get_in_array(t, sizeof(GLboolean), (void**)&params, &params_maxcount, &params_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT2(glGetBooleanv, GLenum, void*, pname, params);
+    *params_count = 0;
+    (void)yagl_host_glGetBooleanv(pname, params, params_maxcount, params_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glGetBufferParameteriv dispatcher. id = 45
+ * glGetBufferParameteriv dispatcher. id = 44
  */
-static bool yagl_func_glGetBufferParameteriv(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glGetBufferParameteriv(struct yagl_transport *t)
 {
-    GLenum target = yagl_marshal_get_GLenum(out_buff);
-    GLenum pname = yagl_marshal_get_GLenum(out_buff);
-    target_ulong params = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT3(glGetBufferParameteriv, GLenum, GLenum, target_ulong, target, pname, params);
-    bool res = yagl_host_glGetBufferParameteriv(target, pname, params);
+    GLenum target;
+    GLenum pname;
+    GLint *param;
+    target = yagl_transport_get_out_GLenum(t);
+    pname = yagl_transport_get_out_GLenum(t);
+    yagl_transport_get_in_arg(t, (void**)&param);
+    YAGL_LOG_FUNC_ENTER_SPLIT3(glGetBufferParameteriv, GLenum, GLenum, void*, target, pname, param);
+    (void)yagl_host_glGetBufferParameteriv(target, pname, param);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glGetError dispatcher. id = 46
+ * glGetError dispatcher. id = 45
  */
-static bool yagl_func_glGetError(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glGetError(struct yagl_transport *t)
 {
+    GLenum *retval;
+    yagl_transport_get_in_arg(t, (void**)&retval);
     YAGL_LOG_FUNC_ENTER_SPLIT0(glGetError);
-    GLenum retval;
-    bool res = yagl_host_glGetError(&retval);
-    if (!res) {
-        YAGL_LOG_FUNC_EXIT(NULL);
-        return false;
-    }
-    YAGL_LOG_FUNC_EXIT_SPLIT(GLenum, retval);
-    yagl_marshal_put_GLenum(&in_buff, retval);
+    *retval = yagl_host_glGetError();
+    YAGL_LOG_FUNC_EXIT_SPLIT(GLenum, *retval);
+
     return true;
 }
 
 /*
- * glGetFloatv dispatcher. id = 47
+ * glGetFloatv dispatcher. id = 46
  */
-static bool yagl_func_glGetFloatv(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glGetFloatv(struct yagl_transport *t)
 {
-    GLenum pname = yagl_marshal_get_GLenum(out_buff);
-    target_ulong params = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT2(glGetFloatv, GLenum, target_ulong, pname, params);
-    bool res = yagl_host_glGetFloatv(pname, params);
+    GLenum pname;
+    GLfloat *params;
+    int32_t params_maxcount;
+    int32_t *params_count;
+    pname = yagl_transport_get_out_GLenum(t);
+    if (!yagl_transport_get_in_array(t, sizeof(GLfloat), (void**)&params, &params_maxcount, &params_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT2(glGetFloatv, GLenum, void*, pname, params);
+    *params_count = 0;
+    (void)yagl_host_glGetFloatv(pname, params, params_maxcount, params_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glGetFramebufferAttachmentParameteriv dispatcher. id = 48
+ * glGetFramebufferAttachmentParameteriv dispatcher. id = 47
  */
-static bool yagl_func_glGetFramebufferAttachmentParameteriv(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glGetFramebufferAttachmentParameteriv(struct yagl_transport *t)
 {
-    GLenum target = yagl_marshal_get_GLenum(out_buff);
-    GLenum attachment = yagl_marshal_get_GLenum(out_buff);
-    GLenum pname = yagl_marshal_get_GLenum(out_buff);
-    target_ulong params = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT4(glGetFramebufferAttachmentParameteriv, GLenum, GLenum, GLenum, target_ulong, target, attachment, pname, params);
-    bool res = yagl_host_glGetFramebufferAttachmentParameteriv(target, attachment, pname, params);
+    GLenum target;
+    GLenum attachment;
+    GLenum pname;
+    GLint *param;
+    target = yagl_transport_get_out_GLenum(t);
+    attachment = yagl_transport_get_out_GLenum(t);
+    pname = yagl_transport_get_out_GLenum(t);
+    yagl_transport_get_in_arg(t, (void**)&param);
+    YAGL_LOG_FUNC_ENTER_SPLIT4(glGetFramebufferAttachmentParameteriv, GLenum, GLenum, GLenum, void*, target, attachment, pname, param);
+    (void)yagl_host_glGetFramebufferAttachmentParameteriv(target, attachment, pname, param);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glGetIntegerv dispatcher. id = 49
+ * glGetIntegerv dispatcher. id = 48
  */
-static bool yagl_func_glGetIntegerv(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glGetIntegerv(struct yagl_transport *t)
 {
-    GLenum pname = yagl_marshal_get_GLenum(out_buff);
-    target_ulong params = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT2(glGetIntegerv, GLenum, target_ulong, pname, params);
-    bool res = yagl_host_glGetIntegerv(pname, params);
+    GLenum pname;
+    GLint *params;
+    int32_t params_maxcount;
+    int32_t *params_count;
+    pname = yagl_transport_get_out_GLenum(t);
+    if (!yagl_transport_get_in_array(t, sizeof(GLint), (void**)&params, &params_maxcount, &params_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT2(glGetIntegerv, GLenum, void*, pname, params);
+    *params_count = 0;
+    (void)yagl_host_glGetIntegerv(pname, params, params_maxcount, params_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glGetRenderbufferParameteriv dispatcher. id = 50
+ * glGetRenderbufferParameteriv dispatcher. id = 49
  */
-static bool yagl_func_glGetRenderbufferParameteriv(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glGetRenderbufferParameteriv(struct yagl_transport *t)
 {
-    GLenum target = yagl_marshal_get_GLenum(out_buff);
-    GLenum pname = yagl_marshal_get_GLenum(out_buff);
-    target_ulong params = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT3(glGetRenderbufferParameteriv, GLenum, GLenum, target_ulong, target, pname, params);
-    bool res = yagl_host_glGetRenderbufferParameteriv(target, pname, params);
+    GLenum target;
+    GLenum pname;
+    GLint *param;
+    target = yagl_transport_get_out_GLenum(t);
+    pname = yagl_transport_get_out_GLenum(t);
+    yagl_transport_get_in_arg(t, (void**)&param);
+    YAGL_LOG_FUNC_ENTER_SPLIT3(glGetRenderbufferParameteriv, GLenum, GLenum, void*, target, pname, param);
+    (void)yagl_host_glGetRenderbufferParameteriv(target, pname, param);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glGetTexParameterfv dispatcher. id = 51
+ * glGetTexParameterfv dispatcher. id = 50
  */
-static bool yagl_func_glGetTexParameterfv(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glGetTexParameterfv(struct yagl_transport *t)
 {
-    GLenum target = yagl_marshal_get_GLenum(out_buff);
-    GLenum pname = yagl_marshal_get_GLenum(out_buff);
-    target_ulong params = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT3(glGetTexParameterfv, GLenum, GLenum, target_ulong, target, pname, params);
-    bool res = yagl_host_glGetTexParameterfv(target, pname, params);
+    GLenum target;
+    GLenum pname;
+    GLfloat *param;
+    target = yagl_transport_get_out_GLenum(t);
+    pname = yagl_transport_get_out_GLenum(t);
+    yagl_transport_get_in_arg(t, (void**)&param);
+    YAGL_LOG_FUNC_ENTER_SPLIT3(glGetTexParameterfv, GLenum, GLenum, void*, target, pname, param);
+    (void)yagl_host_glGetTexParameterfv(target, pname, param);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glGetTexParameteriv dispatcher. id = 52
+ * glGetTexParameteriv dispatcher. id = 51
  */
-static bool yagl_func_glGetTexParameteriv(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glGetTexParameteriv(struct yagl_transport *t)
 {
-    GLenum target = yagl_marshal_get_GLenum(out_buff);
-    GLenum pname = yagl_marshal_get_GLenum(out_buff);
-    target_ulong params = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT3(glGetTexParameteriv, GLenum, GLenum, target_ulong, target, pname, params);
-    bool res = yagl_host_glGetTexParameteriv(target, pname, params);
+    GLenum target;
+    GLenum pname;
+    GLint *param;
+    target = yagl_transport_get_out_GLenum(t);
+    pname = yagl_transport_get_out_GLenum(t);
+    yagl_transport_get_in_arg(t, (void**)&param);
+    YAGL_LOG_FUNC_ENTER_SPLIT3(glGetTexParameteriv, GLenum, GLenum, void*, target, pname, param);
+    (void)yagl_host_glGetTexParameteriv(target, pname, param);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glHint dispatcher. id = 53
+ * glHint dispatcher. id = 52
  */
-static bool yagl_func_glHint(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glHint(struct yagl_transport *t)
 {
-    GLenum target = yagl_marshal_get_GLenum(out_buff);
-    GLenum mode = yagl_marshal_get_GLenum(out_buff);
+    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);
-    bool res = yagl_host_glHint(target, mode);
+    (void)yagl_host_glHint(target, mode);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glIsBuffer dispatcher. id = 54
+ * glIsBuffer dispatcher. id = 53
  */
-static bool yagl_func_glIsBuffer(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glIsBuffer(struct yagl_transport *t)
 {
-    GLuint buffer = yagl_marshal_get_GLuint(out_buff);
+    GLuint buffer;
+    GLboolean *retval;
+    buffer = yagl_transport_get_out_GLuint(t);
+    yagl_transport_get_in_arg(t, (void**)&retval);
     YAGL_LOG_FUNC_ENTER_SPLIT1(glIsBuffer, GLuint, buffer);
-    GLboolean retval;
-    bool res = yagl_host_glIsBuffer(&retval, buffer);
-    if (!res) {
-        YAGL_LOG_FUNC_EXIT(NULL);
-        return false;
-    }
-    YAGL_LOG_FUNC_EXIT_SPLIT(GLboolean, retval);
-    yagl_marshal_put_GLboolean(&in_buff, retval);
+    *retval = yagl_host_glIsBuffer(buffer);
+    YAGL_LOG_FUNC_EXIT_SPLIT(GLboolean, *retval);
+
     return true;
 }
 
 /*
- * glIsEnabled dispatcher. id = 55
+ * glIsEnabled dispatcher. id = 54
  */
-static bool yagl_func_glIsEnabled(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glIsEnabled(struct yagl_transport *t)
 {
-    GLenum cap = yagl_marshal_get_GLenum(out_buff);
+    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);
-    GLboolean retval;
-    bool res = yagl_host_glIsEnabled(&retval, cap);
-    if (!res) {
-        YAGL_LOG_FUNC_EXIT(NULL);
-        return false;
-    }
-    YAGL_LOG_FUNC_EXIT_SPLIT(GLboolean, retval);
-    yagl_marshal_put_GLboolean(&in_buff, retval);
+    *retval = yagl_host_glIsEnabled(cap);
+    YAGL_LOG_FUNC_EXIT_SPLIT(GLboolean, *retval);
+
     return true;
 }
 
 /*
- * glIsFramebuffer dispatcher. id = 56
+ * glIsFramebuffer dispatcher. id = 55
  */
-static bool yagl_func_glIsFramebuffer(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glIsFramebuffer(struct yagl_transport *t)
 {
-    GLuint framebuffer = yagl_marshal_get_GLuint(out_buff);
+    GLuint framebuffer;
+    GLboolean *retval;
+    framebuffer = yagl_transport_get_out_GLuint(t);
+    yagl_transport_get_in_arg(t, (void**)&retval);
     YAGL_LOG_FUNC_ENTER_SPLIT1(glIsFramebuffer, GLuint, framebuffer);
-    GLboolean retval;
-    bool res = yagl_host_glIsFramebuffer(&retval, framebuffer);
-    if (!res) {
-        YAGL_LOG_FUNC_EXIT(NULL);
-        return false;
-    }
-    YAGL_LOG_FUNC_EXIT_SPLIT(GLboolean, retval);
-    yagl_marshal_put_GLboolean(&in_buff, retval);
+    *retval = yagl_host_glIsFramebuffer(framebuffer);
+    YAGL_LOG_FUNC_EXIT_SPLIT(GLboolean, *retval);
+
     return true;
 }
 
 /*
- * glIsRenderbuffer dispatcher. id = 57
+ * glIsRenderbuffer dispatcher. id = 56
  */
-static bool yagl_func_glIsRenderbuffer(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glIsRenderbuffer(struct yagl_transport *t)
 {
-    GLuint renderbuffer = yagl_marshal_get_GLuint(out_buff);
+    GLuint renderbuffer;
+    GLboolean *retval;
+    renderbuffer = yagl_transport_get_out_GLuint(t);
+    yagl_transport_get_in_arg(t, (void**)&retval);
     YAGL_LOG_FUNC_ENTER_SPLIT1(glIsRenderbuffer, GLuint, renderbuffer);
-    GLboolean retval;
-    bool res = yagl_host_glIsRenderbuffer(&retval, renderbuffer);
-    if (!res) {
-        YAGL_LOG_FUNC_EXIT(NULL);
-        return false;
-    }
-    YAGL_LOG_FUNC_EXIT_SPLIT(GLboolean, retval);
-    yagl_marshal_put_GLboolean(&in_buff, retval);
+    *retval = yagl_host_glIsRenderbuffer(renderbuffer);
+    YAGL_LOG_FUNC_EXIT_SPLIT(GLboolean, *retval);
+
     return true;
 }
 
 /*
- * glIsTexture dispatcher. id = 58
+ * glIsTexture dispatcher. id = 57
  */
-static bool yagl_func_glIsTexture(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glIsTexture(struct yagl_transport *t)
 {
-    GLuint texture = yagl_marshal_get_GLuint(out_buff);
+    GLuint texture;
+    GLboolean *retval;
+    texture = yagl_transport_get_out_GLuint(t);
+    yagl_transport_get_in_arg(t, (void**)&retval);
     YAGL_LOG_FUNC_ENTER_SPLIT1(glIsTexture, GLuint, texture);
-    GLboolean retval;
-    bool res = yagl_host_glIsTexture(&retval, texture);
-    if (!res) {
-        YAGL_LOG_FUNC_EXIT(NULL);
-        return false;
-    }
-    YAGL_LOG_FUNC_EXIT_SPLIT(GLboolean, retval);
-    yagl_marshal_put_GLboolean(&in_buff, retval);
+    *retval = yagl_host_glIsTexture(texture);
+    YAGL_LOG_FUNC_EXIT_SPLIT(GLboolean, *retval);
+
     return true;
 }
 
 /*
- * glLineWidth dispatcher. id = 59
+ * glLineWidth dispatcher. id = 58
  */
-static bool yagl_func_glLineWidth(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glLineWidth(struct yagl_transport *t)
 {
-    GLfloat width = yagl_marshal_get_GLfloat(out_buff);
+    GLfloat width;
+    width = yagl_transport_get_out_GLfloat(t);
     YAGL_LOG_FUNC_ENTER_SPLIT1(glLineWidth, GLfloat, width);
-    bool res = yagl_host_glLineWidth(width);
+    (void)yagl_host_glLineWidth(width);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glPixelStorei dispatcher. id = 60
+ * glPixelStorei dispatcher. id = 59
  */
-static bool yagl_func_glPixelStorei(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glPixelStorei(struct yagl_transport *t)
 {
-    GLenum pname = yagl_marshal_get_GLenum(out_buff);
-    GLint param = yagl_marshal_get_GLint(out_buff);
+    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);
-    bool res = yagl_host_glPixelStorei(pname, param);
+    (void)yagl_host_glPixelStorei(pname, param);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glPolygonOffset dispatcher. id = 61
+ * glPolygonOffset dispatcher. id = 60
  */
-static bool yagl_func_glPolygonOffset(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glPolygonOffset(struct yagl_transport *t)
 {
-    GLfloat factor = yagl_marshal_get_GLfloat(out_buff);
-    GLfloat units = yagl_marshal_get_GLfloat(out_buff);
+    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);
-    bool res = yagl_host_glPolygonOffset(factor, units);
+    (void)yagl_host_glPolygonOffset(factor, units);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glReadPixels dispatcher. id = 62
+ * glReadPixels dispatcher. id = 61
  */
-static bool yagl_func_glReadPixels(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glReadPixels(struct yagl_transport *t)
 {
-    GLint x = yagl_marshal_get_GLint(out_buff);
-    GLint y = yagl_marshal_get_GLint(out_buff);
-    GLsizei width = yagl_marshal_get_GLsizei(out_buff);
-    GLsizei height = yagl_marshal_get_GLsizei(out_buff);
-    GLenum format = yagl_marshal_get_GLenum(out_buff);
-    GLenum type = yagl_marshal_get_GLenum(out_buff);
-    target_ulong pixels = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT7(glReadPixels, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, target_ulong, x, y, width, height, format, type, pixels);
-    bool res = yagl_host_glReadPixels(x, y, width, height, format, type, pixels);
+    GLint x;
+    GLint y;
+    GLsizei width;
+    GLsizei height;
+    GLenum format;
+    GLenum type;
+    GLvoid *pixels;
+    int32_t pixels_maxcount;
+    int32_t *pixels_count;
+    x = yagl_transport_get_out_GLint(t);
+    y = yagl_transport_get_out_GLint(t);
+    width = yagl_transport_get_out_GLsizei(t);
+    height = yagl_transport_get_out_GLsizei(t);
+    format = yagl_transport_get_out_GLenum(t);
+    type = yagl_transport_get_out_GLenum(t);
+    if (!yagl_transport_get_in_array(t, 1, (void**)&pixels, &pixels_maxcount, &pixels_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT7(glReadPixels, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, void*, x, y, width, height, format, type, pixels);
+    *pixels_count = 0;
+    (void)yagl_host_glReadPixels(x, y, width, height, format, type, pixels, pixels_maxcount, pixels_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glRenderbufferStorage dispatcher. id = 63
+ * glRenderbufferStorage dispatcher. id = 62
  */
-static bool yagl_func_glRenderbufferStorage(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glRenderbufferStorage(struct yagl_transport *t)
 {
-    GLenum target = yagl_marshal_get_GLenum(out_buff);
-    GLenum internalformat = yagl_marshal_get_GLenum(out_buff);
-    GLsizei width = yagl_marshal_get_GLsizei(out_buff);
-    GLsizei height = yagl_marshal_get_GLsizei(out_buff);
+    GLenum target;
+    GLenum internalformat;
+    GLsizei width;
+    GLsizei height;
+    target = yagl_transport_get_out_GLenum(t);
+    internalformat = yagl_transport_get_out_GLenum(t);
+    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);
-    bool res = yagl_host_glRenderbufferStorage(target, internalformat, width, height);
+    (void)yagl_host_glRenderbufferStorage(target, internalformat, width, height);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glSampleCoverage dispatcher. id = 64
+ * glSampleCoverage dispatcher. id = 63
  */
-static bool yagl_func_glSampleCoverage(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glSampleCoverage(struct yagl_transport *t)
 {
-    GLclampf value = yagl_marshal_get_GLclampf(out_buff);
-    GLboolean invert = yagl_marshal_get_GLboolean(out_buff);
+    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);
-    bool res = yagl_host_glSampleCoverage(value, invert);
+    (void)yagl_host_glSampleCoverage(value, invert);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glScissor dispatcher. id = 65
+ * glScissor dispatcher. id = 64
  */
-static bool yagl_func_glScissor(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glScissor(struct yagl_transport *t)
 {
-    GLint x = yagl_marshal_get_GLint(out_buff);
-    GLint y = yagl_marshal_get_GLint(out_buff);
-    GLsizei width = yagl_marshal_get_GLsizei(out_buff);
-    GLsizei height = yagl_marshal_get_GLsizei(out_buff);
+    GLint x;
+    GLint y;
+    GLsizei width;
+    GLsizei height;
+    x = yagl_transport_get_out_GLint(t);
+    y = yagl_transport_get_out_GLint(t);
+    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);
-    bool res = yagl_host_glScissor(x, y, width, height);
+    (void)yagl_host_glScissor(x, y, width, height);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glStencilFunc dispatcher. id = 66
+ * glStencilFunc dispatcher. id = 65
  */
-static bool yagl_func_glStencilFunc(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glStencilFunc(struct yagl_transport *t)
 {
-    GLenum func = yagl_marshal_get_GLenum(out_buff);
-    GLint ref = yagl_marshal_get_GLint(out_buff);
-    GLuint mask = yagl_marshal_get_GLuint(out_buff);
+    GLenum func;
+    GLint ref;
+    GLuint mask;
+    func = yagl_transport_get_out_GLenum(t);
+    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);
-    bool res = yagl_host_glStencilFunc(func, ref, mask);
+    (void)yagl_host_glStencilFunc(func, ref, mask);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glStencilMask dispatcher. id = 67
+ * glStencilMask dispatcher. id = 66
  */
-static bool yagl_func_glStencilMask(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glStencilMask(struct yagl_transport *t)
 {
-    GLuint mask = yagl_marshal_get_GLuint(out_buff);
+    GLuint mask;
+    mask = yagl_transport_get_out_GLuint(t);
     YAGL_LOG_FUNC_ENTER_SPLIT1(glStencilMask, GLuint, mask);
-    bool res = yagl_host_glStencilMask(mask);
+    (void)yagl_host_glStencilMask(mask);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glStencilOp dispatcher. id = 68
+ * glStencilOp dispatcher. id = 67
  */
-static bool yagl_func_glStencilOp(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glStencilOp(struct yagl_transport *t)
 {
-    GLenum fail = yagl_marshal_get_GLenum(out_buff);
-    GLenum zfail = yagl_marshal_get_GLenum(out_buff);
-    GLenum zpass = yagl_marshal_get_GLenum(out_buff);
+    GLenum fail;
+    GLenum zfail;
+    GLenum zpass;
+    fail = yagl_transport_get_out_GLenum(t);
+    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);
-    bool res = yagl_host_glStencilOp(fail, zfail, zpass);
+    (void)yagl_host_glStencilOp(fail, zfail, zpass);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glTexImage2D dispatcher. id = 69
- */
-static bool yagl_func_glTexImage2D(uint8_t **out_buff,
-    uint8_t *in_buff)
-{
-    GLenum target = yagl_marshal_get_GLenum(out_buff);
-    GLint level = yagl_marshal_get_GLint(out_buff);
-    GLint internalformat = yagl_marshal_get_GLint(out_buff);
-    GLsizei width = yagl_marshal_get_GLsizei(out_buff);
-    GLsizei height = yagl_marshal_get_GLsizei(out_buff);
-    GLint border = yagl_marshal_get_GLint(out_buff);
-    GLenum format = yagl_marshal_get_GLenum(out_buff);
-    GLenum type = yagl_marshal_get_GLenum(out_buff);
-    target_ulong pixels = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT9(glTexImage2D, GLenum, GLint, GLint, GLsizei, GLsizei, GLint, GLenum, GLenum, target_ulong, target, level, internalformat, width, height, border, format, type, pixels);
-    bool res = yagl_host_glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels);
+ * glTexImage2D dispatcher. id = 68
+ */
+static bool yagl_func_glTexImage2D(struct yagl_transport *t)
+{
+    GLenum target;
+    GLint level;
+    GLint internalformat;
+    GLsizei width;
+    GLsizei height;
+    GLint border;
+    GLenum format;
+    GLenum type;
+    const GLvoid *pixels;
+    int32_t pixels_count;
+    target = yagl_transport_get_out_GLenum(t);
+    level = yagl_transport_get_out_GLint(t);
+    internalformat = yagl_transport_get_out_GLint(t);
+    width = yagl_transport_get_out_GLsizei(t);
+    height = yagl_transport_get_out_GLsizei(t);
+    border = yagl_transport_get_out_GLint(t);
+    format = yagl_transport_get_out_GLenum(t);
+    type = yagl_transport_get_out_GLenum(t);
+    if (!yagl_transport_get_out_array(t, 1, (const void**)&pixels, &pixels_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT9(glTexImage2D, GLenum, GLint, GLint, GLsizei, GLsizei, GLint, GLenum, GLenum, void*, target, level, internalformat, width, height, border, format, type, pixels);
+    (void)yagl_host_glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels, pixels_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glTexParameterf dispatcher. id = 70
+ * glTexParameterf dispatcher. id = 69
  */
-static bool yagl_func_glTexParameterf(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glTexParameterf(struct yagl_transport *t)
 {
-    GLenum target = yagl_marshal_get_GLenum(out_buff);
-    GLenum pname = yagl_marshal_get_GLenum(out_buff);
-    GLfloat param = yagl_marshal_get_GLfloat(out_buff);
+    GLenum target;
+    GLenum pname;
+    GLfloat param;
+    target = yagl_transport_get_out_GLenum(t);
+    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);
-    bool res = yagl_host_glTexParameterf(target, pname, param);
+    (void)yagl_host_glTexParameterf(target, pname, param);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glTexParameterfv dispatcher. id = 71
+ * glTexParameterfv dispatcher. id = 70
  */
-static bool yagl_func_glTexParameterfv(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glTexParameterfv(struct yagl_transport *t)
 {
-    GLenum target = yagl_marshal_get_GLenum(out_buff);
-    GLenum pname = yagl_marshal_get_GLenum(out_buff);
-    target_ulong params = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT3(glTexParameterfv, GLenum, GLenum, target_ulong, target, pname, params);
-    bool res = yagl_host_glTexParameterfv(target, pname, params);
+    GLenum target;
+    GLenum pname;
+    const GLfloat *params;
+    int32_t params_count;
+    target = yagl_transport_get_out_GLenum(t);
+    pname = yagl_transport_get_out_GLenum(t);
+    if (!yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&params, &params_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT3(glTexParameterfv, GLenum, GLenum, void*, target, pname, params);
+    (void)yagl_host_glTexParameterfv(target, pname, params, params_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glTexParameteri dispatcher. id = 72
+ * glTexParameteri dispatcher. id = 71
  */
-static bool yagl_func_glTexParameteri(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glTexParameteri(struct yagl_transport *t)
 {
-    GLenum target = yagl_marshal_get_GLenum(out_buff);
-    GLenum pname = yagl_marshal_get_GLenum(out_buff);
-    GLint param = yagl_marshal_get_GLint(out_buff);
+    GLenum target;
+    GLenum pname;
+    GLint param;
+    target = yagl_transport_get_out_GLenum(t);
+    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);
-    bool res = yagl_host_glTexParameteri(target, pname, param);
+    (void)yagl_host_glTexParameteri(target, pname, param);
+    YAGL_LOG_FUNC_EXIT(NULL);
+
+    return true;
+}
+
+/*
+ * glTexParameteriv dispatcher. id = 72
+ */
+static bool yagl_func_glTexParameteriv(struct yagl_transport *t)
+{
+    GLenum target;
+    GLenum pname;
+    const GLint *params;
+    int32_t params_count;
+    target = yagl_transport_get_out_GLenum(t);
+    pname = yagl_transport_get_out_GLenum(t);
+    if (!yagl_transport_get_out_array(t, sizeof(GLint), (const void**)&params, &params_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT3(glTexParameteriv, GLenum, GLenum, void*, target, pname, params);
+    (void)yagl_host_glTexParameteriv(target, pname, params, params_count);
+    YAGL_LOG_FUNC_EXIT(NULL);
+
+    return true;
+}
+
+/*
+ * glTexSubImage2D dispatcher. id = 73
+ */
+static bool yagl_func_glTexSubImage2D(struct yagl_transport *t)
+{
+    GLenum target;
+    GLint level;
+    GLint xoffset;
+    GLint yoffset;
+    GLsizei width;
+    GLsizei height;
+    GLenum format;
+    GLenum type;
+    const GLvoid *pixels;
+    int32_t pixels_count;
+    target = yagl_transport_get_out_GLenum(t);
+    level = yagl_transport_get_out_GLint(t);
+    xoffset = yagl_transport_get_out_GLint(t);
+    yoffset = yagl_transport_get_out_GLint(t);
+    width = yagl_transport_get_out_GLsizei(t);
+    height = yagl_transport_get_out_GLsizei(t);
+    format = yagl_transport_get_out_GLenum(t);
+    type = yagl_transport_get_out_GLenum(t);
+    if (!yagl_transport_get_out_array(t, 1, (const void**)&pixels, &pixels_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT9(glTexSubImage2D, GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, void*, target, level, xoffset, yoffset, width, height, format, type, pixels);
+    (void)yagl_host_glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels, pixels_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glTexParameteriv dispatcher. id = 73
+ * glViewport dispatcher. id = 74
  */
-static bool yagl_func_glTexParameteriv(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glViewport(struct yagl_transport *t)
 {
-    GLenum target = yagl_marshal_get_GLenum(out_buff);
-    GLenum pname = yagl_marshal_get_GLenum(out_buff);
-    target_ulong params = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT3(glTexParameteriv, GLenum, GLenum, target_ulong, target, pname, params);
-    bool res = yagl_host_glTexParameteriv(target, pname, params);
+    GLint x;
+    GLint y;
+    GLsizei width;
+    GLsizei height;
+    x = yagl_transport_get_out_GLint(t);
+    y = yagl_transport_get_out_GLint(t);
+    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);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glTexSubImage2D dispatcher. id = 74
+ * glTransferArrayYAGL dispatcher. id = 75
  */
-static bool yagl_func_glTexSubImage2D(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glTransferArrayYAGL(struct yagl_transport *t)
 {
-    GLenum target = yagl_marshal_get_GLenum(out_buff);
-    GLint level = yagl_marshal_get_GLint(out_buff);
-    GLint xoffset = yagl_marshal_get_GLint(out_buff);
-    GLint yoffset = yagl_marshal_get_GLint(out_buff);
-    GLsizei width = yagl_marshal_get_GLsizei(out_buff);
-    GLsizei height = yagl_marshal_get_GLsizei(out_buff);
-    GLenum format = yagl_marshal_get_GLenum(out_buff);
-    GLenum type = yagl_marshal_get_GLenum(out_buff);
-    target_ulong pixels = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT9(glTexSubImage2D, GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, target_ulong, target, level, xoffset, yoffset, width, height, format, type, pixels);
-    bool res = yagl_host_glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels);
+    GLuint indx;
+    GLint first;
+    const GLvoid *data;
+    int32_t data_count;
+    indx = yagl_transport_get_out_GLuint(t);
+    first = yagl_transport_get_out_GLint(t);
+    if (!yagl_transport_get_out_array(t, 1, (const void**)&data, &data_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT3(glTransferArrayYAGL, GLuint, GLint, void*, indx, first, data);
+    (void)yagl_host_glTransferArrayYAGL(indx, first, data, data_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glViewport dispatcher. id = 75
+ * glDrawElementsIndicesYAGL dispatcher. id = 76
  */
-static bool yagl_func_glViewport(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glDrawElementsIndicesYAGL(struct yagl_transport *t)
 {
-    GLint x = yagl_marshal_get_GLint(out_buff);
-    GLint y = yagl_marshal_get_GLint(out_buff);
-    GLsizei width = yagl_marshal_get_GLsizei(out_buff);
-    GLsizei height = yagl_marshal_get_GLsizei(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT4(glViewport, GLint, GLint, GLsizei, GLsizei, x, y, width, height);
-    bool res = yagl_host_glViewport(x, y, width, height);
+    GLenum mode;
+    GLenum type;
+    const GLvoid *indices;
+    int32_t indices_count;
+    mode = yagl_transport_get_out_GLenum(t);
+    type = yagl_transport_get_out_GLenum(t);
+    if (!yagl_transport_get_out_array(t, 1, (const void**)&indices, &indices_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT3(glDrawElementsIndicesYAGL, GLenum, GLenum, void*, mode, type, indices);
+    (void)yagl_host_glDrawElementsIndicesYAGL(mode, type, indices, indices_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
+}
+
+/*
+ * glDrawElementsOffsetYAGL dispatcher. id = 77
+ */
+static bool yagl_func_glDrawElementsOffsetYAGL(struct yagl_transport *t)
+{
+    GLenum mode;
+    GLenum type;
+    GLsizei offset;
+    GLsizei count;
+    mode = yagl_transport_get_out_GLenum(t);
+    type = yagl_transport_get_out_GLenum(t);
+    offset = yagl_transport_get_out_GLsizei(t);
+    count = yagl_transport_get_out_GLsizei(t);
+    YAGL_LOG_FUNC_ENTER_SPLIT4(glDrawElementsOffsetYAGL, GLenum, GLenum, GLsizei, GLsizei, mode, type, offset, count);
+    (void)yagl_host_glDrawElementsOffsetYAGL(mode, type, offset, count);
+    YAGL_LOG_FUNC_EXIT(NULL);
+
+    return true;
 }
 
 /*
- * glGetExtensionStringYAGL dispatcher. id = 76
+ * glGetExtensionStringYAGL dispatcher. id = 78
  */
-static bool yagl_func_glGetExtensionStringYAGL(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glGetExtensionStringYAGL(struct yagl_transport *t)
 {
-    target_ulong str = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT1(glGetExtensionStringYAGL, target_ulong, str);
-    GLuint retval;
-    bool res = yagl_host_glGetExtensionStringYAGL(&retval, str);
-    if (!res) {
-        YAGL_LOG_FUNC_EXIT(NULL);
+    GLchar *str;
+    int32_t str_maxcount;
+    int32_t *str_count;
+    if (!yagl_transport_get_in_array(t, sizeof(GLchar), (void**)&str, &str_maxcount, &str_count)) {
         return false;
     }
-    YAGL_LOG_FUNC_EXIT_SPLIT(GLuint, retval);
-    yagl_marshal_put_GLuint(&in_buff, retval);
+    YAGL_LOG_FUNC_ENTER_SPLIT1(glGetExtensionStringYAGL, void*, str);
+    *str_count = 0;
+    (void)yagl_host_glGetExtensionStringYAGL(str, str_maxcount, str_count);
+    YAGL_LOG_FUNC_EXIT(NULL);
+
     return true;
 }
 
 /*
- * glGetVertexAttribRangeYAGL dispatcher. id = 77
+ * glGetVertexAttribRangeYAGL dispatcher. id = 79
  */
-static bool yagl_func_glGetVertexAttribRangeYAGL(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glGetVertexAttribRangeYAGL(struct yagl_transport *t)
 {
-    GLsizei count = yagl_marshal_get_GLsizei(out_buff);
-    GLenum type = yagl_marshal_get_GLenum(out_buff);
-    target_ulong indices = yagl_marshal_get_ptr(out_buff);
-    target_ulong range_first = yagl_marshal_get_ptr(out_buff);
-    target_ulong range_count = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT5(glGetVertexAttribRangeYAGL, GLsizei, GLenum, target_ulong, target_ulong, target_ulong, count, type, indices, range_first, range_count);
-    bool res = yagl_host_glGetVertexAttribRangeYAGL(count, type, indices, range_first, range_count);
+    GLenum type;
+    GLsizei offset;
+    GLsizei count;
+    GLint *range_first;
+    GLsizei *range_count;
+    type = yagl_transport_get_out_GLenum(t);
+    offset = yagl_transport_get_out_GLsizei(t);
+    count = yagl_transport_get_out_GLsizei(t);
+    yagl_transport_get_in_arg(t, (void**)&range_first);
+    yagl_transport_get_in_arg(t, (void**)&range_count);
+    YAGL_LOG_FUNC_ENTER_SPLIT5(glGetVertexAttribRangeYAGL, GLenum, GLsizei, GLsizei, void*, void*, type, offset, count, range_first, range_count);
+    (void)yagl_host_glGetVertexAttribRangeYAGL(type, offset, count, range_first, range_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glAlphaFunc dispatcher. id = 78
+ * glAlphaFunc dispatcher. id = 80
  */
-static bool yagl_func_glAlphaFunc(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glAlphaFunc(struct yagl_transport *t)
 {
-    GLenum func = yagl_marshal_get_GLenum(out_buff);
-    GLclampf ref = yagl_marshal_get_GLclampf(out_buff);
+    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);
-    bool res = yagl_host_glAlphaFunc(func, ref);
+    (void)yagl_host_glAlphaFunc(func, ref);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glClipPlanef dispatcher. id = 79
+ * glClipPlanef dispatcher. id = 81
  */
-static bool yagl_func_glClipPlanef(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glClipPlanef(struct yagl_transport *t)
 {
-    GLenum plane = yagl_marshal_get_GLenum(out_buff);
-    target_ulong equation = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT2(glClipPlanef, GLenum, target_ulong, plane, equation);
-    bool res = yagl_host_glClipPlanef(plane, equation);
+    GLenum plane;
+    const GLfloat *equation;
+    int32_t equation_count;
+    plane = yagl_transport_get_out_GLenum(t);
+    if (!yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&equation, &equation_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT2(glClipPlanef, GLenum, void*, plane, equation);
+    (void)yagl_host_glClipPlanef(plane, equation, equation_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glColor4f dispatcher. id = 80
+ * glColor4f dispatcher. id = 82
  */
-static bool yagl_func_glColor4f(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glColor4f(struct yagl_transport *t)
 {
-    GLfloat red = yagl_marshal_get_GLfloat(out_buff);
-    GLfloat green = yagl_marshal_get_GLfloat(out_buff);
-    GLfloat blue = yagl_marshal_get_GLfloat(out_buff);
-    GLfloat alpha = yagl_marshal_get_GLfloat(out_buff);
+    GLfloat red;
+    GLfloat green;
+    GLfloat blue;
+    GLfloat alpha;
+    red = yagl_transport_get_out_GLfloat(t);
+    green = yagl_transport_get_out_GLfloat(t);
+    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);
-    bool res = yagl_host_glColor4f(red, green, blue, alpha);
+    (void)yagl_host_glColor4f(red, green, blue, alpha);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glFogf dispatcher. id = 81
+ * glFogf dispatcher. id = 83
  */
-static bool yagl_func_glFogf(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glFogf(struct yagl_transport *t)
 {
-    GLenum pname = yagl_marshal_get_GLenum(out_buff);
-    GLfloat param = yagl_marshal_get_GLfloat(out_buff);
+    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);
-    bool res = yagl_host_glFogf(pname, param);
+    (void)yagl_host_glFogf(pname, param);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glFogfv dispatcher. id = 82
+ * glFogfv dispatcher. id = 84
  */
-static bool yagl_func_glFogfv(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glFogfv(struct yagl_transport *t)
 {
-    GLenum pname = yagl_marshal_get_GLenum(out_buff);
-    target_ulong params = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT2(glFogfv, GLenum, target_ulong, pname, params);
-    bool res = yagl_host_glFogfv(pname, params);
+    GLenum pname;
+    const GLfloat *params;
+    int32_t params_count;
+    pname = yagl_transport_get_out_GLenum(t);
+    if (!yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&params, &params_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT2(glFogfv, GLenum, void*, pname, params);
+    (void)yagl_host_glFogfv(pname, params, params_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glFrustumf dispatcher. id = 83
+ * glFrustumf dispatcher. id = 85
  */
-static bool yagl_func_glFrustumf(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glFrustumf(struct yagl_transport *t)
 {
-    GLfloat left = yagl_marshal_get_GLfloat(out_buff);
-    GLfloat right = yagl_marshal_get_GLfloat(out_buff);
-    GLfloat bottom = yagl_marshal_get_GLfloat(out_buff);
-    GLfloat top = yagl_marshal_get_GLfloat(out_buff);
-    GLfloat zNear = yagl_marshal_get_GLfloat(out_buff);
-    GLfloat zFar = yagl_marshal_get_GLfloat(out_buff);
+    GLfloat left;
+    GLfloat right;
+    GLfloat bottom;
+    GLfloat top;
+    GLfloat zNear;
+    GLfloat zFar;
+    left = yagl_transport_get_out_GLfloat(t);
+    right = yagl_transport_get_out_GLfloat(t);
+    bottom = yagl_transport_get_out_GLfloat(t);
+    top = yagl_transport_get_out_GLfloat(t);
+    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);
-    bool res = yagl_host_glFrustumf(left, right, bottom, top, zNear, zFar);
+    (void)yagl_host_glFrustumf(left, right, bottom, top, zNear, zFar);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glGetClipPlanef dispatcher. id = 84
+ * glGetClipPlanef dispatcher. id = 86
  */
-static bool yagl_func_glGetClipPlanef(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glGetClipPlanef(struct yagl_transport *t)
 {
-    GLenum pname = yagl_marshal_get_GLenum(out_buff);
-    target_ulong eqn = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT2(glGetClipPlanef, GLenum, target_ulong, pname, eqn);
-    bool res = yagl_host_glGetClipPlanef(pname, eqn);
+    GLenum pname;
+    GLfloat *eqn;
+    int32_t eqn_maxcount;
+    int32_t *eqn_count;
+    pname = yagl_transport_get_out_GLenum(t);
+    if (!yagl_transport_get_in_array(t, sizeof(GLfloat), (void**)&eqn, &eqn_maxcount, &eqn_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT2(glGetClipPlanef, GLenum, void*, pname, eqn);
+    *eqn_count = 0;
+    (void)yagl_host_glGetClipPlanef(pname, eqn, eqn_maxcount, eqn_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glGetLightfv dispatcher. id = 85
+ * glGetLightfv dispatcher. id = 87
  */
-static bool yagl_func_glGetLightfv(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glGetLightfv(struct yagl_transport *t)
 {
-    GLenum light = yagl_marshal_get_GLenum(out_buff);
-    GLenum pname = yagl_marshal_get_GLenum(out_buff);
-    target_ulong params = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT3(glGetLightfv, GLenum, GLenum, target_ulong, light, pname, params);
-    bool res = yagl_host_glGetLightfv(light, pname, params);
+    GLenum light;
+    GLenum pname;
+    GLfloat *params;
+    int32_t params_maxcount;
+    int32_t *params_count;
+    light = yagl_transport_get_out_GLenum(t);
+    pname = yagl_transport_get_out_GLenum(t);
+    if (!yagl_transport_get_in_array(t, sizeof(GLfloat), (void**)&params, &params_maxcount, &params_count)) {
+        return false;
+    }
+    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);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glGetMaterialfv dispatcher. id = 86
+ * glGetMaterialfv dispatcher. id = 88
  */
-static bool yagl_func_glGetMaterialfv(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glGetMaterialfv(struct yagl_transport *t)
 {
-    GLenum face = yagl_marshal_get_GLenum(out_buff);
-    GLenum pname = yagl_marshal_get_GLenum(out_buff);
-    target_ulong params = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT3(glGetMaterialfv, GLenum, GLenum, target_ulong, face, pname, params);
-    bool res = yagl_host_glGetMaterialfv(face, pname, params);
+    GLenum face;
+    GLenum pname;
+    GLfloat *params;
+    int32_t params_maxcount;
+    int32_t *params_count;
+    face = yagl_transport_get_out_GLenum(t);
+    pname = yagl_transport_get_out_GLenum(t);
+    if (!yagl_transport_get_in_array(t, sizeof(GLfloat), (void**)&params, &params_maxcount, &params_count)) {
+        return false;
+    }
+    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);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glGetTexEnvfv dispatcher. id = 87
+ * glGetTexEnvfv dispatcher. id = 89
  */
-static bool yagl_func_glGetTexEnvfv(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glGetTexEnvfv(struct yagl_transport *t)
 {
-    GLenum env = yagl_marshal_get_GLenum(out_buff);
-    GLenum pname = yagl_marshal_get_GLenum(out_buff);
-    target_ulong params = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT3(glGetTexEnvfv, GLenum, GLenum, target_ulong, env, pname, params);
-    bool res = yagl_host_glGetTexEnvfv(env, pname, params);
+    GLenum env;
+    GLenum pname;
+    GLfloat *params;
+    int32_t params_maxcount;
+    int32_t *params_count;
+    env = yagl_transport_get_out_GLenum(t);
+    pname = yagl_transport_get_out_GLenum(t);
+    if (!yagl_transport_get_in_array(t, sizeof(GLfloat), (void**)&params, &params_maxcount, &params_count)) {
+        return false;
+    }
+    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);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glLightModelf dispatcher. id = 88
+ * glLightModelf dispatcher. id = 90
  */
-static bool yagl_func_glLightModelf(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glLightModelf(struct yagl_transport *t)
 {
-    GLenum pname = yagl_marshal_get_GLenum(out_buff);
-    GLfloat param = yagl_marshal_get_GLfloat(out_buff);
+    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);
-    bool res = yagl_host_glLightModelf(pname, param);
+    (void)yagl_host_glLightModelf(pname, param);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glLightModelfv dispatcher. id = 89
+ * glLightModelfv dispatcher. id = 91
  */
-static bool yagl_func_glLightModelfv(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glLightModelfv(struct yagl_transport *t)
 {
-    GLenum pname = yagl_marshal_get_GLenum(out_buff);
-    target_ulong params = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT2(glLightModelfv, GLenum, target_ulong, pname, params);
-    bool res = yagl_host_glLightModelfv(pname, params);
+    GLenum pname;
+    const GLfloat *params;
+    int32_t params_count;
+    pname = yagl_transport_get_out_GLenum(t);
+    if (!yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&params, &params_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT2(glLightModelfv, GLenum, void*, pname, params);
+    (void)yagl_host_glLightModelfv(pname, params, params_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glLightf dispatcher. id = 90
+ * glLightf dispatcher. id = 92
  */
-static bool yagl_func_glLightf(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glLightf(struct yagl_transport *t)
 {
-    GLenum light = yagl_marshal_get_GLenum(out_buff);
-    GLenum pname = yagl_marshal_get_GLenum(out_buff);
-    GLfloat param = yagl_marshal_get_GLfloat(out_buff);
+    GLenum light;
+    GLenum pname;
+    GLfloat param;
+    light = yagl_transport_get_out_GLenum(t);
+    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);
-    bool res = yagl_host_glLightf(light, pname, param);
+    (void)yagl_host_glLightf(light, pname, param);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glLightfv dispatcher. id = 91
+ * glLightfv dispatcher. id = 93
  */
-static bool yagl_func_glLightfv(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glLightfv(struct yagl_transport *t)
 {
-    GLenum light = yagl_marshal_get_GLenum(out_buff);
-    GLenum pname = yagl_marshal_get_GLenum(out_buff);
-    target_ulong params = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT3(glLightfv, GLenum, GLenum, target_ulong, light, pname, params);
-    bool res = yagl_host_glLightfv(light, pname, params);
+    GLenum light;
+    GLenum pname;
+    const GLfloat *params;
+    int32_t params_count;
+    light = yagl_transport_get_out_GLenum(t);
+    pname = yagl_transport_get_out_GLenum(t);
+    if (!yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&params, &params_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT3(glLightfv, GLenum, GLenum, void*, light, pname, params);
+    (void)yagl_host_glLightfv(light, pname, params, params_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glLoadMatrixf dispatcher. id = 92
+ * glLoadMatrixf dispatcher. id = 94
  */
-static bool yagl_func_glLoadMatrixf(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glLoadMatrixf(struct yagl_transport *t)
 {
-    target_ulong m = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT1(glLoadMatrixf, target_ulong, m);
-    bool res = yagl_host_glLoadMatrixf(m);
+    const GLfloat *m;
+    int32_t m_count;
+    if (!yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&m, &m_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT1(glLoadMatrixf, void*, m);
+    (void)yagl_host_glLoadMatrixf(m, m_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glMaterialf dispatcher. id = 93
+ * glMaterialf dispatcher. id = 95
  */
-static bool yagl_func_glMaterialf(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glMaterialf(struct yagl_transport *t)
 {
-    GLenum face = yagl_marshal_get_GLenum(out_buff);
-    GLenum pname = yagl_marshal_get_GLenum(out_buff);
-    GLfloat param = yagl_marshal_get_GLfloat(out_buff);
+    GLenum face;
+    GLenum pname;
+    GLfloat param;
+    face = yagl_transport_get_out_GLenum(t);
+    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);
-    bool res = yagl_host_glMaterialf(face, pname, param);
+    (void)yagl_host_glMaterialf(face, pname, param);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glMaterialfv dispatcher. id = 94
+ * glMaterialfv dispatcher. id = 96
  */
-static bool yagl_func_glMaterialfv(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glMaterialfv(struct yagl_transport *t)
 {
-    GLenum face = yagl_marshal_get_GLenum(out_buff);
-    GLenum pname = yagl_marshal_get_GLenum(out_buff);
-    target_ulong params = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT3(glMaterialfv, GLenum, GLenum, target_ulong, face, pname, params);
-    bool res = yagl_host_glMaterialfv(face, pname, params);
+    GLenum face;
+    GLenum pname;
+    const GLfloat *params;
+    int32_t params_count;
+    face = yagl_transport_get_out_GLenum(t);
+    pname = yagl_transport_get_out_GLenum(t);
+    if (!yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&params, &params_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT3(glMaterialfv, GLenum, GLenum, void*, face, pname, params);
+    (void)yagl_host_glMaterialfv(face, pname, params, params_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glMultMatrixf dispatcher. id = 95
+ * glMultMatrixf dispatcher. id = 97
  */
-static bool yagl_func_glMultMatrixf(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glMultMatrixf(struct yagl_transport *t)
 {
-    target_ulong m = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT1(glMultMatrixf, target_ulong, m);
-    bool res = yagl_host_glMultMatrixf(m);
+    const GLfloat *m;
+    int32_t m_count;
+    if (!yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&m, &m_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT1(glMultMatrixf, void*, m);
+    (void)yagl_host_glMultMatrixf(m, m_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glMultiTexCoord4f dispatcher. id = 96
+ * glMultiTexCoord4f dispatcher. id = 98
  */
-static bool yagl_func_glMultiTexCoord4f(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glMultiTexCoord4f(struct yagl_transport *t)
 {
-    GLenum target = yagl_marshal_get_GLenum(out_buff);
-    GLfloat s = yagl_marshal_get_GLfloat(out_buff);
-    GLfloat t = yagl_marshal_get_GLfloat(out_buff);
-    GLfloat r = yagl_marshal_get_GLfloat(out_buff);
-    GLfloat q = yagl_marshal_get_GLfloat(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT5(glMultiTexCoord4f, GLenum, GLfloat, GLfloat, GLfloat, GLfloat, target, s, t, r, q);
-    bool res = yagl_host_glMultiTexCoord4f(target, s, t, r, q);
+    GLenum target;
+    GLfloat s;
+    GLfloat tt;
+    GLfloat r;
+    GLfloat q;
+    target = yagl_transport_get_out_GLenum(t);
+    s = yagl_transport_get_out_GLfloat(t);
+    tt = yagl_transport_get_out_GLfloat(t);
+    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);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glNormal3f dispatcher. id = 97
+ * glNormal3f dispatcher. id = 99
  */
-static bool yagl_func_glNormal3f(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glNormal3f(struct yagl_transport *t)
 {
-    GLfloat nx = yagl_marshal_get_GLfloat(out_buff);
-    GLfloat ny = yagl_marshal_get_GLfloat(out_buff);
-    GLfloat nz = yagl_marshal_get_GLfloat(out_buff);
+    GLfloat nx;
+    GLfloat ny;
+    GLfloat nz;
+    nx = yagl_transport_get_out_GLfloat(t);
+    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);
-    bool res = yagl_host_glNormal3f(nx, ny, nz);
+    (void)yagl_host_glNormal3f(nx, ny, nz);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glOrthof dispatcher. id = 98
+ * glOrthof dispatcher. id = 100
  */
-static bool yagl_func_glOrthof(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glOrthof(struct yagl_transport *t)
 {
-    GLfloat left = yagl_marshal_get_GLfloat(out_buff);
-    GLfloat right = yagl_marshal_get_GLfloat(out_buff);
-    GLfloat bottom = yagl_marshal_get_GLfloat(out_buff);
-    GLfloat top = yagl_marshal_get_GLfloat(out_buff);
-    GLfloat zNear = yagl_marshal_get_GLfloat(out_buff);
-    GLfloat zFar = yagl_marshal_get_GLfloat(out_buff);
+    GLfloat left;
+    GLfloat right;
+    GLfloat bottom;
+    GLfloat top;
+    GLfloat zNear;
+    GLfloat zFar;
+    left = yagl_transport_get_out_GLfloat(t);
+    right = yagl_transport_get_out_GLfloat(t);
+    bottom = yagl_transport_get_out_GLfloat(t);
+    top = yagl_transport_get_out_GLfloat(t);
+    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);
-    bool res = yagl_host_glOrthof(left, right, bottom, top, zNear, zFar);
+    (void)yagl_host_glOrthof(left, right, bottom, top, zNear, zFar);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glPointParameterf dispatcher. id = 99
+ * glPointParameterf dispatcher. id = 101
  */
-static bool yagl_func_glPointParameterf(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glPointParameterf(struct yagl_transport *t)
 {
-    GLenum pname = yagl_marshal_get_GLenum(out_buff);
-    GLfloat param = yagl_marshal_get_GLfloat(out_buff);
+    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);
-    bool res = yagl_host_glPointParameterf(pname, param);
+    (void)yagl_host_glPointParameterf(pname, param);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glPointParameterfv dispatcher. id = 100
+ * glPointParameterfv dispatcher. id = 102
  */
-static bool yagl_func_glPointParameterfv(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glPointParameterfv(struct yagl_transport *t)
 {
-    GLenum pname = yagl_marshal_get_GLenum(out_buff);
-    target_ulong params = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT2(glPointParameterfv, GLenum, target_ulong, pname, params);
-    bool res = yagl_host_glPointParameterfv(pname, params);
+    GLenum pname;
+    const GLfloat *params;
+    int32_t params_count;
+    pname = yagl_transport_get_out_GLenum(t);
+    if (!yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&params, &params_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT2(glPointParameterfv, GLenum, void*, pname, params);
+    (void)yagl_host_glPointParameterfv(pname, params, params_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glPointSize dispatcher. id = 101
+ * glPointSize dispatcher. id = 103
  */
-static bool yagl_func_glPointSize(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glPointSize(struct yagl_transport *t)
 {
-    GLfloat size = yagl_marshal_get_GLfloat(out_buff);
+    GLfloat size;
+    size = yagl_transport_get_out_GLfloat(t);
     YAGL_LOG_FUNC_ENTER_SPLIT1(glPointSize, GLfloat, size);
-    bool res = yagl_host_glPointSize(size);
+    (void)yagl_host_glPointSize(size);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glPointSizePointerOES dispatcher. id = 102
+ * glPointSizePointerOES dispatcher. id = 104
  */
-static bool yagl_func_glPointSizePointerOES(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glPointSizePointerOES(struct yagl_transport *t)
 {
-    GLenum type = yagl_marshal_get_GLenum(out_buff);
-    GLsizei stride = yagl_marshal_get_GLsizei(out_buff);
-    target_ulong pointer = yagl_marshal_get_ptr(out_buff);
+    GLenum type;
+    GLsizei stride;
+    target_ulong pointer;
+    type = yagl_transport_get_out_GLenum(t);
+    stride = yagl_transport_get_out_GLsizei(t);
+    pointer = yagl_transport_get_out_va(t);
     YAGL_LOG_FUNC_ENTER_SPLIT3(glPointSizePointerOES, GLenum, GLsizei, target_ulong, type, stride, pointer);
-    bool res = yagl_host_glPointSizePointerOES(type, stride, pointer);
+    (void)yagl_host_glPointSizePointerOES(type, stride, pointer);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glRotatef dispatcher. id = 103
+ * glRotatef dispatcher. id = 105
  */
-static bool yagl_func_glRotatef(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glRotatef(struct yagl_transport *t)
 {
-    GLfloat angle = yagl_marshal_get_GLfloat(out_buff);
-    GLfloat x = yagl_marshal_get_GLfloat(out_buff);
-    GLfloat y = yagl_marshal_get_GLfloat(out_buff);
-    GLfloat z = yagl_marshal_get_GLfloat(out_buff);
+    GLfloat angle;
+    GLfloat x;
+    GLfloat y;
+    GLfloat z;
+    angle = yagl_transport_get_out_GLfloat(t);
+    x = yagl_transport_get_out_GLfloat(t);
+    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);
-    bool res = yagl_host_glRotatef(angle, x, y, z);
+    (void)yagl_host_glRotatef(angle, x, y, z);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glScalef dispatcher. id = 104
+ * glScalef dispatcher. id = 106
  */
-static bool yagl_func_glScalef(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glScalef(struct yagl_transport *t)
 {
-    GLfloat x = yagl_marshal_get_GLfloat(out_buff);
-    GLfloat y = yagl_marshal_get_GLfloat(out_buff);
-    GLfloat z = yagl_marshal_get_GLfloat(out_buff);
+    GLfloat x;
+    GLfloat y;
+    GLfloat z;
+    x = yagl_transport_get_out_GLfloat(t);
+    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);
-    bool res = yagl_host_glScalef(x, y, z);
+    (void)yagl_host_glScalef(x, y, z);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glTexEnvf dispatcher. id = 105
+ * glTexEnvf dispatcher. id = 107
  */
-static bool yagl_func_glTexEnvf(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glTexEnvf(struct yagl_transport *t)
 {
-    GLenum target = yagl_marshal_get_GLenum(out_buff);
-    GLenum pname = yagl_marshal_get_GLenum(out_buff);
-    GLfloat param = yagl_marshal_get_GLfloat(out_buff);
+    GLenum target;
+    GLenum pname;
+    GLfloat param;
+    target = yagl_transport_get_out_GLenum(t);
+    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);
-    bool res = yagl_host_glTexEnvf(target, pname, param);
+    (void)yagl_host_glTexEnvf(target, pname, param);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glTexEnvfv dispatcher. id = 106
+ * glTexEnvfv dispatcher. id = 108
  */
-static bool yagl_func_glTexEnvfv(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glTexEnvfv(struct yagl_transport *t)
 {
-    GLenum target = yagl_marshal_get_GLenum(out_buff);
-    GLenum pname = yagl_marshal_get_GLenum(out_buff);
-    target_ulong params = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT3(glTexEnvfv, GLenum, GLenum, target_ulong, target, pname, params);
-    bool res = yagl_host_glTexEnvfv(target, pname, params);
+    GLenum target;
+    GLenum pname;
+    const GLfloat *params;
+    int32_t params_count;
+    target = yagl_transport_get_out_GLenum(t);
+    pname = yagl_transport_get_out_GLenum(t);
+    if (!yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&params, &params_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT3(glTexEnvfv, GLenum, GLenum, void*, target, pname, params);
+    (void)yagl_host_glTexEnvfv(target, pname, params, params_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glTranslatef dispatcher. id = 107
+ * glTranslatef dispatcher. id = 109
  */
-static bool yagl_func_glTranslatef(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glTranslatef(struct yagl_transport *t)
 {
-    GLfloat x = yagl_marshal_get_GLfloat(out_buff);
-    GLfloat y = yagl_marshal_get_GLfloat(out_buff);
-    GLfloat z = yagl_marshal_get_GLfloat(out_buff);
+    GLfloat x;
+    GLfloat y;
+    GLfloat z;
+    x = yagl_transport_get_out_GLfloat(t);
+    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);
-    bool res = yagl_host_glTranslatef(x, y, z);
+    (void)yagl_host_glTranslatef(x, y, z);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glAlphaFuncx dispatcher. id = 108
+ * glAlphaFuncx dispatcher. id = 110
  */
-static bool yagl_func_glAlphaFuncx(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glAlphaFuncx(struct yagl_transport *t)
 {
-    GLenum func = yagl_marshal_get_GLenum(out_buff);
-    GLclampx ref = yagl_marshal_get_GLclampx(out_buff);
+    GLenum func;
+    GLclampx ref;
+    func = yagl_transport_get_out_GLenum(t);
+    ref = yagl_transport_get_out_GLclampx(t);
     YAGL_LOG_FUNC_ENTER_SPLIT2(glAlphaFuncx, GLenum, GLclampx, func, ref);
-    bool res = yagl_host_glAlphaFuncx(func, ref);
+    (void)yagl_host_glAlphaFuncx(func, ref);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glClearColorx dispatcher. id = 109
+ * glClearColorx dispatcher. id = 111
  */
-static bool yagl_func_glClearColorx(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glClearColorx(struct yagl_transport *t)
 {
-    GLclampx red = yagl_marshal_get_GLclampx(out_buff);
-    GLclampx green = yagl_marshal_get_GLclampx(out_buff);
-    GLclampx blue = yagl_marshal_get_GLclampx(out_buff);
-    GLclampx alpha = yagl_marshal_get_GLclampx(out_buff);
+    GLclampx red;
+    GLclampx green;
+    GLclampx blue;
+    GLclampx alpha;
+    red = yagl_transport_get_out_GLclampx(t);
+    green = yagl_transport_get_out_GLclampx(t);
+    blue = yagl_transport_get_out_GLclampx(t);
+    alpha = yagl_transport_get_out_GLclampx(t);
     YAGL_LOG_FUNC_ENTER_SPLIT4(glClearColorx, GLclampx, GLclampx, GLclampx, GLclampx, red, green, blue, alpha);
-    bool res = yagl_host_glClearColorx(red, green, blue, alpha);
+    (void)yagl_host_glClearColorx(red, green, blue, alpha);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glClearDepthx dispatcher. id = 110
+ * glClearDepthx dispatcher. id = 112
  */
-static bool yagl_func_glClearDepthx(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glClearDepthx(struct yagl_transport *t)
 {
-    GLclampx depth = yagl_marshal_get_GLclampx(out_buff);
+    GLclampx depth;
+    depth = yagl_transport_get_out_GLclampx(t);
     YAGL_LOG_FUNC_ENTER_SPLIT1(glClearDepthx, GLclampx, depth);
-    bool res = yagl_host_glClearDepthx(depth);
+    (void)yagl_host_glClearDepthx(depth);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glClientActiveTexture dispatcher. id = 111
+ * glClientActiveTexture dispatcher. id = 113
  */
-static bool yagl_func_glClientActiveTexture(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glClientActiveTexture(struct yagl_transport *t)
 {
-    GLenum texture = yagl_marshal_get_GLenum(out_buff);
+    GLenum texture;
+    texture = yagl_transport_get_out_GLenum(t);
     YAGL_LOG_FUNC_ENTER_SPLIT1(glClientActiveTexture, GLenum, texture);
-    bool res = yagl_host_glClientActiveTexture(texture);
+    (void)yagl_host_glClientActiveTexture(texture);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glClipPlanex dispatcher. id = 112
+ * glClipPlanex dispatcher. id = 114
  */
-static bool yagl_func_glClipPlanex(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glClipPlanex(struct yagl_transport *t)
 {
-    GLenum plane = yagl_marshal_get_GLenum(out_buff);
-    target_ulong equation = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT2(glClipPlanex, GLenum, target_ulong, plane, equation);
-    bool res = yagl_host_glClipPlanex(plane, equation);
+    GLenum plane;
+    const GLfixed *equation;
+    int32_t equation_count;
+    plane = yagl_transport_get_out_GLenum(t);
+    if (!yagl_transport_get_out_array(t, sizeof(GLfixed), (const void**)&equation, &equation_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT2(glClipPlanex, GLenum, void*, plane, equation);
+    (void)yagl_host_glClipPlanex(plane, equation, equation_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glColor4ub dispatcher. id = 113
+ * glColor4ub dispatcher. id = 115
  */
-static bool yagl_func_glColor4ub(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glColor4ub(struct yagl_transport *t)
 {
-    GLubyte red = yagl_marshal_get_GLubyte(out_buff);
-    GLubyte green = yagl_marshal_get_GLubyte(out_buff);
-    GLubyte blue = yagl_marshal_get_GLubyte(out_buff);
-    GLubyte alpha = yagl_marshal_get_GLubyte(out_buff);
+    GLubyte red;
+    GLubyte green;
+    GLubyte blue;
+    GLubyte alpha;
+    red = yagl_transport_get_out_GLubyte(t);
+    green = yagl_transport_get_out_GLubyte(t);
+    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);
-    bool res = yagl_host_glColor4ub(red, green, blue, alpha);
+    (void)yagl_host_glColor4ub(red, green, blue, alpha);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glColor4x dispatcher. id = 114
+ * glColor4x dispatcher. id = 116
  */
-static bool yagl_func_glColor4x(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glColor4x(struct yagl_transport *t)
 {
-    GLfixed red = yagl_marshal_get_GLfixed(out_buff);
-    GLfixed green = yagl_marshal_get_GLfixed(out_buff);
-    GLfixed blue = yagl_marshal_get_GLfixed(out_buff);
-    GLfixed alpha = yagl_marshal_get_GLfixed(out_buff);
+    GLfixed red;
+    GLfixed green;
+    GLfixed blue;
+    GLfixed alpha;
+    red = yagl_transport_get_out_GLfixed(t);
+    green = yagl_transport_get_out_GLfixed(t);
+    blue = yagl_transport_get_out_GLfixed(t);
+    alpha = yagl_transport_get_out_GLfixed(t);
     YAGL_LOG_FUNC_ENTER_SPLIT4(glColor4x, GLfixed, GLfixed, GLfixed, GLfixed, red, green, blue, alpha);
-    bool res = yagl_host_glColor4x(red, green, blue, alpha);
+    (void)yagl_host_glColor4x(red, green, blue, alpha);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glColorPointer dispatcher. id = 115
+ * glColorPointer dispatcher. id = 117
  */
-static bool yagl_func_glColorPointer(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glColorPointer(struct yagl_transport *t)
 {
-    GLint size = yagl_marshal_get_GLint(out_buff);
-    GLenum type = yagl_marshal_get_GLenum(out_buff);
-    GLsizei stride = yagl_marshal_get_GLsizei(out_buff);
-    target_ulong pointer = yagl_marshal_get_ptr(out_buff);
+    GLint size;
+    GLenum type;
+    GLsizei stride;
+    target_ulong pointer;
+    size = yagl_transport_get_out_GLint(t);
+    type = yagl_transport_get_out_GLenum(t);
+    stride = yagl_transport_get_out_GLsizei(t);
+    pointer = yagl_transport_get_out_va(t);
     YAGL_LOG_FUNC_ENTER_SPLIT4(glColorPointer, GLint, GLenum, GLsizei, target_ulong, size, type, stride, pointer);
-    bool res = yagl_host_glColorPointer(size, type, stride, pointer);
+    (void)yagl_host_glColorPointer(size, type, stride, pointer);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glDepthRangex dispatcher. id = 116
+ * glDepthRangex dispatcher. id = 118
  */
-static bool yagl_func_glDepthRangex(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glDepthRangex(struct yagl_transport *t)
 {
-    GLclampx zNear = yagl_marshal_get_GLclampx(out_buff);
-    GLclampx zFar = yagl_marshal_get_GLclampx(out_buff);
+    GLclampx zNear;
+    GLclampx zFar;
+    zNear = yagl_transport_get_out_GLclampx(t);
+    zFar = yagl_transport_get_out_GLclampx(t);
     YAGL_LOG_FUNC_ENTER_SPLIT2(glDepthRangex, GLclampx, GLclampx, zNear, zFar);
-    bool res = yagl_host_glDepthRangex(zNear, zFar);
+    (void)yagl_host_glDepthRangex(zNear, zFar);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glDisableClientState dispatcher. id = 117
+ * glDisableClientState dispatcher. id = 119
  */
-static bool yagl_func_glDisableClientState(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glDisableClientState(struct yagl_transport *t)
 {
-    GLenum array = yagl_marshal_get_GLenum(out_buff);
+    GLenum array;
+    array = yagl_transport_get_out_GLenum(t);
     YAGL_LOG_FUNC_ENTER_SPLIT1(glDisableClientState, GLenum, array);
-    bool res = yagl_host_glDisableClientState(array);
+    (void)yagl_host_glDisableClientState(array);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glEnableClientState dispatcher. id = 118
+ * glEnableClientState dispatcher. id = 120
  */
-static bool yagl_func_glEnableClientState(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glEnableClientState(struct yagl_transport *t)
 {
-    GLenum array = yagl_marshal_get_GLenum(out_buff);
+    GLenum array;
+    array = yagl_transport_get_out_GLenum(t);
     YAGL_LOG_FUNC_ENTER_SPLIT1(glEnableClientState, GLenum, array);
-    bool res = yagl_host_glEnableClientState(array);
+    (void)yagl_host_glEnableClientState(array);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glFogx dispatcher. id = 119
+ * glFogx dispatcher. id = 121
  */
-static bool yagl_func_glFogx(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glFogx(struct yagl_transport *t)
 {
-    GLenum pname = yagl_marshal_get_GLenum(out_buff);
-    GLfixed param = yagl_marshal_get_GLfixed(out_buff);
+    GLenum pname;
+    GLfixed param;
+    pname = yagl_transport_get_out_GLenum(t);
+    param = yagl_transport_get_out_GLfixed(t);
     YAGL_LOG_FUNC_ENTER_SPLIT2(glFogx, GLenum, GLfixed, pname, param);
-    bool res = yagl_host_glFogx(pname, param);
+    (void)yagl_host_glFogx(pname, param);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glFogxv dispatcher. id = 120
+ * glFogxv dispatcher. id = 122
  */
-static bool yagl_func_glFogxv(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glFogxv(struct yagl_transport *t)
 {
-    GLenum pname = yagl_marshal_get_GLenum(out_buff);
-    target_ulong params = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT2(glFogxv, GLenum, target_ulong, pname, params);
-    bool res = yagl_host_glFogxv(pname, params);
+    GLenum pname;
+    const GLfixed *params;
+    int32_t params_count;
+    pname = yagl_transport_get_out_GLenum(t);
+    if (!yagl_transport_get_out_array(t, sizeof(GLfixed), (const void**)&params, &params_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT2(glFogxv, GLenum, void*, pname, params);
+    (void)yagl_host_glFogxv(pname, params, params_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glFrustumx dispatcher. id = 121
+ * glFrustumx dispatcher. id = 123
  */
-static bool yagl_func_glFrustumx(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glFrustumx(struct yagl_transport *t)
 {
-    GLfixed left = yagl_marshal_get_GLfixed(out_buff);
-    GLfixed right = yagl_marshal_get_GLfixed(out_buff);
-    GLfixed bottom = yagl_marshal_get_GLfixed(out_buff);
-    GLfixed top = yagl_marshal_get_GLfixed(out_buff);
-    GLfixed zNear = yagl_marshal_get_GLfixed(out_buff);
-    GLfixed zFar = yagl_marshal_get_GLfixed(out_buff);
+    GLfixed left;
+    GLfixed right;
+    GLfixed bottom;
+    GLfixed top;
+    GLfixed zNear;
+    GLfixed zFar;
+    left = yagl_transport_get_out_GLfixed(t);
+    right = yagl_transport_get_out_GLfixed(t);
+    bottom = yagl_transport_get_out_GLfixed(t);
+    top = yagl_transport_get_out_GLfixed(t);
+    zNear = yagl_transport_get_out_GLfixed(t);
+    zFar = yagl_transport_get_out_GLfixed(t);
     YAGL_LOG_FUNC_ENTER_SPLIT6(glFrustumx, GLfixed, GLfixed, GLfixed, GLfixed, GLfixed, GLfixed, left, right, bottom, top, zNear, zFar);
-    bool res = yagl_host_glFrustumx(left, right, bottom, top, zNear, zFar);
+    (void)yagl_host_glFrustumx(left, right, bottom, top, zNear, zFar);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glGetClipPlanex dispatcher. id = 122
+ * glGetClipPlanex dispatcher. id = 124
  */
-static bool yagl_func_glGetClipPlanex(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glGetClipPlanex(struct yagl_transport *t)
 {
-    GLenum pname = yagl_marshal_get_GLenum(out_buff);
-    target_ulong eqn = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT2(glGetClipPlanex, GLenum, target_ulong, pname, eqn);
-    bool res = yagl_host_glGetClipPlanex(pname, eqn);
+    GLenum pname;
+    GLfixed *eqn;
+    int32_t eqn_maxcount;
+    int32_t *eqn_count;
+    pname = yagl_transport_get_out_GLenum(t);
+    if (!yagl_transport_get_in_array(t, sizeof(GLfixed), (void**)&eqn, &eqn_maxcount, &eqn_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT2(glGetClipPlanex, GLenum, void*, pname, eqn);
+    *eqn_count = 0;
+    (void)yagl_host_glGetClipPlanex(pname, eqn, eqn_maxcount, eqn_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glGetFixedv dispatcher. id = 123
+ * glGetFixedv dispatcher. id = 125
  */
-static bool yagl_func_glGetFixedv(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glGetFixedv(struct yagl_transport *t)
 {
-    GLenum pname = yagl_marshal_get_GLenum(out_buff);
-    target_ulong params = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT2(glGetFixedv, GLenum, target_ulong, pname, params);
-    bool res = yagl_host_glGetFixedv(pname, params);
+    GLenum pname;
+    GLfixed *params;
+    int32_t params_maxcount;
+    int32_t *params_count;
+    pname = yagl_transport_get_out_GLenum(t);
+    if (!yagl_transport_get_in_array(t, sizeof(GLfixed), (void**)&params, &params_maxcount, &params_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT2(glGetFixedv, GLenum, void*, pname, params);
+    *params_count = 0;
+    (void)yagl_host_glGetFixedv(pname, params, params_maxcount, params_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glGetLightxv dispatcher. id = 124
+ * glGetLightxv dispatcher. id = 126
  */
-static bool yagl_func_glGetLightxv(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glGetLightxv(struct yagl_transport *t)
 {
-    GLenum light = yagl_marshal_get_GLenum(out_buff);
-    GLenum pname = yagl_marshal_get_GLenum(out_buff);
-    target_ulong params = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT3(glGetLightxv, GLenum, GLenum, target_ulong, light, pname, params);
-    bool res = yagl_host_glGetLightxv(light, pname, params);
+    GLenum light;
+    GLenum pname;
+    GLfixed *params;
+    int32_t params_maxcount;
+    int32_t *params_count;
+    light = yagl_transport_get_out_GLenum(t);
+    pname = yagl_transport_get_out_GLenum(t);
+    if (!yagl_transport_get_in_array(t, sizeof(GLfixed), (void**)&params, &params_maxcount, &params_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT3(glGetLightxv, GLenum, GLenum, void*, light, pname, params);
+    *params_count = 0;
+    (void)yagl_host_glGetLightxv(light, pname, params, params_maxcount, params_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glGetMaterialxv dispatcher. id = 125
+ * glGetMaterialxv dispatcher. id = 127
  */
-static bool yagl_func_glGetMaterialxv(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glGetMaterialxv(struct yagl_transport *t)
 {
-    GLenum face = yagl_marshal_get_GLenum(out_buff);
-    GLenum pname = yagl_marshal_get_GLenum(out_buff);
-    target_ulong params = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT3(glGetMaterialxv, GLenum, GLenum, target_ulong, face, pname, params);
-    bool res = yagl_host_glGetMaterialxv(face, pname, params);
+    GLenum face;
+    GLenum pname;
+    GLfixed *params;
+    int32_t params_maxcount;
+    int32_t *params_count;
+    face = yagl_transport_get_out_GLenum(t);
+    pname = yagl_transport_get_out_GLenum(t);
+    if (!yagl_transport_get_in_array(t, sizeof(GLfixed), (void**)&params, &params_maxcount, &params_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT3(glGetMaterialxv, GLenum, GLenum, void*, face, pname, params);
+    *params_count = 0;
+    (void)yagl_host_glGetMaterialxv(face, pname, params, params_maxcount, params_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glGetPointerv dispatcher. id = 126
+ * glGetPointerv dispatcher. id = 128
  */
-static bool yagl_func_glGetPointerv(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glGetPointerv(struct yagl_transport *t)
 {
-    GLenum pname = yagl_marshal_get_GLenum(out_buff);
-    target_ulong params = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT2(glGetPointerv, GLenum, target_ulong, pname, params);
-    bool res = yagl_host_glGetPointerv(pname, params);
+    GLenum pname;
+    target_ulong *params;
+    pname = yagl_transport_get_out_GLenum(t);
+    yagl_transport_get_in_arg(t, (void**)&params);
+    YAGL_LOG_FUNC_ENTER_SPLIT2(glGetPointerv, GLenum, target_ulong*, pname, params);
+    (void)yagl_host_glGetPointerv(pname, params);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glGetTexEnviv dispatcher. id = 127
+ * glGetTexEnviv dispatcher. id = 129
  */
-static bool yagl_func_glGetTexEnviv(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glGetTexEnviv(struct yagl_transport *t)
 {
-    GLenum env = yagl_marshal_get_GLenum(out_buff);
-    GLenum pname = yagl_marshal_get_GLenum(out_buff);
-    target_ulong params = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT3(glGetTexEnviv, GLenum, GLenum, target_ulong, env, pname, params);
-    bool res = yagl_host_glGetTexEnviv(env, pname, params);
+    GLenum env;
+    GLenum pname;
+    GLint *params;
+    int32_t params_maxcount;
+    int32_t *params_count;
+    env = yagl_transport_get_out_GLenum(t);
+    pname = yagl_transport_get_out_GLenum(t);
+    if (!yagl_transport_get_in_array(t, sizeof(GLint), (void**)&params, &params_maxcount, &params_count)) {
+        return false;
+    }
+    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);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glGetTexEnvxv dispatcher. id = 128
+ * glGetTexEnvxv dispatcher. id = 130
  */
-static bool yagl_func_glGetTexEnvxv(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glGetTexEnvxv(struct yagl_transport *t)
 {
-    GLenum env = yagl_marshal_get_GLenum(out_buff);
-    GLenum pname = yagl_marshal_get_GLenum(out_buff);
-    target_ulong params = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT3(glGetTexEnvxv, GLenum, GLenum, target_ulong, env, pname, params);
-    bool res = yagl_host_glGetTexEnvxv(env, pname, params);
+    GLenum env;
+    GLenum pname;
+    GLfixed *params;
+    int32_t params_maxcount;
+    int32_t *params_count;
+    env = yagl_transport_get_out_GLenum(t);
+    pname = yagl_transport_get_out_GLenum(t);
+    if (!yagl_transport_get_in_array(t, sizeof(GLfixed), (void**)&params, &params_maxcount, &params_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT3(glGetTexEnvxv, GLenum, GLenum, void*, env, pname, params);
+    *params_count = 0;
+    (void)yagl_host_glGetTexEnvxv(env, pname, params, params_maxcount, params_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glGetTexParameterxv dispatcher. id = 129
+ * glGetTexParameterxv dispatcher. id = 131
  */
-static bool yagl_func_glGetTexParameterxv(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glGetTexParameterxv(struct yagl_transport *t)
 {
-    GLenum target = yagl_marshal_get_GLenum(out_buff);
-    GLenum pname = yagl_marshal_get_GLenum(out_buff);
-    target_ulong params = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT3(glGetTexParameterxv, GLenum, GLenum, target_ulong, target, pname, params);
-    bool res = yagl_host_glGetTexParameterxv(target, pname, params);
+    GLenum target;
+    GLenum pname;
+    GLfixed *param;
+    target = yagl_transport_get_out_GLenum(t);
+    pname = yagl_transport_get_out_GLenum(t);
+    yagl_transport_get_in_arg(t, (void**)&param);
+    YAGL_LOG_FUNC_ENTER_SPLIT3(glGetTexParameterxv, GLenum, GLenum, void*, target, pname, param);
+    (void)yagl_host_glGetTexParameterxv(target, pname, param);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glLightModelx dispatcher. id = 130
+ * glLightModelx dispatcher. id = 132
  */
-static bool yagl_func_glLightModelx(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glLightModelx(struct yagl_transport *t)
 {
-    GLenum pname = yagl_marshal_get_GLenum(out_buff);
-    GLfixed param = yagl_marshal_get_GLfixed(out_buff);
+    GLenum pname;
+    GLfixed param;
+    pname = yagl_transport_get_out_GLenum(t);
+    param = yagl_transport_get_out_GLfixed(t);
     YAGL_LOG_FUNC_ENTER_SPLIT2(glLightModelx, GLenum, GLfixed, pname, param);
-    bool res = yagl_host_glLightModelx(pname, param);
+    (void)yagl_host_glLightModelx(pname, param);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glLightModelxv dispatcher. id = 131
+ * glLightModelxv dispatcher. id = 133
  */
-static bool yagl_func_glLightModelxv(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glLightModelxv(struct yagl_transport *t)
 {
-    GLenum pname = yagl_marshal_get_GLenum(out_buff);
-    target_ulong params = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT2(glLightModelxv, GLenum, target_ulong, pname, params);
-    bool res = yagl_host_glLightModelxv(pname, params);
+    GLenum pname;
+    const GLfixed *params;
+    int32_t params_count;
+    pname = yagl_transport_get_out_GLenum(t);
+    if (!yagl_transport_get_out_array(t, sizeof(GLfixed), (const void**)&params, &params_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT2(glLightModelxv, GLenum, void*, pname, params);
+    (void)yagl_host_glLightModelxv(pname, params, params_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glLightx dispatcher. id = 132
+ * glLightx dispatcher. id = 134
  */
-static bool yagl_func_glLightx(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glLightx(struct yagl_transport *t)
 {
-    GLenum light = yagl_marshal_get_GLenum(out_buff);
-    GLenum pname = yagl_marshal_get_GLenum(out_buff);
-    GLfixed param = yagl_marshal_get_GLfixed(out_buff);
+    GLenum light;
+    GLenum pname;
+    GLfixed param;
+    light = yagl_transport_get_out_GLenum(t);
+    pname = yagl_transport_get_out_GLenum(t);
+    param = yagl_transport_get_out_GLfixed(t);
     YAGL_LOG_FUNC_ENTER_SPLIT3(glLightx, GLenum, GLenum, GLfixed, light, pname, param);
-    bool res = yagl_host_glLightx(light, pname, param);
+    (void)yagl_host_glLightx(light, pname, param);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glLightxv dispatcher. id = 133
+ * glLightxv dispatcher. id = 135
  */
-static bool yagl_func_glLightxv(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glLightxv(struct yagl_transport *t)
 {
-    GLenum light = yagl_marshal_get_GLenum(out_buff);
-    GLenum pname = yagl_marshal_get_GLenum(out_buff);
-    target_ulong params = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT3(glLightxv, GLenum, GLenum, target_ulong, light, pname, params);
-    bool res = yagl_host_glLightxv(light, pname, params);
+    GLenum light;
+    GLenum pname;
+    const GLfixed *params;
+    int32_t params_count;
+    light = yagl_transport_get_out_GLenum(t);
+    pname = yagl_transport_get_out_GLenum(t);
+    if (!yagl_transport_get_out_array(t, sizeof(GLfixed), (const void**)&params, &params_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT3(glLightxv, GLenum, GLenum, void*, light, pname, params);
+    (void)yagl_host_glLightxv(light, pname, params, params_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glLineWidthx dispatcher. id = 134
+ * glLineWidthx dispatcher. id = 136
  */
-static bool yagl_func_glLineWidthx(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glLineWidthx(struct yagl_transport *t)
 {
-    GLfixed width = yagl_marshal_get_GLfixed(out_buff);
+    GLfixed width;
+    width = yagl_transport_get_out_GLfixed(t);
     YAGL_LOG_FUNC_ENTER_SPLIT1(glLineWidthx, GLfixed, width);
-    bool res = yagl_host_glLineWidthx(width);
+    (void)yagl_host_glLineWidthx(width);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glLoadIdentity dispatcher. id = 135
+ * glLoadIdentity dispatcher. id = 137
  */
-static bool yagl_func_glLoadIdentity(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glLoadIdentity(struct yagl_transport *t)
 {
     YAGL_LOG_FUNC_ENTER_SPLIT0(glLoadIdentity);
-    bool res = yagl_host_glLoadIdentity();
+    (void)yagl_host_glLoadIdentity();
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glLoadMatrixx dispatcher. id = 136
+ * glLoadMatrixx dispatcher. id = 138
  */
-static bool yagl_func_glLoadMatrixx(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glLoadMatrixx(struct yagl_transport *t)
 {
-    target_ulong m = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT1(glLoadMatrixx, target_ulong, m);
-    bool res = yagl_host_glLoadMatrixx(m);
+    const GLfixed *m;
+    int32_t m_count;
+    if (!yagl_transport_get_out_array(t, sizeof(GLfixed), (const void**)&m, &m_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT1(glLoadMatrixx, void*, m);
+    (void)yagl_host_glLoadMatrixx(m, m_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glLogicOp dispatcher. id = 137
+ * glLogicOp dispatcher. id = 139
  */
-static bool yagl_func_glLogicOp(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glLogicOp(struct yagl_transport *t)
 {
-    GLenum opcode = yagl_marshal_get_GLenum(out_buff);
+    GLenum opcode;
+    opcode = yagl_transport_get_out_GLenum(t);
     YAGL_LOG_FUNC_ENTER_SPLIT1(glLogicOp, GLenum, opcode);
-    bool res = yagl_host_glLogicOp(opcode);
+    (void)yagl_host_glLogicOp(opcode);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glMaterialx dispatcher. id = 138
+ * glMaterialx dispatcher. id = 140
  */
-static bool yagl_func_glMaterialx(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glMaterialx(struct yagl_transport *t)
 {
-    GLenum face = yagl_marshal_get_GLenum(out_buff);
-    GLenum pname = yagl_marshal_get_GLenum(out_buff);
-    GLfixed param = yagl_marshal_get_GLfixed(out_buff);
+    GLenum face;
+    GLenum pname;
+    GLfixed param;
+    face = yagl_transport_get_out_GLenum(t);
+    pname = yagl_transport_get_out_GLenum(t);
+    param = yagl_transport_get_out_GLfixed(t);
     YAGL_LOG_FUNC_ENTER_SPLIT3(glMaterialx, GLenum, GLenum, GLfixed, face, pname, param);
-    bool res = yagl_host_glMaterialx(face, pname, param);
+    (void)yagl_host_glMaterialx(face, pname, param);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glMaterialxv dispatcher. id = 139
+ * glMaterialxv dispatcher. id = 141
  */
-static bool yagl_func_glMaterialxv(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glMaterialxv(struct yagl_transport *t)
 {
-    GLenum face = yagl_marshal_get_GLenum(out_buff);
-    GLenum pname = yagl_marshal_get_GLenum(out_buff);
-    target_ulong params = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT3(glMaterialxv, GLenum, GLenum, target_ulong, face, pname, params);
-    bool res = yagl_host_glMaterialxv(face, pname, params);
+    GLenum face;
+    GLenum pname;
+    const GLfixed *params;
+    int32_t params_count;
+    face = yagl_transport_get_out_GLenum(t);
+    pname = yagl_transport_get_out_GLenum(t);
+    if (!yagl_transport_get_out_array(t, sizeof(GLfixed), (const void**)&params, &params_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT3(glMaterialxv, GLenum, GLenum, void*, face, pname, params);
+    (void)yagl_host_glMaterialxv(face, pname, params, params_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glMatrixMode dispatcher. id = 140
+ * glMatrixMode dispatcher. id = 142
  */
-static bool yagl_func_glMatrixMode(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glMatrixMode(struct yagl_transport *t)
 {
-    GLenum mode = yagl_marshal_get_GLenum(out_buff);
+    GLenum mode;
+    mode = yagl_transport_get_out_GLenum(t);
     YAGL_LOG_FUNC_ENTER_SPLIT1(glMatrixMode, GLenum, mode);
-    bool res = yagl_host_glMatrixMode(mode);
+    (void)yagl_host_glMatrixMode(mode);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glMultMatrixx dispatcher. id = 141
+ * glMultMatrixx dispatcher. id = 143
  */
-static bool yagl_func_glMultMatrixx(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glMultMatrixx(struct yagl_transport *t)
 {
-    target_ulong m = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT1(glMultMatrixx, target_ulong, m);
-    bool res = yagl_host_glMultMatrixx(m);
+    const GLfixed *m;
+    int32_t m_count;
+    if (!yagl_transport_get_out_array(t, sizeof(GLfixed), (const void**)&m, &m_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT1(glMultMatrixx, void*, m);
+    (void)yagl_host_glMultMatrixx(m, m_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glMultiTexCoord4x dispatcher. id = 142
+ * glMultiTexCoord4x dispatcher. id = 144
  */
-static bool yagl_func_glMultiTexCoord4x(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glMultiTexCoord4x(struct yagl_transport *t)
 {
-    GLenum target = yagl_marshal_get_GLenum(out_buff);
-    GLfixed s = yagl_marshal_get_GLfixed(out_buff);
-    GLfixed t = yagl_marshal_get_GLfixed(out_buff);
-    GLfixed r = yagl_marshal_get_GLfixed(out_buff);
-    GLfixed q = yagl_marshal_get_GLfixed(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT5(glMultiTexCoord4x, GLenum, GLfixed, GLfixed, GLfixed, GLfixed, target, s, t, r, q);
-    bool res = yagl_host_glMultiTexCoord4x(target, s, t, r, q);
+    GLenum target;
+    GLfixed s;
+    GLfixed tt;
+    GLfixed r;
+    GLfixed q;
+    target = yagl_transport_get_out_GLenum(t);
+    s = yagl_transport_get_out_GLfixed(t);
+    tt = yagl_transport_get_out_GLfixed(t);
+    r = yagl_transport_get_out_GLfixed(t);
+    q = yagl_transport_get_out_GLfixed(t);
+    YAGL_LOG_FUNC_ENTER_SPLIT5(glMultiTexCoord4x, GLenum, GLfixed, GLfixed, GLfixed, GLfixed, target, s, tt, r, q);
+    (void)yagl_host_glMultiTexCoord4x(target, s, tt, r, q);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glNormal3x dispatcher. id = 143
+ * glNormal3x dispatcher. id = 145
  */
-static bool yagl_func_glNormal3x(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glNormal3x(struct yagl_transport *t)
 {
-    GLfixed nx = yagl_marshal_get_GLfixed(out_buff);
-    GLfixed ny = yagl_marshal_get_GLfixed(out_buff);
-    GLfixed nz = yagl_marshal_get_GLfixed(out_buff);
+    GLfixed nx;
+    GLfixed ny;
+    GLfixed nz;
+    nx = yagl_transport_get_out_GLfixed(t);
+    ny = yagl_transport_get_out_GLfixed(t);
+    nz = yagl_transport_get_out_GLfixed(t);
     YAGL_LOG_FUNC_ENTER_SPLIT3(glNormal3x, GLfixed, GLfixed, GLfixed, nx, ny, nz);
-    bool res = yagl_host_glNormal3x(nx, ny, nz);
+    (void)yagl_host_glNormal3x(nx, ny, nz);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glNormalPointer dispatcher. id = 144
+ * glNormalPointer dispatcher. id = 146
  */
-static bool yagl_func_glNormalPointer(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glNormalPointer(struct yagl_transport *t)
 {
-    GLenum type = yagl_marshal_get_GLenum(out_buff);
-    GLsizei stride = yagl_marshal_get_GLsizei(out_buff);
-    target_ulong pointer = yagl_marshal_get_ptr(out_buff);
+    GLenum type;
+    GLsizei stride;
+    target_ulong pointer;
+    type = yagl_transport_get_out_GLenum(t);
+    stride = yagl_transport_get_out_GLsizei(t);
+    pointer = yagl_transport_get_out_va(t);
     YAGL_LOG_FUNC_ENTER_SPLIT3(glNormalPointer, GLenum, GLsizei, target_ulong, type, stride, pointer);
-    bool res = yagl_host_glNormalPointer(type, stride, pointer);
+    (void)yagl_host_glNormalPointer(type, stride, pointer);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glOrthox dispatcher. id = 145
+ * glOrthox dispatcher. id = 147
  */
-static bool yagl_func_glOrthox(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glOrthox(struct yagl_transport *t)
 {
-    GLfixed left = yagl_marshal_get_GLfixed(out_buff);
-    GLfixed right = yagl_marshal_get_GLfixed(out_buff);
-    GLfixed bottom = yagl_marshal_get_GLfixed(out_buff);
-    GLfixed top = yagl_marshal_get_GLfixed(out_buff);
-    GLfixed zNear = yagl_marshal_get_GLfixed(out_buff);
-    GLfixed zFar = yagl_marshal_get_GLfixed(out_buff);
+    GLfixed left;
+    GLfixed right;
+    GLfixed bottom;
+    GLfixed top;
+    GLfixed zNear;
+    GLfixed zFar;
+    left = yagl_transport_get_out_GLfixed(t);
+    right = yagl_transport_get_out_GLfixed(t);
+    bottom = yagl_transport_get_out_GLfixed(t);
+    top = yagl_transport_get_out_GLfixed(t);
+    zNear = yagl_transport_get_out_GLfixed(t);
+    zFar = yagl_transport_get_out_GLfixed(t);
     YAGL_LOG_FUNC_ENTER_SPLIT6(glOrthox, GLfixed, GLfixed, GLfixed, GLfixed, GLfixed, GLfixed, left, right, bottom, top, zNear, zFar);
-    bool res = yagl_host_glOrthox(left, right, bottom, top, zNear, zFar);
+    (void)yagl_host_glOrthox(left, right, bottom, top, zNear, zFar);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glPointParameterx dispatcher. id = 146
+ * glPointParameterx dispatcher. id = 148
  */
-static bool yagl_func_glPointParameterx(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glPointParameterx(struct yagl_transport *t)
 {
-    GLenum pname = yagl_marshal_get_GLenum(out_buff);
-    GLfixed param = yagl_marshal_get_GLfixed(out_buff);
+    GLenum pname;
+    GLfixed param;
+    pname = yagl_transport_get_out_GLenum(t);
+    param = yagl_transport_get_out_GLfixed(t);
     YAGL_LOG_FUNC_ENTER_SPLIT2(glPointParameterx, GLenum, GLfixed, pname, param);
-    bool res = yagl_host_glPointParameterx(pname, param);
+    (void)yagl_host_glPointParameterx(pname, param);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glPointParameterxv dispatcher. id = 147
+ * glPointParameterxv dispatcher. id = 149
  */
-static bool yagl_func_glPointParameterxv(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glPointParameterxv(struct yagl_transport *t)
 {
-    GLenum pname = yagl_marshal_get_GLenum(out_buff);
-    target_ulong params = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT2(glPointParameterxv, GLenum, target_ulong, pname, params);
-    bool res = yagl_host_glPointParameterxv(pname, params);
+    GLenum pname;
+    const GLfixed *params;
+    int32_t params_count;
+    pname = yagl_transport_get_out_GLenum(t);
+    if (!yagl_transport_get_out_array(t, sizeof(GLfixed), (const void**)&params, &params_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT2(glPointParameterxv, GLenum, void*, pname, params);
+    (void)yagl_host_glPointParameterxv(pname, params, params_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glPointSizex dispatcher. id = 148
+ * glPointSizex dispatcher. id = 150
  */
-static bool yagl_func_glPointSizex(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glPointSizex(struct yagl_transport *t)
 {
-    GLfixed size = yagl_marshal_get_GLfixed(out_buff);
+    GLfixed size;
+    size = yagl_transport_get_out_GLfixed(t);
     YAGL_LOG_FUNC_ENTER_SPLIT1(glPointSizex, GLfixed, size);
-    bool res = yagl_host_glPointSizex(size);
+    (void)yagl_host_glPointSizex(size);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glPolygonOffsetx dispatcher. id = 149
+ * glPolygonOffsetx dispatcher. id = 151
  */
-static bool yagl_func_glPolygonOffsetx(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glPolygonOffsetx(struct yagl_transport *t)
 {
-    GLfixed factor = yagl_marshal_get_GLfixed(out_buff);
-    GLfixed units = yagl_marshal_get_GLfixed(out_buff);
+    GLfixed factor;
+    GLfixed units;
+    factor = yagl_transport_get_out_GLfixed(t);
+    units = yagl_transport_get_out_GLfixed(t);
     YAGL_LOG_FUNC_ENTER_SPLIT2(glPolygonOffsetx, GLfixed, GLfixed, factor, units);
-    bool res = yagl_host_glPolygonOffsetx(factor, units);
+    (void)yagl_host_glPolygonOffsetx(factor, units);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glPopMatrix dispatcher. id = 150
+ * glPopMatrix dispatcher. id = 152
  */
-static bool yagl_func_glPopMatrix(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glPopMatrix(struct yagl_transport *t)
 {
     YAGL_LOG_FUNC_ENTER_SPLIT0(glPopMatrix);
-    bool res = yagl_host_glPopMatrix();
+    (void)yagl_host_glPopMatrix();
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glPushMatrix dispatcher. id = 151
+ * glPushMatrix dispatcher. id = 153
  */
-static bool yagl_func_glPushMatrix(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glPushMatrix(struct yagl_transport *t)
 {
     YAGL_LOG_FUNC_ENTER_SPLIT0(glPushMatrix);
-    bool res = yagl_host_glPushMatrix();
+    (void)yagl_host_glPushMatrix();
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glRotatex dispatcher. id = 152
+ * glRotatex dispatcher. id = 154
  */
-static bool yagl_func_glRotatex(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glRotatex(struct yagl_transport *t)
 {
-    GLfixed angle = yagl_marshal_get_GLfixed(out_buff);
-    GLfixed x = yagl_marshal_get_GLfixed(out_buff);
-    GLfixed y = yagl_marshal_get_GLfixed(out_buff);
-    GLfixed z = yagl_marshal_get_GLfixed(out_buff);
+    GLfixed angle;
+    GLfixed x;
+    GLfixed y;
+    GLfixed z;
+    angle = yagl_transport_get_out_GLfixed(t);
+    x = yagl_transport_get_out_GLfixed(t);
+    y = yagl_transport_get_out_GLfixed(t);
+    z = yagl_transport_get_out_GLfixed(t);
     YAGL_LOG_FUNC_ENTER_SPLIT4(glRotatex, GLfixed, GLfixed, GLfixed, GLfixed, angle, x, y, z);
-    bool res = yagl_host_glRotatex(angle, x, y, z);
+    (void)yagl_host_glRotatex(angle, x, y, z);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glSampleCoveragex dispatcher. id = 153
+ * glSampleCoveragex dispatcher. id = 155
  */
-static bool yagl_func_glSampleCoveragex(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glSampleCoveragex(struct yagl_transport *t)
 {
-    GLclampx value = yagl_marshal_get_GLclampx(out_buff);
-    GLboolean invert = yagl_marshal_get_GLboolean(out_buff);
+    GLclampx value;
+    GLboolean invert;
+    value = yagl_transport_get_out_GLclampx(t);
+    invert = yagl_transport_get_out_GLboolean(t);
     YAGL_LOG_FUNC_ENTER_SPLIT2(glSampleCoveragex, GLclampx, GLboolean, value, invert);
-    bool res = yagl_host_glSampleCoveragex(value, invert);
+    (void)yagl_host_glSampleCoveragex(value, invert);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glScalex dispatcher. id = 154
+ * glScalex dispatcher. id = 156
  */
-static bool yagl_func_glScalex(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glScalex(struct yagl_transport *t)
 {
-    GLfixed x = yagl_marshal_get_GLfixed(out_buff);
-    GLfixed y = yagl_marshal_get_GLfixed(out_buff);
-    GLfixed z = yagl_marshal_get_GLfixed(out_buff);
+    GLfixed x;
+    GLfixed y;
+    GLfixed z;
+    x = yagl_transport_get_out_GLfixed(t);
+    y = yagl_transport_get_out_GLfixed(t);
+    z = yagl_transport_get_out_GLfixed(t);
     YAGL_LOG_FUNC_ENTER_SPLIT3(glScalex, GLfixed, GLfixed, GLfixed, x, y, z);
-    bool res = yagl_host_glScalex(x, y, z);
+    (void)yagl_host_glScalex(x, y, z);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glShadeModel dispatcher. id = 155
+ * glShadeModel dispatcher. id = 157
  */
-static bool yagl_func_glShadeModel(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glShadeModel(struct yagl_transport *t)
 {
-    GLenum mode = yagl_marshal_get_GLenum(out_buff);
+    GLenum mode;
+    mode = yagl_transport_get_out_GLenum(t);
     YAGL_LOG_FUNC_ENTER_SPLIT1(glShadeModel, GLenum, mode);
-    bool res = yagl_host_glShadeModel(mode);
+    (void)yagl_host_glShadeModel(mode);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glTexCoordPointer dispatcher. id = 156
+ * glTexCoordPointer dispatcher. id = 158
  */
-static bool yagl_func_glTexCoordPointer(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glTexCoordPointer(struct yagl_transport *t)
 {
-    GLint size = yagl_marshal_get_GLint(out_buff);
-    GLenum type = yagl_marshal_get_GLenum(out_buff);
-    GLsizei stride = yagl_marshal_get_GLsizei(out_buff);
-    target_ulong pointer = yagl_marshal_get_ptr(out_buff);
+    GLint size;
+    GLenum type;
+    GLsizei stride;
+    target_ulong pointer;
+    size = yagl_transport_get_out_GLint(t);
+    type = yagl_transport_get_out_GLenum(t);
+    stride = yagl_transport_get_out_GLsizei(t);
+    pointer = yagl_transport_get_out_va(t);
     YAGL_LOG_FUNC_ENTER_SPLIT4(glTexCoordPointer, GLint, GLenum, GLsizei, target_ulong, size, type, stride, pointer);
-    bool res = yagl_host_glTexCoordPointer(size, type, stride, pointer);
+    (void)yagl_host_glTexCoordPointer(size, type, stride, pointer);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glTexEnvi dispatcher. id = 157
+ * glTexEnvi dispatcher. id = 159
  */
-static bool yagl_func_glTexEnvi(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glTexEnvi(struct yagl_transport *t)
 {
-    GLenum target = yagl_marshal_get_GLenum(out_buff);
-    GLenum pname = yagl_marshal_get_GLenum(out_buff);
-    GLint param = yagl_marshal_get_GLint(out_buff);
+    GLenum target;
+    GLenum pname;
+    GLint param;
+    target = yagl_transport_get_out_GLenum(t);
+    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);
-    bool res = yagl_host_glTexEnvi(target, pname, param);
+    (void)yagl_host_glTexEnvi(target, pname, param);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glTexEnvx dispatcher. id = 158
+ * glTexEnvx dispatcher. id = 160
  */
-static bool yagl_func_glTexEnvx(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glTexEnvx(struct yagl_transport *t)
 {
-    GLenum target = yagl_marshal_get_GLenum(out_buff);
-    GLenum pname = yagl_marshal_get_GLenum(out_buff);
-    GLfixed param = yagl_marshal_get_GLfixed(out_buff);
+    GLenum target;
+    GLenum pname;
+    GLfixed param;
+    target = yagl_transport_get_out_GLenum(t);
+    pname = yagl_transport_get_out_GLenum(t);
+    param = yagl_transport_get_out_GLfixed(t);
     YAGL_LOG_FUNC_ENTER_SPLIT3(glTexEnvx, GLenum, GLenum, GLfixed, target, pname, param);
-    bool res = yagl_host_glTexEnvx(target, pname, param);
+    (void)yagl_host_glTexEnvx(target, pname, param);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glTexEnviv dispatcher. id = 159
+ * glTexEnviv dispatcher. id = 161
  */
-static bool yagl_func_glTexEnviv(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glTexEnviv(struct yagl_transport *t)
 {
-    GLenum target = yagl_marshal_get_GLenum(out_buff);
-    GLenum pname = yagl_marshal_get_GLenum(out_buff);
-    target_ulong params = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT3(glTexEnviv, GLenum, GLenum, target_ulong, target, pname, params);
-    bool res = yagl_host_glTexEnviv(target, pname, params);
+    GLenum target;
+    GLenum pname;
+    const GLint *params;
+    int32_t params_count;
+    target = yagl_transport_get_out_GLenum(t);
+    pname = yagl_transport_get_out_GLenum(t);
+    if (!yagl_transport_get_out_array(t, sizeof(GLint), (const void**)&params, &params_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT3(glTexEnviv, GLenum, GLenum, void*, target, pname, params);
+    (void)yagl_host_glTexEnviv(target, pname, params, params_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glTexEnvxv dispatcher. id = 160
+ * glTexEnvxv dispatcher. id = 162
  */
-static bool yagl_func_glTexEnvxv(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glTexEnvxv(struct yagl_transport *t)
 {
-    GLenum target = yagl_marshal_get_GLenum(out_buff);
-    GLenum pname = yagl_marshal_get_GLenum(out_buff);
-    target_ulong params = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT3(glTexEnvxv, GLenum, GLenum, target_ulong, target, pname, params);
-    bool res = yagl_host_glTexEnvxv(target, pname, params);
+    GLenum target;
+    GLenum pname;
+    const GLfixed *params;
+    int32_t params_count;
+    target = yagl_transport_get_out_GLenum(t);
+    pname = yagl_transport_get_out_GLenum(t);
+    if (!yagl_transport_get_out_array(t, sizeof(GLfixed), (const void**)&params, &params_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT3(glTexEnvxv, GLenum, GLenum, void*, target, pname, params);
+    (void)yagl_host_glTexEnvxv(target, pname, params, params_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glTexParameterx dispatcher. id = 161
+ * glTexParameterx dispatcher. id = 163
  */
-static bool yagl_func_glTexParameterx(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glTexParameterx(struct yagl_transport *t)
 {
-    GLenum target = yagl_marshal_get_GLenum(out_buff);
-    GLenum pname = yagl_marshal_get_GLenum(out_buff);
-    GLfixed param = yagl_marshal_get_GLfixed(out_buff);
+    GLenum target;
+    GLenum pname;
+    GLfixed param;
+    target = yagl_transport_get_out_GLenum(t);
+    pname = yagl_transport_get_out_GLenum(t);
+    param = yagl_transport_get_out_GLfixed(t);
     YAGL_LOG_FUNC_ENTER_SPLIT3(glTexParameterx, GLenum, GLenum, GLfixed, target, pname, param);
-    bool res = yagl_host_glTexParameterx(target, pname, param);
+    (void)yagl_host_glTexParameterx(target, pname, param);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glTexParameterxv dispatcher. id = 162
+ * glTexParameterxv dispatcher. id = 164
  */
-static bool yagl_func_glTexParameterxv(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glTexParameterxv(struct yagl_transport *t)
 {
-    GLenum target = yagl_marshal_get_GLenum(out_buff);
-    GLenum pname = yagl_marshal_get_GLenum(out_buff);
-    target_ulong params = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT3(glTexParameterxv, GLenum, GLenum, target_ulong, target, pname, params);
-    bool res = yagl_host_glTexParameterxv(target, pname, params);
+    GLenum target;
+    GLenum pname;
+    const GLfixed *params;
+    int32_t params_count;
+    target = yagl_transport_get_out_GLenum(t);
+    pname = yagl_transport_get_out_GLenum(t);
+    if (!yagl_transport_get_out_array(t, sizeof(GLfixed), (const void**)&params, &params_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT3(glTexParameterxv, GLenum, GLenum, void*, target, pname, params);
+    (void)yagl_host_glTexParameterxv(target, pname, params, params_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glTranslatex dispatcher. id = 163
+ * glTranslatex dispatcher. id = 165
  */
-static bool yagl_func_glTranslatex(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glTranslatex(struct yagl_transport *t)
 {
-    GLfixed x = yagl_marshal_get_GLfixed(out_buff);
-    GLfixed y = yagl_marshal_get_GLfixed(out_buff);
-    GLfixed z = yagl_marshal_get_GLfixed(out_buff);
+    GLfixed x;
+    GLfixed y;
+    GLfixed z;
+    x = yagl_transport_get_out_GLfixed(t);
+    y = yagl_transport_get_out_GLfixed(t);
+    z = yagl_transport_get_out_GLfixed(t);
     YAGL_LOG_FUNC_ENTER_SPLIT3(glTranslatex, GLfixed, GLfixed, GLfixed, x, y, z);
-    bool res = yagl_host_glTranslatex(x, y, z);
+    (void)yagl_host_glTranslatex(x, y, z);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glVertexPointer dispatcher. id = 164
+ * glVertexPointer dispatcher. id = 166
  */
-static bool yagl_func_glVertexPointer(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glVertexPointer(struct yagl_transport *t)
 {
-    GLint size = yagl_marshal_get_GLint(out_buff);
-    GLenum type = yagl_marshal_get_GLenum(out_buff);
-    GLsizei stride = yagl_marshal_get_GLsizei(out_buff);
-    target_ulong pointer = yagl_marshal_get_ptr(out_buff);
+    GLint size;
+    GLenum type;
+    GLsizei stride;
+    target_ulong pointer;
+    size = yagl_transport_get_out_GLint(t);
+    type = yagl_transport_get_out_GLenum(t);
+    stride = yagl_transport_get_out_GLsizei(t);
+    pointer = yagl_transport_get_out_va(t);
     YAGL_LOG_FUNC_ENTER_SPLIT4(glVertexPointer, GLint, GLenum, GLsizei, target_ulong, size, type, stride, pointer);
-    bool res = yagl_host_glVertexPointer(size, type, stride, pointer);
+    (void)yagl_host_glVertexPointer(size, type, stride, pointer);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
-const uint32_t yagl_gles1_api_num_funcs = 164;
+const uint32_t yagl_gles1_api_num_funcs = 166;
 
 yagl_api_func yagl_gles1_api_funcs[] = {
     &yagl_func_glActiveTexture,
@@ -2496,7 +3109,6 @@ yagl_api_func yagl_gles1_api_funcs[] = {
     &yagl_func_glDepthRangef,
     &yagl_func_glDisable,
     &yagl_func_glDrawArrays,
-    &yagl_func_glDrawElements,
     &yagl_func_glEGLImageTargetTexture2DOES,
     &yagl_func_glEnable,
     &yagl_func_glFlush,
@@ -2540,6 +3152,9 @@ yagl_api_func yagl_gles1_api_funcs[] = {
     &yagl_func_glTexParameteriv,
     &yagl_func_glTexSubImage2D,
     &yagl_func_glViewport,
+    &yagl_func_glTransferArrayYAGL,
+    &yagl_func_glDrawElementsIndicesYAGL,
+    &yagl_func_glDrawElementsOffsetYAGL,
     &yagl_func_glGetExtensionStringYAGL,
     &yagl_func_glGetVertexAttribRangeYAGL,
     &yagl_func_glAlphaFunc,
@@ -2628,5 +3243,5 @@ yagl_api_func yagl_gles1_api_funcs[] = {
     &yagl_func_glTexParameterx,
     &yagl_func_glTexParameterxv,
     &yagl_func_glTranslatex,
-    &yagl_func_glVertexPointer
+    &yagl_func_glVertexPointer,
 };
index f93a437..b9cc7ca 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Generated by gen-yagl-calls.sh, do not modify!
+ * Generated by gen-yagl-calls.py, do not modify!
  */
 #ifndef _QEMU_YAGL_GLES1_CALLS_H_
 #define _QEMU_YAGL_GLES1_CALLS_H_
index 5a77acc..604b525 100644 (file)
@@ -18,7 +18,6 @@
 #include "yagl_log.h"
 #include "yagl_client_interface.h"
 #include "yagl_sharegroup.h"
-#include "yagl_mem_gl.h"
 
 #define YAGL_TEX_ENV_PARAM_MAX_LEN        4
 #define YAGL_POINT_PARAM_MAX_LEN          3
@@ -41,12 +40,11 @@ static YAGL_DEFINE_TLS(YaglGles1ApiTs *, gles1_api_ts);
         (ctx->base.base.client_api != yagl_client_api_gles1)) { \
         YAGL_LOG_WARN("no current context"); \
         ret_expr; \
-        return true; \
     }
 
-#define YAGL_GET_CTX_RET(func, ret) YAGL_GET_CTX_IMPL(func, *retval = ret)
+#define YAGL_GET_CTX_RET(func, ret) YAGL_GET_CTX_IMPL(func, return ret)
 
-#define YAGL_GET_CTX(func) YAGL_GET_CTX_IMPL(func,)
+#define YAGL_GET_CTX(func) YAGL_GET_CTX_IMPL(func, return)
 
 static bool yagl_gles1_get_float(struct yagl_gles_context *ctx,
                                  GLenum pname,
@@ -221,7 +219,7 @@ static inline bool yagl_gles1_array_idx_get(YaglGles1Context *ctx,
     return true;
 }
 
-static inline bool yagl_gles1_light_param_len(GLenum pname, unsigned *len)
+static inline bool yagl_gles1_light_param_len(GLenum pname, int32_t *len)
 {
     switch (pname) {
     case GL_AMBIENT:
@@ -247,7 +245,7 @@ static inline bool yagl_gles1_light_param_len(GLenum pname, unsigned *len)
     return true;
 }
 
-static inline bool yagl_gles1_material_param_len(GLenum pname, unsigned *len)
+static inline bool yagl_gles1_material_param_len(GLenum pname, int32_t *len)
 {
     switch (pname) {
     case GL_AMBIENT:
@@ -267,20 +265,17 @@ static inline bool yagl_gles1_material_param_len(GLenum pname, unsigned *len)
     return true;
 }
 
-bool yagl_host_glAlphaFunc(GLenum func,
+void yagl_host_glAlphaFunc(GLenum func,
     GLclampf ref)
 {
     YAGL_GET_CTX(glAlphaFunc);
 
     ctx->driver->AlphaFunc(func, ref);
-
-    return true;
 }
 
-bool yagl_host_glClipPlanef(GLenum plane,
-    target_ulong /* const GLfloat* */ equation_)
+void yagl_host_glClipPlanef(GLenum plane,
+    const GLfloat *equation, int32_t equation_count)
 {
-    GLfloat equationf[4];
     yagl_GLdouble equationd[4];
     unsigned i;
 
@@ -288,23 +283,21 @@ bool yagl_host_glClipPlanef(GLenum plane,
 
     if (plane < GL_CLIP_PLANE0 || plane >= (GL_CLIP_PLANE0 + ctx->max_clip_planes)) {
         YAGL_SET_ERR(GL_INVALID_ENUM);
-        return true;
+        return;
     }
 
-    if (!yagl_mem_get(equation_, 4 * sizeof(GLfloat), equationf)) {
-        return false;
-    }
+    if (equation) {
+        for (i = 0; i < 4; ++i) {
+            equationd[i] = (yagl_GLdouble)equation[i];
+        }
 
-    for (i = 0; i < 4; ++i) {
-        equationd[i] = (yagl_GLdouble)equationf[i];
+        ctx->driver->ClipPlane(plane, equationd);
+    } else {
+        ctx->driver->ClipPlane(plane, NULL);
     }
-
-    ctx->driver->ClipPlane(plane, equationd);
-
-    return true;
 }
 
-bool yagl_host_glColor4f(GLfloat red,
+void yagl_host_glColor4f(GLfloat red,
     GLfloat green,
     GLfloat blue,
     GLfloat alpha)
@@ -312,11 +305,9 @@ bool yagl_host_glColor4f(GLfloat red,
     YAGL_GET_CTX(glColor4f);
 
     ctx->driver->Color4f(red, green, blue, alpha);
-
-    return true;
 }
 
-bool yagl_host_glFogf(GLenum pname,
+void yagl_host_glFogf(GLenum pname,
     GLfloat param)
 {
     YAGL_GET_CTX(glFogf);
@@ -327,39 +318,24 @@ bool yagl_host_glFogf(GLenum pname,
     } else {
         ctx->driver->Fogf(pname, param);
     }
-
-    return true;
 }
 
-bool yagl_host_glFogfv(GLenum pname,
-    target_ulong /* const GLfloat* */ params_)
+void yagl_host_glFogfv(GLenum pname,
+    const GLfloat *params, int32_t params_count)
 {
-    GLfloat params[YAGL_FOG_PARAM_MAX_LEN];
-    unsigned count = 1;
-
     YAGL_GET_CTX(glFogfv);
 
     if (pname != GL_FOG_MODE && pname != GL_FOG_DENSITY &&
         pname != GL_FOG_START && pname != GL_FOG_END &&
         pname != GL_FOG_COLOR) {
         YAGL_SET_ERR(GL_INVALID_ENUM);
-        return true;
-    }
-
-    if (pname == GL_FOG_COLOR) {
-        count = YAGL_FOG_PARAM_MAX_LEN;
-    }
-
-    if (!yagl_mem_get(params_, count * sizeof(GLfloat), params)) {
-        return false;
+        return;
     }
 
     ctx->driver->Fogfv(pname,  params);
-
-    return true;
 }
 
-bool yagl_host_glFrustumf(GLfloat left,
+void yagl_host_glFrustumf(GLfloat left,
     GLfloat right,
     GLfloat bottom,
     GLfloat top,
@@ -374,101 +350,61 @@ bool yagl_host_glFrustumf(GLfloat left,
     } else {
         ctx->driver->Frustum(left, right, bottom, top, zNear, zFar);
     }
-
-    return true;
 }
 
-bool yagl_host_glGetClipPlanef(GLenum plane,
-    target_ulong /* GLfloat* */ eqn)
+void yagl_host_glGetClipPlanef(GLenum pname,
+    GLfloat *eqn, int32_t eqn_maxcount, int32_t *eqn_count)
 {
     yagl_GLdouble equationd[4];
-    GLfloat equationf[4];
     unsigned i;
 
     YAGL_GET_CTX(glGetClipPlanef);
 
-    if (plane < GL_CLIP_PLANE0 || plane >= (GL_CLIP_PLANE0 + ctx->max_clip_planes)) {
+    if (pname < GL_CLIP_PLANE0 || pname >= (GL_CLIP_PLANE0 + ctx->max_clip_planes)) {
         YAGL_SET_ERR(GL_INVALID_ENUM);
-        return true;
+        return;
     }
 
-    if (!yagl_mem_prepare(cur_ts->mt1, eqn, 4 * sizeof(GLfloat))) {
-        return false;
-    }
-
-    ctx->driver->GetClipPlane(plane, equationd);
-
-    for (i = 0; i < 4; ++i) {
-        equationf[i] = (GLfloat)equationd[i];
-    }
+    ctx->driver->GetClipPlane(pname, equationd);
 
     if (eqn) {
-        yagl_mem_put(cur_ts->mt1, equationf);
+        for (i = 0; i < 4; ++i) {
+            eqn[i] = (GLfloat)equationd[i];
+        }
+        *eqn_count = 4;
     }
-
-    return true;
 }
 
-bool yagl_host_glGetLightfv(GLenum light,
+void yagl_host_glGetLightfv(GLenum light,
     GLenum pname,
-    target_ulong /* GLfloat* */ params_)
+    GLfloat *params, int32_t params_maxcount, int32_t *params_count)
 {
-    GLfloat params[YAGL_LIGHT_PARAM_MAX_LEN];
-    unsigned count;
-
     YAGL_GET_CTX(glGetLightfv);
 
     if (light < GL_LIGHT0 || light >= (GL_LIGHT0 + ctx->max_lights) ||
-        !yagl_gles1_light_param_len(pname, &count)) {
+        !yagl_gles1_light_param_len(pname, params_count)) {
         YAGL_SET_ERR(GL_INVALID_ENUM);
-        return true;
-    }
-
-    assert(count <= YAGL_LIGHT_PARAM_MAX_LEN);
-
-    if (!yagl_mem_prepare(cur_ts->mt1, params_, count * sizeof(GLfloat))) {
-        return false;
+        return;
     }
 
     ctx->driver->GetLightfv(light, pname, params);
-
-    if (params_) {
-        yagl_mem_put(cur_ts->mt1, params);
-    }
-
-    return true;
 }
 
-bool yagl_host_glGetMaterialfv(GLenum face,
+void yagl_host_glGetMaterialfv(GLenum face,
     GLenum pname,
-    target_ulong /* GLfloat* */ params_)
+    GLfloat *params, int32_t params_maxcount, int32_t *params_count)
 {
-    GLfloat params[YAGL_MATERIAL_PARAM_MAX_LEN];
-    unsigned count;
-
     YAGL_GET_CTX(glGetMaterialfv);
 
-    if (!yagl_gles1_material_param_len(pname, &count)) {
+    if (!yagl_gles1_material_param_len(pname, params_count)) {
         YAGL_SET_ERR(GL_INVALID_ENUM);
-        return true;
-    }
-
-    assert(count <= YAGL_MATERIAL_PARAM_MAX_LEN);
-
-    if (!yagl_mem_prepare(cur_ts->mt1, params_, count * sizeof(GLfloat))) {
-        return false;
+        return;
     }
 
     ctx->driver->GetMaterialfv(face, pname, params);
-
-    if (params_) {
-        yagl_mem_put(cur_ts->mt1, params);
-    }
-
-    return true;
 }
 
-bool yagl_host_glLightModelf(GLenum pname,
+void yagl_host_glLightModelf(GLenum pname,
     GLfloat param)
 {
     YAGL_GET_CTX(glLightModelf);
@@ -478,37 +414,22 @@ bool yagl_host_glLightModelf(GLenum pname,
     } else {
         ctx->driver->LightModelf(pname, param);
     }
-
-    return true;
 }
 
-bool yagl_host_glLightModelfv(GLenum pname,
-    target_ulong /* const GLfloat* */ params_)
+void yagl_host_glLightModelfv(GLenum pname,
+    const GLfloat *params, int32_t params_count)
 {
-    GLfloat params[YAGL_LIGHT_MODEL_PARAM_MAX_LEN];
-    unsigned count = 1;
-
     YAGL_GET_CTX(glLightModelfv);
 
     if (pname != GL_LIGHT_MODEL_TWO_SIDE && pname != GL_LIGHT_MODEL_AMBIENT) {
         YAGL_SET_ERR(GL_INVALID_ENUM);
-        return true;
-    }
-
-    if (pname == GL_LIGHT_MODEL_AMBIENT) {
-        count = 4;
-    }
-
-    if (!yagl_mem_get(params_, count * sizeof(GLfloat), params)) {
-        return false;
+        return;
     }
 
     ctx->driver->LightModelfv(pname, params);
-
-    return true;
 }
 
-bool yagl_host_glLightf(GLenum light,
+void yagl_host_glLightf(GLenum light,
     GLenum pname,
     GLfloat param)
 {
@@ -519,55 +440,33 @@ bool yagl_host_glLightf(GLenum light,
     } else {
         ctx->driver->Lightf(light, pname, param);
     }
-
-    return true;
 }
 
-bool yagl_host_glLightfv(GLenum light,
+void yagl_host_glLightfv(GLenum light,
     GLenum pname,
-    target_ulong /* const GLfloat* */ params_)
+    const GLfloat *params, int32_t params_count)
 {
-    GLfloat params[YAGL_LIGHT_PARAM_MAX_LEN];
-    unsigned count;
+    int32_t tmp;
 
     YAGL_GET_CTX(glLightfv);
 
     if (light < GL_LIGHT0 || light >= (GL_LIGHT0 + ctx->max_lights) ||
-        !yagl_gles1_light_param_len(pname, &count)) {
+        !yagl_gles1_light_param_len(pname, &tmp)) {
         YAGL_SET_ERR(GL_INVALID_ENUM);
-        return true;
-    }
-
-    assert(count <= YAGL_LIGHT_PARAM_MAX_LEN);
-
-    if (!yagl_mem_get(params_, count * sizeof(GLfloat), &params[0])) {
-        return false;
+        return;
     }
 
     ctx->driver->Lightfv(light, pname, params);
-
-    return true;
 }
 
-bool yagl_host_glLoadMatrixf(target_ulong /* const GLfloat* */ m)
+void yagl_host_glLoadMatrixf(const GLfloat *m, int32_t m_count)
 {
-    GLfloat *matrix = NULL;
-
     YAGL_GET_CTX(glLoadMatrixf);
 
-    if (m) {
-        matrix = yagl_gles_context_malloc(&ctx->base, 16 * sizeof(*matrix));
-        if (!yagl_mem_get(m, 16 * sizeof(*matrix), matrix)) {
-            return false;
-        }
-    }
-
-    ctx->driver->LoadMatrixf(matrix);
-
-    return true;
+    ctx->driver->LoadMatrixf(m);
 }
 
-bool yagl_host_glMaterialf(GLenum face,
+void yagl_host_glMaterialf(GLenum face,
     GLenum pname,
     GLfloat param)
 {
@@ -578,57 +477,35 @@ bool yagl_host_glMaterialf(GLenum face,
     } else {
         ctx->driver->Materialf(face, pname, param);
     }
-
-    return true;
 }
 
-bool yagl_host_glMaterialfv(GLenum face,
+void yagl_host_glMaterialfv(GLenum face,
     GLenum pname,
-    target_ulong /* const GLfloat* */ params_)
+    const GLfloat *params, int32_t params_count)
 {
-    GLfloat params[YAGL_MATERIAL_PARAM_MAX_LEN];
-    unsigned count;
+    int32_t tmp;
 
     YAGL_GET_CTX(glMaterialfv);
 
     if (face != GL_FRONT_AND_BACK ||
-        !yagl_gles1_material_param_len(pname, &count)) {
+        !yagl_gles1_material_param_len(pname, &tmp)) {
         YAGL_SET_ERR(GL_INVALID_ENUM);
-        return true;
-    }
-
-    assert(count <= YAGL_MATERIAL_PARAM_MAX_LEN);
-
-    if (!yagl_mem_get(params_, count * sizeof(GLfloat), &params[0])) {
-        return false;
+        return;
     }
 
     ctx->driver->Materialfv(face, pname, params);
-
-    return true;
 }
 
-bool yagl_host_glMultMatrixf(target_ulong /* const GLfloat* */ m)
+void yagl_host_glMultMatrixf(const GLfloat *m, int32_t m_count)
 {
-    GLfloat *matrix = NULL;
-
     YAGL_GET_CTX(glMultMatrixf);
 
-    if (m) {
-        matrix = yagl_gles_context_malloc(&ctx->base, 16 * sizeof(*matrix));
-        if (!yagl_mem_get(m, 16 * sizeof(*matrix), matrix)) {
-            return false;
-        }
-    }
-
-    ctx->driver->MultMatrixf(matrix);
-
-    return true;
+    ctx->driver->MultMatrixf(m);
 }
 
-bool yagl_host_glMultiTexCoord4f(GLenum target,
+void yagl_host_glMultiTexCoord4f(GLenum target,
     GLfloat s,
-    GLfloat t,
+    GLfloat tt,
     GLfloat r,
     GLfloat q)
 {
@@ -636,24 +513,20 @@ bool yagl_host_glMultiTexCoord4f(GLenum target,
 
     if (target >= GL_TEXTURE0 &&
         target < (GL_TEXTURE0 + ctx->base.num_texture_units)) {
-        ctx->driver->MultiTexCoord4f(target, s, t, r, q);
+        ctx->driver->MultiTexCoord4f(target, s, tt, r, q);
     }
-
-    return true;
 }
 
-bool yagl_host_glNormal3f(GLfloat nx,
+void yagl_host_glNormal3f(GLfloat nx,
     GLfloat ny,
     GLfloat nz)
 {
     YAGL_GET_CTX(glNormal3f);
 
     ctx->driver->Normal3f(nx, ny, nz);
-
-    return true;
 }
 
-bool yagl_host_glOrthof(GLfloat left,
+void yagl_host_glOrthof(GLfloat left,
     GLfloat right,
     GLfloat bottom,
     GLfloat top,
@@ -667,11 +540,9 @@ bool yagl_host_glOrthof(GLfloat left,
     } else {
         ctx->driver->Ortho(left, right, bottom, top, zNear, zFar);
     }
-
-    return true;
 }
 
-bool yagl_host_glPointParameterf(GLenum pname,
+void yagl_host_glPointParameterf(GLenum pname,
     GLfloat param)
 {
     YAGL_GET_CTX(glPointParameterf);
@@ -682,39 +553,24 @@ bool yagl_host_glPointParameterf(GLenum pname,
     } else {
         ctx->driver->PointParameterf(pname, param);
     }
-
-    return true;
 }
 
-bool yagl_host_glPointParameterfv(GLenum pname,
-    target_ulong /* const GLfloat* */ params_)
+void yagl_host_glPointParameterfv(GLenum pname,
+    const GLfloat *params, int32_t params_count)
 {
-    GLfloat params[YAGL_POINT_PARAM_MAX_LEN];
-    unsigned count = 1;
-
     YAGL_GET_CTX(glPointParameterfv);
 
     if (pname != GL_POINT_SIZE_MIN && pname != GL_POINT_SIZE_MIN &&
         pname != GL_POINT_SIZE_MAX && pname != GL_POINT_FADE_THRESHOLD_SIZE &&
         pname != GL_POINT_DISTANCE_ATTENUATION) {
         YAGL_SET_ERR(GL_INVALID_ENUM);
-        return true;
-    }
-
-    if (pname == GL_POINT_DISTANCE_ATTENUATION) {
-        count = YAGL_POINT_PARAM_MAX_LEN;
-    }
-
-    if (!yagl_mem_get(params_, count * sizeof(GLfloat),  &params[0])) {
-        return false;
+        return;
     }
 
     ctx->driver->PointParameterfv(pname, params);
-
-    return true;
 }
 
-bool yagl_host_glPointSize(GLfloat size)
+void yagl_host_glPointSize(GLfloat size)
 {
     YAGL_GET_CTX(glPointSize);
 
@@ -723,11 +579,9 @@ bool yagl_host_glPointSize(GLfloat size)
     } else {
         ctx->driver->PointSize(size);
     }
-
-    return true;
 }
 
-bool yagl_host_glRotatef(GLfloat angle,
+void yagl_host_glRotatef(GLfloat angle,
     GLfloat x,
     GLfloat y,
     GLfloat z)
@@ -735,76 +589,53 @@ bool yagl_host_glRotatef(GLfloat angle,
     YAGL_GET_CTX(glRotatef);
 
     ctx->driver->Rotatef(angle, x, y, z);
-
-    return true;
 }
 
-bool yagl_host_glScalef(GLfloat x,
+void yagl_host_glScalef(GLfloat x,
     GLfloat y,
     GLfloat z)
 {
     YAGL_GET_CTX(glScalef);
 
     ctx->driver->Scalef(x, y, z);
-
-    return true;
 }
 
-bool yagl_host_glTexEnvf(GLenum target,
+void yagl_host_glTexEnvf(GLenum target,
     GLenum pname,
     GLfloat param)
 {
     YAGL_GET_CTX(glTexEnvf);
 
     ctx->driver->TexEnvf(target, pname, param);
-
-    return true;
 }
 
-bool yagl_host_glTexEnvfv(GLenum target,
+void yagl_host_glTexEnvfv(GLenum target,
     GLenum pname,
-    target_ulong /* const GLfloat* */ params_)
+    const GLfloat *params, int32_t params_count)
 {
-    GLfloat params[YAGL_TEX_ENV_PARAM_MAX_LEN];
-    unsigned count = 1;
-
     YAGL_GET_CTX(glTexEnvfv);
 
-    if (pname == GL_TEXTURE_ENV_COLOR) {
-        count = YAGL_TEX_ENV_PARAM_MAX_LEN;
-    }
-
-    if (!yagl_mem_get(params_, count * sizeof(GLfloat), &params[0])) {
-        return false;
-    }
-
     ctx->driver->TexEnvfv(target, pname, params);
-
-    return true;
 }
 
-bool yagl_host_glTranslatef(GLfloat x,
+void yagl_host_glTranslatef(GLfloat x,
     GLfloat y,
     GLfloat z)
 {
     YAGL_GET_CTX(glTranslatef);
 
     ctx->driver->Translatef(x, y, z);
-
-    return true;
 }
 
-bool yagl_host_glAlphaFuncx(GLenum func,
+void yagl_host_glAlphaFuncx(GLenum func,
     GLclampx ref)
 {
     YAGL_GET_CTX(glAlphaFuncx);
 
     ctx->driver->AlphaFunc(func, yagl_fixed_to_float(ref));
-
-    return true;
 }
 
-bool yagl_host_glClearColorx(GLclampx red,
+void yagl_host_glClearColorx(GLclampx red,
     GLclampx green,
     GLclampx blue,
     GLclampx alpha)
@@ -815,39 +646,32 @@ bool yagl_host_glClearColorx(GLclampx red,
                                  yagl_fixed_to_float(green),
                                  yagl_fixed_to_float(blue),
                                  yagl_fixed_to_float(alpha));
-
-    return true;
 }
 
-bool yagl_host_glClearDepthx(GLclampx depth)
+void yagl_host_glClearDepthx(GLclampx depth)
 {
     YAGL_GET_CTX(glClearDepthx);
 
     ctx->driver->base.ClearDepth(yagl_fixed_to_double(depth));
-
-    return true;
 }
 
-bool yagl_host_glClientActiveTexture(GLenum new_texture)
+void yagl_host_glClientActiveTexture(GLenum texture)
 {
     YAGL_GET_CTX(glClientActiveTexture);
 
-    if ((new_texture < GL_TEXTURE0) ||
-        (new_texture >= (GL_TEXTURE0 + ctx->base.num_texture_units))) {
+    if ((texture < GL_TEXTURE0) ||
+        (texture >= (GL_TEXTURE0 + ctx->base.num_texture_units))) {
         YAGL_SET_ERR(GL_INVALID_ENUM);
-        return true;
+        return;
     }
-    ctx->client_active_texture = new_texture - GL_TEXTURE0;
+    ctx->client_active_texture = texture - GL_TEXTURE0;
 
-    ctx->driver->ClientActiveTexture(new_texture);
-
-    return true;
+    ctx->driver->ClientActiveTexture(texture);
 }
 
-bool yagl_host_glClipPlanex(GLenum plane,
-    target_ulong /* const GLfixed* */ equation_)
+void yagl_host_glClipPlanex(GLenum plane,
+    const GLfixed *equation, int32_t equation_count)
 {
-    GLfixed equationx[4];
     yagl_GLdouble equationd[4];
     unsigned i;
 
@@ -856,23 +680,21 @@ bool yagl_host_glClipPlanex(GLenum plane,
     if (plane < GL_CLIP_PLANE0 ||
         plane >= (GL_CLIP_PLANE0 + ctx->max_clip_planes)) {
         YAGL_SET_ERR(GL_INVALID_ENUM);
-        return true;
+        return;
     }
 
-    if (!yagl_mem_get(equation_, 4 * sizeof(GLfixed), &equationx[0])) {
-        return false;
-    }
+    if (equation) {
+        for (i = 0; i < 4; ++i) {
+            equationd[i] = yagl_fixed_to_double(equation[i]);
+        }
 
-    for (i = 0; i < 4; ++i) {
-        equationd[i] = yagl_fixed_to_double(equationx[i]);
+        ctx->driver->ClipPlane(plane, equationd);
+    } else {
+        ctx->driver->ClipPlane(plane, NULL);
     }
-
-    ctx->driver->ClipPlane(plane, equationd);
-
-    return true;
 }
 
-bool yagl_host_glColor4ub(GLubyte red,
+void yagl_host_glColor4ub(GLubyte red,
     GLubyte green,
     GLubyte blue,
     GLubyte alpha)
@@ -880,11 +702,9 @@ bool yagl_host_glColor4ub(GLubyte red,
     YAGL_GET_CTX(glColor4ub);
 
     ctx->driver->Color4ub(red, green, blue, alpha);
-
-    return true;
 }
 
-bool yagl_host_glColor4x(GLfixed red,
+void yagl_host_glColor4x(GLfixed red,
     GLfixed green,
     GLfixed blue,
     GLfixed alpha)
@@ -895,14 +715,12 @@ bool yagl_host_glColor4x(GLfixed red,
                          yagl_fixed_to_float(green),
                          yagl_fixed_to_float(blue),
                          yagl_fixed_to_float(alpha));
-
-    return true;
 }
 
-bool yagl_host_glColorPointer(GLint size,
+void yagl_host_glColorPointer(GLint size,
     GLenum type,
     GLsizei stride,
-    target_ulong /* const GLvoid* */ pointer)
+    target_ulong pointer)
 {
     struct yagl_gles_array *carray;
 
@@ -910,12 +728,12 @@ bool yagl_host_glColorPointer(GLint size,
 
     if (size != 4 || stride < 0) {
         YAGL_SET_ERR(GL_INVALID_VALUE);
-        return true;
+        return;
     }
 
     if (type != GL_FLOAT && type != GL_FIXED && type != GL_UNSIGNED_BYTE) {
         YAGL_SET_ERR(GL_INVALID_ENUM);
-        return true;
+        return;
     }
 
     carray = yagl_gles_context_get_array(&ctx->base, YAGL_GLES1_ARRAY_COLOR);
@@ -945,22 +763,18 @@ bool yagl_host_glColorPointer(GLint size,
             YAGL_SET_ERR(GL_INVALID_VALUE);
         }
     }
-
-    return true;
 }
 
-bool yagl_host_glDepthRangex(GLclampx zNear,
+void yagl_host_glDepthRangex(GLclampx zNear,
     GLclampx zFar)
 {
     YAGL_GET_CTX(glDepthRangex);
 
     ctx->driver->base.DepthRange(yagl_fixed_to_double(zNear),
                                  yagl_fixed_to_double(zFar));
-
-    return true;
 }
 
-bool yagl_host_glDisableClientState(GLenum array_name)
+void yagl_host_glDisableClientState(GLenum array_name)
 {
     struct yagl_gles_array *array;
     unsigned arr_idx;
@@ -969,7 +783,7 @@ bool yagl_host_glDisableClientState(GLenum array_name)
 
     if (!yagl_gles1_array_idx_get(ctx, array_name, &arr_idx)) {
         YAGL_SET_ERR(GL_INVALID_ENUM);
-        return true;
+        return;
     }
 
     array = yagl_gles_context_get_array(&ctx->base, arr_idx);
@@ -981,11 +795,9 @@ bool yagl_host_glDisableClientState(GLenum array_name)
     if (array_name != GL_POINT_SIZE_ARRAY_OES) {
         ctx->driver->DisableClientState(array_name);
     }
-
-    return true;
 }
 
-bool yagl_host_glEnableClientState(GLenum array_name)
+void yagl_host_glEnableClientState(GLenum array_name)
 {
     struct yagl_gles_array *array;
     unsigned arr_idx;
@@ -994,7 +806,7 @@ bool yagl_host_glEnableClientState(GLenum array_name)
 
     if (!yagl_gles1_array_idx_get(ctx, array_name, &arr_idx)) {
         YAGL_SET_ERR(GL_INVALID_ENUM);
-        return true;
+        return;
     }
 
     array = yagl_gles_context_get_array(&ctx->base, arr_idx);
@@ -1006,11 +818,9 @@ bool yagl_host_glEnableClientState(GLenum array_name)
     if (array_name != GL_POINT_SIZE_ARRAY_OES) {
         ctx->driver->EnableClientState(array_name);
     }
-
-    return true;
 }
 
-bool yagl_host_glFogx(GLenum pname,
+void yagl_host_glFogx(GLenum pname,
     GLfixed param)
 {
     YAGL_GET_CTX(glFogx);
@@ -1025,16 +835,14 @@ bool yagl_host_glFogx(GLenum pname,
             ctx->driver->Fogf(pname, yagl_fixed_to_float(param));
         }
     }
-
-    return true;
 }
 
-bool yagl_host_glFogxv(GLenum pname,
-    target_ulong /* const GLfixed* */ params_)
+void yagl_host_glFogxv(GLenum pname,
+    const GLfixed *params, int32_t params_count)
 {
     GLfixed paramsx[YAGL_FOG_PARAM_MAX_LEN];
     GLfloat paramsf[YAGL_FOG_PARAM_MAX_LEN];
-    unsigned count = 1, i;
+    int32_t i;
 
     YAGL_GET_CTX(glFogxv);
 
@@ -1042,31 +850,21 @@ bool yagl_host_glFogxv(GLenum pname,
         pname != GL_FOG_START && pname != GL_FOG_END &&
         pname != GL_FOG_COLOR) {
         YAGL_SET_ERR(GL_INVALID_ENUM);
-        return true;
-    }
-
-    if (pname == GL_FOG_COLOR) {
-        count = YAGL_FOG_PARAM_MAX_LEN;
-    }
-
-    if (!yagl_mem_get(params_, count * sizeof(GLfixed), &paramsx[0])) {
-        return false;
+        return;
     }
 
     if (pname == GL_FOG_MODE) {
         paramsf[0] = (GLfloat)paramsx[0];
     } else {
-        for (i = 0; i < count; ++i) {
+        for (i = 0; i < params_count; ++i) {
             paramsf[i] = yagl_fixed_to_float(paramsx[i]);
         }
     }
 
     ctx->driver->Fogfv(pname, paramsf);
-
-    return true;
 }
 
-bool yagl_host_glFrustumx(GLfixed left,
+void yagl_host_glFrustumx(GLfixed left,
     GLfixed right,
     GLfixed bottom,
     GLfixed top,
@@ -1086,152 +884,111 @@ bool yagl_host_glFrustumx(GLfixed left,
                              yagl_fixed_to_double(zNear),
                              yagl_fixed_to_double(zFar));
     }
-
-    return true;
 }
 
-bool yagl_host_glGetClipPlanex(GLenum plane,
-    target_ulong /* GLfixed* */ eqn)
+void yagl_host_glGetClipPlanex(GLenum pname,
+    GLfixed *eqn, int32_t eqn_maxcount, int32_t *eqn_count)
 {
     yagl_GLdouble equationd[4];
-    GLfixed equationx[4];
     unsigned i;
 
     YAGL_GET_CTX(glGetClipPlanex);
 
-    if (plane < GL_CLIP_PLANE0 ||
-        plane >= (GL_CLIP_PLANE0 + ctx->max_clip_planes)) {
+    if (pname < GL_CLIP_PLANE0 ||
+        pname >= (GL_CLIP_PLANE0 + ctx->max_clip_planes)) {
         YAGL_SET_ERR(GL_INVALID_ENUM);
-        return true;
+        return;
     }
 
-    if (!yagl_mem_prepare(cur_ts->mt1, eqn, 4 * sizeof(GLfixed))) {
-        return false;
-    }
-
-    ctx->driver->GetClipPlane(plane, equationd);
-
-    for (i = 0; i < 4; ++i) {
-        equationx[i] = yagl_double_to_fixed((GLfloat)equationd[i]);
-    }
+    ctx->driver->GetClipPlane(pname, equationd);
 
     if (eqn) {
-        yagl_mem_put(cur_ts->mt1, equationx);
+        for (i = 0; i < 4; ++i) {
+            eqn[i] = yagl_double_to_fixed((GLfloat)equationd[i]);
+        }
+        *eqn_count = 4;
     }
-
-    return true;
 }
 
-bool yagl_host_glGetFixedv(GLenum pname,
-    target_ulong /* GLfixed* */ params_)
+void yagl_host_glGetFixedv(GLenum pname,
+    GLfixed *params, int32_t params_maxcount, int32_t *params_count)
 {
-    int count = 0, i;
-    void *params = NULL;
+    GLfloat *tmp;
+    int32_t i;
 
     YAGL_GET_CTX(glGetFixedv);
 
-    if (!ctx->base.get_param_count(&ctx->base, pname, &count)) {
+    if (!ctx->base.get_param_count(&ctx->base, pname, params_count)) {
         YAGL_SET_ERR(GL_INVALID_ENUM);
-        goto out;
+        return;
     }
 
-    if (!yagl_mem_prepare(cur_ts->mt1, params_, count * sizeof(GLfixed))) {
-        return false;
+    if (!params) {
+        return;
     }
 
-    params = yagl_gles_context_malloc0(&ctx->base, count * sizeof(GLfloat));
+    tmp = yagl_gles_context_malloc0(&ctx->base, *params_count * sizeof(GLfloat));
 
-    if (!ctx->base.get_floatv(&ctx->base, pname, params)) {
-        if (!yagl_gles1_get_float(&ctx->base, pname, (GLfloat *)params)) {
-            ctx->driver->base.GetFloatv(pname, params);
+    if (!ctx->base.get_floatv(&ctx->base, pname, tmp)) {
+        if (!yagl_gles1_get_float(&ctx->base, pname, tmp)) {
+            ctx->driver->base.GetFloatv(pname, tmp);
         }
     }
 
-    assert(sizeof(GLfixed) == sizeof(GLfloat));
-
-    for (i = 0; i < count; ++i) {
-        ((GLfixed *)params)[i] = yagl_float_to_fixed(((GLfloat *)params)[i]);
-    }
-
-    if (params_) {
-        yagl_mem_put(cur_ts->mt1, params);
+    for (i = 0; i < *params_count; ++i) {
+        params[i] = yagl_float_to_fixed(tmp[i]);
     }
-
-out:
-    return true;
 }
 
-bool yagl_host_glGetLightxv(GLenum light,
+void yagl_host_glGetLightxv(GLenum light,
     GLenum pname,
-    target_ulong /* GLfixed* */ params_)
+    GLfixed *params, int32_t params_maxcount, int32_t *params_count)
 {
     GLfloat paramsf[YAGL_LIGHT_PARAM_MAX_LEN];
-    GLfixed paramsx[YAGL_LIGHT_PARAM_MAX_LEN];
-    unsigned count, i;
+    int32_t i;
 
     YAGL_GET_CTX(glGetLightxv);
 
     if (light < GL_LIGHT0 || light >= (GL_LIGHT0 + ctx->max_lights) ||
-        !yagl_gles1_light_param_len(pname, &count)) {
+        !yagl_gles1_light_param_len(pname, params_count)) {
         YAGL_SET_ERR(GL_INVALID_ENUM);
-        return true;
-    }
-
-    assert(count <= YAGL_LIGHT_PARAM_MAX_LEN);
-
-    if (!yagl_mem_prepare(cur_ts->mt1, params_, count * sizeof(GLfixed))) {
-        return false;
+        return;
     }
 
     ctx->driver->GetLightfv(light, pname, paramsf);
 
-    for (i = 0; i < count; ++i) {
-        paramsx[i] = yagl_float_to_fixed(paramsf[i]);
-    }
-
-    if (params_) {
-        yagl_mem_put(cur_ts->mt1, paramsx);
+    if (params) {
+        for (i = 0; i < *params_count; ++i) {
+            params[i] = yagl_float_to_fixed(paramsf[i]);
+        }
     }
-
-    return true;
 }
 
-bool yagl_host_glGetMaterialxv(GLenum face,
+void yagl_host_glGetMaterialxv(GLenum face,
     GLenum pname,
-    target_ulong /* GLfixed* */ params_)
+    GLfixed *params, int32_t params_maxcount, int32_t *params_count)
 {
     GLfloat paramsf[YAGL_MATERIAL_PARAM_MAX_LEN];
-    GLfixed paramsx[YAGL_MATERIAL_PARAM_MAX_LEN];
-    unsigned count, i;
+    int32_t i;
 
     YAGL_GET_CTX(glGetMaterialxv);
 
-    if (!yagl_gles1_material_param_len(pname, &count)) {
+    if (!yagl_gles1_material_param_len(pname, params_count)) {
         YAGL_SET_ERR(GL_INVALID_ENUM);
-        return true;
-    }
-
-    assert(count <= YAGL_MATERIAL_PARAM_MAX_LEN);
-
-    if (!yagl_mem_prepare(cur_ts->mt1, params_, count * sizeof(GLfixed))) {
-        return false;
+        return;
     }
 
     ctx->driver->GetMaterialfv(face, pname, paramsf);
 
-    for (i = 0; i < count; ++i) {
-        paramsx[i] = yagl_float_to_fixed(paramsf[i]);
-    }
-
-    if (params_) {
-        yagl_mem_put(cur_ts->mt1, paramsx);
+    if (params) {
+        for (i = 0; i < *params_count; ++i) {
+            params[i] = yagl_float_to_fixed(paramsf[i]);
+        }
     }
-
-    return true;
 }
 
-bool yagl_host_glGetPointerv(GLenum pname,
-    target_ulong /* GLvoid** */ params)
+void yagl_host_glGetPointerv(GLenum pname,
+    target_ulong *params)
 {
     struct yagl_gles_array *array;
     unsigned arr_idx;
@@ -1241,11 +998,7 @@ bool yagl_host_glGetPointerv(GLenum pname,
 
     if (!yagl_gles1_array_idx_get(ctx, pname, &arr_idx)) {
         YAGL_SET_ERR(GL_INVALID_ENUM);
-        return true;
-    }
-
-    if (!yagl_mem_prepare_ptr(cur_ts->mt1, params)) {
-        return false;
+        return;
     }
 
     array = yagl_gles_context_get_array(&ctx->base, arr_idx);
@@ -1259,114 +1012,88 @@ bool yagl_host_glGetPointerv(GLenum pname,
     }
 
     if (params) {
-        yagl_mem_put_ptr(cur_ts->mt1, pointer);
+        *params = pointer;
     }
-
-    return true;
 }
 
-bool yagl_host_glGetTexEnviv(GLenum target,
+void yagl_host_glGetTexEnviv(GLenum env,
     GLenum pname,
-    target_ulong /* GLint* */ params_)
+    GLint *params, int32_t params_maxcount, int32_t *params_count)
 {
-    GLint params[YAGL_TEX_ENV_PARAM_MAX_LEN];
-    unsigned count = 1;
-
     YAGL_GET_CTX(glGetTexEnviv);
 
-    if (target != GL_TEXTURE_ENV && target != GL_POINT_SPRITE_OES) {
+    if (env != GL_TEXTURE_ENV && env != GL_POINT_SPRITE_OES) {
         YAGL_SET_ERR(GL_INVALID_ENUM);
-        return true;
+        return;
     }
 
     if (pname == GL_TEXTURE_ENV_COLOR) {
-        count = YAGL_TEX_ENV_PARAM_MAX_LEN;
-    }
-
-    if (!yagl_mem_prepare(cur_ts->mt1, params_, count * sizeof(GLint))) {
-        return false;
+        *params_count = YAGL_TEX_ENV_PARAM_MAX_LEN;
+    } else {
+        *params_count = 1;
     }
 
-    ctx->driver->GetTexEnviv(target, pname, params);
-
-    yagl_mem_put(cur_ts->mt1, params);
-
-    return true;
+    ctx->driver->GetTexEnviv(env, pname, params);
 }
 
-bool yagl_host_glGetTexEnvfv(GLenum target,
+void yagl_host_glGetTexEnvfv(GLenum env,
     GLenum pname,
-    target_ulong /* GLfloat* */ params_)
+    GLfloat *params, int32_t params_maxcount, int32_t *params_count)
 {
-    GLfloat params[YAGL_TEX_ENV_PARAM_MAX_LEN];
-    unsigned count = 1;
-
     YAGL_GET_CTX(glGetTexEnvfv);
 
-    if (target != GL_TEXTURE_ENV && target != GL_POINT_SPRITE_OES) {
+    if (env != GL_TEXTURE_ENV && env != GL_POINT_SPRITE_OES) {
         YAGL_SET_ERR(GL_INVALID_ENUM);
-        return true;
+        return;
     }
 
     if (pname == GL_TEXTURE_ENV_COLOR) {
-        count = YAGL_TEX_ENV_PARAM_MAX_LEN;
-    }
-
-    if (!yagl_mem_prepare(cur_ts->mt1, params_, count * sizeof(GLfloat))) {
-        return false;
+        *params_count = YAGL_TEX_ENV_PARAM_MAX_LEN;
+    } else {
+        *params_count = 1;
     }
 
-    ctx->driver->GetTexEnvfv(target, pname, params);
-
-    yagl_mem_put(cur_ts->mt1, params);
-
-    return true;
+    ctx->driver->GetTexEnvfv(env, pname, params);
 }
 
-bool yagl_host_glGetTexEnvxv(GLenum target,
+void yagl_host_glGetTexEnvxv(GLenum env,
     GLenum pname,
-    target_ulong /* GLfixed* */ params_)
+    GLfixed *params, int32_t params_maxcount, int32_t *params_count)
 {
     GLfloat paramsf[YAGL_TEX_ENV_PARAM_MAX_LEN];
-    GLfixed paramsx[YAGL_TEX_ENV_PARAM_MAX_LEN];
-    unsigned count = 1;
 
     YAGL_GET_CTX(glGetTexEnvxv);
 
-    if (target != GL_TEXTURE_ENV && target != GL_POINT_SPRITE_OES) {
+    if (env != GL_TEXTURE_ENV && env != GL_POINT_SPRITE_OES) {
         YAGL_SET_ERR(GL_INVALID_ENUM);
-        return true;
+        return;
     }
 
     if (pname == GL_TEXTURE_ENV_COLOR) {
-        count = YAGL_TEX_ENV_PARAM_MAX_LEN;
-    }
-
-    if (!yagl_mem_prepare(cur_ts->mt1, params_, count * sizeof(GLfixed))) {
-        return false;
+        *params_count = YAGL_TEX_ENV_PARAM_MAX_LEN;
+    } else {
+        *params_count = 1;
     }
 
-    ctx->driver->GetTexEnvfv(target, pname, paramsf);
+    ctx->driver->GetTexEnvfv(env, pname, paramsf);
 
-    if (pname == GL_TEXTURE_ENV_COLOR || pname == GL_RGB_SCALE ||
-        pname == GL_ALPHA_SCALE) {
-        unsigned i;
+    if (params) {
+        if (pname == GL_TEXTURE_ENV_COLOR || pname == GL_RGB_SCALE ||
+            pname == GL_ALPHA_SCALE) {
+            unsigned i;
 
-        for (i = 0; i < count; ++i) {
-            paramsx[i] = yagl_float_to_fixed(paramsf[i]);
+            for (i = 0; i < *params_count; ++i) {
+                params[i] = yagl_float_to_fixed(paramsf[i]);
+            }
+        } else {
+            params[0] = (GLfixed)paramsf[0];
         }
-    } else {
-        paramsx[0] = (GLfixed)paramsf[0];
     }
-
-    yagl_mem_put(cur_ts->mt1, paramsx);
-
-    return true;
 }
 
-bool yagl_host_glGetTexParameterxv(GLenum target,
+void yagl_host_glGetTexParameterxv(GLenum target,
     GLenum pname,
-    target_ulong /* GLfixed* */ params_)
+    GLfixed *param)
 {
     GLfloat paramf;
 
@@ -1374,23 +1101,17 @@ bool yagl_host_glGetTexParameterxv(GLenum target,
 
     if (target != GL_TEXTURE_2D) {
         YAGL_SET_ERR(GL_INVALID_ENUM);
-        return true;
-    }
-
-    if (!yagl_mem_prepare_GLfixed(cur_ts->mt1, params_)) {
-        return false;
+        return;
     }
 
     ctx->driver->base.GetTexParameterfv(target, pname, &paramf);
 
-    if (params_) {
-        yagl_mem_put_GLfixed(cur_ts->mt1, (GLfixed)paramf);
+    if (param) {
+        *param = (GLfixed)paramf;
     }
-
-    return true;
 }
 
-bool yagl_host_glLightModelx(GLenum pname,
+void yagl_host_glLightModelx(GLenum pname,
     GLfixed param)
 {
     YAGL_GET_CTX(glLightModelx);
@@ -1400,49 +1121,35 @@ bool yagl_host_glLightModelx(GLenum pname,
     } else {
         ctx->driver->LightModelf(pname, (GLfloat)param);
     }
-
-    return true;
 }
 
-bool yagl_host_glLightModelxv(GLenum pname,
-    target_ulong /* const GLfixed* */ params_)
+void yagl_host_glLightModelxv(GLenum pname,
+    const GLfixed *params, int32_t params_count)
 {
     GLfloat paramsf[YAGL_LIGHT_MODEL_PARAM_MAX_LEN];
+    uint32_t i;
 
     YAGL_GET_CTX(glLightModelxv);
 
-    if (pname == GL_LIGHT_MODEL_TWO_SIDE) {
-        GLfixed paramx;
-
-        if (!yagl_mem_get_GLfixed(params_, &paramx)) {
-            return false;
-        }
-
-        paramsf[0] = (GLfloat)paramx;
-    } else if (pname == GL_LIGHT_MODEL_AMBIENT) {
-        GLfixed paramsx[YAGL_LIGHT_MODEL_PARAM_MAX_LEN];
-        unsigned i;
-
-        if (!yagl_mem_get(params_,
-                          YAGL_LIGHT_MODEL_PARAM_MAX_LEN * sizeof(GLfixed),
-                          &paramsx[0])) {
-            return false;
+    if (params) {
+        if (pname == GL_LIGHT_MODEL_TWO_SIDE) {
+            paramsf[0] = (GLfloat)params[0];
+        } else if (pname == GL_LIGHT_MODEL_AMBIENT) {
+            for (i = 0; i < YAGL_LIGHT_MODEL_PARAM_MAX_LEN; ++i) {
+                paramsf[i] = yagl_fixed_to_float(params[i]);
+            }
+        } else {
+            YAGL_SET_ERR(GL_INVALID_ENUM);
+            return;
         }
 
-        for (i = 0; i < YAGL_LIGHT_MODEL_PARAM_MAX_LEN; ++i) {
-            paramsf[i] = yagl_fixed_to_float(paramsx[i]);
-        }
+        ctx->driver->LightModelfv(pname, paramsf);
     } else {
-        YAGL_SET_ERR(GL_INVALID_ENUM);
-        return true;
+        ctx->driver->LightModelfv(pname, NULL);
     }
-
-    ctx->driver->LightModelfv(pname, paramsf);
-
-    return true;
 }
 
-bool yagl_host_glLightx(GLenum light,
+void yagl_host_glLightx(GLenum light,
     GLenum pname,
     GLfixed param)
 {
@@ -1453,42 +1160,34 @@ bool yagl_host_glLightx(GLenum light,
     } else {
         ctx->driver->Lightf(light, pname, yagl_fixed_to_float(param));
     }
-
-    return true;
 }
 
-bool yagl_host_glLightxv(GLenum light,
+void yagl_host_glLightxv(GLenum light,
     GLenum pname,
-    target_ulong /* const GLfixed* */ params_)
+    const GLfixed *params, int32_t params_count)
 {
     GLfloat paramsf[YAGL_LIGHT_PARAM_MAX_LEN];
-    GLfixed paramsx[YAGL_LIGHT_PARAM_MAX_LEN];
-    unsigned count, i;
+    int32_t tmp, i;
 
     YAGL_GET_CTX(glLightxv);
 
     if (light < GL_LIGHT0 || light >= (GL_LIGHT0 + ctx->max_lights) ||
-        !yagl_gles1_light_param_len(pname, &count)) {
+        !yagl_gles1_light_param_len(pname, &tmp)) {
         YAGL_SET_ERR(GL_INVALID_ENUM);
-        return true;
-    }
-
-    assert(count <= YAGL_LIGHT_PARAM_MAX_LEN);
-
-    if (!yagl_mem_get(params_, count * sizeof(GLfixed), &paramsx[0])) {
-        return false;
+        return;
     }
 
-    for (i = 0; i < count; ++i) {
-        paramsf[i] = yagl_fixed_to_float(paramsx[i]);
+    if (params) {
+        for (i = 0; i < params_count; ++i) {
+            paramsf[i] = yagl_fixed_to_float(params[i]);
+        }
+        ctx->driver->Lightfv(light, pname, paramsf);
+    } else {
+        ctx->driver->Lightfv(light, pname, NULL);
     }
-
-    ctx->driver->Lightfv(light, pname, paramsf);
-
-    return true;
 }
 
-bool yagl_host_glLineWidthx(GLfixed width)
+void yagl_host_glLineWidthx(GLfixed width)
 {
     GLfloat widthf;
 
@@ -1498,58 +1197,45 @@ bool yagl_host_glLineWidthx(GLfixed width)
 
     if (widthf <= 0) {
         YAGL_SET_ERR(GL_INVALID_VALUE);
-        return true;
+        return;
     }
 
     ctx->driver->base.LineWidth(widthf);
-
-    return true;
 }
 
-bool yagl_host_glLoadIdentity(void)
+void yagl_host_glLoadIdentity(void)
 {
     YAGL_GET_CTX(glLoadIdentity);
 
     ctx->driver->LoadIdentity();
-
-    return true;
 }
 
-bool yagl_host_glLoadMatrixx(target_ulong /* const GLfixed* */ m)
+void yagl_host_glLoadMatrixx(const GLfixed *m, int32_t m_count)
 {
     unsigned i;
-    void *matrix = NULL;
+    GLfloat *tmp = NULL;
 
     YAGL_GET_CTX(glLoadMatrixx);
 
     if (m) {
-        matrix = yagl_gles_context_malloc(&ctx->base, 16 * sizeof(GLfixed));
-        if (!yagl_mem_get(m, 16 * sizeof(GLfixed), matrix)) {
-            return false;
-        }
-    }
-
-    assert(sizeof(GLfloat) == sizeof(GLfixed));
+        tmp = yagl_gles_context_malloc(&ctx->base, 16 * sizeof(GLfloat));
 
-    for (i = 0; i < 16; ++i) {
-        ((GLfloat *)matrix)[i] = yagl_fixed_to_float(((GLfixed *)matrix)[i]);
+        for (i = 0; i < 16; ++i) {
+            tmp[i] = yagl_fixed_to_float(m[i]);
+        }
     }
 
-    ctx->driver->LoadMatrixf(matrix);
-
-    return true;
+    ctx->driver->LoadMatrixf(tmp);
 }
 
-bool yagl_host_glLogicOp(GLenum opcode)
+void yagl_host_glLogicOp(GLenum opcode)
 {
     YAGL_GET_CTX(glLogicOp);
 
     ctx->driver->LogicOp(opcode);
-
-    return true;
 }
 
-bool yagl_host_glMaterialx(GLenum face,
+void yagl_host_glMaterialx(GLenum face,
     GLenum pname,
     GLfixed param)
 {
@@ -1560,78 +1246,61 @@ bool yagl_host_glMaterialx(GLenum face,
     } else {
         ctx->driver->Materialf(face, pname, yagl_fixed_to_float(param));
     }
-
-    return true;
 }
 
-bool yagl_host_glMaterialxv(GLenum face,
+void yagl_host_glMaterialxv(GLenum face,
     GLenum pname,
-    target_ulong /* const GLfixed* */ params_)
+    const GLfixed *params, int32_t params_count)
 {
     GLfloat paramsf[YAGL_MATERIAL_PARAM_MAX_LEN];
-    GLfixed paramsx[YAGL_MATERIAL_PARAM_MAX_LEN];
-    unsigned count, i;
+    int32_t tmp, i;
 
     YAGL_GET_CTX(glMaterialxv);
 
     if (face != GL_FRONT_AND_BACK ||
-        !yagl_gles1_material_param_len(pname, &count)) {
+        !yagl_gles1_material_param_len(pname, &tmp)) {
         YAGL_SET_ERR(GL_INVALID_ENUM);
-        return true;
+        return;
     }
 
-    assert(count <= YAGL_MATERIAL_PARAM_MAX_LEN);
-
-    if (!yagl_mem_get(params_, count * sizeof(GLfixed), &paramsx[0])) {
-        return false;
-    }
-
-    for (i = 0; i < count; ++i) {
-        paramsf[i] = yagl_fixed_to_float(paramsx[i]);
+    if (params) {
+        for (i = 0; i < params_count; ++i) {
+            paramsf[i] = yagl_fixed_to_float(params[i]);
+        }
+        ctx->driver->Materialfv(face, pname, paramsf);
+    } else {
+        ctx->driver->Materialfv(face, pname, NULL);
     }
-
-    ctx->driver->Materialfv(face, pname, paramsf);
-
-    return true;
 }
 
-bool yagl_host_glMatrixMode(GLenum mode)
+void yagl_host_glMatrixMode(GLenum mode)
 {
     YAGL_GET_CTX(glMatrixMode);
 
     ctx->driver->MatrixMode(mode);
-
-    return true;
 }
 
-bool yagl_host_glMultMatrixx(target_ulong /* const GLfixed* */ m)
+void yagl_host_glMultMatrixx(const GLfixed *m, int32_t m_count)
 {
-    unsigned i;
-    void *matrix = NULL;
+    GLfloat *tmp = NULL;
+    int32_t i;
 
     YAGL_GET_CTX(glMultMatrixf);
 
     if (m) {
-        matrix = yagl_gles_context_malloc(&ctx->base, 16 * sizeof(GLfixed));
-        if (!yagl_mem_get(m, 16 * sizeof(GLfixed), matrix)) {
-            return false;
-        }
-    }
-
-    assert(sizeof(GLfloat) == sizeof(GLfixed));
+        tmp = yagl_gles_context_malloc(&ctx->base, 16 * sizeof(GLfloat));
 
-    for (i = 0; i < 16; ++i) {
-        ((GLfloat *)matrix)[i] = yagl_fixed_to_float(((GLfixed *)matrix)[i]);
+        for (i = 0; i < 16; ++i) {
+            tmp[i] = yagl_fixed_to_float(m[i]);
+        }
     }
 
-    ctx->driver->MultMatrixf(matrix);
-
-    return true;
+    ctx->driver->MultMatrixf(tmp);
 }
 
-bool yagl_host_glMultiTexCoord4x(GLenum target,
+void yagl_host_glMultiTexCoord4x(GLenum target,
     GLfixed s,
-    GLfixed t,
+    GLfixed tt,
     GLfixed r,
     GLfixed q)
 {
@@ -1641,15 +1310,13 @@ bool yagl_host_glMultiTexCoord4x(GLenum target,
         target < (GL_TEXTURE0 + ctx->base.num_texture_units)) {
         ctx->driver->MultiTexCoord4f(target,
                                      yagl_fixed_to_float(s),
-                                     yagl_fixed_to_float(t),
+                                     yagl_fixed_to_float(tt),
                                      yagl_fixed_to_float(r),
                                      yagl_fixed_to_float(q));
     }
-
-    return true;
 }
 
-bool yagl_host_glNormal3x(GLfixed nx,
+void yagl_host_glNormal3x(GLfixed nx,
     GLfixed ny,
     GLfixed nz)
 {
@@ -1658,13 +1325,11 @@ bool yagl_host_glNormal3x(GLfixed nx,
     ctx->driver->Normal3f(yagl_fixed_to_float(nx),
                           yagl_fixed_to_float(ny),
                           yagl_fixed_to_float(nz));
-
-    return true;
 }
 
-bool yagl_host_glNormalPointer(GLenum type,
+void yagl_host_glNormalPointer(GLenum type,
     GLsizei stride,
-    target_ulong /* const GLvoid* */ pointer)
+    target_ulong pointer)
 {
     struct yagl_gles_array *narray;
 
@@ -1672,13 +1337,13 @@ bool yagl_host_glNormalPointer(GLenum type,
 
     if (stride < 0) {
         YAGL_SET_ERR(GL_INVALID_VALUE);
-        return true;
+        return;
     }
 
     if (type != GL_FLOAT && type != GL_FIXED &&
         type != GL_SHORT && type != GL_BYTE) {
         YAGL_SET_ERR(GL_INVALID_ENUM);
-        return true;
+        return;
     }
 
     narray = yagl_gles_context_get_array(&ctx->base, YAGL_GLES1_ARRAY_NORMAL);
@@ -1708,11 +1373,9 @@ bool yagl_host_glNormalPointer(GLenum type,
             YAGL_SET_ERR(GL_INVALID_VALUE);
         }
     }
-
-    return true;
 }
 
-bool yagl_host_glOrthox(GLfixed left,
+void yagl_host_glOrthox(GLfixed left,
     GLfixed right,
     GLfixed bottom,
     GLfixed top,
@@ -1731,11 +1394,9 @@ bool yagl_host_glOrthox(GLfixed left,
                            yagl_fixed_to_double(zNear),
                            yagl_fixed_to_double(zFar));
     }
-
-    return true;
 }
 
-bool yagl_host_glPointParameterx(GLenum pname,
+void yagl_host_glPointParameterx(GLenum pname,
     GLfixed param)
 {
     YAGL_GET_CTX(glPointParameterx);
@@ -1746,16 +1407,13 @@ bool yagl_host_glPointParameterx(GLenum pname,
     } else {
         ctx->driver->PointParameterf(pname, yagl_fixed_to_float(param));
     }
-
-    return true;
 }
 
-bool yagl_host_glPointParameterxv(GLenum pname,
-    target_ulong /* const GLfixed* */ params_)
+void yagl_host_glPointParameterxv(GLenum pname,
+    const GLfixed *params, int32_t params_count)
 {
-    GLfixed paramsx[YAGL_POINT_PARAM_MAX_LEN];
     GLfloat paramsf[YAGL_POINT_PARAM_MAX_LEN];
-    unsigned count = 1, i;
+    int32_t i;
 
     YAGL_GET_CTX(glPointParameterxv);
 
@@ -1763,27 +1421,20 @@ bool yagl_host_glPointParameterxv(GLenum pname,
         pname != GL_POINT_SIZE_MAX && pname != GL_POINT_FADE_THRESHOLD_SIZE &&
         pname != GL_POINT_DISTANCE_ATTENUATION) {
         YAGL_SET_ERR(GL_INVALID_ENUM);
-        return true;
-    }
-
-    if (pname == GL_POINT_DISTANCE_ATTENUATION) {
-        count = YAGL_POINT_PARAM_MAX_LEN;
+        return;
     }
 
-    if (!yagl_mem_get(params_, count * sizeof(GLfixed), &paramsx[0])) {
-        return false;
-    }
-
-    for (i = 0; i < count; ++i) {
-        paramsf[i] = yagl_fixed_to_float(paramsx[i]);
+    if (params) {
+        for (i = 0; i < params_count; ++i) {
+            paramsf[i] = yagl_fixed_to_float(params[i]);
+        }
+        ctx->driver->PointParameterfv(pname, paramsf);
+    } else {
+        ctx->driver->PointParameterfv(pname, NULL);
     }
-
-    ctx->driver->PointParameterfv(pname, paramsf);
-
-    return true;
 }
 
-bool yagl_host_glPointSizex(GLfixed size)
+void yagl_host_glPointSizex(GLfixed size)
 {
     GLfloat sizef;
 
@@ -1796,13 +1447,11 @@ bool yagl_host_glPointSizex(GLfixed size)
     } else {
         ctx->driver->PointSize(sizef);
     }
-
-    return true;
 }
 
-bool yagl_host_glPointSizePointerOES(GLenum type,
+void yagl_host_glPointSizePointerOES(GLenum type,
     GLsizei stride,
-    target_ulong /* const GLvoid* */ pointer)
+    target_ulong pointer)
 {
     struct yagl_gles_array *parray;
 
@@ -1810,12 +1459,12 @@ bool yagl_host_glPointSizePointerOES(GLenum type,
 
     if (stride < 0) {
         YAGL_SET_ERR(GL_INVALID_VALUE);
-        return true;
+        return;
     }
 
     if (type != GL_FLOAT && type != GL_FIXED) {
         YAGL_SET_ERR(GL_INVALID_ENUM);
-        return true;
+        return;
     }
 
     parray = yagl_gles_context_get_array(&ctx->base, YAGL_GLES1_ARRAY_POINTSIZE);
@@ -1845,40 +1494,32 @@ bool yagl_host_glPointSizePointerOES(GLenum type,
             YAGL_SET_ERR(GL_INVALID_VALUE);
         }
     }
-
-    return true;
 }
 
-bool yagl_host_glPolygonOffsetx(GLfixed factor,
+void yagl_host_glPolygonOffsetx(GLfixed factor,
     GLfixed units)
 {
     YAGL_GET_CTX(glPolygonOffsetx);
 
     ctx->driver->base.PolygonOffset(yagl_fixed_to_float(factor),
                                     yagl_fixed_to_float(units));
-
-    return true;
 }
 
-bool yagl_host_glPopMatrix(void)
+void yagl_host_glPopMatrix(void)
 {
     YAGL_GET_CTX(glPopMatrix);
 
     ctx->driver->PopMatrix();
-
-    return true;
 }
 
-bool yagl_host_glPushMatrix(void)
+void yagl_host_glPushMatrix(void)
 {
     YAGL_GET_CTX(glPushMatrix);
 
     ctx->driver->PushMatrix();
-
-    return true;
 }
 
-bool yagl_host_glRotatex(GLfixed angle,
+void yagl_host_glRotatex(GLfixed angle,
     GLfixed x,
     GLfixed y,
     GLfixed z)
@@ -1889,21 +1530,17 @@ bool yagl_host_glRotatex(GLfixed angle,
                          yagl_fixed_to_float(x),
                          yagl_fixed_to_float(y),
                          yagl_fixed_to_float(z));
-
-    return true;
 }
 
-bool yagl_host_glSampleCoveragex(GLclampx value,
+void yagl_host_glSampleCoveragex(GLclampx value,
     GLboolean invert)
 {
     YAGL_GET_CTX(glSampleCoveragex);
 
     ctx->driver->base.SampleCoverage(yagl_fixed_to_float(value), invert);
-
-    return true;
 }
 
-bool yagl_host_glScalex(GLfixed x,
+void yagl_host_glScalex(GLfixed x,
     GLfixed y,
     GLfixed z)
 {
@@ -1912,23 +1549,19 @@ bool yagl_host_glScalex(GLfixed x,
     ctx->driver->Scalef(yagl_fixed_to_float(x),
                         yagl_fixed_to_float(y),
                         yagl_fixed_to_float(z));
-
-    return true;
 }
 
-bool yagl_host_glShadeModel(GLenum mode)
+void yagl_host_glShadeModel(GLenum mode)
 {
     YAGL_GET_CTX(glShadeModel);
 
     ctx->driver->ShadeModel(mode);
-
-    return true;
 }
 
-bool yagl_host_glTexCoordPointer(GLint size,
+void yagl_host_glTexCoordPointer(GLint size,
     GLenum type,
     GLsizei stride,
-    target_ulong /* const GLvoid* */ pointer)
+    target_ulong pointer)
 {
     struct yagl_gles_array *texarray;
 
@@ -1936,13 +1569,13 @@ bool yagl_host_glTexCoordPointer(GLint size,
 
     if ((size < 2) || (size > 4) || (stride < 0)) {
         YAGL_SET_ERR(GL_INVALID_VALUE);
-        return true;
+        return;
     }
 
     if (type != GL_FLOAT && type != GL_FIXED &&
         type != GL_SHORT && type != GL_BYTE) {
         YAGL_SET_ERR(GL_INVALID_ENUM);
-        return true;
+        return;
     }
 
     texarray = yagl_gles_context_get_array(&ctx->base,
@@ -1974,11 +1607,9 @@ bool yagl_host_glTexCoordPointer(GLint size,
             YAGL_SET_ERR(GL_INVALID_VALUE);
         }
     }
-
-    return true;
 }
 
-bool yagl_host_glTexEnvi(GLenum target,
+void yagl_host_glTexEnvi(GLenum target,
     GLenum pname,
     GLint param)
 {
@@ -1986,15 +1617,13 @@ bool yagl_host_glTexEnvi(GLenum target,
 
     if (target != GL_TEXTURE_ENV && target != GL_POINT_SPRITE_OES) {
         YAGL_SET_ERR(GL_INVALID_ENUM);
-        return true;
+        return;
     }
 
     ctx->driver->TexEnvi(target, pname, param);
-
-    return true;
 }
 
-bool yagl_host_glTexEnvx(GLenum target,
+void yagl_host_glTexEnvx(GLenum target,
     GLenum pname,
     GLfixed param)
 {
@@ -2004,7 +1633,7 @@ bool yagl_host_glTexEnvx(GLenum target,
 
     if (target != GL_TEXTURE_ENV && target != GL_POINT_SPRITE_OES) {
         YAGL_SET_ERR(GL_INVALID_ENUM);
-        return true;
+        return;
     }
 
     if (pname == GL_RGB_SCALE || pname == GL_ALPHA_SCALE) {
@@ -2014,83 +1643,55 @@ bool yagl_host_glTexEnvx(GLenum target,
     }
 
     ctx->driver->TexEnvf(target, pname, paramf);
-
-    return true;
 }
 
-bool yagl_host_glTexEnviv(GLenum target,
+void yagl_host_glTexEnviv(GLenum target,
     GLenum pname,
-    target_ulong /* const GLint* */ params_)
+    const GLint *params, int32_t params_count)
 {
-    GLint params[YAGL_TEX_ENV_PARAM_MAX_LEN];
-    unsigned count = 1;
-
     YAGL_GET_CTX(glTexEnviv);
 
     if (target != GL_TEXTURE_ENV && target != GL_POINT_SPRITE_OES) {
         YAGL_SET_ERR(GL_INVALID_ENUM);
-        return true;
-    }
-
-    if (pname == GL_TEXTURE_ENV_COLOR) {
-        count = YAGL_TEX_ENV_PARAM_MAX_LEN;
-    }
-
-    if (!yagl_mem_get(params_, count * sizeof(GLint), &params[0])) {
-        return false;
+        return;
     }
 
     ctx->driver->TexEnviv(target, pname, params);
-
-    return true;
 }
 
-bool yagl_host_glTexEnvxv(GLenum target,
+void yagl_host_glTexEnvxv(GLenum target,
     GLenum pname,
-    target_ulong /* const GLfixed* */ params_)
+    const GLfixed *params, int32_t params_count)
 {
     GLfloat paramsf[YAGL_TEX_ENV_PARAM_MAX_LEN];
+    int32_t i;
 
     YAGL_GET_CTX(glTexEnvxv);
 
     if (target != GL_TEXTURE_ENV && target != GL_POINT_SPRITE_OES) {
         YAGL_SET_ERR(GL_INVALID_ENUM);
-        return true;
+        return;
     }
 
-    if (pname == GL_TEXTURE_ENV_COLOR) {
-        GLfixed paramsx[YAGL_TEX_ENV_PARAM_MAX_LEN];
-        unsigned i;
-
-        if (!yagl_mem_get(params_,
-                          YAGL_TEX_ENV_PARAM_MAX_LEN * sizeof(GLfixed),
-                          &paramsx[0])) {
-            return false;
-        }
-
-        for (i = 0; i < YAGL_TEX_ENV_PARAM_MAX_LEN; ++i) {
-            paramsf[i] = yagl_fixed_to_float(paramsx[i]);
-        }
-    } else {
-        GLfixed paramx;
-
-        if (!yagl_mem_get_GLfixed(params_, &paramx)) {
-            return false;
-        }
-
-        if (pname == GL_RGB_SCALE || pname == GL_ALPHA_SCALE) {
-            paramsf[0] = yagl_fixed_to_float(paramx);
+    if (params) {
+        if (pname == GL_TEXTURE_ENV_COLOR) {
+            for (i = 0; i < YAGL_TEX_ENV_PARAM_MAX_LEN; ++i) {
+                paramsf[i] = yagl_fixed_to_float(params[i]);
+            }
         } else {
-            paramsf[0] = (GLfloat)paramx;
+            if (pname == GL_RGB_SCALE || pname == GL_ALPHA_SCALE) {
+                paramsf[0] = yagl_fixed_to_float(params[0]);
+            } else {
+                paramsf[0] = (GLfloat)params[0];
+            }
         }
+        ctx->driver->TexEnvfv(target, pname, paramsf);
+    } else {
+        ctx->driver->TexEnvfv(target, pname, NULL);
     }
-
-    ctx->driver->TexEnvfv(target, pname, paramsf);
-
-    return true;
 }
 
-bool yagl_host_glTexParameterx(GLenum target,
+void yagl_host_glTexParameterx(GLenum target,
     GLenum pname,
     GLfixed param)
 {
@@ -2098,17 +1699,15 @@ bool yagl_host_glTexParameterx(GLenum target,
 
     if (target != GL_TEXTURE_2D) {
         YAGL_SET_ERR(GL_INVALID_ENUM);
-        return true;
+        return;
     }
 
     ctx->driver->base.TexParameterf(target, pname, (GLfloat)param);
-
-    return true;
 }
 
-bool yagl_host_glTexParameterxv(GLenum target,
+void yagl_host_glTexParameterxv(GLenum target,
     GLenum pname,
-    target_ulong /* const GLfixed* */ params_)
+    const GLfixed *params, int32_t params_count)
 {
     GLfloat paramf;
 
@@ -2116,25 +1715,18 @@ bool yagl_host_glTexParameterxv(GLenum target,
 
     if (target != GL_TEXTURE_2D) {
         YAGL_SET_ERR(GL_INVALID_ENUM);
-        return true;
+        return;
     }
 
-    if (params_) {
-        GLfixed paramx;
-
-        if (!yagl_mem_get_GLfixed(params_, &paramx)) {
-            return false;
-        }
-
-        paramf = (GLfloat)paramx;
+    if (params) {
+        paramf = (GLfloat)params[0];
+        ctx->driver->base.TexParameterfv(target, pname, &paramf);
+    } else {
+        ctx->driver->base.TexParameterfv(target, pname, NULL);
     }
-
-    ctx->driver->base.TexParameterfv(target, pname, params_ ? &paramf : NULL);
-
-    return true;
 }
 
-bool yagl_host_glTranslatex(GLfixed x,
+void yagl_host_glTranslatex(GLfixed x,
     GLfixed y,
     GLfixed z)
 {
@@ -2143,14 +1735,12 @@ bool yagl_host_glTranslatex(GLfixed x,
     ctx->driver->Translatef(yagl_fixed_to_float(x),
                             yagl_fixed_to_float(y),
                             yagl_fixed_to_float(z));
-
-    return true;
 }
 
-bool yagl_host_glVertexPointer(GLint size,
+void yagl_host_glVertexPointer(GLint size,
     GLenum type,
     GLsizei stride,
-    target_ulong /* const GLvoid* */ pointer)
+    target_ulong pointer)
 {
     struct yagl_gles_array *varray;
 
@@ -2158,13 +1748,13 @@ bool yagl_host_glVertexPointer(GLint size,
 
     if ((size < 2) || (size > 4) || (stride < 0)) {
         YAGL_SET_ERR(GL_INVALID_VALUE);
-        return true;
+        return;
     }
 
     if (type != GL_FLOAT && type != GL_FIXED &&
         type != GL_SHORT && type != GL_BYTE) {
         YAGL_SET_ERR(GL_INVALID_ENUM);
-        return true;
+        return;
     }
 
     varray = yagl_gles_context_get_array(&ctx->base, YAGL_GLES1_ARRAY_VERTEX);
@@ -2194,6 +1784,4 @@ bool yagl_host_glVertexPointer(GLint size,
             YAGL_SET_ERR(GL_INVALID_VALUE);
         }
     }
-
-    return true;
 }
index de011fc..852dcc6 100644 (file)
 
 struct yagl_api_ps *yagl_host_gles1_process_init(struct yagl_api *api);
 
-bool yagl_host_glAlphaFunc(GLenum func,
+void yagl_host_glAlphaFunc(GLenum func,
     GLclampf ref);
-bool yagl_host_glClipPlanef(GLenum plane,
-    target_ulong /* const GLfloat* */ equation);
-bool yagl_host_glColor4f(GLfloat red,
+void yagl_host_glClipPlanef(GLenum plane,
+    const GLfloat *equation, int32_t equation_count);
+void yagl_host_glColor4f(GLfloat red,
     GLfloat green,
     GLfloat blue,
     GLfloat alpha);
-bool yagl_host_glFogf(GLenum pname,
+void yagl_host_glFogf(GLenum pname,
     GLfloat param);
-bool yagl_host_glFogfv(GLenum pname,
-    target_ulong /* const GLfloat* */ params);
-bool yagl_host_glFrustumf(GLfloat left,
+void yagl_host_glFogfv(GLenum pname,
+    const GLfloat *params, int32_t params_count);
+void yagl_host_glFrustumf(GLfloat left,
     GLfloat right,
     GLfloat bottom,
     GLfloat top,
     GLfloat zNear,
     GLfloat zFar);
-bool yagl_host_glGetClipPlanef(GLenum pname,
-    target_ulong /* GLfloat* */ eqn);
-bool yagl_host_glGetLightfv(GLenum light,
+void yagl_host_glGetClipPlanef(GLenum pname,
+    GLfloat *eqn, int32_t eqn_maxcount, int32_t *eqn_count);
+void yagl_host_glGetLightfv(GLenum light,
     GLenum pname,
-    target_ulong /* GLfloat* */ params);
-bool yagl_host_glGetMaterialfv(GLenum face,
+    GLfloat *params, int32_t params_maxcount, int32_t *params_count);
+void yagl_host_glGetMaterialfv(GLenum face,
     GLenum pname,
-    target_ulong /* GLfloat* */ params);
-bool yagl_host_glGetTexEnvfv(GLenum env,
+    GLfloat *params, int32_t params_maxcount, int32_t *params_count);
+void yagl_host_glGetTexEnvfv(GLenum env,
     GLenum pname,
-    target_ulong /* GLfloat* */ params);
-bool yagl_host_glLightModelf(GLenum pname,
+    GLfloat *params, int32_t params_maxcount, int32_t *params_count);
+void yagl_host_glLightModelf(GLenum pname,
     GLfloat param);
-bool yagl_host_glLightModelfv(GLenum pname,
-    target_ulong /* const GLfloat* */ params);
-bool yagl_host_glLightf(GLenum light,
+void yagl_host_glLightModelfv(GLenum pname,
+    const GLfloat *params, int32_t params_count);
+void yagl_host_glLightf(GLenum light,
     GLenum pname,
     GLfloat param);
-bool yagl_host_glLightfv(GLenum light,
+void yagl_host_glLightfv(GLenum light,
     GLenum pname,
-    target_ulong /* const GLfloat* */ params);
-bool yagl_host_glLoadMatrixf(target_ulong /* const GLfloat* */ m);
-bool yagl_host_glMaterialf(GLenum face,
+    const GLfloat *params, int32_t params_count);
+void yagl_host_glLoadMatrixf(const GLfloat *m, int32_t m_count);
+void yagl_host_glMaterialf(GLenum face,
     GLenum pname,
     GLfloat param);
-bool yagl_host_glMaterialfv(GLenum face,
+void yagl_host_glMaterialfv(GLenum face,
     GLenum pname,
-    target_ulong /* const GLfloat* */ params);
-bool yagl_host_glMultMatrixf(target_ulong /* const GLfloat* */ m);
-bool yagl_host_glMultiTexCoord4f(GLenum target,
+    const GLfloat *params, int32_t params_count);
+void yagl_host_glMultMatrixf(const GLfloat *m, int32_t m_count);
+void yagl_host_glMultiTexCoord4f(GLenum target,
     GLfloat s,
-    GLfloat t,
+    GLfloat tt,
     GLfloat r,
     GLfloat q);
-bool yagl_host_glNormal3f(GLfloat nx,
+void yagl_host_glNormal3f(GLfloat nx,
     GLfloat ny,
     GLfloat nz);
-bool yagl_host_glOrthof(GLfloat left,
+void yagl_host_glOrthof(GLfloat left,
     GLfloat right,
     GLfloat bottom,
     GLfloat top,
     GLfloat zNear,
     GLfloat zFar);
-bool yagl_host_glPointParameterf(GLenum pname,
+void yagl_host_glPointParameterf(GLenum pname,
     GLfloat param);
-bool yagl_host_glPointParameterfv(GLenum pname,
-    target_ulong /* const GLfloat* */ params);
-bool yagl_host_glPointSize(GLfloat size);
-bool yagl_host_glPointSizePointerOES(GLenum type,
+void yagl_host_glPointParameterfv(GLenum pname,
+    const GLfloat *params, int32_t params_count);
+void yagl_host_glPointSize(GLfloat size);
+void yagl_host_glPointSizePointerOES(GLenum type,
     GLsizei stride,
-    target_ulong /* const GLvoid* */ pointer);
-bool yagl_host_glRotatef(GLfloat angle,
+    target_ulong pointer);
+void yagl_host_glRotatef(GLfloat angle,
     GLfloat x,
     GLfloat y,
     GLfloat z);
-bool yagl_host_glScalef(GLfloat x,
+void yagl_host_glScalef(GLfloat x,
     GLfloat y,
     GLfloat z);
-bool yagl_host_glTexEnvf(GLenum target,
+void yagl_host_glTexEnvf(GLenum target,
     GLenum pname,
     GLfloat param);
-bool yagl_host_glTexEnvfv(GLenum target,
+void yagl_host_glTexEnvfv(GLenum target,
     GLenum pname,
-    target_ulong /* const GLfloat* */ params);
-bool yagl_host_glTranslatef(GLfloat x,
+    const GLfloat *params, int32_t params_count);
+void yagl_host_glTranslatef(GLfloat x,
     GLfloat y,
     GLfloat z);
-bool yagl_host_glAlphaFuncx(GLenum func,
+void yagl_host_glAlphaFuncx(GLenum func,
     GLclampx ref);
-bool yagl_host_glClearColorx(GLclampx red,
+void yagl_host_glClearColorx(GLclampx red,
     GLclampx green,
     GLclampx blue,
     GLclampx alpha);
-bool yagl_host_glClearDepthx(GLclampx depth);
-bool yagl_host_glClientActiveTexture(GLenum texture);
-bool yagl_host_glClipPlanex(GLenum plane,
-    target_ulong /* const GLfixed* */ equation);
-bool yagl_host_glColor4ub(GLubyte red,
+void yagl_host_glClearDepthx(GLclampx depth);
+void yagl_host_glClientActiveTexture(GLenum texture);
+void yagl_host_glClipPlanex(GLenum plane,
+    const GLfixed *equation, int32_t equation_count);
+void yagl_host_glColor4ub(GLubyte red,
     GLubyte green,
     GLubyte blue,
     GLubyte alpha);
-bool yagl_host_glColor4x(GLfixed red,
+void yagl_host_glColor4x(GLfixed red,
     GLfixed green,
     GLfixed blue,
     GLfixed alpha);
-bool yagl_host_glColorPointer(GLint size,
+void yagl_host_glColorPointer(GLint size,
     GLenum type,
     GLsizei stride,
-    target_ulong /* const GLvoid* */ pointer);
-bool yagl_host_glDepthRangex(GLclampx zNear,
+    target_ulong pointer);
+void yagl_host_glDepthRangex(GLclampx zNear,
     GLclampx zFar);
-bool yagl_host_glDisableClientState(GLenum array);
-bool yagl_host_glEnableClientState(GLenum array);
-bool yagl_host_glFogx(GLenum pname,
+void yagl_host_glDisableClientState(GLenum array);
+void yagl_host_glEnableClientState(GLenum array);
+void yagl_host_glFogx(GLenum pname,
     GLfixed param);
-bool yagl_host_glFogxv(GLenum pname,
-    target_ulong /* const GLfixed* */ params);
-bool yagl_host_glFrustumx(GLfixed left,
+void yagl_host_glFogxv(GLenum pname,
+    const GLfixed *params, int32_t params_count);
+void yagl_host_glFrustumx(GLfixed left,
     GLfixed right,
     GLfixed bottom,
     GLfixed top,
     GLfixed zNear,
     GLfixed zFar);
-bool yagl_host_glGetClipPlanex(GLenum pname,
-    target_ulong /* GLfixed* */ eqn);
-bool yagl_host_glGetFixedv(GLenum pname,
-    target_ulong /* GLfixed* */ params);
-bool yagl_host_glGetLightxv(GLenum light,
+void yagl_host_glGetClipPlanex(GLenum pname,
+    GLfixed *eqn, int32_t eqn_maxcount, int32_t *eqn_count);
+void yagl_host_glGetFixedv(GLenum pname,
+    GLfixed *params, int32_t params_maxcount, int32_t *params_count);
+void yagl_host_glGetLightxv(GLenum light,
     GLenum pname,
-    target_ulong /* GLfixed* */ params);
-bool yagl_host_glGetMaterialxv(GLenum face,
+    GLfixed *params, int32_t params_maxcount, int32_t *params_count);
+void yagl_host_glGetMaterialxv(GLenum face,
     GLenum pname,
-    target_ulong /* GLfixed* */ params);
-bool yagl_host_glGetPointerv(GLenum pname,
-    target_ulong /* GLvoid** */ params);
-bool yagl_host_glGetTexEnviv(GLenum env,
+    GLfixed *params, int32_t params_maxcount, int32_t *params_count);
+void yagl_host_glGetPointerv(GLenum pname,
+    target_ulong *params);
+void yagl_host_glGetTexEnviv(GLenum env,
     GLenum pname,
-    target_ulong /* GLint* */ params);
-bool yagl_host_glGetTexEnvxv(GLenum env,
+    GLint *params, int32_t params_maxcount, int32_t *params_count);
+void yagl_host_glGetTexEnvxv(GLenum env,
     GLenum pname,
-    target_ulong /* GLfixed* */ params);
-bool yagl_host_glGetTexParameterxv(GLenum target,
+    GLfixed *params, int32_t params_maxcount, int32_t *params_count);
+void yagl_host_glGetTexParameterxv(GLenum target,
     GLenum pname,
-    target_ulong /* GLfixed* */ params);
-bool yagl_host_glLightModelx(GLenum pname,
+    GLfixed *param);
+void yagl_host_glLightModelx(GLenum pname,
     GLfixed param);
-bool yagl_host_glLightModelxv(GLenum pname,
-    target_ulong /* const GLfixed* */ params);
-bool yagl_host_glLightx(GLenum light,
+void yagl_host_glLightModelxv(GLenum pname,
+    const GLfixed *params, int32_t params_count);
+void yagl_host_glLightx(GLenum light,
     GLenum pname,
     GLfixed param);
-bool yagl_host_glLightxv(GLenum light,
+void yagl_host_glLightxv(GLenum light,
     GLenum pname,
-    target_ulong /* const GLfixed* */ params);
-bool yagl_host_glLineWidthx(GLfixed width);
-bool yagl_host_glLoadIdentity(void);
-bool yagl_host_glLoadMatrixx(target_ulong /* const GLfixed* */ m);
-bool yagl_host_glLogicOp(GLenum opcode);
-bool yagl_host_glMaterialx(GLenum face,
+    const GLfixed *params, int32_t params_count);
+void yagl_host_glLineWidthx(GLfixed width);
+void yagl_host_glLoadIdentity(void);
+void yagl_host_glLoadMatrixx(const GLfixed *m, int32_t m_count);
+void yagl_host_glLogicOp(GLenum opcode);
+void yagl_host_glMaterialx(GLenum face,
     GLenum pname,
     GLfixed param);
-bool yagl_host_glMaterialxv(GLenum face,
+void yagl_host_glMaterialxv(GLenum face,
     GLenum pname,
-    target_ulong /* const GLfixed* */ params);
-bool yagl_host_glMatrixMode(GLenum mode);
-bool yagl_host_glMultMatrixx(target_ulong /* const GLfixed* */ m);
-bool yagl_host_glMultiTexCoord4x(GLenum target,
+    const GLfixed *params, int32_t params_count);
+void yagl_host_glMatrixMode(GLenum mode);
+void yagl_host_glMultMatrixx(const GLfixed *m, int32_t m_count);
+void yagl_host_glMultiTexCoord4x(GLenum target,
     GLfixed s,
-    GLfixed t,
+    GLfixed tt,
     GLfixed r,
     GLfixed q);
-bool yagl_host_glNormal3x(GLfixed nx,
+void yagl_host_glNormal3x(GLfixed nx,
     GLfixed ny,
     GLfixed nz);
-bool yagl_host_glNormalPointer(GLenum type,
+void yagl_host_glNormalPointer(GLenum type,
     GLsizei stride,
-    target_ulong /* const GLvoid* */ pointer);
-bool yagl_host_glOrthox(GLfixed left,
+    target_ulong pointer);
+void yagl_host_glOrthox(GLfixed left,
     GLfixed right,
     GLfixed bottom,
     GLfixed top,
     GLfixed zNear,
     GLfixed zFar);
-bool yagl_host_glPointParameterx(GLenum pname,
+void yagl_host_glPointParameterx(GLenum pname,
     GLfixed param);
-bool yagl_host_glPointParameterxv(GLenum pname,
-    target_ulong /* const GLfixed* */ params);
-bool yagl_host_glPointSizex(GLfixed size);
-bool yagl_host_glPolygonOffsetx(GLfixed factor,
+void yagl_host_glPointParameterxv(GLenum pname,
+    const GLfixed *params, int32_t params_count);
+void yagl_host_glPointSizex(GLfixed size);
+void yagl_host_glPolygonOffsetx(GLfixed factor,
     GLfixed units);
-bool yagl_host_glPopMatrix(void);
-bool yagl_host_glPushMatrix(void);
-bool yagl_host_glRotatex(GLfixed angle,
+void yagl_host_glPopMatrix(void);
+void yagl_host_glPushMatrix(void);
+void yagl_host_glRotatex(GLfixed angle,
     GLfixed x,
     GLfixed y,
     GLfixed z);
-bool yagl_host_glSampleCoveragex(GLclampx value,
+void yagl_host_glSampleCoveragex(GLclampx value,
     GLboolean invert);
-bool yagl_host_glScalex(GLfixed x,
+void yagl_host_glScalex(GLfixed x,
     GLfixed y,
     GLfixed z);
-bool yagl_host_glShadeModel(GLenum mode);
-bool yagl_host_glTexCoordPointer(GLint size,
+void yagl_host_glShadeModel(GLenum mode);
+void yagl_host_glTexCoordPointer(GLint size,
     GLenum type,
     GLsizei stride,
-    target_ulong /* const GLvoid* */ pointer);
-bool yagl_host_glTexEnvi(GLenum target,
+    target_ulong pointer);
+void yagl_host_glTexEnvi(GLenum target,
     GLenum pname,
     GLint param);
-bool yagl_host_glTexEnvx(GLenum target,
+void yagl_host_glTexEnvx(GLenum target,
     GLenum pname,
     GLfixed param);
-bool yagl_host_glTexEnviv(GLenum target,
+void yagl_host_glTexEnviv(GLenum target,
     GLenum pname,
-    target_ulong /* const GLint* */ params);
-bool yagl_host_glTexEnvxv(GLenum target,
+    const GLint *params, int32_t params_count);
+void yagl_host_glTexEnvxv(GLenum target,
     GLenum pname,
-    target_ulong /* const GLfixed* */ params);
-bool yagl_host_glTexParameterx(GLenum target,
+    const GLfixed *params, int32_t params_count);
+void yagl_host_glTexParameterx(GLenum target,
     GLenum pname,
     GLfixed param);
-bool yagl_host_glTexParameterxv(GLenum target,
+void yagl_host_glTexParameterxv(GLenum target,
     GLenum pname,
-    target_ulong /* const GLfixed* */ params);
-bool yagl_host_glTranslatex(GLfixed x,
+    const GLfixed *params, int32_t params_count);
+void yagl_host_glTranslatex(GLfixed x,
     GLfixed y,
     GLfixed z);
-bool yagl_host_glVertexPointer(GLint size,
+void yagl_host_glVertexPointer(GLint size,
     GLenum type,
     GLsizei stride,
-    target_ulong /* const GLvoid* */ pointer);
+    target_ulong pointer);
 
 #endif
index 9ea5f50..f427997 100644 (file)
@@ -1,9 +1,9 @@
 /*
- * Generated by gen-yagl-calls.sh, do not modify!
+ * Generated by gen-yagl-calls.py, do not modify!
  */
 #include "yagl_gles2_calls.h"
 #include "yagl_host_gles2_calls.h"
-#include "yagl_marshal_gl.h"
+#include "yagl_transport_gl2.h"
 #include "yagl_thread.h"
 #include "yagl_process.h"
 #include "yagl_log.h"
 /*
  * glActiveTexture dispatcher. id = 1
  */
-static bool yagl_func_glActiveTexture(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glActiveTexture(struct yagl_transport *t)
 {
-    GLenum texture = yagl_marshal_get_GLenum(out_buff);
+    GLenum texture;
+    texture = yagl_transport_get_out_GLenum(t);
     YAGL_LOG_FUNC_ENTER_SPLIT1(glActiveTexture, GLenum, texture);
-    bool res = yagl_host_glActiveTexture(texture);
+    (void)yagl_host_glActiveTexture(texture);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
  * glBindBuffer dispatcher. id = 2
  */
-static bool yagl_func_glBindBuffer(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glBindBuffer(struct yagl_transport *t)
 {
-    GLenum target = yagl_marshal_get_GLenum(out_buff);
-    GLuint buffer = yagl_marshal_get_GLuint(out_buff);
+    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);
-    bool res = yagl_host_glBindBuffer(target, buffer);
+    (void)yagl_host_glBindBuffer(target, buffer);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
  * glBindFramebuffer dispatcher. id = 3
  */
-static bool yagl_func_glBindFramebuffer(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glBindFramebuffer(struct yagl_transport *t)
 {
-    GLenum target = yagl_marshal_get_GLenum(out_buff);
-    GLuint framebuffer = yagl_marshal_get_GLuint(out_buff);
+    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);
-    bool res = yagl_host_glBindFramebuffer(target, framebuffer);
+    (void)yagl_host_glBindFramebuffer(target, framebuffer);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
  * glBindRenderbuffer dispatcher. id = 4
  */
-static bool yagl_func_glBindRenderbuffer(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glBindRenderbuffer(struct yagl_transport *t)
 {
-    GLenum target = yagl_marshal_get_GLenum(out_buff);
-    GLuint renderbuffer = yagl_marshal_get_GLuint(out_buff);
+    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);
-    bool res = yagl_host_glBindRenderbuffer(target, renderbuffer);
+    (void)yagl_host_glBindRenderbuffer(target, renderbuffer);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
  * glBindTexture dispatcher. id = 5
  */
-static bool yagl_func_glBindTexture(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glBindTexture(struct yagl_transport *t)
 {
-    GLenum target = yagl_marshal_get_GLenum(out_buff);
-    GLuint texture = yagl_marshal_get_GLuint(out_buff);
+    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);
-    bool res = yagl_host_glBindTexture(target, texture);
+    (void)yagl_host_glBindTexture(target, texture);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
  * glBlendEquation dispatcher. id = 6
  */
-static bool yagl_func_glBlendEquation(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glBlendEquation(struct yagl_transport *t)
 {
-    GLenum mode = yagl_marshal_get_GLenum(out_buff);
+    GLenum mode;
+    mode = yagl_transport_get_out_GLenum(t);
     YAGL_LOG_FUNC_ENTER_SPLIT1(glBlendEquation, GLenum, mode);
-    bool res = yagl_host_glBlendEquation(mode);
+    (void)yagl_host_glBlendEquation(mode);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
  * glBlendEquationSeparate dispatcher. id = 7
  */
-static bool yagl_func_glBlendEquationSeparate(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glBlendEquationSeparate(struct yagl_transport *t)
 {
-    GLenum modeRGB = yagl_marshal_get_GLenum(out_buff);
-    GLenum modeAlpha = yagl_marshal_get_GLenum(out_buff);
+    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);
-    bool res = yagl_host_glBlendEquationSeparate(modeRGB, modeAlpha);
+    (void)yagl_host_glBlendEquationSeparate(modeRGB, modeAlpha);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
  * glBlendFunc dispatcher. id = 8
  */
-static bool yagl_func_glBlendFunc(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glBlendFunc(struct yagl_transport *t)
 {
-    GLenum sfactor = yagl_marshal_get_GLenum(out_buff);
-    GLenum dfactor = yagl_marshal_get_GLenum(out_buff);
+    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);
-    bool res = yagl_host_glBlendFunc(sfactor, dfactor);
+    (void)yagl_host_glBlendFunc(sfactor, dfactor);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
  * glBlendFuncSeparate dispatcher. id = 9
  */
-static bool yagl_func_glBlendFuncSeparate(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glBlendFuncSeparate(struct yagl_transport *t)
 {
-    GLenum srcRGB = yagl_marshal_get_GLenum(out_buff);
-    GLenum dstRGB = yagl_marshal_get_GLenum(out_buff);
-    GLenum srcAlpha = yagl_marshal_get_GLenum(out_buff);
-    GLenum dstAlpha = yagl_marshal_get_GLenum(out_buff);
+    GLenum srcRGB;
+    GLenum dstRGB;
+    GLenum srcAlpha;
+    GLenum dstAlpha;
+    srcRGB = yagl_transport_get_out_GLenum(t);
+    dstRGB = yagl_transport_get_out_GLenum(t);
+    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);
-    bool res = yagl_host_glBlendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha);
+    (void)yagl_host_glBlendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
  * glBufferData dispatcher. id = 10
  */
-static bool yagl_func_glBufferData(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glBufferData(struct yagl_transport *t)
 {
-    GLenum target = yagl_marshal_get_GLenum(out_buff);
-    GLsizeiptr size = yagl_marshal_get_GLsizeiptr(out_buff);
-    target_ulong data = yagl_marshal_get_ptr(out_buff);
-    GLenum usage = yagl_marshal_get_GLenum(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT4(glBufferData, GLenum, GLsizeiptr, target_ulong, GLenum, target, size, data, usage);
-    bool res = yagl_host_glBufferData(target, size, data, usage);
+    GLenum target;
+    const GLvoid *data;
+    int32_t data_count;
+    GLenum usage;
+    target = yagl_transport_get_out_GLenum(t);
+    if (!yagl_transport_get_out_array(t, 1, (const void**)&data, &data_count)) {
+        return false;
+    }
+    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);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
  * glBufferSubData dispatcher. id = 11
  */
-static bool yagl_func_glBufferSubData(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glBufferSubData(struct yagl_transport *t)
 {
-    GLenum target = yagl_marshal_get_GLenum(out_buff);
-    GLintptr offset = yagl_marshal_get_GLintptr(out_buff);
-    GLsizeiptr size = yagl_marshal_get_GLsizeiptr(out_buff);
-    target_ulong data = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT4(glBufferSubData, GLenum, GLintptr, GLsizeiptr, target_ulong, target, offset, size, data);
-    bool res = yagl_host_glBufferSubData(target, offset, size, data);
+    GLenum target;
+    GLsizei offset;
+    const GLvoid *data;
+    int32_t data_count;
+    target = yagl_transport_get_out_GLenum(t);
+    offset = yagl_transport_get_out_GLsizei(t);
+    if (!yagl_transport_get_out_array(t, 1, (const void**)&data, &data_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT3(glBufferSubData, GLenum, GLsizei, void*, target, offset, data);
+    (void)yagl_host_glBufferSubData(target, offset, data, data_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
  * glCheckFramebufferStatus dispatcher. id = 12
  */
-static bool yagl_func_glCheckFramebufferStatus(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glCheckFramebufferStatus(struct yagl_transport *t)
 {
-    GLenum target = yagl_marshal_get_GLenum(out_buff);
+    GLenum target;
+    GLenum *retval;
+    target = yagl_transport_get_out_GLenum(t);
+    yagl_transport_get_in_arg(t, (void**)&retval);
     YAGL_LOG_FUNC_ENTER_SPLIT1(glCheckFramebufferStatus, GLenum, target);
-    GLenum retval;
-    bool res = yagl_host_glCheckFramebufferStatus(&retval, target);
-    if (!res) {
-        YAGL_LOG_FUNC_EXIT(NULL);
-        return false;
-    }
-    YAGL_LOG_FUNC_EXIT_SPLIT(GLenum, retval);
-    yagl_marshal_put_GLenum(&in_buff, retval);
+    *retval = yagl_host_glCheckFramebufferStatus(target);
+    YAGL_LOG_FUNC_EXIT_SPLIT(GLenum, *retval);
+
     return true;
 }
 
 /*
  * glClear dispatcher. id = 13
  */
-static bool yagl_func_glClear(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glClear(struct yagl_transport *t)
 {
-    GLbitfield mask = yagl_marshal_get_GLbitfield(out_buff);
+    GLbitfield mask;
+    mask = yagl_transport_get_out_GLbitfield(t);
     YAGL_LOG_FUNC_ENTER_SPLIT1(glClear, GLbitfield, mask);
-    bool res = yagl_host_glClear(mask);
+    (void)yagl_host_glClear(mask);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
  * glClearColor dispatcher. id = 14
  */
-static bool yagl_func_glClearColor(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glClearColor(struct yagl_transport *t)
 {
-    GLclampf red = yagl_marshal_get_GLclampf(out_buff);
-    GLclampf green = yagl_marshal_get_GLclampf(out_buff);
-    GLclampf blue = yagl_marshal_get_GLclampf(out_buff);
-    GLclampf alpha = yagl_marshal_get_GLclampf(out_buff);
+    GLclampf red;
+    GLclampf green;
+    GLclampf blue;
+    GLclampf alpha;
+    red = yagl_transport_get_out_GLclampf(t);
+    green = yagl_transport_get_out_GLclampf(t);
+    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);
-    bool res = yagl_host_glClearColor(red, green, blue, alpha);
+    (void)yagl_host_glClearColor(red, green, blue, alpha);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
  * glClearDepthf dispatcher. id = 15
  */
-static bool yagl_func_glClearDepthf(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glClearDepthf(struct yagl_transport *t)
 {
-    GLclampf depth = yagl_marshal_get_GLclampf(out_buff);
+    GLclampf depth;
+    depth = yagl_transport_get_out_GLclampf(t);
     YAGL_LOG_FUNC_ENTER_SPLIT1(glClearDepthf, GLclampf, depth);
-    bool res = yagl_host_glClearDepthf(depth);
+    (void)yagl_host_glClearDepthf(depth);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
  * glClearStencil dispatcher. id = 16
  */
-static bool yagl_func_glClearStencil(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glClearStencil(struct yagl_transport *t)
 {
-    GLint s = yagl_marshal_get_GLint(out_buff);
+    GLint s;
+    s = yagl_transport_get_out_GLint(t);
     YAGL_LOG_FUNC_ENTER_SPLIT1(glClearStencil, GLint, s);
-    bool res = yagl_host_glClearStencil(s);
+    (void)yagl_host_glClearStencil(s);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
  * glColorMask dispatcher. id = 17
  */
-static bool yagl_func_glColorMask(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glColorMask(struct yagl_transport *t)
 {
-    GLboolean red = yagl_marshal_get_GLboolean(out_buff);
-    GLboolean green = yagl_marshal_get_GLboolean(out_buff);
-    GLboolean blue = yagl_marshal_get_GLboolean(out_buff);
-    GLboolean alpha = yagl_marshal_get_GLboolean(out_buff);
+    GLboolean red;
+    GLboolean green;
+    GLboolean blue;
+    GLboolean alpha;
+    red = yagl_transport_get_out_GLboolean(t);
+    green = yagl_transport_get_out_GLboolean(t);
+    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);
-    bool res = yagl_host_glColorMask(red, green, blue, alpha);
+    (void)yagl_host_glColorMask(red, green, blue, alpha);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
  * glCompressedTexImage2D dispatcher. id = 18
  */
-static bool yagl_func_glCompressedTexImage2D(uint8_t **out_buff,
-    uint8_t *in_buff)
-{
-    GLenum target = yagl_marshal_get_GLenum(out_buff);
-    GLint level = yagl_marshal_get_GLint(out_buff);
-    GLenum internalformat = yagl_marshal_get_GLenum(out_buff);
-    GLsizei width = yagl_marshal_get_GLsizei(out_buff);
-    GLsizei height = yagl_marshal_get_GLsizei(out_buff);
-    GLint border = yagl_marshal_get_GLint(out_buff);
-    GLsizei imageSize = yagl_marshal_get_GLsizei(out_buff);
-    target_ulong data = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT8(glCompressedTexImage2D, GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, target_ulong, target, level, internalformat, width, height, border, imageSize, data);
-    bool res = yagl_host_glCompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data);
+static bool yagl_func_glCompressedTexImage2D(struct yagl_transport *t)
+{
+    GLenum target;
+    GLint level;
+    GLenum internalformat;
+    GLsizei width;
+    GLsizei height;
+    GLint border;
+    const GLvoid *data;
+    int32_t data_count;
+    target = yagl_transport_get_out_GLenum(t);
+    level = yagl_transport_get_out_GLint(t);
+    internalformat = yagl_transport_get_out_GLenum(t);
+    width = yagl_transport_get_out_GLsizei(t);
+    height = yagl_transport_get_out_GLsizei(t);
+    border = yagl_transport_get_out_GLint(t);
+    if (!yagl_transport_get_out_array(t, 1, (const void**)&data, &data_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT7(glCompressedTexImage2D, GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, void*, target, level, internalformat, width, height, border, data);
+    (void)yagl_host_glCompressedTexImage2D(target, level, internalformat, width, height, border, data, data_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
  * glCompressedTexSubImage2D dispatcher. id = 19
  */
-static bool yagl_func_glCompressedTexSubImage2D(uint8_t **out_buff,
-    uint8_t *in_buff)
-{
-    GLenum target = yagl_marshal_get_GLenum(out_buff);
-    GLint level = yagl_marshal_get_GLint(out_buff);
-    GLint xoffset = yagl_marshal_get_GLint(out_buff);
-    GLint yoffset = yagl_marshal_get_GLint(out_buff);
-    GLsizei width = yagl_marshal_get_GLsizei(out_buff);
-    GLsizei height = yagl_marshal_get_GLsizei(out_buff);
-    GLenum format = yagl_marshal_get_GLenum(out_buff);
-    GLsizei imageSize = yagl_marshal_get_GLsizei(out_buff);
-    target_ulong data = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT9(glCompressedTexSubImage2D, GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, target_ulong, target, level, xoffset, yoffset, width, height, format, imageSize, data);
-    bool res = yagl_host_glCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data);
+static bool yagl_func_glCompressedTexSubImage2D(struct yagl_transport *t)
+{
+    GLenum target;
+    GLint level;
+    GLint xoffset;
+    GLint yoffset;
+    GLsizei width;
+    GLsizei height;
+    GLenum format;
+    const GLvoid *data;
+    int32_t data_count;
+    target = yagl_transport_get_out_GLenum(t);
+    level = yagl_transport_get_out_GLint(t);
+    xoffset = yagl_transport_get_out_GLint(t);
+    yoffset = yagl_transport_get_out_GLint(t);
+    width = yagl_transport_get_out_GLsizei(t);
+    height = yagl_transport_get_out_GLsizei(t);
+    format = yagl_transport_get_out_GLenum(t);
+    if (!yagl_transport_get_out_array(t, 1, (const void**)&data, &data_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT8(glCompressedTexSubImage2D, GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, void*, target, level, xoffset, yoffset, width, height, format, data);
+    (void)yagl_host_glCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, data, data_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
  * glCopyTexImage2D dispatcher. id = 20
  */
-static bool yagl_func_glCopyTexImage2D(uint8_t **out_buff,
-    uint8_t *in_buff)
-{
-    GLenum target = yagl_marshal_get_GLenum(out_buff);
-    GLint level = yagl_marshal_get_GLint(out_buff);
-    GLenum internalformat = yagl_marshal_get_GLenum(out_buff);
-    GLint x = yagl_marshal_get_GLint(out_buff);
-    GLint y = yagl_marshal_get_GLint(out_buff);
-    GLsizei width = yagl_marshal_get_GLsizei(out_buff);
-    GLsizei height = yagl_marshal_get_GLsizei(out_buff);
-    GLint border = yagl_marshal_get_GLint(out_buff);
+static bool yagl_func_glCopyTexImage2D(struct yagl_transport *t)
+{
+    GLenum target;
+    GLint level;
+    GLenum internalformat;
+    GLint x;
+    GLint y;
+    GLsizei width;
+    GLsizei height;
+    GLint border;
+    target = yagl_transport_get_out_GLenum(t);
+    level = yagl_transport_get_out_GLint(t);
+    internalformat = yagl_transport_get_out_GLenum(t);
+    x = yagl_transport_get_out_GLint(t);
+    y = yagl_transport_get_out_GLint(t);
+    width = yagl_transport_get_out_GLsizei(t);
+    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);
-    bool res = yagl_host_glCopyTexImage2D(target, level, internalformat, x, y, width, height, border);
+    (void)yagl_host_glCopyTexImage2D(target, level, internalformat, x, y, width, height, border);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
  * glCopyTexSubImage2D dispatcher. id = 21
  */
-static bool yagl_func_glCopyTexSubImage2D(uint8_t **out_buff,
-    uint8_t *in_buff)
-{
-    GLenum target = yagl_marshal_get_GLenum(out_buff);
-    GLint level = yagl_marshal_get_GLint(out_buff);
-    GLint xoffset = yagl_marshal_get_GLint(out_buff);
-    GLint yoffset = yagl_marshal_get_GLint(out_buff);
-    GLint x = yagl_marshal_get_GLint(out_buff);
-    GLint y = yagl_marshal_get_GLint(out_buff);
-    GLsizei width = yagl_marshal_get_GLsizei(out_buff);
-    GLsizei height = yagl_marshal_get_GLsizei(out_buff);
+static bool yagl_func_glCopyTexSubImage2D(struct yagl_transport *t)
+{
+    GLenum target;
+    GLint level;
+    GLint xoffset;
+    GLint yoffset;
+    GLint x;
+    GLint y;
+    GLsizei width;
+    GLsizei height;
+    target = yagl_transport_get_out_GLenum(t);
+    level = yagl_transport_get_out_GLint(t);
+    xoffset = yagl_transport_get_out_GLint(t);
+    yoffset = yagl_transport_get_out_GLint(t);
+    x = yagl_transport_get_out_GLint(t);
+    y = yagl_transport_get_out_GLint(t);
+    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);
-    bool res = yagl_host_glCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height);
+    (void)yagl_host_glCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
  * glCullFace dispatcher. id = 22
  */
-static bool yagl_func_glCullFace(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glCullFace(struct yagl_transport *t)
 {
-    GLenum mode = yagl_marshal_get_GLenum(out_buff);
+    GLenum mode;
+    mode = yagl_transport_get_out_GLenum(t);
     YAGL_LOG_FUNC_ENTER_SPLIT1(glCullFace, GLenum, mode);
-    bool res = yagl_host_glCullFace(mode);
+    (void)yagl_host_glCullFace(mode);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
  * glDeleteBuffers dispatcher. id = 23
  */
-static bool yagl_func_glDeleteBuffers(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glDeleteBuffers(struct yagl_transport *t)
 {
-    GLsizei n = yagl_marshal_get_GLsizei(out_buff);
-    target_ulong buffers = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT2(glDeleteBuffers, GLsizei, target_ulong, n, buffers);
-    bool res = yagl_host_glDeleteBuffers(n, buffers);
+    const GLuint *buffers;
+    int32_t buffers_count;
+    if (!yagl_transport_get_out_array(t, sizeof(GLuint), (const void**)&buffers, &buffers_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT1(glDeleteBuffers, void*, buffers);
+    (void)yagl_host_glDeleteBuffers(buffers, buffers_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
  * glDeleteFramebuffers dispatcher. id = 24
  */
-static bool yagl_func_glDeleteFramebuffers(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glDeleteFramebuffers(struct yagl_transport *t)
 {
-    GLsizei n = yagl_marshal_get_GLsizei(out_buff);
-    target_ulong framebuffers = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT2(glDeleteFramebuffers, GLsizei, target_ulong, n, framebuffers);
-    bool res = yagl_host_glDeleteFramebuffers(n, framebuffers);
+    const GLuint *framebuffers;
+    int32_t framebuffers_count;
+    if (!yagl_transport_get_out_array(t, sizeof(GLuint), (const void**)&framebuffers, &framebuffers_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT1(glDeleteFramebuffers, void*, framebuffers);
+    (void)yagl_host_glDeleteFramebuffers(framebuffers, framebuffers_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
  * glDeleteRenderbuffers dispatcher. id = 25
  */
-static bool yagl_func_glDeleteRenderbuffers(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glDeleteRenderbuffers(struct yagl_transport *t)
 {
-    GLsizei n = yagl_marshal_get_GLsizei(out_buff);
-    target_ulong renderbuffers = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT2(glDeleteRenderbuffers, GLsizei, target_ulong, n, renderbuffers);
-    bool res = yagl_host_glDeleteRenderbuffers(n, renderbuffers);
+    const GLuint *renderbuffers;
+    int32_t renderbuffers_count;
+    if (!yagl_transport_get_out_array(t, sizeof(GLuint), (const void**)&renderbuffers, &renderbuffers_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT1(glDeleteRenderbuffers, void*, renderbuffers);
+    (void)yagl_host_glDeleteRenderbuffers(renderbuffers, renderbuffers_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
  * glDeleteTextures dispatcher. id = 26
  */
-static bool yagl_func_glDeleteTextures(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glDeleteTextures(struct yagl_transport *t)
 {
-    GLsizei n = yagl_marshal_get_GLsizei(out_buff);
-    target_ulong textures = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT2(glDeleteTextures, GLsizei, target_ulong, n, textures);
-    bool res = yagl_host_glDeleteTextures(n, textures);
+    const GLuint *textures;
+    int32_t textures_count;
+    if (!yagl_transport_get_out_array(t, sizeof(GLuint), (const void**)&textures, &textures_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT1(glDeleteTextures, void*, textures);
+    (void)yagl_host_glDeleteTextures(textures, textures_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
  * glDepthFunc dispatcher. id = 27
  */
-static bool yagl_func_glDepthFunc(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glDepthFunc(struct yagl_transport *t)
 {
-    GLenum func = yagl_marshal_get_GLenum(out_buff);
+    GLenum func;
+    func = yagl_transport_get_out_GLenum(t);
     YAGL_LOG_FUNC_ENTER_SPLIT1(glDepthFunc, GLenum, func);
-    bool res = yagl_host_glDepthFunc(func);
+    (void)yagl_host_glDepthFunc(func);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
  * glDepthMask dispatcher. id = 28
  */
-static bool yagl_func_glDepthMask(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glDepthMask(struct yagl_transport *t)
 {
-    GLboolean flag = yagl_marshal_get_GLboolean(out_buff);
+    GLboolean flag;
+    flag = yagl_transport_get_out_GLboolean(t);
     YAGL_LOG_FUNC_ENTER_SPLIT1(glDepthMask, GLboolean, flag);
-    bool res = yagl_host_glDepthMask(flag);
+    (void)yagl_host_glDepthMask(flag);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
  * glDepthRangef dispatcher. id = 29
  */
-static bool yagl_func_glDepthRangef(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glDepthRangef(struct yagl_transport *t)
 {
-    GLclampf zNear = yagl_marshal_get_GLclampf(out_buff);
-    GLclampf zFar = yagl_marshal_get_GLclampf(out_buff);
+    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);
-    bool res = yagl_host_glDepthRangef(zNear, zFar);
+    (void)yagl_host_glDepthRangef(zNear, zFar);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
  * glDisable dispatcher. id = 30
  */
-static bool yagl_func_glDisable(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glDisable(struct yagl_transport *t)
 {
-    GLenum cap = yagl_marshal_get_GLenum(out_buff);
+    GLenum cap;
+    cap = yagl_transport_get_out_GLenum(t);
     YAGL_LOG_FUNC_ENTER_SPLIT1(glDisable, GLenum, cap);
-    bool res = yagl_host_glDisable(cap);
+    (void)yagl_host_glDisable(cap);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
  * glDrawArrays dispatcher. id = 31
  */
-static bool yagl_func_glDrawArrays(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glDrawArrays(struct yagl_transport *t)
 {
-    GLenum mode = yagl_marshal_get_GLenum(out_buff);
-    GLint first = yagl_marshal_get_GLint(out_buff);
-    GLsizei count = yagl_marshal_get_GLsizei(out_buff);
+    GLenum mode;
+    GLint first;
+    GLsizei count;
+    mode = yagl_transport_get_out_GLenum(t);
+    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);
-    bool res = yagl_host_glDrawArrays(mode, first, count);
+    (void)yagl_host_glDrawArrays(mode, first, count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
-}
 
-/*
- * glDrawElements dispatcher. id = 32
- */
-static bool yagl_func_glDrawElements(uint8_t **out_buff,
-    uint8_t *in_buff)
-{
-    GLenum mode = yagl_marshal_get_GLenum(out_buff);
-    GLsizei count = yagl_marshal_get_GLsizei(out_buff);
-    GLenum type = yagl_marshal_get_GLenum(out_buff);
-    target_ulong indices = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT4(glDrawElements, GLenum, GLsizei, GLenum, target_ulong, mode, count, type, indices);
-    bool res = yagl_host_glDrawElements(mode, count, type, indices);
-    YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+    return true;
 }
 
 /*
- * glEGLImageTargetTexture2DOES dispatcher. id = 33
+ * glEGLImageTargetTexture2DOES dispatcher. id = 32
  */
-static bool yagl_func_glEGLImageTargetTexture2DOES(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glEGLImageTargetTexture2DOES(struct yagl_transport *t)
 {
-    GLenum target = yagl_marshal_get_GLenum(out_buff);
-    yagl_host_handle image = yagl_marshal_get_host_handle(out_buff);
+    GLenum target;
+    yagl_host_handle image;
+    target = yagl_transport_get_out_GLenum(t);
+    image = yagl_transport_get_out_yagl_host_handle(t);
     YAGL_LOG_FUNC_ENTER_SPLIT2(glEGLImageTargetTexture2DOES, GLenum, yagl_host_handle, target, image);
-    bool res = yagl_host_glEGLImageTargetTexture2DOES(target, image);
+    (void)yagl_host_glEGLImageTargetTexture2DOES(target, image);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glEnable dispatcher. id = 34
+ * glEnable dispatcher. id = 33
  */
-static bool yagl_func_glEnable(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glEnable(struct yagl_transport *t)
 {
-    GLenum cap = yagl_marshal_get_GLenum(out_buff);
+    GLenum cap;
+    cap = yagl_transport_get_out_GLenum(t);
     YAGL_LOG_FUNC_ENTER_SPLIT1(glEnable, GLenum, cap);
-    bool res = yagl_host_glEnable(cap);
+    (void)yagl_host_glEnable(cap);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glFlush dispatcher. id = 35
+ * glFlush dispatcher. id = 34
  */
-static bool yagl_func_glFlush(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glFlush(struct yagl_transport *t)
 {
     YAGL_LOG_FUNC_ENTER_SPLIT0(glFlush);
-    bool res = yagl_host_glFlush();
+    (void)yagl_host_glFlush();
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glFramebufferTexture2D dispatcher. id = 36
+ * glFramebufferTexture2D dispatcher. id = 35
  */
-static bool yagl_func_glFramebufferTexture2D(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glFramebufferTexture2D(struct yagl_transport *t)
 {
-    GLenum target = yagl_marshal_get_GLenum(out_buff);
-    GLenum attachment = yagl_marshal_get_GLenum(out_buff);
-    GLenum textarget = yagl_marshal_get_GLenum(out_buff);
-    GLuint texture = yagl_marshal_get_GLuint(out_buff);
-    GLint level = yagl_marshal_get_GLint(out_buff);
+    GLenum target;
+    GLenum attachment;
+    GLenum textarget;
+    GLuint texture;
+    GLint level;
+    target = yagl_transport_get_out_GLenum(t);
+    attachment = yagl_transport_get_out_GLenum(t);
+    textarget = yagl_transport_get_out_GLenum(t);
+    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);
-    bool res = yagl_host_glFramebufferTexture2D(target, attachment, textarget, texture, level);
+    (void)yagl_host_glFramebufferTexture2D(target, attachment, textarget, texture, level);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glFramebufferRenderbuffer dispatcher. id = 37
+ * glFramebufferRenderbuffer dispatcher. id = 36
  */
-static bool yagl_func_glFramebufferRenderbuffer(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glFramebufferRenderbuffer(struct yagl_transport *t)
 {
-    GLenum target = yagl_marshal_get_GLenum(out_buff);
-    GLenum attachment = yagl_marshal_get_GLenum(out_buff);
-    GLenum renderbuffertarget = yagl_marshal_get_GLenum(out_buff);
-    GLuint renderbuffer = yagl_marshal_get_GLuint(out_buff);
+    GLenum target;
+    GLenum attachment;
+    GLenum renderbuffertarget;
+    GLuint renderbuffer;
+    target = yagl_transport_get_out_GLenum(t);
+    attachment = yagl_transport_get_out_GLenum(t);
+    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);
-    bool res = yagl_host_glFramebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer);
+    (void)yagl_host_glFramebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glFrontFace dispatcher. id = 38
+ * glFrontFace dispatcher. id = 37
  */
-static bool yagl_func_glFrontFace(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glFrontFace(struct yagl_transport *t)
 {
-    GLenum mode = yagl_marshal_get_GLenum(out_buff);
+    GLenum mode;
+    mode = yagl_transport_get_out_GLenum(t);
     YAGL_LOG_FUNC_ENTER_SPLIT1(glFrontFace, GLenum, mode);
-    bool res = yagl_host_glFrontFace(mode);
+    (void)yagl_host_glFrontFace(mode);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glGenBuffers dispatcher. id = 39
+ * glGenBuffers dispatcher. id = 38
  */
-static bool yagl_func_glGenBuffers(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glGenBuffers(struct yagl_transport *t)
 {
-    GLsizei n = yagl_marshal_get_GLsizei(out_buff);
-    target_ulong buffers = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT2(glGenBuffers, GLsizei, target_ulong, n, buffers);
-    bool res = yagl_host_glGenBuffers(n, buffers);
+    GLuint *buffers;
+    int32_t buffers_maxcount;
+    int32_t *buffers_count;
+    if (!yagl_transport_get_in_array(t, sizeof(GLuint), (void**)&buffers, &buffers_maxcount, &buffers_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT1(glGenBuffers, void*, buffers);
+    *buffers_count = 0;
+    (void)yagl_host_glGenBuffers(buffers, buffers_maxcount, buffers_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glGenerateMipmap dispatcher. id = 40
+ * glGenerateMipmap dispatcher. id = 39
  */
-static bool yagl_func_glGenerateMipmap(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glGenerateMipmap(struct yagl_transport *t)
 {
-    GLenum target = yagl_marshal_get_GLenum(out_buff);
+    GLenum target;
+    target = yagl_transport_get_out_GLenum(t);
     YAGL_LOG_FUNC_ENTER_SPLIT1(glGenerateMipmap, GLenum, target);
-    bool res = yagl_host_glGenerateMipmap(target);
+    (void)yagl_host_glGenerateMipmap(target);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glGenFramebuffers dispatcher. id = 41
+ * glGenFramebuffers dispatcher. id = 40
  */
-static bool yagl_func_glGenFramebuffers(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glGenFramebuffers(struct yagl_transport *t)
 {
-    GLsizei n = yagl_marshal_get_GLsizei(out_buff);
-    target_ulong framebuffers = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT2(glGenFramebuffers, GLsizei, target_ulong, n, framebuffers);
-    bool res = yagl_host_glGenFramebuffers(n, framebuffers);
+    GLuint *framebuffers;
+    int32_t framebuffers_maxcount;
+    int32_t *framebuffers_count;
+    if (!yagl_transport_get_in_array(t, sizeof(GLuint), (void**)&framebuffers, &framebuffers_maxcount, &framebuffers_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT1(glGenFramebuffers, void*, framebuffers);
+    *framebuffers_count = 0;
+    (void)yagl_host_glGenFramebuffers(framebuffers, framebuffers_maxcount, framebuffers_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glGenRenderbuffers dispatcher. id = 42
+ * glGenRenderbuffers dispatcher. id = 41
  */
-static bool yagl_func_glGenRenderbuffers(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glGenRenderbuffers(struct yagl_transport *t)
 {
-    GLsizei n = yagl_marshal_get_GLsizei(out_buff);
-    target_ulong renderbuffers = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT2(glGenRenderbuffers, GLsizei, target_ulong, n, renderbuffers);
-    bool res = yagl_host_glGenRenderbuffers(n, renderbuffers);
+    GLuint *renderbuffers;
+    int32_t renderbuffers_maxcount;
+    int32_t *renderbuffers_count;
+    if (!yagl_transport_get_in_array(t, sizeof(GLuint), (void**)&renderbuffers, &renderbuffers_maxcount, &renderbuffers_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT1(glGenRenderbuffers, void*, renderbuffers);
+    *renderbuffers_count = 0;
+    (void)yagl_host_glGenRenderbuffers(renderbuffers, renderbuffers_maxcount, renderbuffers_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glGenTextures dispatcher. id = 43
+ * glGenTextures dispatcher. id = 42
  */
-static bool yagl_func_glGenTextures(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glGenTextures(struct yagl_transport *t)
 {
-    GLsizei n = yagl_marshal_get_GLsizei(out_buff);
-    target_ulong textures = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT2(glGenTextures, GLsizei, target_ulong, n, textures);
-    bool res = yagl_host_glGenTextures(n, textures);
+    GLuint *textures;
+    int32_t textures_maxcount;
+    int32_t *textures_count;
+    if (!yagl_transport_get_in_array(t, sizeof(GLuint), (void**)&textures, &textures_maxcount, &textures_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT1(glGenTextures, void*, textures);
+    *textures_count = 0;
+    (void)yagl_host_glGenTextures(textures, textures_maxcount, textures_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glGetBooleanv dispatcher. id = 44
+ * glGetBooleanv dispatcher. id = 43
  */
-static bool yagl_func_glGetBooleanv(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glGetBooleanv(struct yagl_transport *t)
 {
-    GLenum pname = yagl_marshal_get_GLenum(out_buff);
-    target_ulong params = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT2(glGetBooleanv, GLenum, target_ulong, pname, params);
-    bool res = yagl_host_glGetBooleanv(pname, params);
+    GLenum pname;
+    GLboolean *params;
+    int32_t params_maxcount;
+    int32_t *params_count;
+    pname = yagl_transport_get_out_GLenum(t);
+    if (!yagl_transport_get_in_array(t, sizeof(GLboolean), (void**)&params, &params_maxcount, &params_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT2(glGetBooleanv, GLenum, void*, pname, params);
+    *params_count = 0;
+    (void)yagl_host_glGetBooleanv(pname, params, params_maxcount, params_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glGetBufferParameteriv dispatcher. id = 45
+ * glGetBufferParameteriv dispatcher. id = 44
  */
-static bool yagl_func_glGetBufferParameteriv(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glGetBufferParameteriv(struct yagl_transport *t)
 {
-    GLenum target = yagl_marshal_get_GLenum(out_buff);
-    GLenum pname = yagl_marshal_get_GLenum(out_buff);
-    target_ulong params = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT3(glGetBufferParameteriv, GLenum, GLenum, target_ulong, target, pname, params);
-    bool res = yagl_host_glGetBufferParameteriv(target, pname, params);
+    GLenum target;
+    GLenum pname;
+    GLint *param;
+    target = yagl_transport_get_out_GLenum(t);
+    pname = yagl_transport_get_out_GLenum(t);
+    yagl_transport_get_in_arg(t, (void**)&param);
+    YAGL_LOG_FUNC_ENTER_SPLIT3(glGetBufferParameteriv, GLenum, GLenum, void*, target, pname, param);
+    (void)yagl_host_glGetBufferParameteriv(target, pname, param);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glGetError dispatcher. id = 46
+ * glGetError dispatcher. id = 45
  */
-static bool yagl_func_glGetError(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glGetError(struct yagl_transport *t)
 {
+    GLenum *retval;
+    yagl_transport_get_in_arg(t, (void**)&retval);
     YAGL_LOG_FUNC_ENTER_SPLIT0(glGetError);
-    GLenum retval;
-    bool res = yagl_host_glGetError(&retval);
-    if (!res) {
-        YAGL_LOG_FUNC_EXIT(NULL);
-        return false;
-    }
-    YAGL_LOG_FUNC_EXIT_SPLIT(GLenum, retval);
-    yagl_marshal_put_GLenum(&in_buff, retval);
+    *retval = yagl_host_glGetError();
+    YAGL_LOG_FUNC_EXIT_SPLIT(GLenum, *retval);
+
     return true;
 }
 
 /*
- * glGetFloatv dispatcher. id = 47
+ * glGetFloatv dispatcher. id = 46
  */
-static bool yagl_func_glGetFloatv(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glGetFloatv(struct yagl_transport *t)
 {
-    GLenum pname = yagl_marshal_get_GLenum(out_buff);
-    target_ulong params = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT2(glGetFloatv, GLenum, target_ulong, pname, params);
-    bool res = yagl_host_glGetFloatv(pname, params);
+    GLenum pname;
+    GLfloat *params;
+    int32_t params_maxcount;
+    int32_t *params_count;
+    pname = yagl_transport_get_out_GLenum(t);
+    if (!yagl_transport_get_in_array(t, sizeof(GLfloat), (void**)&params, &params_maxcount, &params_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT2(glGetFloatv, GLenum, void*, pname, params);
+    *params_count = 0;
+    (void)yagl_host_glGetFloatv(pname, params, params_maxcount, params_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glGetFramebufferAttachmentParameteriv dispatcher. id = 48
+ * glGetFramebufferAttachmentParameteriv dispatcher. id = 47
  */
-static bool yagl_func_glGetFramebufferAttachmentParameteriv(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glGetFramebufferAttachmentParameteriv(struct yagl_transport *t)
 {
-    GLenum target = yagl_marshal_get_GLenum(out_buff);
-    GLenum attachment = yagl_marshal_get_GLenum(out_buff);
-    GLenum pname = yagl_marshal_get_GLenum(out_buff);
-    target_ulong params = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT4(glGetFramebufferAttachmentParameteriv, GLenum, GLenum, GLenum, target_ulong, target, attachment, pname, params);
-    bool res = yagl_host_glGetFramebufferAttachmentParameteriv(target, attachment, pname, params);
+    GLenum target;
+    GLenum attachment;
+    GLenum pname;
+    GLint *param;
+    target = yagl_transport_get_out_GLenum(t);
+    attachment = yagl_transport_get_out_GLenum(t);
+    pname = yagl_transport_get_out_GLenum(t);
+    yagl_transport_get_in_arg(t, (void**)&param);
+    YAGL_LOG_FUNC_ENTER_SPLIT4(glGetFramebufferAttachmentParameteriv, GLenum, GLenum, GLenum, void*, target, attachment, pname, param);
+    (void)yagl_host_glGetFramebufferAttachmentParameteriv(target, attachment, pname, param);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glGetIntegerv dispatcher. id = 49
+ * glGetIntegerv dispatcher. id = 48
  */
-static bool yagl_func_glGetIntegerv(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glGetIntegerv(struct yagl_transport *t)
 {
-    GLenum pname = yagl_marshal_get_GLenum(out_buff);
-    target_ulong params = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT2(glGetIntegerv, GLenum, target_ulong, pname, params);
-    bool res = yagl_host_glGetIntegerv(pname, params);
+    GLenum pname;
+    GLint *params;
+    int32_t params_maxcount;
+    int32_t *params_count;
+    pname = yagl_transport_get_out_GLenum(t);
+    if (!yagl_transport_get_in_array(t, sizeof(GLint), (void**)&params, &params_maxcount, &params_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT2(glGetIntegerv, GLenum, void*, pname, params);
+    *params_count = 0;
+    (void)yagl_host_glGetIntegerv(pname, params, params_maxcount, params_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glGetRenderbufferParameteriv dispatcher. id = 50
+ * glGetRenderbufferParameteriv dispatcher. id = 49
  */
-static bool yagl_func_glGetRenderbufferParameteriv(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glGetRenderbufferParameteriv(struct yagl_transport *t)
 {
-    GLenum target = yagl_marshal_get_GLenum(out_buff);
-    GLenum pname = yagl_marshal_get_GLenum(out_buff);
-    target_ulong params = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT3(glGetRenderbufferParameteriv, GLenum, GLenum, target_ulong, target, pname, params);
-    bool res = yagl_host_glGetRenderbufferParameteriv(target, pname, params);
+    GLenum target;
+    GLenum pname;
+    GLint *param;
+    target = yagl_transport_get_out_GLenum(t);
+    pname = yagl_transport_get_out_GLenum(t);
+    yagl_transport_get_in_arg(t, (void**)&param);
+    YAGL_LOG_FUNC_ENTER_SPLIT3(glGetRenderbufferParameteriv, GLenum, GLenum, void*, target, pname, param);
+    (void)yagl_host_glGetRenderbufferParameteriv(target, pname, param);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glGetTexParameterfv dispatcher. id = 51
+ * glGetTexParameterfv dispatcher. id = 50
  */
-static bool yagl_func_glGetTexParameterfv(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glGetTexParameterfv(struct yagl_transport *t)
 {
-    GLenum target = yagl_marshal_get_GLenum(out_buff);
-    GLenum pname = yagl_marshal_get_GLenum(out_buff);
-    target_ulong params = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT3(glGetTexParameterfv, GLenum, GLenum, target_ulong, target, pname, params);
-    bool res = yagl_host_glGetTexParameterfv(target, pname, params);
+    GLenum target;
+    GLenum pname;
+    GLfloat *param;
+    target = yagl_transport_get_out_GLenum(t);
+    pname = yagl_transport_get_out_GLenum(t);
+    yagl_transport_get_in_arg(t, (void**)&param);
+    YAGL_LOG_FUNC_ENTER_SPLIT3(glGetTexParameterfv, GLenum, GLenum, void*, target, pname, param);
+    (void)yagl_host_glGetTexParameterfv(target, pname, param);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glGetTexParameteriv dispatcher. id = 52
+ * glGetTexParameteriv dispatcher. id = 51
  */
-static bool yagl_func_glGetTexParameteriv(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glGetTexParameteriv(struct yagl_transport *t)
 {
-    GLenum target = yagl_marshal_get_GLenum(out_buff);
-    GLenum pname = yagl_marshal_get_GLenum(out_buff);
-    target_ulong params = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT3(glGetTexParameteriv, GLenum, GLenum, target_ulong, target, pname, params);
-    bool res = yagl_host_glGetTexParameteriv(target, pname, params);
+    GLenum target;
+    GLenum pname;
+    GLint *param;
+    target = yagl_transport_get_out_GLenum(t);
+    pname = yagl_transport_get_out_GLenum(t);
+    yagl_transport_get_in_arg(t, (void**)&param);
+    YAGL_LOG_FUNC_ENTER_SPLIT3(glGetTexParameteriv, GLenum, GLenum, void*, target, pname, param);
+    (void)yagl_host_glGetTexParameteriv(target, pname, param);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glHint dispatcher. id = 53
+ * glHint dispatcher. id = 52
  */
-static bool yagl_func_glHint(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glHint(struct yagl_transport *t)
 {
-    GLenum target = yagl_marshal_get_GLenum(out_buff);
-    GLenum mode = yagl_marshal_get_GLenum(out_buff);
+    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);
-    bool res = yagl_host_glHint(target, mode);
+    (void)yagl_host_glHint(target, mode);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glIsBuffer dispatcher. id = 54
+ * glIsBuffer dispatcher. id = 53
  */
-static bool yagl_func_glIsBuffer(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glIsBuffer(struct yagl_transport *t)
 {
-    GLuint buffer = yagl_marshal_get_GLuint(out_buff);
+    GLuint buffer;
+    GLboolean *retval;
+    buffer = yagl_transport_get_out_GLuint(t);
+    yagl_transport_get_in_arg(t, (void**)&retval);
     YAGL_LOG_FUNC_ENTER_SPLIT1(glIsBuffer, GLuint, buffer);
-    GLboolean retval;
-    bool res = yagl_host_glIsBuffer(&retval, buffer);
-    if (!res) {
-        YAGL_LOG_FUNC_EXIT(NULL);
-        return false;
-    }
-    YAGL_LOG_FUNC_EXIT_SPLIT(GLboolean, retval);
-    yagl_marshal_put_GLboolean(&in_buff, retval);
+    *retval = yagl_host_glIsBuffer(buffer);
+    YAGL_LOG_FUNC_EXIT_SPLIT(GLboolean, *retval);
+
     return true;
 }
 
 /*
- * glIsEnabled dispatcher. id = 55
+ * glIsEnabled dispatcher. id = 54
  */
-static bool yagl_func_glIsEnabled(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glIsEnabled(struct yagl_transport *t)
 {
-    GLenum cap = yagl_marshal_get_GLenum(out_buff);
+    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);
-    GLboolean retval;
-    bool res = yagl_host_glIsEnabled(&retval, cap);
-    if (!res) {
-        YAGL_LOG_FUNC_EXIT(NULL);
-        return false;
-    }
-    YAGL_LOG_FUNC_EXIT_SPLIT(GLboolean, retval);
-    yagl_marshal_put_GLboolean(&in_buff, retval);
+    *retval = yagl_host_glIsEnabled(cap);
+    YAGL_LOG_FUNC_EXIT_SPLIT(GLboolean, *retval);
+
     return true;
 }
 
 /*
- * glIsFramebuffer dispatcher. id = 56
+ * glIsFramebuffer dispatcher. id = 55
  */
-static bool yagl_func_glIsFramebuffer(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glIsFramebuffer(struct yagl_transport *t)
 {
-    GLuint framebuffer = yagl_marshal_get_GLuint(out_buff);
+    GLuint framebuffer;
+    GLboolean *retval;
+    framebuffer = yagl_transport_get_out_GLuint(t);
+    yagl_transport_get_in_arg(t, (void**)&retval);
     YAGL_LOG_FUNC_ENTER_SPLIT1(glIsFramebuffer, GLuint, framebuffer);
-    GLboolean retval;
-    bool res = yagl_host_glIsFramebuffer(&retval, framebuffer);
-    if (!res) {
-        YAGL_LOG_FUNC_EXIT(NULL);
-        return false;
-    }
-    YAGL_LOG_FUNC_EXIT_SPLIT(GLboolean, retval);
-    yagl_marshal_put_GLboolean(&in_buff, retval);
+    *retval = yagl_host_glIsFramebuffer(framebuffer);
+    YAGL_LOG_FUNC_EXIT_SPLIT(GLboolean, *retval);
+
     return true;
 }
 
 /*
- * glIsRenderbuffer dispatcher. id = 57
+ * glIsRenderbuffer dispatcher. id = 56
  */
-static bool yagl_func_glIsRenderbuffer(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glIsRenderbuffer(struct yagl_transport *t)
 {
-    GLuint renderbuffer = yagl_marshal_get_GLuint(out_buff);
+    GLuint renderbuffer;
+    GLboolean *retval;
+    renderbuffer = yagl_transport_get_out_GLuint(t);
+    yagl_transport_get_in_arg(t, (void**)&retval);
     YAGL_LOG_FUNC_ENTER_SPLIT1(glIsRenderbuffer, GLuint, renderbuffer);
-    GLboolean retval;
-    bool res = yagl_host_glIsRenderbuffer(&retval, renderbuffer);
-    if (!res) {
-        YAGL_LOG_FUNC_EXIT(NULL);
-        return false;
-    }
-    YAGL_LOG_FUNC_EXIT_SPLIT(GLboolean, retval);
-    yagl_marshal_put_GLboolean(&in_buff, retval);
+    *retval = yagl_host_glIsRenderbuffer(renderbuffer);
+    YAGL_LOG_FUNC_EXIT_SPLIT(GLboolean, *retval);
+
     return true;
 }
 
 /*
- * glIsTexture dispatcher. id = 58
+ * glIsTexture dispatcher. id = 57
  */
-static bool yagl_func_glIsTexture(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glIsTexture(struct yagl_transport *t)
 {
-    GLuint texture = yagl_marshal_get_GLuint(out_buff);
+    GLuint texture;
+    GLboolean *retval;
+    texture = yagl_transport_get_out_GLuint(t);
+    yagl_transport_get_in_arg(t, (void**)&retval);
     YAGL_LOG_FUNC_ENTER_SPLIT1(glIsTexture, GLuint, texture);
-    GLboolean retval;
-    bool res = yagl_host_glIsTexture(&retval, texture);
-    if (!res) {
-        YAGL_LOG_FUNC_EXIT(NULL);
-        return false;
-    }
-    YAGL_LOG_FUNC_EXIT_SPLIT(GLboolean, retval);
-    yagl_marshal_put_GLboolean(&in_buff, retval);
+    *retval = yagl_host_glIsTexture(texture);
+    YAGL_LOG_FUNC_EXIT_SPLIT(GLboolean, *retval);
+
     return true;
 }
 
 /*
- * glLineWidth dispatcher. id = 59
+ * glLineWidth dispatcher. id = 58
  */
-static bool yagl_func_glLineWidth(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glLineWidth(struct yagl_transport *t)
 {
-    GLfloat width = yagl_marshal_get_GLfloat(out_buff);
+    GLfloat width;
+    width = yagl_transport_get_out_GLfloat(t);
     YAGL_LOG_FUNC_ENTER_SPLIT1(glLineWidth, GLfloat, width);
-    bool res = yagl_host_glLineWidth(width);
+    (void)yagl_host_glLineWidth(width);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glPixelStorei dispatcher. id = 60
+ * glPixelStorei dispatcher. id = 59
  */
-static bool yagl_func_glPixelStorei(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glPixelStorei(struct yagl_transport *t)
 {
-    GLenum pname = yagl_marshal_get_GLenum(out_buff);
-    GLint param = yagl_marshal_get_GLint(out_buff);
+    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);
-    bool res = yagl_host_glPixelStorei(pname, param);
+    (void)yagl_host_glPixelStorei(pname, param);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glPolygonOffset dispatcher. id = 61
+ * glPolygonOffset dispatcher. id = 60
  */
-static bool yagl_func_glPolygonOffset(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glPolygonOffset(struct yagl_transport *t)
 {
-    GLfloat factor = yagl_marshal_get_GLfloat(out_buff);
-    GLfloat units = yagl_marshal_get_GLfloat(out_buff);
+    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);
-    bool res = yagl_host_glPolygonOffset(factor, units);
+    (void)yagl_host_glPolygonOffset(factor, units);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glReadPixels dispatcher. id = 62
+ * glReadPixels dispatcher. id = 61
  */
-static bool yagl_func_glReadPixels(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glReadPixels(struct yagl_transport *t)
 {
-    GLint x = yagl_marshal_get_GLint(out_buff);
-    GLint y = yagl_marshal_get_GLint(out_buff);
-    GLsizei width = yagl_marshal_get_GLsizei(out_buff);
-    GLsizei height = yagl_marshal_get_GLsizei(out_buff);
-    GLenum format = yagl_marshal_get_GLenum(out_buff);
-    GLenum type = yagl_marshal_get_GLenum(out_buff);
-    target_ulong pixels = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT7(glReadPixels, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, target_ulong, x, y, width, height, format, type, pixels);
-    bool res = yagl_host_glReadPixels(x, y, width, height, format, type, pixels);
+    GLint x;
+    GLint y;
+    GLsizei width;
+    GLsizei height;
+    GLenum format;
+    GLenum type;
+    GLvoid *pixels;
+    int32_t pixels_maxcount;
+    int32_t *pixels_count;
+    x = yagl_transport_get_out_GLint(t);
+    y = yagl_transport_get_out_GLint(t);
+    width = yagl_transport_get_out_GLsizei(t);
+    height = yagl_transport_get_out_GLsizei(t);
+    format = yagl_transport_get_out_GLenum(t);
+    type = yagl_transport_get_out_GLenum(t);
+    if (!yagl_transport_get_in_array(t, 1, (void**)&pixels, &pixels_maxcount, &pixels_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT7(glReadPixels, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, void*, x, y, width, height, format, type, pixels);
+    *pixels_count = 0;
+    (void)yagl_host_glReadPixels(x, y, width, height, format, type, pixels, pixels_maxcount, pixels_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glRenderbufferStorage dispatcher. id = 63
+ * glRenderbufferStorage dispatcher. id = 62
  */
-static bool yagl_func_glRenderbufferStorage(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glRenderbufferStorage(struct yagl_transport *t)
 {
-    GLenum target = yagl_marshal_get_GLenum(out_buff);
-    GLenum internalformat = yagl_marshal_get_GLenum(out_buff);
-    GLsizei width = yagl_marshal_get_GLsizei(out_buff);
-    GLsizei height = yagl_marshal_get_GLsizei(out_buff);
+    GLenum target;
+    GLenum internalformat;
+    GLsizei width;
+    GLsizei height;
+    target = yagl_transport_get_out_GLenum(t);
+    internalformat = yagl_transport_get_out_GLenum(t);
+    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);
-    bool res = yagl_host_glRenderbufferStorage(target, internalformat, width, height);
+    (void)yagl_host_glRenderbufferStorage(target, internalformat, width, height);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glSampleCoverage dispatcher. id = 64
+ * glSampleCoverage dispatcher. id = 63
  */
-static bool yagl_func_glSampleCoverage(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glSampleCoverage(struct yagl_transport *t)
 {
-    GLclampf value = yagl_marshal_get_GLclampf(out_buff);
-    GLboolean invert = yagl_marshal_get_GLboolean(out_buff);
+    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);
-    bool res = yagl_host_glSampleCoverage(value, invert);
+    (void)yagl_host_glSampleCoverage(value, invert);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glScissor dispatcher. id = 65
+ * glScissor dispatcher. id = 64
  */
-static bool yagl_func_glScissor(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glScissor(struct yagl_transport *t)
 {
-    GLint x = yagl_marshal_get_GLint(out_buff);
-    GLint y = yagl_marshal_get_GLint(out_buff);
-    GLsizei width = yagl_marshal_get_GLsizei(out_buff);
-    GLsizei height = yagl_marshal_get_GLsizei(out_buff);
+    GLint x;
+    GLint y;
+    GLsizei width;
+    GLsizei height;
+    x = yagl_transport_get_out_GLint(t);
+    y = yagl_transport_get_out_GLint(t);
+    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);
-    bool res = yagl_host_glScissor(x, y, width, height);
+    (void)yagl_host_glScissor(x, y, width, height);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glStencilFunc dispatcher. id = 66
+ * glStencilFunc dispatcher. id = 65
  */
-static bool yagl_func_glStencilFunc(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glStencilFunc(struct yagl_transport *t)
 {
-    GLenum func = yagl_marshal_get_GLenum(out_buff);
-    GLint ref = yagl_marshal_get_GLint(out_buff);
-    GLuint mask = yagl_marshal_get_GLuint(out_buff);
+    GLenum func;
+    GLint ref;
+    GLuint mask;
+    func = yagl_transport_get_out_GLenum(t);
+    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);
-    bool res = yagl_host_glStencilFunc(func, ref, mask);
+    (void)yagl_host_glStencilFunc(func, ref, mask);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glStencilMask dispatcher. id = 67
+ * glStencilMask dispatcher. id = 66
  */
-static bool yagl_func_glStencilMask(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glStencilMask(struct yagl_transport *t)
 {
-    GLuint mask = yagl_marshal_get_GLuint(out_buff);
+    GLuint mask;
+    mask = yagl_transport_get_out_GLuint(t);
     YAGL_LOG_FUNC_ENTER_SPLIT1(glStencilMask, GLuint, mask);
-    bool res = yagl_host_glStencilMask(mask);
+    (void)yagl_host_glStencilMask(mask);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glStencilOp dispatcher. id = 68
+ * glStencilOp dispatcher. id = 67
  */
-static bool yagl_func_glStencilOp(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glStencilOp(struct yagl_transport *t)
 {
-    GLenum fail = yagl_marshal_get_GLenum(out_buff);
-    GLenum zfail = yagl_marshal_get_GLenum(out_buff);
-    GLenum zpass = yagl_marshal_get_GLenum(out_buff);
+    GLenum fail;
+    GLenum zfail;
+    GLenum zpass;
+    fail = yagl_transport_get_out_GLenum(t);
+    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);
-    bool res = yagl_host_glStencilOp(fail, zfail, zpass);
+    (void)yagl_host_glStencilOp(fail, zfail, zpass);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glTexImage2D dispatcher. id = 69
- */
-static bool yagl_func_glTexImage2D(uint8_t **out_buff,
-    uint8_t *in_buff)
-{
-    GLenum target = yagl_marshal_get_GLenum(out_buff);
-    GLint level = yagl_marshal_get_GLint(out_buff);
-    GLint internalformat = yagl_marshal_get_GLint(out_buff);
-    GLsizei width = yagl_marshal_get_GLsizei(out_buff);
-    GLsizei height = yagl_marshal_get_GLsizei(out_buff);
-    GLint border = yagl_marshal_get_GLint(out_buff);
-    GLenum format = yagl_marshal_get_GLenum(out_buff);
-    GLenum type = yagl_marshal_get_GLenum(out_buff);
-    target_ulong pixels = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT9(glTexImage2D, GLenum, GLint, GLint, GLsizei, GLsizei, GLint, GLenum, GLenum, target_ulong, target, level, internalformat, width, height, border, format, type, pixels);
-    bool res = yagl_host_glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels);
+ * glTexImage2D dispatcher. id = 68
+ */
+static bool yagl_func_glTexImage2D(struct yagl_transport *t)
+{
+    GLenum target;
+    GLint level;
+    GLint internalformat;
+    GLsizei width;
+    GLsizei height;
+    GLint border;
+    GLenum format;
+    GLenum type;
+    const GLvoid *pixels;
+    int32_t pixels_count;
+    target = yagl_transport_get_out_GLenum(t);
+    level = yagl_transport_get_out_GLint(t);
+    internalformat = yagl_transport_get_out_GLint(t);
+    width = yagl_transport_get_out_GLsizei(t);
+    height = yagl_transport_get_out_GLsizei(t);
+    border = yagl_transport_get_out_GLint(t);
+    format = yagl_transport_get_out_GLenum(t);
+    type = yagl_transport_get_out_GLenum(t);
+    if (!yagl_transport_get_out_array(t, 1, (const void**)&pixels, &pixels_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT9(glTexImage2D, GLenum, GLint, GLint, GLsizei, GLsizei, GLint, GLenum, GLenum, void*, target, level, internalformat, width, height, border, format, type, pixels);
+    (void)yagl_host_glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels, pixels_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glTexParameterf dispatcher. id = 70
+ * glTexParameterf dispatcher. id = 69
  */
-static bool yagl_func_glTexParameterf(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glTexParameterf(struct yagl_transport *t)
 {
-    GLenum target = yagl_marshal_get_GLenum(out_buff);
-    GLenum pname = yagl_marshal_get_GLenum(out_buff);
-    GLfloat param = yagl_marshal_get_GLfloat(out_buff);
+    GLenum target;
+    GLenum pname;
+    GLfloat param;
+    target = yagl_transport_get_out_GLenum(t);
+    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);
-    bool res = yagl_host_glTexParameterf(target, pname, param);
+    (void)yagl_host_glTexParameterf(target, pname, param);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glTexParameterfv dispatcher. id = 71
+ * glTexParameterfv dispatcher. id = 70
  */
-static bool yagl_func_glTexParameterfv(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glTexParameterfv(struct yagl_transport *t)
 {
-    GLenum target = yagl_marshal_get_GLenum(out_buff);
-    GLenum pname = yagl_marshal_get_GLenum(out_buff);
-    target_ulong params = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT3(glTexParameterfv, GLenum, GLenum, target_ulong, target, pname, params);
-    bool res = yagl_host_glTexParameterfv(target, pname, params);
+    GLenum target;
+    GLenum pname;
+    const GLfloat *params;
+    int32_t params_count;
+    target = yagl_transport_get_out_GLenum(t);
+    pname = yagl_transport_get_out_GLenum(t);
+    if (!yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&params, &params_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT3(glTexParameterfv, GLenum, GLenum, void*, target, pname, params);
+    (void)yagl_host_glTexParameterfv(target, pname, params, params_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glTexParameteri dispatcher. id = 72
+ * glTexParameteri dispatcher. id = 71
  */
-static bool yagl_func_glTexParameteri(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glTexParameteri(struct yagl_transport *t)
 {
-    GLenum target = yagl_marshal_get_GLenum(out_buff);
-    GLenum pname = yagl_marshal_get_GLenum(out_buff);
-    GLint param = yagl_marshal_get_GLint(out_buff);
+    GLenum target;
+    GLenum pname;
+    GLint param;
+    target = yagl_transport_get_out_GLenum(t);
+    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);
-    bool res = yagl_host_glTexParameteri(target, pname, param);
+    (void)yagl_host_glTexParameteri(target, pname, param);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glTexParameteriv dispatcher. id = 73
+ * glTexParameteriv dispatcher. id = 72
  */
-static bool yagl_func_glTexParameteriv(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glTexParameteriv(struct yagl_transport *t)
 {
-    GLenum target = yagl_marshal_get_GLenum(out_buff);
-    GLenum pname = yagl_marshal_get_GLenum(out_buff);
-    target_ulong params = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT3(glTexParameteriv, GLenum, GLenum, target_ulong, target, pname, params);
-    bool res = yagl_host_glTexParameteriv(target, pname, params);
+    GLenum target;
+    GLenum pname;
+    const GLint *params;
+    int32_t params_count;
+    target = yagl_transport_get_out_GLenum(t);
+    pname = yagl_transport_get_out_GLenum(t);
+    if (!yagl_transport_get_out_array(t, sizeof(GLint), (const void**)&params, &params_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT3(glTexParameteriv, GLenum, GLenum, void*, target, pname, params);
+    (void)yagl_host_glTexParameteriv(target, pname, params, params_count);
+    YAGL_LOG_FUNC_EXIT(NULL);
+
+    return true;
+}
+
+/*
+ * glTexSubImage2D dispatcher. id = 73
+ */
+static bool yagl_func_glTexSubImage2D(struct yagl_transport *t)
+{
+    GLenum target;
+    GLint level;
+    GLint xoffset;
+    GLint yoffset;
+    GLsizei width;
+    GLsizei height;
+    GLenum format;
+    GLenum type;
+    const GLvoid *pixels;
+    int32_t pixels_count;
+    target = yagl_transport_get_out_GLenum(t);
+    level = yagl_transport_get_out_GLint(t);
+    xoffset = yagl_transport_get_out_GLint(t);
+    yoffset = yagl_transport_get_out_GLint(t);
+    width = yagl_transport_get_out_GLsizei(t);
+    height = yagl_transport_get_out_GLsizei(t);
+    format = yagl_transport_get_out_GLenum(t);
+    type = yagl_transport_get_out_GLenum(t);
+    if (!yagl_transport_get_out_array(t, 1, (const void**)&pixels, &pixels_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT9(glTexSubImage2D, GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, void*, target, level, xoffset, yoffset, width, height, format, type, pixels);
+    (void)yagl_host_glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels, pixels_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glTexSubImage2D dispatcher. id = 74
+ * glViewport dispatcher. id = 74
  */
-static bool yagl_func_glTexSubImage2D(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glViewport(struct yagl_transport *t)
 {
-    GLenum target = yagl_marshal_get_GLenum(out_buff);
-    GLint level = yagl_marshal_get_GLint(out_buff);
-    GLint xoffset = yagl_marshal_get_GLint(out_buff);
-    GLint yoffset = yagl_marshal_get_GLint(out_buff);
-    GLsizei width = yagl_marshal_get_GLsizei(out_buff);
-    GLsizei height = yagl_marshal_get_GLsizei(out_buff);
-    GLenum format = yagl_marshal_get_GLenum(out_buff);
-    GLenum type = yagl_marshal_get_GLenum(out_buff);
-    target_ulong pixels = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT9(glTexSubImage2D, GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, target_ulong, target, level, xoffset, yoffset, width, height, format, type, pixels);
-    bool res = yagl_host_glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels);
+    GLint x;
+    GLint y;
+    GLsizei width;
+    GLsizei height;
+    x = yagl_transport_get_out_GLint(t);
+    y = yagl_transport_get_out_GLint(t);
+    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);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glViewport dispatcher. id = 75
+ * glTransferArrayYAGL dispatcher. id = 75
  */
-static bool yagl_func_glViewport(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glTransferArrayYAGL(struct yagl_transport *t)
 {
-    GLint x = yagl_marshal_get_GLint(out_buff);
-    GLint y = yagl_marshal_get_GLint(out_buff);
-    GLsizei width = yagl_marshal_get_GLsizei(out_buff);
-    GLsizei height = yagl_marshal_get_GLsizei(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT4(glViewport, GLint, GLint, GLsizei, GLsizei, x, y, width, height);
-    bool res = yagl_host_glViewport(x, y, width, height);
+    GLuint indx;
+    GLint first;
+    const GLvoid *data;
+    int32_t data_count;
+    indx = yagl_transport_get_out_GLuint(t);
+    first = yagl_transport_get_out_GLint(t);
+    if (!yagl_transport_get_out_array(t, 1, (const void**)&data, &data_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT3(glTransferArrayYAGL, GLuint, GLint, void*, indx, first, data);
+    (void)yagl_host_glTransferArrayYAGL(indx, first, data, data_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glGetExtensionStringYAGL dispatcher. id = 76
+ * glDrawElementsIndicesYAGL dispatcher. id = 76
  */
-static bool yagl_func_glGetExtensionStringYAGL(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glDrawElementsIndicesYAGL(struct yagl_transport *t)
 {
-    target_ulong str = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT1(glGetExtensionStringYAGL, target_ulong, str);
-    GLuint retval;
-    bool res = yagl_host_glGetExtensionStringYAGL(&retval, str);
-    if (!res) {
-        YAGL_LOG_FUNC_EXIT(NULL);
+    GLenum mode;
+    GLenum type;
+    const GLvoid *indices;
+    int32_t indices_count;
+    mode = yagl_transport_get_out_GLenum(t);
+    type = yagl_transport_get_out_GLenum(t);
+    if (!yagl_transport_get_out_array(t, 1, (const void**)&indices, &indices_count)) {
         return false;
     }
-    YAGL_LOG_FUNC_EXIT_SPLIT(GLuint, retval);
-    yagl_marshal_put_GLuint(&in_buff, retval);
+    YAGL_LOG_FUNC_ENTER_SPLIT3(glDrawElementsIndicesYAGL, GLenum, GLenum, void*, mode, type, indices);
+    (void)yagl_host_glDrawElementsIndicesYAGL(mode, type, indices, indices_count);
+    YAGL_LOG_FUNC_EXIT(NULL);
+
     return true;
 }
 
 /*
- * glGetVertexAttribRangeYAGL dispatcher. id = 77
+ * glDrawElementsOffsetYAGL dispatcher. id = 77
  */
-static bool yagl_func_glGetVertexAttribRangeYAGL(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glDrawElementsOffsetYAGL(struct yagl_transport *t)
 {
-    GLsizei count = yagl_marshal_get_GLsizei(out_buff);
-    GLenum type = yagl_marshal_get_GLenum(out_buff);
-    target_ulong indices = yagl_marshal_get_ptr(out_buff);
-    target_ulong range_first = yagl_marshal_get_ptr(out_buff);
-    target_ulong range_count = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT5(glGetVertexAttribRangeYAGL, GLsizei, GLenum, target_ulong, target_ulong, target_ulong, count, type, indices, range_first, range_count);
-    bool res = yagl_host_glGetVertexAttribRangeYAGL(count, type, indices, range_first, range_count);
+    GLenum mode;
+    GLenum type;
+    GLsizei offset;
+    GLsizei count;
+    mode = yagl_transport_get_out_GLenum(t);
+    type = yagl_transport_get_out_GLenum(t);
+    offset = yagl_transport_get_out_GLsizei(t);
+    count = yagl_transport_get_out_GLsizei(t);
+    YAGL_LOG_FUNC_ENTER_SPLIT4(glDrawElementsOffsetYAGL, GLenum, GLenum, GLsizei, GLsizei, mode, type, offset, count);
+    (void)yagl_host_glDrawElementsOffsetYAGL(mode, type, offset, count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
+}
+
+/*
+ * glGetExtensionStringYAGL dispatcher. id = 78
+ */
+static bool yagl_func_glGetExtensionStringYAGL(struct yagl_transport *t)
+{
+    GLchar *str;
+    int32_t str_maxcount;
+    int32_t *str_count;
+    if (!yagl_transport_get_in_array(t, sizeof(GLchar), (void**)&str, &str_maxcount, &str_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT1(glGetExtensionStringYAGL, void*, str);
+    *str_count = 0;
+    (void)yagl_host_glGetExtensionStringYAGL(str, str_maxcount, str_count);
+    YAGL_LOG_FUNC_EXIT(NULL);
+
+    return true;
 }
 
 /*
- * glAttachShader dispatcher. id = 78
+ * glGetVertexAttribRangeYAGL dispatcher. id = 79
  */
-static bool yagl_func_glAttachShader(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glGetVertexAttribRangeYAGL(struct yagl_transport *t)
 {
-    GLuint program = yagl_marshal_get_GLuint(out_buff);
-    GLuint shader = yagl_marshal_get_GLuint(out_buff);
+    GLenum type;
+    GLsizei offset;
+    GLsizei count;
+    GLint *range_first;
+    GLsizei *range_count;
+    type = yagl_transport_get_out_GLenum(t);
+    offset = yagl_transport_get_out_GLsizei(t);
+    count = yagl_transport_get_out_GLsizei(t);
+    yagl_transport_get_in_arg(t, (void**)&range_first);
+    yagl_transport_get_in_arg(t, (void**)&range_count);
+    YAGL_LOG_FUNC_ENTER_SPLIT5(glGetVertexAttribRangeYAGL, GLenum, GLsizei, GLsizei, void*, void*, type, offset, count, range_first, range_count);
+    (void)yagl_host_glGetVertexAttribRangeYAGL(type, offset, count, range_first, range_count);
+    YAGL_LOG_FUNC_EXIT(NULL);
+
+    return true;
+}
+
+/*
+ * glAttachShader dispatcher. id = 80
+ */
+static bool yagl_func_glAttachShader(struct yagl_transport *t)
+{
+    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);
-    bool res = yagl_host_glAttachShader(program, shader);
+    (void)yagl_host_glAttachShader(program, shader);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glBindAttribLocation dispatcher. id = 79
+ * glBindAttribLocation dispatcher. id = 81
  */
-static bool yagl_func_glBindAttribLocation(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glBindAttribLocation(struct yagl_transport *t)
 {
-    GLuint program = yagl_marshal_get_GLuint(out_buff);
-    GLuint index = yagl_marshal_get_GLuint(out_buff);
-    target_ulong name = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT3(glBindAttribLocation, GLuint, GLuint, target_ulong, program, index, name);
-    bool res = yagl_host_glBindAttribLocation(program, index, name);
+    GLuint program;
+    GLuint index;
+    const GLchar *name;
+    int32_t name_count;
+    program = yagl_transport_get_out_GLuint(t);
+    index = yagl_transport_get_out_GLuint(t);
+    if (!yagl_transport_get_out_array(t, sizeof(GLchar), (const void**)&name, &name_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT3(glBindAttribLocation, GLuint, GLuint, void*, program, index, name);
+    (void)yagl_host_glBindAttribLocation(program, index, name, name_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glBlendColor dispatcher. id = 80
+ * glBlendColor dispatcher. id = 82
  */
-static bool yagl_func_glBlendColor(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glBlendColor(struct yagl_transport *t)
 {
-    GLclampf red = yagl_marshal_get_GLclampf(out_buff);
-    GLclampf green = yagl_marshal_get_GLclampf(out_buff);
-    GLclampf blue = yagl_marshal_get_GLclampf(out_buff);
-    GLclampf alpha = yagl_marshal_get_GLclampf(out_buff);
+    GLclampf red;
+    GLclampf green;
+    GLclampf blue;
+    GLclampf alpha;
+    red = yagl_transport_get_out_GLclampf(t);
+    green = yagl_transport_get_out_GLclampf(t);
+    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);
-    bool res = yagl_host_glBlendColor(red, green, blue, alpha);
+    (void)yagl_host_glBlendColor(red, green, blue, alpha);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glCompileShader dispatcher. id = 81
+ * glCompileShader dispatcher. id = 83
  */
-static bool yagl_func_glCompileShader(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glCompileShader(struct yagl_transport *t)
 {
-    GLuint shader = yagl_marshal_get_GLuint(out_buff);
+    GLuint shader;
+    shader = yagl_transport_get_out_GLuint(t);
     YAGL_LOG_FUNC_ENTER_SPLIT1(glCompileShader, GLuint, shader);
-    bool res = yagl_host_glCompileShader(shader);
+    (void)yagl_host_glCompileShader(shader);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glCreateProgram dispatcher. id = 82
+ * glCreateProgram dispatcher. id = 84
  */
-static bool yagl_func_glCreateProgram(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glCreateProgram(struct yagl_transport *t)
 {
+    GLuint *retval;
+    yagl_transport_get_in_arg(t, (void**)&retval);
     YAGL_LOG_FUNC_ENTER_SPLIT0(glCreateProgram);
-    GLuint retval;
-    bool res = yagl_host_glCreateProgram(&retval);
-    if (!res) {
-        YAGL_LOG_FUNC_EXIT(NULL);
-        return false;
-    }
-    YAGL_LOG_FUNC_EXIT_SPLIT(GLuint, retval);
-    yagl_marshal_put_GLuint(&in_buff, retval);
+    *retval = yagl_host_glCreateProgram();
+    YAGL_LOG_FUNC_EXIT_SPLIT(GLuint, *retval);
+
     return true;
 }
 
 /*
- * glCreateShader dispatcher. id = 83
+ * glCreateShader dispatcher. id = 85
  */
-static bool yagl_func_glCreateShader(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glCreateShader(struct yagl_transport *t)
 {
-    GLenum type = yagl_marshal_get_GLenum(out_buff);
+    GLenum type;
+    GLuint *retval;
+    type = yagl_transport_get_out_GLenum(t);
+    yagl_transport_get_in_arg(t, (void**)&retval);
     YAGL_LOG_FUNC_ENTER_SPLIT1(glCreateShader, GLenum, type);
-    GLuint retval;
-    bool res = yagl_host_glCreateShader(&retval, type);
-    if (!res) {
-        YAGL_LOG_FUNC_EXIT(NULL);
-        return false;
-    }
-    YAGL_LOG_FUNC_EXIT_SPLIT(GLuint, retval);
-    yagl_marshal_put_GLuint(&in_buff, retval);
+    *retval = yagl_host_glCreateShader(type);
+    YAGL_LOG_FUNC_EXIT_SPLIT(GLuint, *retval);
+
     return true;
 }
 
 /*
- * glDeleteProgram dispatcher. id = 84
+ * glDeleteProgram dispatcher. id = 86
  */
-static bool yagl_func_glDeleteProgram(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glDeleteProgram(struct yagl_transport *t)
 {
-    GLuint program = yagl_marshal_get_GLuint(out_buff);
+    GLuint program;
+    program = yagl_transport_get_out_GLuint(t);
     YAGL_LOG_FUNC_ENTER_SPLIT1(glDeleteProgram, GLuint, program);
-    bool res = yagl_host_glDeleteProgram(program);
+    (void)yagl_host_glDeleteProgram(program);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glDeleteShader dispatcher. id = 85
+ * glDeleteShader dispatcher. id = 87
  */
-static bool yagl_func_glDeleteShader(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glDeleteShader(struct yagl_transport *t)
 {
-    GLuint shader = yagl_marshal_get_GLuint(out_buff);
+    GLuint shader;
+    shader = yagl_transport_get_out_GLuint(t);
     YAGL_LOG_FUNC_ENTER_SPLIT1(glDeleteShader, GLuint, shader);
-    bool res = yagl_host_glDeleteShader(shader);
+    (void)yagl_host_glDeleteShader(shader);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glDetachShader dispatcher. id = 86
+ * glDetachShader dispatcher. id = 88
  */
-static bool yagl_func_glDetachShader(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glDetachShader(struct yagl_transport *t)
 {
-    GLuint program = yagl_marshal_get_GLuint(out_buff);
-    GLuint shader = yagl_marshal_get_GLuint(out_buff);
+    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);
-    bool res = yagl_host_glDetachShader(program, shader);
+    (void)yagl_host_glDetachShader(program, shader);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glDisableVertexAttribArray dispatcher. id = 87
+ * glDisableVertexAttribArray dispatcher. id = 89
  */
-static bool yagl_func_glDisableVertexAttribArray(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glDisableVertexAttribArray(struct yagl_transport *t)
 {
-    GLuint index = yagl_marshal_get_GLuint(out_buff);
+    GLuint index;
+    index = yagl_transport_get_out_GLuint(t);
     YAGL_LOG_FUNC_ENTER_SPLIT1(glDisableVertexAttribArray, GLuint, index);
-    bool res = yagl_host_glDisableVertexAttribArray(index);
+    (void)yagl_host_glDisableVertexAttribArray(index);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glEnableVertexAttribArray dispatcher. id = 88
+ * glEnableVertexAttribArray dispatcher. id = 90
  */
-static bool yagl_func_glEnableVertexAttribArray(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glEnableVertexAttribArray(struct yagl_transport *t)
 {
-    GLuint index = yagl_marshal_get_GLuint(out_buff);
+    GLuint index;
+    index = yagl_transport_get_out_GLuint(t);
     YAGL_LOG_FUNC_ENTER_SPLIT1(glEnableVertexAttribArray, GLuint, index);
-    bool res = yagl_host_glEnableVertexAttribArray(index);
+    (void)yagl_host_glEnableVertexAttribArray(index);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glGetActiveAttrib dispatcher. id = 89
+ * glGetActiveAttrib dispatcher. id = 91
  */
-static bool yagl_func_glGetActiveAttrib(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glGetActiveAttrib(struct yagl_transport *t)
 {
-    GLuint program = yagl_marshal_get_GLuint(out_buff);
-    GLuint index = yagl_marshal_get_GLuint(out_buff);
-    GLsizei bufsize = yagl_marshal_get_GLsizei(out_buff);
-    target_ulong length = yagl_marshal_get_ptr(out_buff);
-    target_ulong size = yagl_marshal_get_ptr(out_buff);
-    target_ulong type = yagl_marshal_get_ptr(out_buff);
-    target_ulong name = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT7(glGetActiveAttrib, GLuint, GLuint, GLsizei, target_ulong, target_ulong, target_ulong, target_ulong, program, index, bufsize, length, size, type, name);
-    bool res = yagl_host_glGetActiveAttrib(program, index, bufsize, length, size, type, name);
+    GLuint program;
+    GLuint index;
+    GLint *size;
+    GLenum *type;
+    GLchar *name;
+    int32_t name_maxcount;
+    int32_t *name_count;
+    program = yagl_transport_get_out_GLuint(t);
+    index = yagl_transport_get_out_GLuint(t);
+    yagl_transport_get_in_arg(t, (void**)&size);
+    yagl_transport_get_in_arg(t, (void**)&type);
+    if (!yagl_transport_get_in_array(t, sizeof(GLchar), (void**)&name, &name_maxcount, &name_count)) {
+        return false;
+    }
+    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);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glGetActiveUniform dispatcher. id = 90
+ * glGetActiveUniform dispatcher. id = 92
  */
-static bool yagl_func_glGetActiveUniform(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glGetActiveUniform(struct yagl_transport *t)
 {
-    GLuint program = yagl_marshal_get_GLuint(out_buff);
-    GLuint index = yagl_marshal_get_GLuint(out_buff);
-    GLsizei bufsize = yagl_marshal_get_GLsizei(out_buff);
-    target_ulong length = yagl_marshal_get_ptr(out_buff);
-    target_ulong size = yagl_marshal_get_ptr(out_buff);
-    target_ulong type = yagl_marshal_get_ptr(out_buff);
-    target_ulong name = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT7(glGetActiveUniform, GLuint, GLuint, GLsizei, target_ulong, target_ulong, target_ulong, target_ulong, program, index, bufsize, length, size, type, name);
-    bool res = yagl_host_glGetActiveUniform(program, index, bufsize, length, size, type, name);
+    GLuint program;
+    GLuint index;
+    GLint *size;
+    GLenum *type;
+    GLchar *name;
+    int32_t name_maxcount;
+    int32_t *name_count;
+    program = yagl_transport_get_out_GLuint(t);
+    index = yagl_transport_get_out_GLuint(t);
+    yagl_transport_get_in_arg(t, (void**)&size);
+    yagl_transport_get_in_arg(t, (void**)&type);
+    if (!yagl_transport_get_in_array(t, sizeof(GLchar), (void**)&name, &name_maxcount, &name_count)) {
+        return false;
+    }
+    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);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glGetAttachedShaders dispatcher. id = 91
+ * glGetAttachedShaders dispatcher. id = 93
  */
-static bool yagl_func_glGetAttachedShaders(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glGetAttachedShaders(struct yagl_transport *t)
 {
-    GLuint program = yagl_marshal_get_GLuint(out_buff);
-    GLsizei maxcount = yagl_marshal_get_GLsizei(out_buff);
-    target_ulong count = yagl_marshal_get_ptr(out_buff);
-    target_ulong shaders = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT4(glGetAttachedShaders, GLuint, GLsizei, target_ulong, target_ulong, program, maxcount, count, shaders);
-    bool res = yagl_host_glGetAttachedShaders(program, maxcount, count, shaders);
+    GLuint program;
+    GLuint *shaders;
+    int32_t shaders_maxcount;
+    int32_t *shaders_count;
+    program = yagl_transport_get_out_GLuint(t);
+    if (!yagl_transport_get_in_array(t, sizeof(GLuint), (void**)&shaders, &shaders_maxcount, &shaders_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT2(glGetAttachedShaders, GLuint, void*, program, shaders);
+    *shaders_count = 0;
+    (void)yagl_host_glGetAttachedShaders(program, shaders, shaders_maxcount, shaders_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glGetAttribLocation dispatcher. id = 92
+ * glGetAttribLocation dispatcher. id = 94
  */
-static bool yagl_func_glGetAttribLocation(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glGetAttribLocation(struct yagl_transport *t)
 {
-    GLuint program = yagl_marshal_get_GLuint(out_buff);
-    target_ulong name = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT2(glGetAttribLocation, GLuint, target_ulong, program, name);
-    int retval;
-    bool res = yagl_host_glGetAttribLocation(&retval, program, name);
-    if (!res) {
-        YAGL_LOG_FUNC_EXIT(NULL);
+    GLuint program;
+    const GLchar *name;
+    int32_t name_count;
+    int *retval;
+    program = yagl_transport_get_out_GLuint(t);
+    if (!yagl_transport_get_out_array(t, sizeof(GLchar), (const void**)&name, &name_count)) {
         return false;
     }
-    YAGL_LOG_FUNC_EXIT_SPLIT(int, retval);
-    yagl_marshal_put_int(&in_buff, retval);
+    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);
+    YAGL_LOG_FUNC_EXIT_SPLIT(int, *retval);
+
     return true;
 }
 
 /*
- * glGetProgramiv dispatcher. id = 93
+ * glGetProgramiv dispatcher. id = 95
  */
-static bool yagl_func_glGetProgramiv(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glGetProgramiv(struct yagl_transport *t)
 {
-    GLuint program = yagl_marshal_get_GLuint(out_buff);
-    GLenum pname = yagl_marshal_get_GLenum(out_buff);
-    target_ulong params = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT3(glGetProgramiv, GLuint, GLenum, target_ulong, program, pname, params);
-    bool res = yagl_host_glGetProgramiv(program, pname, params);
+    GLuint program;
+    GLenum pname;
+    GLint *param;
+    program = yagl_transport_get_out_GLuint(t);
+    pname = yagl_transport_get_out_GLenum(t);
+    yagl_transport_get_in_arg(t, (void**)&param);
+    YAGL_LOG_FUNC_ENTER_SPLIT3(glGetProgramiv, GLuint, GLenum, void*, program, pname, param);
+    (void)yagl_host_glGetProgramiv(program, pname, param);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glGetProgramInfoLog dispatcher. id = 94
+ * glGetProgramInfoLog dispatcher. id = 96
  */
-static bool yagl_func_glGetProgramInfoLog(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glGetProgramInfoLog(struct yagl_transport *t)
 {
-    GLuint program = yagl_marshal_get_GLuint(out_buff);
-    GLsizei bufsize = yagl_marshal_get_GLsizei(out_buff);
-    target_ulong length = yagl_marshal_get_ptr(out_buff);
-    target_ulong infolog = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT4(glGetProgramInfoLog, GLuint, GLsizei, target_ulong, target_ulong, program, bufsize, length, infolog);
-    bool res = yagl_host_glGetProgramInfoLog(program, bufsize, length, infolog);
+    GLuint program;
+    GLchar *infolog;
+    int32_t infolog_maxcount;
+    int32_t *infolog_count;
+    program = yagl_transport_get_out_GLuint(t);
+    if (!yagl_transport_get_in_array(t, sizeof(GLchar), (void**)&infolog, &infolog_maxcount, &infolog_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT2(glGetProgramInfoLog, GLuint, void*, program, infolog);
+    *infolog_count = 0;
+    (void)yagl_host_glGetProgramInfoLog(program, infolog, infolog_maxcount, infolog_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glGetShaderiv dispatcher. id = 95
+ * glGetShaderiv dispatcher. id = 97
  */
-static bool yagl_func_glGetShaderiv(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glGetShaderiv(struct yagl_transport *t)
 {
-    GLuint shader = yagl_marshal_get_GLuint(out_buff);
-    GLenum pname = yagl_marshal_get_GLenum(out_buff);
-    target_ulong params = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT3(glGetShaderiv, GLuint, GLenum, target_ulong, shader, pname, params);
-    bool res = yagl_host_glGetShaderiv(shader, pname, params);
+    GLuint shader;
+    GLenum pname;
+    GLint *param;
+    shader = yagl_transport_get_out_GLuint(t);
+    pname = yagl_transport_get_out_GLenum(t);
+    yagl_transport_get_in_arg(t, (void**)&param);
+    YAGL_LOG_FUNC_ENTER_SPLIT3(glGetShaderiv, GLuint, GLenum, void*, shader, pname, param);
+    (void)yagl_host_glGetShaderiv(shader, pname, param);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glGetShaderInfoLog dispatcher. id = 96
+ * glGetShaderInfoLog dispatcher. id = 98
  */
-static bool yagl_func_glGetShaderInfoLog(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glGetShaderInfoLog(struct yagl_transport *t)
 {
-    GLuint shader = yagl_marshal_get_GLuint(out_buff);
-    GLsizei bufsize = yagl_marshal_get_GLsizei(out_buff);
-    target_ulong length = yagl_marshal_get_ptr(out_buff);
-    target_ulong infolog = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT4(glGetShaderInfoLog, GLuint, GLsizei, target_ulong, target_ulong, shader, bufsize, length, infolog);
-    bool res = yagl_host_glGetShaderInfoLog(shader, bufsize, length, infolog);
+    GLuint shader;
+    GLchar *infolog;
+    int32_t infolog_maxcount;
+    int32_t *infolog_count;
+    shader = yagl_transport_get_out_GLuint(t);
+    if (!yagl_transport_get_in_array(t, sizeof(GLchar), (void**)&infolog, &infolog_maxcount, &infolog_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT2(glGetShaderInfoLog, GLuint, void*, shader, infolog);
+    *infolog_count = 0;
+    (void)yagl_host_glGetShaderInfoLog(shader, infolog, infolog_maxcount, infolog_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glGetShaderPrecisionFormat dispatcher. id = 97
+ * glGetShaderPrecisionFormat dispatcher. id = 99
  */
-static bool yagl_func_glGetShaderPrecisionFormat(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glGetShaderPrecisionFormat(struct yagl_transport *t)
 {
-    GLenum shadertype = yagl_marshal_get_GLenum(out_buff);
-    GLenum precisiontype = yagl_marshal_get_GLenum(out_buff);
-    target_ulong range = yagl_marshal_get_ptr(out_buff);
-    target_ulong precision = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT4(glGetShaderPrecisionFormat, GLenum, GLenum, target_ulong, target_ulong, shadertype, precisiontype, range, precision);
-    bool res = yagl_host_glGetShaderPrecisionFormat(shadertype, precisiontype, range, precision);
+    GLenum shadertype;
+    GLenum precisiontype;
+    GLint *range;
+    int32_t range_maxcount;
+    int32_t *range_count;
+    GLint *precision;
+    shadertype = yagl_transport_get_out_GLenum(t);
+    precisiontype = yagl_transport_get_out_GLenum(t);
+    if (!yagl_transport_get_in_array(t, sizeof(GLint), (void**)&range, &range_maxcount, &range_count)) {
+        return false;
+    }
+    yagl_transport_get_in_arg(t, (void**)&precision);
+    YAGL_LOG_FUNC_ENTER_SPLIT4(glGetShaderPrecisionFormat, GLenum, GLenum, void*, void*, shadertype, precisiontype, range, precision);
+    *range_count = 0;
+    (void)yagl_host_glGetShaderPrecisionFormat(shadertype, precisiontype, range, range_maxcount, range_count, precision);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glGetShaderSource dispatcher. id = 98
+ * glGetShaderSource dispatcher. id = 100
  */
-static bool yagl_func_glGetShaderSource(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glGetShaderSource(struct yagl_transport *t)
 {
-    GLuint shader = yagl_marshal_get_GLuint(out_buff);
-    GLsizei bufsize = yagl_marshal_get_GLsizei(out_buff);
-    target_ulong length = yagl_marshal_get_ptr(out_buff);
-    target_ulong source = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT4(glGetShaderSource, GLuint, GLsizei, target_ulong, target_ulong, shader, bufsize, length, source);
-    bool res = yagl_host_glGetShaderSource(shader, bufsize, length, source);
+    GLuint shader;
+    GLchar *source;
+    int32_t source_maxcount;
+    int32_t *source_count;
+    shader = yagl_transport_get_out_GLuint(t);
+    if (!yagl_transport_get_in_array(t, sizeof(GLchar), (void**)&source, &source_maxcount, &source_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT2(glGetShaderSource, GLuint, void*, shader, source);
+    *source_count = 0;
+    (void)yagl_host_glGetShaderSource(shader, source, source_maxcount, source_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glGetUniformfv dispatcher. id = 99
+ * glGetUniformfv dispatcher. id = 101
  */
-static bool yagl_func_glGetUniformfv(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glGetUniformfv(struct yagl_transport *t)
 {
-    GLuint program = yagl_marshal_get_GLuint(out_buff);
-    GLint location = yagl_marshal_get_GLint(out_buff);
-    target_ulong params = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT3(glGetUniformfv, GLuint, GLint, target_ulong, program, location, params);
-    bool res = yagl_host_glGetUniformfv(program, location, params);
+    GLuint program;
+    GLint location;
+    GLfloat *params;
+    int32_t params_maxcount;
+    int32_t *params_count;
+    program = yagl_transport_get_out_GLuint(t);
+    location = yagl_transport_get_out_GLint(t);
+    if (!yagl_transport_get_in_array(t, sizeof(GLfloat), (void**)&params, &params_maxcount, &params_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT3(glGetUniformfv, GLuint, GLint, void*, program, location, params);
+    *params_count = 0;
+    (void)yagl_host_glGetUniformfv(program, location, params, params_maxcount, params_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glGetUniformiv dispatcher. id = 100
+ * glGetUniformiv dispatcher. id = 102
  */
-static bool yagl_func_glGetUniformiv(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glGetUniformiv(struct yagl_transport *t)
 {
-    GLuint program = yagl_marshal_get_GLuint(out_buff);
-    GLint location = yagl_marshal_get_GLint(out_buff);
-    target_ulong params = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT3(glGetUniformiv, GLuint, GLint, target_ulong, program, location, params);
-    bool res = yagl_host_glGetUniformiv(program, location, params);
+    GLuint program;
+    GLint location;
+    GLint *params;
+    int32_t params_maxcount;
+    int32_t *params_count;
+    program = yagl_transport_get_out_GLuint(t);
+    location = yagl_transport_get_out_GLint(t);
+    if (!yagl_transport_get_in_array(t, sizeof(GLint), (void**)&params, &params_maxcount, &params_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT3(glGetUniformiv, GLuint, GLint, void*, program, location, params);
+    *params_count = 0;
+    (void)yagl_host_glGetUniformiv(program, location, params, params_maxcount, params_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glGetUniformLocation dispatcher. id = 101
+ * glGetUniformLocation dispatcher. id = 103
  */
-static bool yagl_func_glGetUniformLocation(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glGetUniformLocation(struct yagl_transport *t)
 {
-    GLuint program = yagl_marshal_get_GLuint(out_buff);
-    target_ulong name = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT2(glGetUniformLocation, GLuint, target_ulong, program, name);
-    int retval;
-    bool res = yagl_host_glGetUniformLocation(&retval, program, name);
-    if (!res) {
-        YAGL_LOG_FUNC_EXIT(NULL);
+    GLuint program;
+    const GLchar *name;
+    int32_t name_count;
+    int *retval;
+    program = yagl_transport_get_out_GLuint(t);
+    if (!yagl_transport_get_out_array(t, sizeof(GLchar), (const void**)&name, &name_count)) {
         return false;
     }
-    YAGL_LOG_FUNC_EXIT_SPLIT(int, retval);
-    yagl_marshal_put_int(&in_buff, retval);
+    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);
+    YAGL_LOG_FUNC_EXIT_SPLIT(int, *retval);
+
     return true;
 }
 
 /*
- * glGetVertexAttribfv dispatcher. id = 102
+ * glGetVertexAttribfv dispatcher. id = 104
  */
-static bool yagl_func_glGetVertexAttribfv(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glGetVertexAttribfv(struct yagl_transport *t)
 {
-    GLuint index = yagl_marshal_get_GLuint(out_buff);
-    GLenum pname = yagl_marshal_get_GLenum(out_buff);
-    target_ulong params = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT3(glGetVertexAttribfv, GLuint, GLenum, target_ulong, index, pname, params);
-    bool res = yagl_host_glGetVertexAttribfv(index, pname, params);
+    GLuint index;
+    GLenum pname;
+    GLfloat *params;
+    int32_t params_maxcount;
+    int32_t *params_count;
+    index = yagl_transport_get_out_GLuint(t);
+    pname = yagl_transport_get_out_GLenum(t);
+    if (!yagl_transport_get_in_array(t, sizeof(GLfloat), (void**)&params, &params_maxcount, &params_count)) {
+        return false;
+    }
+    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);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glGetVertexAttribiv dispatcher. id = 103
+ * glGetVertexAttribiv dispatcher. id = 105
  */
-static bool yagl_func_glGetVertexAttribiv(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glGetVertexAttribiv(struct yagl_transport *t)
 {
-    GLuint index = yagl_marshal_get_GLuint(out_buff);
-    GLenum pname = yagl_marshal_get_GLenum(out_buff);
-    target_ulong params = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT3(glGetVertexAttribiv, GLuint, GLenum, target_ulong, index, pname, params);
-    bool res = yagl_host_glGetVertexAttribiv(index, pname, params);
+    GLuint index;
+    GLenum pname;
+    GLint *params;
+    int32_t params_maxcount;
+    int32_t *params_count;
+    index = yagl_transport_get_out_GLuint(t);
+    pname = yagl_transport_get_out_GLenum(t);
+    if (!yagl_transport_get_in_array(t, sizeof(GLint), (void**)&params, &params_maxcount, &params_count)) {
+        return false;
+    }
+    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);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glGetVertexAttribPointerv dispatcher. id = 104
+ * glGetVertexAttribPointerv dispatcher. id = 106
  */
-static bool yagl_func_glGetVertexAttribPointerv(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glGetVertexAttribPointerv(struct yagl_transport *t)
 {
-    GLuint index = yagl_marshal_get_GLuint(out_buff);
-    GLenum pname = yagl_marshal_get_GLenum(out_buff);
-    target_ulong pointer = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT3(glGetVertexAttribPointerv, GLuint, GLenum, target_ulong, index, pname, pointer);
-    bool res = yagl_host_glGetVertexAttribPointerv(index, pname, pointer);
+    GLuint index;
+    GLenum pname;
+    target_ulong *pointer;
+    index = yagl_transport_get_out_GLuint(t);
+    pname = yagl_transport_get_out_GLenum(t);
+    yagl_transport_get_in_arg(t, (void**)&pointer);
+    YAGL_LOG_FUNC_ENTER_SPLIT3(glGetVertexAttribPointerv, GLuint, GLenum, target_ulong*, index, pname, pointer);
+    (void)yagl_host_glGetVertexAttribPointerv(index, pname, pointer);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glIsProgram dispatcher. id = 105
+ * glIsProgram dispatcher. id = 107
  */
-static bool yagl_func_glIsProgram(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glIsProgram(struct yagl_transport *t)
 {
-    GLuint program = yagl_marshal_get_GLuint(out_buff);
+    GLuint program;
+    GLboolean *retval;
+    program = yagl_transport_get_out_GLuint(t);
+    yagl_transport_get_in_arg(t, (void**)&retval);
     YAGL_LOG_FUNC_ENTER_SPLIT1(glIsProgram, GLuint, program);
-    GLboolean retval;
-    bool res = yagl_host_glIsProgram(&retval, program);
-    if (!res) {
-        YAGL_LOG_FUNC_EXIT(NULL);
-        return false;
-    }
-    YAGL_LOG_FUNC_EXIT_SPLIT(GLboolean, retval);
-    yagl_marshal_put_GLboolean(&in_buff, retval);
+    *retval = yagl_host_glIsProgram(program);
+    YAGL_LOG_FUNC_EXIT_SPLIT(GLboolean, *retval);
+
     return true;
 }
 
 /*
- * glIsShader dispatcher. id = 106
+ * glIsShader dispatcher. id = 108
  */
-static bool yagl_func_glIsShader(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glIsShader(struct yagl_transport *t)
 {
-    GLuint shader = yagl_marshal_get_GLuint(out_buff);
+    GLuint shader;
+    GLboolean *retval;
+    shader = yagl_transport_get_out_GLuint(t);
+    yagl_transport_get_in_arg(t, (void**)&retval);
     YAGL_LOG_FUNC_ENTER_SPLIT1(glIsShader, GLuint, shader);
-    GLboolean retval;
-    bool res = yagl_host_glIsShader(&retval, shader);
-    if (!res) {
-        YAGL_LOG_FUNC_EXIT(NULL);
-        return false;
-    }
-    YAGL_LOG_FUNC_EXIT_SPLIT(GLboolean, retval);
-    yagl_marshal_put_GLboolean(&in_buff, retval);
+    *retval = yagl_host_glIsShader(shader);
+    YAGL_LOG_FUNC_EXIT_SPLIT(GLboolean, *retval);
+
     return true;
 }
 
 /*
- * glLinkProgram dispatcher. id = 107
+ * glLinkProgram dispatcher. id = 109
  */
-static bool yagl_func_glLinkProgram(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glLinkProgram(struct yagl_transport *t)
 {
-    GLuint program = yagl_marshal_get_GLuint(out_buff);
+    GLuint program;
+    program = yagl_transport_get_out_GLuint(t);
     YAGL_LOG_FUNC_ENTER_SPLIT1(glLinkProgram, GLuint, program);
-    bool res = yagl_host_glLinkProgram(program);
+    (void)yagl_host_glLinkProgram(program);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glReleaseShaderCompiler dispatcher. id = 108
+ * glReleaseShaderCompiler dispatcher. id = 110
  */
-static bool yagl_func_glReleaseShaderCompiler(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glReleaseShaderCompiler(struct yagl_transport *t)
 {
     YAGL_LOG_FUNC_ENTER_SPLIT0(glReleaseShaderCompiler);
-    bool res = yagl_host_glReleaseShaderCompiler();
+    (void)yagl_host_glReleaseShaderCompiler();
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glShaderBinary dispatcher. id = 109
+ * glShaderBinary dispatcher. id = 111
  */
-static bool yagl_func_glShaderBinary(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glShaderBinary(struct yagl_transport *t)
 {
-    GLsizei n = yagl_marshal_get_GLsizei(out_buff);
-    target_ulong shaders = yagl_marshal_get_ptr(out_buff);
-    GLenum binaryformat = yagl_marshal_get_GLenum(out_buff);
-    target_ulong binary = yagl_marshal_get_ptr(out_buff);
-    GLsizei length = yagl_marshal_get_GLsizei(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT5(glShaderBinary, GLsizei, target_ulong, GLenum, target_ulong, GLsizei, n, shaders, binaryformat, binary, length);
-    bool res = yagl_host_glShaderBinary(n, shaders, binaryformat, binary, length);
+    const GLuint *shaders;
+    int32_t shaders_count;
+    GLenum binaryformat;
+    const GLvoid *binary;
+    int32_t binary_count;
+    if (!yagl_transport_get_out_array(t, sizeof(GLuint), (const void**)&shaders, &shaders_count)) {
+        return false;
+    }
+    binaryformat = yagl_transport_get_out_GLenum(t);
+    if (!yagl_transport_get_out_array(t, 1, (const void**)&binary, &binary_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT3(glShaderBinary, void*, GLenum, void*, shaders, binaryformat, binary);
+    (void)yagl_host_glShaderBinary(shaders, shaders_count, binaryformat, binary, binary_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glShaderSource dispatcher. id = 110
+ * glShaderSource dispatcher. id = 112
  */
-static bool yagl_func_glShaderSource(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glShaderSource(struct yagl_transport *t)
 {
-    GLuint shader = yagl_marshal_get_GLuint(out_buff);
-    GLsizei count = yagl_marshal_get_GLsizei(out_buff);
-    target_ulong string = yagl_marshal_get_ptr(out_buff);
-    target_ulong length = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT4(glShaderSource, GLuint, GLsizei, target_ulong, target_ulong, shader, count, string, length);
-    bool res = yagl_host_glShaderSource(shader, count, string, length);
+    GLuint shader;
+    const GLchar *string;
+    int32_t string_count;
+    shader = yagl_transport_get_out_GLuint(t);
+    if (!yagl_transport_get_out_array(t, sizeof(GLchar), (const void**)&string, &string_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT2(glShaderSource, GLuint, void*, shader, string);
+    (void)yagl_host_glShaderSource(shader, string, string_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glStencilFuncSeparate dispatcher. id = 111
+ * glStencilFuncSeparate dispatcher. id = 113
  */
-static bool yagl_func_glStencilFuncSeparate(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glStencilFuncSeparate(struct yagl_transport *t)
 {
-    GLenum face = yagl_marshal_get_GLenum(out_buff);
-    GLenum func = yagl_marshal_get_GLenum(out_buff);
-    GLint ref = yagl_marshal_get_GLint(out_buff);
-    GLuint mask = yagl_marshal_get_GLuint(out_buff);
+    GLenum face;
+    GLenum func;
+    GLint ref;
+    GLuint mask;
+    face = yagl_transport_get_out_GLenum(t);
+    func = yagl_transport_get_out_GLenum(t);
+    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);
-    bool res = yagl_host_glStencilFuncSeparate(face, func, ref, mask);
+    (void)yagl_host_glStencilFuncSeparate(face, func, ref, mask);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glStencilMaskSeparate dispatcher. id = 112
+ * glStencilMaskSeparate dispatcher. id = 114
  */
-static bool yagl_func_glStencilMaskSeparate(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glStencilMaskSeparate(struct yagl_transport *t)
 {
-    GLenum face = yagl_marshal_get_GLenum(out_buff);
-    GLuint mask = yagl_marshal_get_GLuint(out_buff);
+    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);
-    bool res = yagl_host_glStencilMaskSeparate(face, mask);
+    (void)yagl_host_glStencilMaskSeparate(face, mask);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glStencilOpSeparate dispatcher. id = 113
+ * glStencilOpSeparate dispatcher. id = 115
  */
-static bool yagl_func_glStencilOpSeparate(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glStencilOpSeparate(struct yagl_transport *t)
 {
-    GLenum face = yagl_marshal_get_GLenum(out_buff);
-    GLenum fail = yagl_marshal_get_GLenum(out_buff);
-    GLenum zfail = yagl_marshal_get_GLenum(out_buff);
-    GLenum zpass = yagl_marshal_get_GLenum(out_buff);
+    GLenum face;
+    GLenum fail;
+    GLenum zfail;
+    GLenum zpass;
+    face = yagl_transport_get_out_GLenum(t);
+    fail = yagl_transport_get_out_GLenum(t);
+    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);
-    bool res = yagl_host_glStencilOpSeparate(face, fail, zfail, zpass);
+    (void)yagl_host_glStencilOpSeparate(face, fail, zfail, zpass);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glUniform1f dispatcher. id = 114
+ * glUniform1f dispatcher. id = 116
  */
-static bool yagl_func_glUniform1f(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glUniform1f(struct yagl_transport *t)
 {
-    GLint location = yagl_marshal_get_GLint(out_buff);
-    GLfloat x = yagl_marshal_get_GLfloat(out_buff);
+    GLint location;
+    GLfloat x;
+    location = yagl_transport_get_out_GLint(t);
+    x = yagl_transport_get_out_GLfloat(t);
     YAGL_LOG_FUNC_ENTER_SPLIT2(glUniform1f, GLint, GLfloat, location, x);
-    bool res = yagl_host_glUniform1f(location, x);
+    (void)yagl_host_glUniform1f(location, x);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glUniform1fv dispatcher. id = 115
+ * glUniform1fv dispatcher. id = 117
  */
-static bool yagl_func_glUniform1fv(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glUniform1fv(struct yagl_transport *t)
 {
-    GLint location = yagl_marshal_get_GLint(out_buff);
-    GLsizei count = yagl_marshal_get_GLsizei(out_buff);
-    target_ulong v = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT3(glUniform1fv, GLint, GLsizei, target_ulong, location, count, v);
-    bool res = yagl_host_glUniform1fv(location, count, v);
+    GLint location;
+    const GLfloat *v;
+    int32_t v_count;
+    location = yagl_transport_get_out_GLint(t);
+    if (!yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&v, &v_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT2(glUniform1fv, GLint, void*, location, v);
+    (void)yagl_host_glUniform1fv(location, v, v_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glUniform1i dispatcher. id = 116
+ * glUniform1i dispatcher. id = 118
  */
-static bool yagl_func_glUniform1i(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glUniform1i(struct yagl_transport *t)
 {
-    GLint location = yagl_marshal_get_GLint(out_buff);
-    GLint x = yagl_marshal_get_GLint(out_buff);
+    GLint location;
+    GLint x;
+    location = yagl_transport_get_out_GLint(t);
+    x = yagl_transport_get_out_GLint(t);
     YAGL_LOG_FUNC_ENTER_SPLIT2(glUniform1i, GLint, GLint, location, x);
-    bool res = yagl_host_glUniform1i(location, x);
+    (void)yagl_host_glUniform1i(location, x);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glUniform1iv dispatcher. id = 117
+ * glUniform1iv dispatcher. id = 119
  */
-static bool yagl_func_glUniform1iv(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glUniform1iv(struct yagl_transport *t)
 {
-    GLint location = yagl_marshal_get_GLint(out_buff);
-    GLsizei count = yagl_marshal_get_GLsizei(out_buff);
-    target_ulong v = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT3(glUniform1iv, GLint, GLsizei, target_ulong, location, count, v);
-    bool res = yagl_host_glUniform1iv(location, count, v);
+    GLint location;
+    const GLint *v;
+    int32_t v_count;
+    location = yagl_transport_get_out_GLint(t);
+    if (!yagl_transport_get_out_array(t, sizeof(GLint), (const void**)&v, &v_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT2(glUniform1iv, GLint, void*, location, v);
+    (void)yagl_host_glUniform1iv(location, v, v_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glUniform2f dispatcher. id = 118
+ * glUniform2f dispatcher. id = 120
  */
-static bool yagl_func_glUniform2f(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glUniform2f(struct yagl_transport *t)
 {
-    GLint location = yagl_marshal_get_GLint(out_buff);
-    GLfloat x = yagl_marshal_get_GLfloat(out_buff);
-    GLfloat y = yagl_marshal_get_GLfloat(out_buff);
+    GLint location;
+    GLfloat x;
+    GLfloat y;
+    location = yagl_transport_get_out_GLint(t);
+    x = yagl_transport_get_out_GLfloat(t);
+    y = yagl_transport_get_out_GLfloat(t);
     YAGL_LOG_FUNC_ENTER_SPLIT3(glUniform2f, GLint, GLfloat, GLfloat, location, x, y);
-    bool res = yagl_host_glUniform2f(location, x, y);
+    (void)yagl_host_glUniform2f(location, x, y);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glUniform2fv dispatcher. id = 119
+ * glUniform2fv dispatcher. id = 121
  */
-static bool yagl_func_glUniform2fv(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glUniform2fv(struct yagl_transport *t)
 {
-    GLint location = yagl_marshal_get_GLint(out_buff);
-    GLsizei count = yagl_marshal_get_GLsizei(out_buff);
-    target_ulong v = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT3(glUniform2fv, GLint, GLsizei, target_ulong, location, count, v);
-    bool res = yagl_host_glUniform2fv(location, count, v);
+    GLint location;
+    const GLfloat *v;
+    int32_t v_count;
+    location = yagl_transport_get_out_GLint(t);
+    if (!yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&v, &v_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT2(glUniform2fv, GLint, void*, location, v);
+    (void)yagl_host_glUniform2fv(location, v, v_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glUniform2i dispatcher. id = 120
+ * glUniform2i dispatcher. id = 122
  */
-static bool yagl_func_glUniform2i(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glUniform2i(struct yagl_transport *t)
 {
-    GLint location = yagl_marshal_get_GLint(out_buff);
-    GLint x = yagl_marshal_get_GLint(out_buff);
-    GLint y = yagl_marshal_get_GLint(out_buff);
+    GLint location;
+    GLint x;
+    GLint y;
+    location = yagl_transport_get_out_GLint(t);
+    x = yagl_transport_get_out_GLint(t);
+    y = yagl_transport_get_out_GLint(t);
     YAGL_LOG_FUNC_ENTER_SPLIT3(glUniform2i, GLint, GLint, GLint, location, x, y);
-    bool res = yagl_host_glUniform2i(location, x, y);
+    (void)yagl_host_glUniform2i(location, x, y);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glUniform2iv dispatcher. id = 121
+ * glUniform2iv dispatcher. id = 123
  */
-static bool yagl_func_glUniform2iv(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glUniform2iv(struct yagl_transport *t)
 {
-    GLint location = yagl_marshal_get_GLint(out_buff);
-    GLsizei count = yagl_marshal_get_GLsizei(out_buff);
-    target_ulong v = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT3(glUniform2iv, GLint, GLsizei, target_ulong, location, count, v);
-    bool res = yagl_host_glUniform2iv(location, count, v);
+    GLint location;
+    const GLint *v;
+    int32_t v_count;
+    location = yagl_transport_get_out_GLint(t);
+    if (!yagl_transport_get_out_array(t, sizeof(GLint), (const void**)&v, &v_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT2(glUniform2iv, GLint, void*, location, v);
+    (void)yagl_host_glUniform2iv(location, v, v_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glUniform3f dispatcher. id = 122
+ * glUniform3f dispatcher. id = 124
  */
-static bool yagl_func_glUniform3f(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glUniform3f(struct yagl_transport *t)
 {
-    GLint location = yagl_marshal_get_GLint(out_buff);
-    GLfloat x = yagl_marshal_get_GLfloat(out_buff);
-    GLfloat y = yagl_marshal_get_GLfloat(out_buff);
-    GLfloat z = yagl_marshal_get_GLfloat(out_buff);
+    GLint location;
+    GLfloat x;
+    GLfloat y;
+    GLfloat z;
+    location = yagl_transport_get_out_GLint(t);
+    x = yagl_transport_get_out_GLfloat(t);
+    y = yagl_transport_get_out_GLfloat(t);
+    z = yagl_transport_get_out_GLfloat(t);
     YAGL_LOG_FUNC_ENTER_SPLIT4(glUniform3f, GLint, GLfloat, GLfloat, GLfloat, location, x, y, z);
-    bool res = yagl_host_glUniform3f(location, x, y, z);
+    (void)yagl_host_glUniform3f(location, x, y, z);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glUniform3fv dispatcher. id = 123
+ * glUniform3fv dispatcher. id = 125
  */
-static bool yagl_func_glUniform3fv(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glUniform3fv(struct yagl_transport *t)
 {
-    GLint location = yagl_marshal_get_GLint(out_buff);
-    GLsizei count = yagl_marshal_get_GLsizei(out_buff);
-    target_ulong v = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT3(glUniform3fv, GLint, GLsizei, target_ulong, location, count, v);
-    bool res = yagl_host_glUniform3fv(location, count, v);
+    GLint location;
+    const GLfloat *v;
+    int32_t v_count;
+    location = yagl_transport_get_out_GLint(t);
+    if (!yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&v, &v_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT2(glUniform3fv, GLint, void*, location, v);
+    (void)yagl_host_glUniform3fv(location, v, v_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glUniform3i dispatcher. id = 124
+ * glUniform3i dispatcher. id = 126
  */
-static bool yagl_func_glUniform3i(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glUniform3i(struct yagl_transport *t)
 {
-    GLint location = yagl_marshal_get_GLint(out_buff);
-    GLint x = yagl_marshal_get_GLint(out_buff);
-    GLint y = yagl_marshal_get_GLint(out_buff);
-    GLint z = yagl_marshal_get_GLint(out_buff);
+    GLint location;
+    GLint x;
+    GLint y;
+    GLint z;
+    location = yagl_transport_get_out_GLint(t);
+    x = yagl_transport_get_out_GLint(t);
+    y = yagl_transport_get_out_GLint(t);
+    z = yagl_transport_get_out_GLint(t);
     YAGL_LOG_FUNC_ENTER_SPLIT4(glUniform3i, GLint, GLint, GLint, GLint, location, x, y, z);
-    bool res = yagl_host_glUniform3i(location, x, y, z);
+    (void)yagl_host_glUniform3i(location, x, y, z);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glUniform3iv dispatcher. id = 125
+ * glUniform3iv dispatcher. id = 127
  */
-static bool yagl_func_glUniform3iv(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glUniform3iv(struct yagl_transport *t)
 {
-    GLint location = yagl_marshal_get_GLint(out_buff);
-    GLsizei count = yagl_marshal_get_GLsizei(out_buff);
-    target_ulong v = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT3(glUniform3iv, GLint, GLsizei, target_ulong, location, count, v);
-    bool res = yagl_host_glUniform3iv(location, count, v);
+    GLint location;
+    const GLint *v;
+    int32_t v_count;
+    location = yagl_transport_get_out_GLint(t);
+    if (!yagl_transport_get_out_array(t, sizeof(GLint), (const void**)&v, &v_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT2(glUniform3iv, GLint, void*, location, v);
+    (void)yagl_host_glUniform3iv(location, v, v_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glUniform4f dispatcher. id = 126
+ * glUniform4f dispatcher. id = 128
  */
-static bool yagl_func_glUniform4f(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glUniform4f(struct yagl_transport *t)
 {
-    GLint location = yagl_marshal_get_GLint(out_buff);
-    GLfloat x = yagl_marshal_get_GLfloat(out_buff);
-    GLfloat y = yagl_marshal_get_GLfloat(out_buff);
-    GLfloat z = yagl_marshal_get_GLfloat(out_buff);
-    GLfloat w = yagl_marshal_get_GLfloat(out_buff);
+    GLint location;
+    GLfloat x;
+    GLfloat y;
+    GLfloat z;
+    GLfloat w;
+    location = yagl_transport_get_out_GLint(t);
+    x = yagl_transport_get_out_GLfloat(t);
+    y = yagl_transport_get_out_GLfloat(t);
+    z = yagl_transport_get_out_GLfloat(t);
+    w = yagl_transport_get_out_GLfloat(t);
     YAGL_LOG_FUNC_ENTER_SPLIT5(glUniform4f, GLint, GLfloat, GLfloat, GLfloat, GLfloat, location, x, y, z, w);
-    bool res = yagl_host_glUniform4f(location, x, y, z, w);
+    (void)yagl_host_glUniform4f(location, x, y, z, w);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glUniform4fv dispatcher. id = 127
+ * glUniform4fv dispatcher. id = 129
  */
-static bool yagl_func_glUniform4fv(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glUniform4fv(struct yagl_transport *t)
 {
-    GLint location = yagl_marshal_get_GLint(out_buff);
-    GLsizei count = yagl_marshal_get_GLsizei(out_buff);
-    target_ulong v = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT3(glUniform4fv, GLint, GLsizei, target_ulong, location, count, v);
-    bool res = yagl_host_glUniform4fv(location, count, v);
+    GLint location;
+    const GLfloat *v;
+    int32_t v_count;
+    location = yagl_transport_get_out_GLint(t);
+    if (!yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&v, &v_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT2(glUniform4fv, GLint, void*, location, v);
+    (void)yagl_host_glUniform4fv(location, v, v_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glUniform4i dispatcher. id = 128
+ * glUniform4i dispatcher. id = 130
  */
-static bool yagl_func_glUniform4i(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glUniform4i(struct yagl_transport *t)
 {
-    GLint location = yagl_marshal_get_GLint(out_buff);
-    GLint x = yagl_marshal_get_GLint(out_buff);
-    GLint y = yagl_marshal_get_GLint(out_buff);
-    GLint z = yagl_marshal_get_GLint(out_buff);
-    GLint w = yagl_marshal_get_GLint(out_buff);
+    GLint location;
+    GLint x;
+    GLint y;
+    GLint z;
+    GLint w;
+    location = yagl_transport_get_out_GLint(t);
+    x = yagl_transport_get_out_GLint(t);
+    y = yagl_transport_get_out_GLint(t);
+    z = yagl_transport_get_out_GLint(t);
+    w = yagl_transport_get_out_GLint(t);
     YAGL_LOG_FUNC_ENTER_SPLIT5(glUniform4i, GLint, GLint, GLint, GLint, GLint, location, x, y, z, w);
-    bool res = yagl_host_glUniform4i(location, x, y, z, w);
+    (void)yagl_host_glUniform4i(location, x, y, z, w);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glUniform4iv dispatcher. id = 129
+ * glUniform4iv dispatcher. id = 131
  */
-static bool yagl_func_glUniform4iv(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glUniform4iv(struct yagl_transport *t)
 {
-    GLint location = yagl_marshal_get_GLint(out_buff);
-    GLsizei count = yagl_marshal_get_GLsizei(out_buff);
-    target_ulong v = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT3(glUniform4iv, GLint, GLsizei, target_ulong, location, count, v);
-    bool res = yagl_host_glUniform4iv(location, count, v);
+    GLint location;
+    const GLint *v;
+    int32_t v_count;
+    location = yagl_transport_get_out_GLint(t);
+    if (!yagl_transport_get_out_array(t, sizeof(GLint), (const void**)&v, &v_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT2(glUniform4iv, GLint, void*, location, v);
+    (void)yagl_host_glUniform4iv(location, v, v_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glUniformMatrix2fv dispatcher. id = 130
+ * glUniformMatrix2fv dispatcher. id = 132
  */
-static bool yagl_func_glUniformMatrix2fv(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glUniformMatrix2fv(struct yagl_transport *t)
 {
-    GLint location = yagl_marshal_get_GLint(out_buff);
-    GLsizei count = yagl_marshal_get_GLsizei(out_buff);
-    GLboolean transpose = yagl_marshal_get_GLboolean(out_buff);
-    target_ulong value = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT4(glUniformMatrix2fv, GLint, GLsizei, GLboolean, target_ulong, location, count, transpose, value);
-    bool res = yagl_host_glUniformMatrix2fv(location, count, transpose, value);
+    GLint location;
+    GLboolean transpose;
+    const GLfloat *value;
+    int32_t value_count;
+    location = yagl_transport_get_out_GLint(t);
+    transpose = yagl_transport_get_out_GLboolean(t);
+    if (!yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&value, &value_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT3(glUniformMatrix2fv, GLint, GLboolean, void*, location, transpose, value);
+    (void)yagl_host_glUniformMatrix2fv(location, transpose, value, value_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glUniformMatrix3fv dispatcher. id = 131
+ * glUniformMatrix3fv dispatcher. id = 133
  */
-static bool yagl_func_glUniformMatrix3fv(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glUniformMatrix3fv(struct yagl_transport *t)
 {
-    GLint location = yagl_marshal_get_GLint(out_buff);
-    GLsizei count = yagl_marshal_get_GLsizei(out_buff);
-    GLboolean transpose = yagl_marshal_get_GLboolean(out_buff);
-    target_ulong value = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT4(glUniformMatrix3fv, GLint, GLsizei, GLboolean, target_ulong, location, count, transpose, value);
-    bool res = yagl_host_glUniformMatrix3fv(location, count, transpose, value);
+    GLint location;
+    GLboolean transpose;
+    const GLfloat *value;
+    int32_t value_count;
+    location = yagl_transport_get_out_GLint(t);
+    transpose = yagl_transport_get_out_GLboolean(t);
+    if (!yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&value, &value_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT3(glUniformMatrix3fv, GLint, GLboolean, void*, location, transpose, value);
+    (void)yagl_host_glUniformMatrix3fv(location, transpose, value, value_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glUniformMatrix4fv dispatcher. id = 132
+ * glUniformMatrix4fv dispatcher. id = 134
  */
-static bool yagl_func_glUniformMatrix4fv(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glUniformMatrix4fv(struct yagl_transport *t)
 {
-    GLint location = yagl_marshal_get_GLint(out_buff);
-    GLsizei count = yagl_marshal_get_GLsizei(out_buff);
-    GLboolean transpose = yagl_marshal_get_GLboolean(out_buff);
-    target_ulong value = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT4(glUniformMatrix4fv, GLint, GLsizei, GLboolean, target_ulong, location, count, transpose, value);
-    bool res = yagl_host_glUniformMatrix4fv(location, count, transpose, value);
+    GLint location;
+    GLboolean transpose;
+    const GLfloat *value;
+    int32_t value_count;
+    location = yagl_transport_get_out_GLint(t);
+    transpose = yagl_transport_get_out_GLboolean(t);
+    if (!yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&value, &value_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT3(glUniformMatrix4fv, GLint, GLboolean, void*, location, transpose, value);
+    (void)yagl_host_glUniformMatrix4fv(location, transpose, value, value_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glUseProgram dispatcher. id = 133
+ * glUseProgram dispatcher. id = 135
  */
-static bool yagl_func_glUseProgram(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glUseProgram(struct yagl_transport *t)
 {
-    GLuint program = yagl_marshal_get_GLuint(out_buff);
+    GLuint program;
+    program = yagl_transport_get_out_GLuint(t);
     YAGL_LOG_FUNC_ENTER_SPLIT1(glUseProgram, GLuint, program);
-    bool res = yagl_host_glUseProgram(program);
+    (void)yagl_host_glUseProgram(program);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glValidateProgram dispatcher. id = 134
+ * glValidateProgram dispatcher. id = 136
  */
-static bool yagl_func_glValidateProgram(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glValidateProgram(struct yagl_transport *t)
 {
-    GLuint program = yagl_marshal_get_GLuint(out_buff);
+    GLuint program;
+    program = yagl_transport_get_out_GLuint(t);
     YAGL_LOG_FUNC_ENTER_SPLIT1(glValidateProgram, GLuint, program);
-    bool res = yagl_host_glValidateProgram(program);
+    (void)yagl_host_glValidateProgram(program);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glVertexAttrib1f dispatcher. id = 135
+ * glVertexAttrib1f dispatcher. id = 137
  */
-static bool yagl_func_glVertexAttrib1f(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glVertexAttrib1f(struct yagl_transport *t)
 {
-    GLuint indx = yagl_marshal_get_GLuint(out_buff);
-    GLfloat x = yagl_marshal_get_GLfloat(out_buff);
+    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);
-    bool res = yagl_host_glVertexAttrib1f(indx, x);
+    (void)yagl_host_glVertexAttrib1f(indx, x);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glVertexAttrib1fv dispatcher. id = 136
+ * glVertexAttrib1fv dispatcher. id = 138
  */
-static bool yagl_func_glVertexAttrib1fv(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glVertexAttrib1fv(struct yagl_transport *t)
 {
-    GLuint indx = yagl_marshal_get_GLuint(out_buff);
-    target_ulong values = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT2(glVertexAttrib1fv, GLuint, target_ulong, indx, values);
-    bool res = yagl_host_glVertexAttrib1fv(indx, values);
+    GLuint indx;
+    const GLfloat *values;
+    int32_t values_count;
+    indx = yagl_transport_get_out_GLuint(t);
+    if (!yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&values, &values_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT2(glVertexAttrib1fv, GLuint, void*, indx, values);
+    (void)yagl_host_glVertexAttrib1fv(indx, values, values_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glVertexAttrib2f dispatcher. id = 137
+ * glVertexAttrib2f dispatcher. id = 139
  */
-static bool yagl_func_glVertexAttrib2f(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glVertexAttrib2f(struct yagl_transport *t)
 {
-    GLuint indx = yagl_marshal_get_GLuint(out_buff);
-    GLfloat x = yagl_marshal_get_GLfloat(out_buff);
-    GLfloat y = yagl_marshal_get_GLfloat(out_buff);
+    GLuint indx;
+    GLfloat x;
+    GLfloat y;
+    indx = yagl_transport_get_out_GLuint(t);
+    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);
-    bool res = yagl_host_glVertexAttrib2f(indx, x, y);
+    (void)yagl_host_glVertexAttrib2f(indx, x, y);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glVertexAttrib2fv dispatcher. id = 138
+ * glVertexAttrib2fv dispatcher. id = 140
  */
-static bool yagl_func_glVertexAttrib2fv(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glVertexAttrib2fv(struct yagl_transport *t)
 {
-    GLuint indx = yagl_marshal_get_GLuint(out_buff);
-    target_ulong values = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT2(glVertexAttrib2fv, GLuint, target_ulong, indx, values);
-    bool res = yagl_host_glVertexAttrib2fv(indx, values);
+    GLuint indx;
+    const GLfloat *values;
+    int32_t values_count;
+    indx = yagl_transport_get_out_GLuint(t);
+    if (!yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&values, &values_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT2(glVertexAttrib2fv, GLuint, void*, indx, values);
+    (void)yagl_host_glVertexAttrib2fv(indx, values, values_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glVertexAttrib3f dispatcher. id = 139
+ * glVertexAttrib3f dispatcher. id = 141
  */
-static bool yagl_func_glVertexAttrib3f(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glVertexAttrib3f(struct yagl_transport *t)
 {
-    GLuint indx = yagl_marshal_get_GLuint(out_buff);
-    GLfloat x = yagl_marshal_get_GLfloat(out_buff);
-    GLfloat y = yagl_marshal_get_GLfloat(out_buff);
-    GLfloat z = yagl_marshal_get_GLfloat(out_buff);
+    GLuint indx;
+    GLfloat x;
+    GLfloat y;
+    GLfloat z;
+    indx = yagl_transport_get_out_GLuint(t);
+    x = yagl_transport_get_out_GLfloat(t);
+    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);
-    bool res = yagl_host_glVertexAttrib3f(indx, x, y, z);
+    (void)yagl_host_glVertexAttrib3f(indx, x, y, z);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glVertexAttrib3fv dispatcher. id = 140
+ * glVertexAttrib3fv dispatcher. id = 142
  */
-static bool yagl_func_glVertexAttrib3fv(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glVertexAttrib3fv(struct yagl_transport *t)
 {
-    GLuint indx = yagl_marshal_get_GLuint(out_buff);
-    target_ulong values = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT2(glVertexAttrib3fv, GLuint, target_ulong, indx, values);
-    bool res = yagl_host_glVertexAttrib3fv(indx, values);
+    GLuint indx;
+    const GLfloat *values;
+    int32_t values_count;
+    indx = yagl_transport_get_out_GLuint(t);
+    if (!yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&values, &values_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT2(glVertexAttrib3fv, GLuint, void*, indx, values);
+    (void)yagl_host_glVertexAttrib3fv(indx, values, values_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glVertexAttrib4f dispatcher. id = 141
+ * glVertexAttrib4f dispatcher. id = 143
  */
-static bool yagl_func_glVertexAttrib4f(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glVertexAttrib4f(struct yagl_transport *t)
 {
-    GLuint indx = yagl_marshal_get_GLuint(out_buff);
-    GLfloat x = yagl_marshal_get_GLfloat(out_buff);
-    GLfloat y = yagl_marshal_get_GLfloat(out_buff);
-    GLfloat z = yagl_marshal_get_GLfloat(out_buff);
-    GLfloat w = yagl_marshal_get_GLfloat(out_buff);
+    GLuint indx;
+    GLfloat x;
+    GLfloat y;
+    GLfloat z;
+    GLfloat w;
+    indx = yagl_transport_get_out_GLuint(t);
+    x = yagl_transport_get_out_GLfloat(t);
+    y = yagl_transport_get_out_GLfloat(t);
+    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);
-    bool res = yagl_host_glVertexAttrib4f(indx, x, y, z, w);
+    (void)yagl_host_glVertexAttrib4f(indx, x, y, z, w);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glVertexAttrib4fv dispatcher. id = 142
+ * glVertexAttrib4fv dispatcher. id = 144
  */
-static bool yagl_func_glVertexAttrib4fv(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glVertexAttrib4fv(struct yagl_transport *t)
 {
-    GLuint indx = yagl_marshal_get_GLuint(out_buff);
-    target_ulong values = yagl_marshal_get_ptr(out_buff);
-    YAGL_LOG_FUNC_ENTER_SPLIT2(glVertexAttrib4fv, GLuint, target_ulong, indx, values);
-    bool res = yagl_host_glVertexAttrib4fv(indx, values);
+    GLuint indx;
+    const GLfloat *values;
+    int32_t values_count;
+    indx = yagl_transport_get_out_GLuint(t);
+    if (!yagl_transport_get_out_array(t, sizeof(GLfloat), (const void**)&values, &values_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT2(glVertexAttrib4fv, GLuint, void*, indx, values);
+    (void)yagl_host_glVertexAttrib4fv(indx, values, values_count);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
 /*
- * glVertexAttribPointer dispatcher. id = 143
+ * glVertexAttribPointer dispatcher. id = 145
  */
-static bool yagl_func_glVertexAttribPointer(uint8_t **out_buff,
-    uint8_t *in_buff)
+static bool yagl_func_glVertexAttribPointer(struct yagl_transport *t)
 {
-    GLuint indx = yagl_marshal_get_GLuint(out_buff);
-    GLint size = yagl_marshal_get_GLint(out_buff);
-    GLenum type = yagl_marshal_get_GLenum(out_buff);
-    GLboolean normalized = yagl_marshal_get_GLboolean(out_buff);
-    GLsizei stride = yagl_marshal_get_GLsizei(out_buff);
-    target_ulong ptr = yagl_marshal_get_ptr(out_buff);
+    GLuint indx;
+    GLint size;
+    GLenum type;
+    GLboolean normalized;
+    GLsizei stride;
+    target_ulong ptr;
+    indx = yagl_transport_get_out_GLuint(t);
+    size = yagl_transport_get_out_GLint(t);
+    type = yagl_transport_get_out_GLenum(t);
+    normalized = yagl_transport_get_out_GLboolean(t);
+    stride = yagl_transport_get_out_GLsizei(t);
+    ptr = yagl_transport_get_out_va(t);
     YAGL_LOG_FUNC_ENTER_SPLIT6(glVertexAttribPointer, GLuint, GLint, GLenum, GLboolean, GLsizei, target_ulong, indx, size, type, normalized, stride, ptr);
-    bool res = yagl_host_glVertexAttribPointer(indx, size, type, normalized, stride, ptr);
+    (void)yagl_host_glVertexAttribPointer(indx, size, type, normalized, stride, ptr);
     YAGL_LOG_FUNC_EXIT(NULL);
-    return res;
+
+    return true;
 }
 
-const uint32_t yagl_gles2_api_num_funcs = 143;
+const uint32_t yagl_gles2_api_num_funcs = 145;
 
 yagl_api_func yagl_gles2_api_funcs[] = {
     &yagl_func_glActiveTexture,
@@ -2246,7 +2755,6 @@ yagl_api_func yagl_gles2_api_funcs[] = {
     &yagl_func_glDepthRangef,
     &yagl_func_glDisable,
     &yagl_func_glDrawArrays,
-    &yagl_func_glDrawElements,
     &yagl_func_glEGLImageTargetTexture2DOES,
     &yagl_func_glEnable,
     &yagl_func_glFlush,
@@ -2290,6 +2798,9 @@ yagl_api_func yagl_gles2_api_funcs[] = {
     &yagl_func_glTexParameteriv,
     &yagl_func_glTexSubImage2D,
     &yagl_func_glViewport,
+    &yagl_func_glTransferArrayYAGL,
+    &yagl_func_glDrawElementsIndicesYAGL,
+    &yagl_func_glDrawElementsOffsetYAGL,
     &yagl_func_glGetExtensionStringYAGL,
     &yagl_func_glGetVertexAttribRangeYAGL,
     &yagl_func_glAttachShader,
@@ -2357,5 +2868,5 @@ yagl_api_func yagl_gles2_api_funcs[] = {
     &yagl_func_glVertexAttrib3fv,
     &yagl_func_glVertexAttrib4f,
     &yagl_func_glVertexAttrib4fv,
-    &yagl_func_glVertexAttribPointer
+    &yagl_func_glVertexAttribPointer,
 };
index 7dd0d68..5bb30f8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Generated by gen-yagl-calls.sh, do not modify!
+ * Generated by gen-yagl-calls.py, do not modify!
  */
 #ifndef _QEMU_YAGL_GLES2_CALLS_H_
 #define _QEMU_YAGL_GLES2_CALLS_H_
index 48df920..b59f6b4 100644 (file)
@@ -193,54 +193,41 @@ static char *yagl_gles2_shader_patch(const char *source,
 }
 
 void yagl_gles2_shader_source(struct yagl_gles2_shader *shader,
-                              GLchar **strings,
-                              int count)
+                              const GLchar *string)
 {
-    GLchar **processed_strings = NULL;
-    GLint *lengths = NULL;
-    int i;
-
-    processed_strings = g_malloc0(count * sizeof(*processed_strings));
-
-    lengths = g_malloc0(count * sizeof(*lengths));
-
-    for (i = 0; i < count; ++i) {
-        processed_strings[i] = yagl_gles2_shader_patch(strings[i],
-                                                       strlen(strings[i]),
-                                                       &lengths[i]);
-        if (i == 0) {
-            /*
-             * On some GPUs (like Ivybridge Desktop) it's necessary to add
-             * "#version" directive as the first line of the shader, otherwise
-             * some of the features might not be available to the shader.
-             *
-             * For example, on Ivybridge Desktop, if we don't add the "#version"
-             * line to the fragment shader then "gl_PointCoord"
-             * won't be available.
-             */
-            if (strstr(processed_strings[i], "#version") == NULL) {
-                char *tmp = g_malloc(strlen(processed_strings[i]) + sizeof("#version 120\n\n"));
-                strcpy(tmp, "#version 120\n\n");
-                strcat(tmp, processed_strings[i]);
-                g_free(processed_strings[i]);
-                processed_strings[i] = tmp;
-                lengths[i] = strlen(tmp);
-            }
-        }
+    const GLchar *strings[1];
+    GLint patched_len = 0;
+    GLchar *patched_string = yagl_gles2_shader_patch(string,
+                                                     strlen(string),
+                                                     &patched_len);
+
+    /*
+     * On some GPUs (like Ivybridge Desktop) it's necessary to add
+     * "#version" directive as the first line of the shader, otherwise
+     * some of the features might not be available to the shader.
+     *
+     * For example, on Ivybridge Desktop, if we don't add the "#version"
+     * line to the fragment shader then "gl_PointCoord"
+     * won't be available.
+     */
+
+    if (strstr(patched_string, "#version") == NULL) {
+        patched_len += sizeof("#version 120\n\n");
+        char *tmp = g_malloc(patched_len);
+        strcpy(tmp, "#version 120\n\n");
+        strcat(tmp, patched_string);
+        g_free(patched_string);
+        patched_string = tmp;
     }
 
+    strings[0] = patched_string;
+
     shader->driver->ShaderSource(shader->global_name,
-                                 count,
-                                 (const GLchar**)processed_strings,
-                                 lengths);
-
-    g_free(lengths);
-    if (processed_strings) {
-        for (i = 0; i < count; ++i) {
-            g_free(processed_strings[i]);
-        }
-        g_free(processed_strings);
-    }
+                                 1,
+                                 strings,
+                                 &patched_len);
+
+    g_free(patched_string);
 }
 
 void yagl_gles2_shader_compile(struct yagl_gles2_shader *shader)
index 6635f11..9f80187 100644 (file)
@@ -37,8 +37,7 @@ struct yagl_gles2_shader
                               GLenum type);
 
 void yagl_gles2_shader_source(struct yagl_gles2_shader *shader,
-                              GLchar **strings,
-                              int count);
+                              const GLchar *string);
 
 void yagl_gles2_shader_compile(struct yagl_gles2_shader *shader);
 
index 79b7184..c710a8a 100644 (file)
@@ -18,7 +18,6 @@
 #include "yagl_process.h"
 #include "yagl_client_interface.h"
 #include "yagl_sharegroup.h"
-#include "yagl_mem_gl.h"
 
 #define YAGL_SET_ERR(err) \
     yagl_gles_context_set_error(&ctx->base, err); \
@@ -34,12 +33,11 @@ static YAGL_DEFINE_TLS(struct yagl_gles2_api_ts*, gles2_api_ts);
         (ctx->base.base.client_api != yagl_client_api_gles2)) { \
         YAGL_LOG_WARN("no current context"); \
         ret_expr; \
-        return true; \
     }
 
-#define YAGL_GET_CTX_RET(func, ret) YAGL_GET_CTX_IMPL(func, *retval = ret)
+#define YAGL_GET_CTX_RET(func, ret) YAGL_GET_CTX_IMPL(func, return ret)
 
-#define YAGL_GET_CTX(func) YAGL_GET_CTX_IMPL(func,)
+#define YAGL_GET_CTX(func) YAGL_GET_CTX_IMPL(func, return)
 
 #define YAGL_UNIMPLEMENTED_RET(func, ret) \
     YAGL_GET_CTX_RET(func, ret); \
@@ -50,7 +48,7 @@ static YAGL_DEFINE_TLS(struct yagl_gles2_api_ts*, gles2_api_ts);
 #define YAGL_UNIMPLEMENTED(func) \
     YAGL_GET_CTX(func); \
     YAGL_LOG_WARN("NOT IMPLEMENTED!!!"); \
-    return true
+    return
 
 static bool yagl_get_array_param(struct yagl_gles_array *array,
                                  GLenum pname,
@@ -206,7 +204,7 @@ struct yagl_api_ps *yagl_host_gles2_process_init(struct yagl_api *api)
     return &gles2_api_ps->base;
 }
 
-bool yagl_host_glAttachShader(GLuint program,
+void yagl_host_glAttachShader(GLuint program,
     GLuint shader)
 {
     struct yagl_gles2_program *program_obj = NULL;
@@ -248,17 +246,13 @@ bool yagl_host_glAttachShader(GLuint program,
 out:
     yagl_gles2_shader_release(shader_obj);
     yagl_gles2_program_release(program_obj);
-
-    return true;
 }
 
-bool yagl_host_glBindAttribLocation(GLuint program,
+void yagl_host_glBindAttribLocation(GLuint program,
     GLuint index,
-    target_ulong /* const GLchar* */ name_)
+    const GLchar *name, int32_t name_count)
 {
-    bool res = true;
     struct yagl_gles2_program *program_obj = NULL;
-    GLchar *name = NULL;
 
     YAGL_GET_CTX(glBindAttribLocation);
 
@@ -275,25 +269,17 @@ bool yagl_host_glBindAttribLocation(GLuint program,
         goto out;
     }
 
-    if (name_) {
-        name = yagl_mem_get_string(name_);
-        if (!name) {
-            res = false;
-            goto out;
-        }
+    if (name) {
         YAGL_LOG_TRACE("binding attrib %s location to %d", name, index);
     }
 
     yagl_gles2_program_bind_attrib_location(program_obj, index, name);
 
 out:
-    g_free(name);
     yagl_gles2_program_release(program_obj);
-
-    return res;
 }
 
-bool yagl_host_glBlendColor(GLclampf red,
+void yagl_host_glBlendColor(GLclampf red,
     GLclampf green,
     GLclampf blue,
     GLclampf alpha)
@@ -301,11 +287,9 @@ bool yagl_host_glBlendColor(GLclampf red,
     YAGL_GET_CTX(glBlendColor);
 
     ctx->driver->BlendColor(red, green, blue, alpha);
-
-    return true;
 }
 
-bool yagl_host_glCompileShader(GLuint shader)
+void yagl_host_glCompileShader(GLuint shader)
 {
     struct yagl_gles2_shader *shader_obj = NULL;
 
@@ -328,41 +312,36 @@ bool yagl_host_glCompileShader(GLuint shader)
 
 out:
     yagl_gles2_shader_release(shader_obj);
-
-    return true;
 }
 
-bool yagl_host_glCreateProgram(GLuint* retval)
+GLuint yagl_host_glCreateProgram(void)
 {
+    GLuint res = 0;
     struct yagl_gles2_program *program = NULL;
 
     YAGL_GET_CTX_RET(glCreateProgram, 0);
 
-    *retval = 0;
-
     program = yagl_gles2_program_create(ctx->driver);
 
     if (!program) {
         goto out;
     }
 
-    *retval = yagl_sharegroup_add(ctx->sg, YAGL_NS_SHADER_PROGRAM, &program->base);
+    res = yagl_sharegroup_add(ctx->sg, YAGL_NS_SHADER_PROGRAM, &program->base);
 
 out:
     yagl_gles2_program_release(program);
 
-    return true;
+    return res;
 }
 
-bool yagl_host_glCreateShader(GLuint* retval,
-    GLenum type)
+GLuint yagl_host_glCreateShader(GLenum type)
 {
+    GLuint res = 0;
     struct yagl_gles2_shader *shader = NULL;
 
     YAGL_GET_CTX_RET(glCreateShader, 0);
 
-    *retval = 0;
-
     shader = yagl_gles2_shader_create(ctx->driver, type);
 
     if (!shader) {
@@ -370,15 +349,15 @@ bool yagl_host_glCreateShader(GLuint* retval,
         goto out;
     }
 
-    *retval = yagl_sharegroup_add(ctx->sg, YAGL_NS_SHADER_PROGRAM, &shader->base);
+    res = yagl_sharegroup_add(ctx->sg, YAGL_NS_SHADER_PROGRAM, &shader->base);
 
 out:
     yagl_gles2_shader_release(shader);
 
-    return true;
+    return res;
 }
 
-bool yagl_host_glDeleteProgram(GLuint program)
+void yagl_host_glDeleteProgram(GLuint program)
 {
     struct yagl_gles2_program *program_obj = NULL;
 
@@ -409,11 +388,9 @@ bool yagl_host_glDeleteProgram(GLuint program)
 
 out:
     yagl_gles2_program_release(program_obj);
-
-    return true;
 }
 
-bool yagl_host_glDeleteShader(GLuint shader)
+void yagl_host_glDeleteShader(GLuint shader)
 {
     struct yagl_gles2_shader *shader_obj = NULL;
 
@@ -442,11 +419,9 @@ bool yagl_host_glDeleteShader(GLuint shader)
 
 out:
     yagl_gles2_shader_release(shader_obj);
-
-    return true;
 }
 
-bool yagl_host_glDetachShader(GLuint program,
+void yagl_host_glDetachShader(GLuint program,
     GLuint shader)
 {
     struct yagl_gles2_program *program_obj = NULL;
@@ -488,11 +463,9 @@ bool yagl_host_glDetachShader(GLuint program,
 out:
     yagl_gles2_shader_release(shader_obj);
     yagl_gles2_program_release(program_obj);
-
-    return true;
 }
 
-bool yagl_host_glDisableVertexAttribArray(GLuint index)
+void yagl_host_glDisableVertexAttribArray(GLuint index)
 {
     struct yagl_gles_array *array = NULL;
 
@@ -502,17 +475,15 @@ bool yagl_host_glDisableVertexAttribArray(GLuint index)
 
     if (!array) {
         YAGL_SET_ERR(GL_INVALID_VALUE);
-        return true;
+        return;
     }
 
     yagl_gles_array_enable(array, false);
 
     ctx->driver->DisableVertexAttribArray(index);
-
-    return true;
 }
 
-bool yagl_host_glEnableVertexAttribArray(GLuint index)
+void yagl_host_glEnableVertexAttribArray(GLuint index)
 {
     struct yagl_gles_array *array = NULL;
 
@@ -522,30 +493,22 @@ bool yagl_host_glEnableVertexAttribArray(GLuint index)
 
     if (!array) {
         YAGL_SET_ERR(GL_INVALID_VALUE);
-        return true;
+        return;
     }
 
     yagl_gles_array_enable(array, true);
 
     ctx->driver->EnableVertexAttribArray(index);
-
-    return true;
 }
 
-bool yagl_host_glGetActiveAttrib(GLuint program,
+void yagl_host_glGetActiveAttrib(GLuint program,
     GLuint index,
-    GLsizei bufsize,
-    target_ulong /* GLsizei* */ length_,
-    target_ulong /* GLint* */ size_,
-    target_ulong /* GLenum* */ type_,
-    target_ulong /* GLchar* */ name_)
+    GLint *size,
+    GLenum *type,
+    GLchar *name, int32_t name_maxcount, int32_t *name_count)
 {
-    bool res = true;
+    GLsizei tmp = -1;
     struct yagl_gles2_program *program_obj = NULL;
-    GLchar *name = NULL;
-    GLsizei length = 0;
-    GLint size = 0;
-    GLenum type = 0;
 
     YAGL_GET_CTX(glGetActiveAttrib);
 
@@ -562,65 +525,32 @@ bool yagl_host_glGetActiveAttrib(GLuint program,
         goto out;
     }
 
-    if (bufsize > 0) {
-        name = yagl_gles_context_malloc(&ctx->base, bufsize);
-    }
-
     yagl_gles2_program_get_active_attrib(program_obj,
                                          index,
-                                         bufsize,
-                                         &length,
-                                         &size,
-                                         &type,
+                                         name_maxcount,
+                                         &tmp,
+                                         size,
+                                         type,
                                          name);
 
-    YAGL_LOG_TRACE("got active attrib: size = %d, type = %u, name = %s",
-                   size, type, name);
-
-    if (!yagl_mem_prepare_GLsizei(cur_ts->mt1, length_) ||
-        !yagl_mem_prepare_GLint(cur_ts->mt2, size_) ||
-        !yagl_mem_prepare_GLenum(cur_ts->mt3, type_) ||
-        !yagl_mem_prepare(cur_ts->mt4, name_, length + 1)) {
-        res = false;
-        goto out;
-    }
-
-    if (length_) {
-        yagl_mem_put_GLsizei(cur_ts->mt1, length);
-    }
-
-    if (size_) {
-        yagl_mem_put_GLint(cur_ts->mt2, size);
-    }
-
-    if (type_) {
-        yagl_mem_put_GLenum(cur_ts->mt3, type);
-    }
-
-    if (name_ && name) {
-        yagl_mem_put(cur_ts->mt4, name);
+    if (tmp >= 0) {
+        YAGL_LOG_TRACE("got active attrib: size = %d, type = %u, name = %s",
+                       (size ? *size : -1), (type ? *type : -1), name);
+        *name_count = tmp + 1;
     }
 
 out:
     yagl_gles2_program_release(program_obj);
-
-    return res;
 }
 
-bool yagl_host_glGetActiveUniform(GLuint program,
+void yagl_host_glGetActiveUniform(GLuint program,
     GLuint index,
-    GLsizei bufsize,
-    target_ulong /* GLsizei* */ length_,
-    target_ulong /* GLint* */ size_,
-    target_ulong /* GLenum* */ type_,
-    target_ulong /* GLchar* */ name_)
+    GLint *size,
+    GLenum *type,
+    GLchar *name, int32_t name_maxcount, int32_t *name_count)
 {
-    bool res = true;
+    GLsizei tmp = -1;
     struct yagl_gles2_program *program_obj = NULL;
-    GLchar *name = NULL;
-    GLsizei length = 0;
-    GLint size = 0;
-    GLenum type = 0;
 
     YAGL_GET_CTX(glGetActiveUniform);
 
@@ -637,60 +567,28 @@ bool yagl_host_glGetActiveUniform(GLuint program,
         goto out;
     }
 
-    if (bufsize > 0) {
-        name = yagl_gles_context_malloc(&ctx->base, bufsize);
-    }
-
     yagl_gles2_program_get_active_uniform(program_obj,
                                           index,
-                                          bufsize,
-                                          &length,
-                                          &size,
-                                          &type,
+                                          name_maxcount,
+                                          &tmp,
+                                          size,
+                                          type,
                                           name);
 
-    YAGL_LOG_TRACE("got active uniform: size = %d, type = %u, name = %s",
-                   size, type, name);
-
-    if (!yagl_mem_prepare_GLsizei(cur_ts->mt1, length_) ||
-        !yagl_mem_prepare_GLint(cur_ts->mt2, size_) ||
-        !yagl_mem_prepare_GLenum(cur_ts->mt3, type_) ||
-        !yagl_mem_prepare(cur_ts->mt4, name_, length + 1)) {
-        res = false;
-        goto out;
-    }
-
-    if (length_) {
-        yagl_mem_put_GLsizei(cur_ts->mt1, length);
-    }
-
-    if (size_) {
-        yagl_mem_put_GLint(cur_ts->mt2, size);
-    }
-
-    if (type_) {
-        yagl_mem_put_GLenum(cur_ts->mt3, type);
-    }
-
-    if (name_ && name) {
-        yagl_mem_put(cur_ts->mt4, name);
+    if (tmp >= 0) {
+        YAGL_LOG_TRACE("got active uniform: size = %d, type = %u, name = %s",
+                       (size ? *size : -1), (type ? *type : -1), name);
+        *name_count = tmp + 1;
     }
 
 out:
     yagl_gles2_program_release(program_obj);
-
-    return res;
 }
 
-bool yagl_host_glGetAttachedShaders(GLuint program,
-    GLsizei maxcount,
-    target_ulong /* GLsizei* */ count_,
-    target_ulong /* GLuint* */ shaders_)
+void yagl_host_glGetAttachedShaders(GLuint program,
+    GLuint *shaders, int32_t shaders_maxcount, int32_t *shaders_count)
 {
-    bool res = true;
     struct yagl_gles2_program *program_obj = NULL;
-    GLsizei count = 0;
-    GLuint *shaders = 0;
 
     YAGL_GET_CTX(glGetAttachedShaders);
 
@@ -707,62 +605,41 @@ bool yagl_host_glGetAttachedShaders(GLuint program,
         goto out;
     }
 
-    if (maxcount < 0) {
+    if (shaders_maxcount < 0) {
         YAGL_SET_ERR(GL_INVALID_VALUE);
         goto out;
     }
 
-    if (!yagl_mem_prepare_GLsizei(cur_ts->mt1, count_)) {
-        res = false;
-        goto out;
-    }
-
-    if (maxcount > 0) {
-        shaders = yagl_gles_context_malloc0(&ctx->base,
-            maxcount * sizeof(*shaders));
-
-        if (program_obj->vertex_shader_local_name != 0) {
-            if (count < maxcount) {
-                shaders[count++] = program_obj->vertex_shader_local_name;
+    if (program_obj->vertex_shader_local_name != 0) {
+        if (*shaders_count < shaders_maxcount) {
+            if (shaders) {
+                shaders[*shaders_count] = program_obj->vertex_shader_local_name;
             }
+            ++*shaders_count;
         }
+    }
 
-        if (program_obj->fragment_shader_local_name != 0) {
-            if (count < maxcount) {
-                shaders[count++] = program_obj->fragment_shader_local_name;
+    if (program_obj->fragment_shader_local_name != 0) {
+        if (*shaders_count < shaders_maxcount) {
+            if (shaders) {
+                shaders[*shaders_count] = program_obj->fragment_shader_local_name;
             }
+            ++*shaders_count;
         }
-
-        if (!yagl_mem_prepare(cur_ts->mt2, shaders_, count * sizeof(*shaders))) {
-            res = false;
-            goto out;
-        }
-
-        yagl_mem_put(cur_ts->mt2, shaders);
-    }
-
-    if (count_) {
-        yagl_mem_put_GLsizei(cur_ts->mt1, count);
     }
 
 out:
     yagl_gles2_program_release(program_obj);
-
-    return res;
 }
 
-bool yagl_host_glGetAttribLocation(int* retval,
-    GLuint program,
-    target_ulong /* const GLchar* */ name_)
+int yagl_host_glGetAttribLocation(GLuint program,
+    const GLchar *name, int32_t name_count)
 {
-    bool res = true;
+    int res = 0;
     struct yagl_gles2_program *program_obj = NULL;
-    GLchar *name = NULL;
 
     YAGL_GET_CTX_RET(glGetAttribLocation, 0);
 
-    *retval = 0;
-
     program_obj = (struct yagl_gles2_program*)yagl_sharegroup_acquire_object(ctx->sg,
         YAGL_NS_SHADER_PROGRAM, program);
 
@@ -776,39 +653,22 @@ bool yagl_host_glGetAttribLocation(int* retval,
         goto out;
     }
 
-    if (name_) {
-        name = yagl_mem_get_string(name_);
-        if (!name) {
-            res = false;
-            goto out;
-        }
-        YAGL_LOG_TRACE("getting attrib %s location", name);
-    }
-
-    *retval = yagl_gles2_program_get_attrib_location(program_obj, name);
+    res = yagl_gles2_program_get_attrib_location(program_obj, name);
 
 out:
-    g_free(name);
     yagl_gles2_program_release(program_obj);
 
     return res;
 }
 
-bool yagl_host_glGetProgramiv(GLuint program,
+void yagl_host_glGetProgramiv(GLuint program,
     GLenum pname,
-    target_ulong /* GLint* */ params_)
+    GLint *param)
 {
-    bool res = true;
     struct yagl_gles2_program *program_obj = NULL;
-    GLint params = 0;
 
     YAGL_GET_CTX(glGetProgramiv);
 
-    if (!yagl_mem_prepare_GLint(cur_ts->mt1, params_)) {
-        res = false;
-        goto out;
-    }
-
     program_obj = (struct yagl_gles2_program*)yagl_sharegroup_acquire_object(ctx->sg,
         YAGL_NS_SHADER_PROGRAM, program);
 
@@ -822,34 +682,17 @@ bool yagl_host_glGetProgramiv(GLuint program,
         goto out;
     }
 
-    if (params_) {
-        if (!yagl_mem_get_GLint(params_, &params)) {
-            res = false;
-            goto out;
-        }
-    }
-
-    yagl_gles2_program_get_param(program_obj, pname, &params);
-
-    if (params_) {
-        yagl_mem_put_GLint(cur_ts->mt1, params);
-    }
+    yagl_gles2_program_get_param(program_obj, pname, param);
 
 out:
     yagl_gles2_program_release(program_obj);
-
-    return res;
 }
 
-bool yagl_host_glGetProgramInfoLog(GLuint program,
-    GLsizei bufsize,
-    target_ulong /* GLsizei* */ length_,
-    target_ulong /* GLchar* */ infolog_)
+void yagl_host_glGetProgramInfoLog(GLuint program,
+    GLchar *infolog, int32_t infolog_maxcount, int32_t *infolog_count)
 {
-    bool res = true;
+    GLsizei tmp = -1;
     struct yagl_gles2_program *program_obj = NULL;
-    GLsizei length = 0;
-    GLchar *infolog = NULL;
 
     YAGL_GET_CTX(glGetProgramInfoLog);
 
@@ -866,52 +709,29 @@ bool yagl_host_glGetProgramInfoLog(GLuint program,
         goto out;
     }
 
-    if (bufsize < 0) {
+    if (infolog_maxcount < 0) {
         YAGL_SET_ERR(GL_INVALID_VALUE);
         goto out;
     }
 
-    if (bufsize > 0) {
-        infolog = yagl_gles_context_malloc(&ctx->base, bufsize);
-    }
-
-    yagl_gles2_program_get_info_log(program_obj, bufsize, &length, infolog);
-
-    if (!yagl_mem_prepare_GLsizei(cur_ts->mt1, length_) ||
-        !yagl_mem_prepare(cur_ts->mt2, infolog_, length + 1)) {
-        res = false;
-        goto out;
-    }
-
-    if (length_) {
-        yagl_mem_put_GLsizei(cur_ts->mt1, length);
-    }
+    yagl_gles2_program_get_info_log(program_obj, infolog_maxcount, &tmp, infolog);
 
-    if (infolog_ && infolog) {
-        yagl_mem_put(cur_ts->mt2, infolog);
+    if (tmp >= 0) {
+        *infolog_count = tmp + 1;
     }
 
 out:
     yagl_gles2_program_release(program_obj);
-
-    return res;
 }
 
-bool yagl_host_glGetShaderiv(GLuint shader,
+void yagl_host_glGetShaderiv(GLuint shader,
     GLenum pname,
-    target_ulong /* GLint* */ params_)
+    GLint *param)
 {
-    bool res = true;
     struct yagl_gles2_shader *shader_obj = NULL;
-    GLint params = 0;
 
     YAGL_GET_CTX(glGetShaderiv);
 
-    if (!yagl_mem_prepare_GLint(cur_ts->mt1, params_)) {
-        res = false;
-        goto out;
-    }
-
     shader_obj = (struct yagl_gles2_shader*)yagl_sharegroup_acquire_object(ctx->sg,
         YAGL_NS_SHADER_PROGRAM, shader);
 
@@ -925,34 +745,17 @@ bool yagl_host_glGetShaderiv(GLuint shader,
         goto out;
     }
 
-    if (params_) {
-        if (!yagl_mem_get_GLint(params_, &params)) {
-            res = false;
-            goto out;
-        }
-    }
-
-    yagl_gles2_shader_get_param(shader_obj, pname, &params);
-
-    if (params_) {
-        yagl_mem_put_GLint(cur_ts->mt1, params);
-    }
+    yagl_gles2_shader_get_param(shader_obj, pname, param);
 
 out:
     yagl_gles2_shader_release(shader_obj);
-
-    return res;
 }
 
-bool yagl_host_glGetShaderInfoLog(GLuint shader,
-    GLsizei bufsize,
-    target_ulong /* GLsizei* */ length_,
-    target_ulong /* GLchar* */ infolog_)
+void yagl_host_glGetShaderInfoLog(GLuint shader,
+    GLchar *infolog, int32_t infolog_maxcount, int32_t *infolog_count)
 {
-    bool res = true;
+    GLsizei tmp = -1;
     struct yagl_gles2_shader *shader_obj = NULL;
-    GLsizei length = 0;
-    GLchar *infolog = NULL;
 
     YAGL_GET_CTX(glGetShaderInfoLog);
 
@@ -969,93 +772,62 @@ bool yagl_host_glGetShaderInfoLog(GLuint shader,
         goto out;
     }
 
-    if (bufsize < 0) {
+    if (infolog_maxcount < 0) {
         YAGL_SET_ERR(GL_INVALID_VALUE);
         goto out;
     }
 
-    if (bufsize > 0) {
-        infolog = yagl_gles_context_malloc(&ctx->base, bufsize);
-    }
-
-    yagl_gles2_shader_get_info_log(shader_obj, bufsize, &length, infolog);
-
-    if (!yagl_mem_prepare_GLsizei(cur_ts->mt1, length_) ||
-        !yagl_mem_prepare(cur_ts->mt2, infolog_, length + 1)) {
-        res = false;
-        goto out;
-    }
+    yagl_gles2_shader_get_info_log(shader_obj, infolog_maxcount, &tmp, infolog);
 
-    if (length_) {
-        yagl_mem_put_GLsizei(cur_ts->mt1, length);
-    }
-
-    if (infolog_ && infolog) {
-        yagl_mem_put(cur_ts->mt2, infolog);
+    if (tmp >= 0) {
+        *infolog_count = tmp + 1;
     }
 
 out:
     yagl_gles2_shader_release(shader_obj);
-
-    return res;
 }
 
-bool yagl_host_glGetShaderPrecisionFormat(GLenum shadertype,
+void yagl_host_glGetShaderPrecisionFormat(GLenum shadertype,
     GLenum precisiontype,
-    target_ulong /* GLint* */ range_,
-    target_ulong /* GLint* */ precision_)
+    GLint *range, int32_t range_maxcount, int32_t *range_count,
+    GLint *precision)
 {
-    bool res = true;
-    GLint range[2] = { 0, 0 };
-    GLint precision = 0;
-
     YAGL_GET_CTX(glGetShaderPrecisionFormat);
 
-    if (!yagl_mem_prepare(cur_ts->mt1, range_, sizeof(range)) ||
-        !yagl_mem_prepare_GLint(cur_ts->mt2, precision_)) {
-        res = false;
-        goto out;
-    }
-
     switch (precisiontype) {
     case GL_LOW_INT:
     case GL_MEDIUM_INT:
     case GL_HIGH_INT:
-        range[0] = range[1] = 16;
-        precision = 0;
+        if (range) {
+            range[0] = range[1] = 16;
+            *range_count = 2;
+        }
+        if (precision) {
+            *precision = 0;
+        }
         break;
     case GL_LOW_FLOAT:
     case GL_MEDIUM_FLOAT:
     case GL_HIGH_FLOAT:
-        range[0] = range[1] = 127;
-        precision = 24;
+        if (range) {
+            range[0] = range[1] = 127;
+            *range_count = 2;
+        }
+        if (precision) {
+            *precision = 24;
+        }
         break;
     default:
         YAGL_SET_ERR(GL_INVALID_ENUM);
-        goto out;
-    }
-
-    if (range_) {
-        yagl_mem_put(cur_ts->mt1, &range[0]);
-    }
-
-    if (precision_) {
-        yagl_mem_put_GLint(cur_ts->mt2, precision);
+        break;
     }
-
-out:
-    return res;
 }
 
-bool yagl_host_glGetShaderSource(GLuint shader,
-    GLsizei bufsize,
-    target_ulong /* GLsizei* */ length_,
-    target_ulong /* GLchar* */ source_)
+void yagl_host_glGetShaderSource(GLuint shader,
+    GLchar *source, int32_t source_maxcount, int32_t *source_count)
 {
-    bool res = true;
+    GLsizei tmp = -1;
     struct yagl_gles2_shader *shader_obj = NULL;
-    GLsizei length = 0;
-    GLchar *source = NULL;
 
     YAGL_GET_CTX(glGetShaderSource);
 
@@ -1072,46 +844,27 @@ bool yagl_host_glGetShaderSource(GLuint shader,
         goto out;
     }
 
-    if (bufsize < 0) {
+    if (source_maxcount < 0) {
         YAGL_SET_ERR(GL_INVALID_VALUE);
         goto out;
     }
 
-    if (bufsize > 0) {
-        source = yagl_gles_context_malloc(&ctx->base, bufsize);
-    }
-
-    yagl_gles2_shader_get_source(shader_obj, bufsize, &length, source);
-
-    if (!yagl_mem_prepare_GLsizei(cur_ts->mt1, length_) ||
-        !yagl_mem_prepare(cur_ts->mt2, source_, length + 1)) {
-        res = false;
-        goto out;
-    }
-
-    if (length_) {
-        yagl_mem_put_GLsizei(cur_ts->mt1, length);
-    }
+    yagl_gles2_shader_get_source(shader_obj, source_maxcount, &tmp, source);
 
-    if (source_ && source) {
-        yagl_mem_put(cur_ts->mt2, source);
+    if (tmp >= 0) {
+        *source_count = tmp + 1;
     }
 
 out:
     yagl_gles2_shader_release(shader_obj);
-
-    return res;
 }
 
-bool yagl_host_glGetUniformfv(GLuint program,
+void yagl_host_glGetUniformfv(GLuint program,
     GLint location,
-    target_ulong /* GLfloat* */ params_)
+    GLfloat *params, int32_t params_maxcount, int32_t *params_count)
 {
-    bool res = true;
     struct yagl_gles2_program *program_obj = NULL;
     GLenum type;
-    int count;
-    GLfloat params[100]; /* This fits all cases */
 
     YAGL_GET_CTX(glGetUniformfv);
 
@@ -1135,37 +888,23 @@ bool yagl_host_glGetUniformfv(GLuint program,
         goto out;
     }
 
-    if (!yagl_gles2_get_uniform_type_count(type, &count)) {
+    if (!yagl_gles2_get_uniform_type_count(type, params_count)) {
         YAGL_SET_ERR(GL_INVALID_OPERATION);
         goto out;
     }
 
-    if (!yagl_mem_prepare(cur_ts->mt1, params_, count * sizeof(params[0]))) {
-        res = false;
-        goto out;
-    }
-
-    yagl_gles2_program_get_uniform_float(program_obj, location, &params[0]);
-
-    if (params_) {
-        yagl_mem_put(cur_ts->mt1, &params[0]);
-    }
+    yagl_gles2_program_get_uniform_float(program_obj, location, params);
 
 out:
     yagl_gles2_program_release(program_obj);
-
-    return res;
 }
 
-bool yagl_host_glGetUniformiv(GLuint program,
+void yagl_host_glGetUniformiv(GLuint program,
     GLint location,
-    target_ulong /* GLint* */ params_)
+    GLint *params, int32_t params_maxcount, int32_t *params_count)
 {
-    bool res = true;
     struct yagl_gles2_program *program_obj = NULL;
     GLenum type;
-    int count;
-    GLint params[100]; /* This fits all cases */
 
     YAGL_GET_CTX(glGetUniformiv);
 
@@ -1189,40 +928,25 @@ bool yagl_host_glGetUniformiv(GLuint program,
         goto out;
     }
 
-    if (!yagl_gles2_get_uniform_type_count(type, &count)) {
+    if (!yagl_gles2_get_uniform_type_count(type, params_count)) {
         YAGL_SET_ERR(GL_INVALID_OPERATION);
         goto out;
     }
 
-    if (!yagl_mem_prepare(cur_ts->mt1, params_, count * sizeof(params[0]))) {
-        res = false;
-        goto out;
-    }
-
-    yagl_gles2_program_get_uniform_int(program_obj, location, &params[0]);
-
-    if (params_) {
-        yagl_mem_put(cur_ts->mt1, &params[0]);
-    }
+    yagl_gles2_program_get_uniform_int(program_obj, location, params);
 
 out:
     yagl_gles2_program_release(program_obj);
-
-    return res;
 }
 
-bool yagl_host_glGetUniformLocation(int* retval,
-    GLuint program,
-    target_ulong /* const GLchar* */ name_)
+int yagl_host_glGetUniformLocation(GLuint program,
+    const GLchar *name, int32_t name_count)
 {
-    bool res = true;
+    int res = 0;
     struct yagl_gles2_program *program_obj = NULL;
-    GLchar *name = NULL;
 
     YAGL_GET_CTX_RET(glGetUniformLocation, 0);
 
-    *retval = 0;
-
     program_obj = (struct yagl_gles2_program*)yagl_sharegroup_acquire_object(ctx->sg,
         YAGL_NS_SHADER_PROGRAM, program);
 
@@ -1236,32 +960,23 @@ bool yagl_host_glGetUniformLocation(int* retval,
         goto out;
     }
 
-    if (name_) {
-        name = yagl_mem_get_string(name_);
-        if (!name) {
-            res = false;
-            goto out;
-        }
+    if (name) {
         YAGL_LOG_TRACE("getting uniform %s location", name);
     }
 
-    *retval = yagl_gles2_program_get_uniform_location(program_obj, name);
+    res = yagl_gles2_program_get_uniform_location(program_obj, name);
 
 out:
-    g_free(name);
     yagl_gles2_program_release(program_obj);
 
     return res;
 }
 
-bool yagl_host_glGetVertexAttribfv(GLuint index,
+void yagl_host_glGetVertexAttribfv(GLuint index,
     GLenum pname,
-    target_ulong /* GLfloat* */ params_)
+    GLfloat *params, int32_t params_maxcount, int32_t *params_count)
 {
-    bool res = true;
     struct yagl_gles_array *array = NULL;
-    int count = 0;
-    GLfloat *params = NULL;
     GLint param = 0;
 
     YAGL_GET_CTX(glGetVertexAttribfv);
@@ -1270,43 +985,26 @@ bool yagl_host_glGetVertexAttribfv(GLuint index,
 
     if (!array) {
         YAGL_SET_ERR(GL_INVALID_VALUE);
-        goto out;
+        return;
     }
 
-    if (!yagl_gles2_get_array_param_count(pname, &count)) {
+    if (!yagl_gles2_get_array_param_count(pname, params_count)) {
         YAGL_SET_ERR(GL_INVALID_ENUM);
-        goto out;
+        return;
     }
 
-    if (!yagl_mem_prepare(cur_ts->mt1, params_, count * sizeof(*params))) {
-        res = false;
-        goto out;
-    }
-
-    params = yagl_gles_context_malloc0(&ctx->base, count * sizeof(*params));
-
     if (yagl_get_array_param(array, pname, &param)) {
         params[0] = param;
     } else {
         ctx->driver->GetVertexAttribfv(index, pname, params);
     }
-
-    if (params_) {
-        yagl_mem_put(cur_ts->mt1, params);
-    }
-
-out:
-    return res;
 }
 
-bool yagl_host_glGetVertexAttribiv(GLuint index,
+void yagl_host_glGetVertexAttribiv(GLuint index,
     GLenum pname,
-    target_ulong /* GLint* */ params_)
+    GLint *params, int32_t params_maxcount, int32_t *params_count)
 {
-    bool res = true;
     struct yagl_gles_array *array = NULL;
-    int count = 0;
-    GLint *params = NULL;
 
     YAGL_GET_CTX(glGetVertexAttribiv);
 
@@ -1314,112 +1012,85 @@ bool yagl_host_glGetVertexAttribiv(GLuint index,
 
     if (!array) {
         YAGL_SET_ERR(GL_INVALID_VALUE);
-        goto out;
+        return;
     }
 
-    if (!yagl_gles2_get_array_param_count(pname, &count)) {
+    if (!yagl_gles2_get_array_param_count(pname, params_count)) {
         YAGL_SET_ERR(GL_INVALID_ENUM);
-        goto out;
-    }
-
-    if (!yagl_mem_prepare(cur_ts->mt1, params_, count * sizeof(*params))) {
-        res = false;
-        goto out;
+        return;
     }
 
-    params = yagl_gles_context_malloc0(&ctx->base, count * sizeof(*params));
-
     if (!yagl_get_array_param(array, pname, params)) {
         ctx->driver->GetVertexAttribiv(index, pname, params);
     }
-
-    if (params_) {
-        yagl_mem_put(cur_ts->mt1, params);
-    }
-
-out:
-    return res;
 }
 
-bool yagl_host_glGetVertexAttribPointerv(GLuint index,
+void yagl_host_glGetVertexAttribPointerv(GLuint index,
     GLenum pname,
-    target_ulong /* GLvoid** */ pointer_)
+    target_ulong *pointer)
 {
-    bool res = true;
     struct yagl_gles_array *array = NULL;
-    target_ulong pointer = 0;
+    target_ulong tmp = 0;
 
     YAGL_GET_CTX(glGetVertexAttribPointerv);
 
-    if (!yagl_mem_prepare_ptr(cur_ts->mt1, pointer_)) {
-        res = false;
-        goto out;
-    }
-
     array = yagl_gles_context_get_array(&ctx->base, index);
 
     if (!array) {
         YAGL_SET_ERR(GL_INVALID_VALUE);
-        goto out;
+        return;
     }
 
     if (array->vbo) {
-        pointer = array->offset;
+        tmp = array->offset;
     } else {
-        pointer = array->target_data;
+        tmp = array->target_data;
     }
 
-    if (pointer_) {
-        yagl_mem_put_ptr(cur_ts->mt1, pointer);
+    if (pointer) {
+        *pointer = tmp;
     }
-
-out:
-    return res;
 }
 
-bool yagl_host_glIsProgram(GLboolean* retval,
-    GLuint program)
+GLboolean yagl_host_glIsProgram(GLuint program)
 {
+    GLboolean res = GL_FALSE;
     struct yagl_gles2_program *program_obj = NULL;
 
     YAGL_GET_CTX_RET(glIsProgram, GL_FALSE);
 
-    *retval = GL_FALSE;
-
     program_obj = (struct yagl_gles2_program*)yagl_sharegroup_acquire_object(ctx->sg,
         YAGL_NS_SHADER_PROGRAM, program);
 
     if (program_obj) {
-        *retval = program_obj->is_shader ? GL_FALSE : GL_TRUE;
+        res = program_obj->is_shader ? GL_FALSE : GL_TRUE;
     }
 
     yagl_gles2_program_release(program_obj);
 
-    return true;
+    return res;
 }
 
-bool yagl_host_glIsShader(GLboolean* retval,
-    GLuint shader)
+GLboolean yagl_host_glIsShader(GLuint shader)
 {
+    GLboolean res = GL_FALSE;
     struct yagl_gles2_shader *shader_obj = NULL;
 
     YAGL_GET_CTX_RET(glIsShader, GL_FALSE);
 
-    *retval = GL_FALSE;
-
     shader_obj = (struct yagl_gles2_shader*)yagl_sharegroup_acquire_object(ctx->sg,
         YAGL_NS_SHADER_PROGRAM, shader);
 
     if (shader_obj) {
-        *retval = shader_obj->is_shader ? GL_TRUE : GL_FALSE;
+        res = shader_obj->is_shader ? GL_TRUE : GL_FALSE;
     }
 
     yagl_gles2_shader_release(shader_obj);
 
-    return true;
+    return res;
 }
 
-bool yagl_host_glLinkProgram(GLuint program)
+void yagl_host_glLinkProgram(GLuint program)
 {
     struct yagl_gles2_program *program_obj = NULL;
 
@@ -1442,26 +1113,20 @@ bool yagl_host_glLinkProgram(GLuint program)
 
 out:
     yagl_gles2_program_release(program_obj);
-
-    return true;
 }
 
-bool yagl_host_glReleaseShaderCompiler(void)
+void yagl_host_glReleaseShaderCompiler(void)
 {
     YAGL_GET_CTX(glReleaseShaderCompiler);
 
     /*
      * No-op.
      */
-
-    return true;
 }
 
-bool yagl_host_glShaderBinary(GLsizei n,
-    target_ulong /* const GLuint* */ shaders,
+void yagl_host_glShaderBinary(const GLuint *shaders, int32_t shaders_count,
     GLenum binaryformat,
-    target_ulong /* const GLvoid* */ binary,
-    GLsizei length)
+    const GLvoid *binary, int32_t binary_count)
 {
     /*
      * Don't allow to load precompiled shaders.
@@ -1470,21 +1135,14 @@ bool yagl_host_glShaderBinary(GLsizei n,
     YAGL_UNIMPLEMENTED(glShaderBinary);
 }
 
-bool yagl_host_glShaderSource(GLuint shader,
-    GLsizei count,
-    target_ulong /* const GLchar** */ string_,
-    target_ulong /* const GLint* */ length_)
+void yagl_host_glShaderSource(GLuint shader,
+    const GLchar *string, int32_t string_count)
 {
-    bool res = true;
     struct yagl_gles2_shader *shader_obj = NULL;
-    target_ulong *string_ptrs = NULL;
-    GLint *lengths = NULL;
-    GLchar** strings = NULL;
-    int i;
 
     YAGL_GET_CTX(glShaderSource);
 
-    if (count < 0) {
+    if (string_count < 0) {
         YAGL_SET_ERR(GL_INVALID_VALUE);
         goto out;
     }
@@ -1502,66 +1160,19 @@ bool yagl_host_glShaderSource(GLuint shader,
         goto out;
     }
 
-    string_ptrs = g_malloc(count * sizeof(*string_ptrs));
-    if (!yagl_mem_get(string_, count * sizeof(*string_ptrs), string_ptrs)) {
-        res = false;
+    if (!string) {
         goto out;
     }
 
-    if (length_) {
-        lengths = g_malloc(count * sizeof(*lengths));
-        if (!yagl_mem_get(length_, count * sizeof(*lengths), lengths)) {
-            res = false;
-            goto out;
-        }
-    }
+    YAGL_LOG_TRACE("string 0 = %s", string);
 
-    strings = g_malloc0(count * sizeof(*strings));
-
-    for (i = 0; i < count; ++i) {
-        char *tmp;
-
-        if (lengths && (lengths[i] >= 0)) {
-            tmp = g_malloc(lengths[i] + 1);
-            if (!yagl_mem_get(string_ptrs[i], lengths[i], tmp)) {
-                g_free(tmp);
-                tmp = NULL;
-            } else {
-                tmp[lengths[i]] = '\0';
-            }
-        } else {
-            tmp = yagl_mem_get_string(string_ptrs[i]);
-        }
-
-        if (!tmp) {
-            res = false;
-            goto out;
-        }
-
-        strings[i] = tmp;
-
-        YAGL_LOG_TRACE("string %d = %s", i, tmp);
-    }
-
-    yagl_gles2_shader_source(shader_obj,
-                             strings,
-                             count);
+    yagl_gles2_shader_source(shader_obj, string);
 
 out:
-    if (strings) {
-        for (i = 0; i < count; ++i) {
-            g_free(strings[i]);
-        }
-        g_free(strings);
-    }
-    g_free(string_ptrs);
-    g_free(lengths);
     yagl_gles2_shader_release(shader_obj);
-
-    return res;
 }
 
-bool yagl_host_glStencilFuncSeparate(GLenum face,
+void yagl_host_glStencilFuncSeparate(GLenum face,
     GLenum func,
     GLint ref,
     GLuint mask)
@@ -1569,21 +1180,17 @@ bool yagl_host_glStencilFuncSeparate(GLenum face,
     YAGL_GET_CTX(glStencilFuncSeparate);
 
     ctx->driver->StencilFuncSeparate(face, func, ref, mask);
-
-    return true;
 }
 
-bool yagl_host_glStencilMaskSeparate(GLenum face,
+void yagl_host_glStencilMaskSeparate(GLenum face,
     GLuint mask)
 {
     YAGL_GET_CTX(glStencilMaskSeparate);
 
     ctx->driver->StencilMaskSeparate(face, mask);
-
-    return true;
 }
 
-bool yagl_host_glStencilOpSeparate(GLenum face,
+void yagl_host_glStencilOpSeparate(GLenum face,
     GLenum fail,
     GLenum zfail,
     GLenum zpass)
@@ -1591,153 +1198,76 @@ bool yagl_host_glStencilOpSeparate(GLenum face,
     YAGL_GET_CTX(glStencilOpSeparate);
 
     ctx->driver->StencilOpSeparate(face, fail, zfail, zpass);
-
-    return true;
 }
 
-bool yagl_host_glUniform1f(GLint location,
+void yagl_host_glUniform1f(GLint location,
     GLfloat x)
 {
     YAGL_GET_CTX(glUniform1f);
 
     ctx->driver->Uniform1f(location, x);
-
-    return true;
 }
 
-bool yagl_host_glUniform1fv(GLint location,
-    GLsizei count,
-    target_ulong /* const GLfloat* */ v_)
+void yagl_host_glUniform1fv(GLint location,
+    const GLfloat *v, int32_t v_count)
 {
-    bool res = true;
-    GLfloat *v = NULL;
 
     YAGL_GET_CTX(glUniform1fv);
 
-    if (v_) {
-        v = yagl_gles_context_malloc(&ctx->base, count * sizeof(*v));
-        if (!yagl_mem_get(v_,
-                          count * sizeof(*v),
-                          v)) {
-            res = false;
-            goto out;
-        }
-    }
-
-    ctx->driver->Uniform1fv(location, count, v);
-
-out:
-    return res;
+    ctx->driver->Uniform1fv(location, v_count, v);
 }
 
-bool yagl_host_glUniform1i(GLint location,
+void yagl_host_glUniform1i(GLint location,
     GLint x)
 {
     YAGL_GET_CTX(glUniform1i);
 
     ctx->driver->Uniform1i(location, x);
-
-    return true;
 }
 
-bool yagl_host_glUniform1iv(GLint location,
-    GLsizei count,
-    target_ulong /* const GLint* */ v_)
+void yagl_host_glUniform1iv(GLint location,
+    const GLint *v, int32_t v_count)
 {
-    bool res = true;
-    GLint *v = NULL;
-
     YAGL_GET_CTX(glUniform1iv);
 
-    if (v_) {
-        v = yagl_gles_context_malloc(&ctx->base, count * sizeof(*v));
-        if (!yagl_mem_get(v_,
-                          count * sizeof(*v),
-                          v)) {
-            res = false;
-            goto out;
-        }
-    }
-
-    ctx->driver->Uniform1iv(location, count, v);
-
-out:
-    return res;
+    ctx->driver->Uniform1iv(location, v_count, v);
 }
 
-bool yagl_host_glUniform2f(GLint location,
+void yagl_host_glUniform2f(GLint location,
     GLfloat x,
     GLfloat y)
 {
     YAGL_GET_CTX(glUniform2f);
 
     ctx->driver->Uniform2f(location, x, y);
-
-    return true;
 }
 
-bool yagl_host_glUniform2fv(GLint location,
-    GLsizei count,
-    target_ulong /* const GLfloat* */ v_)
+void yagl_host_glUniform2fv(GLint location,
+    const GLfloat *v, int32_t v_count)
 {
-    bool res = true;
-    GLfloat *v = NULL;
-
     YAGL_GET_CTX(glUniform2fv);
 
-    if (v_) {
-        v = yagl_gles_context_malloc(&ctx->base, 2 * count * sizeof(*v));
-        if (!yagl_mem_get(v_,
-                          2 * count * sizeof(*v),
-                          v)) {
-            res = false;
-            goto out;
-        }
-    }
-
-    ctx->driver->Uniform2fv(location, count, v);
-
-out:
-    return res;
+    ctx->driver->Uniform2fv(location, (v_count / 2), v);
 }
 
-bool yagl_host_glUniform2i(GLint location,
+void yagl_host_glUniform2i(GLint location,
     GLint x,
     GLint y)
 {
     YAGL_GET_CTX(glUniform2i);
 
     ctx->driver->Uniform2i(location, x, y);
-
-    return true;
 }
 
-bool yagl_host_glUniform2iv(GLint location,
-    GLsizei count,
-    target_ulong /* const GLint* */ v_)
+void yagl_host_glUniform2iv(GLint location,
+    const GLint *v, int32_t v_count)
 {
-    bool res = true;
-    GLint *v = NULL;
-
     YAGL_GET_CTX(glUniform2iv);
 
-    if (v_) {
-        v = yagl_gles_context_malloc(&ctx->base, 2 * count * sizeof(*v));
-        if (!yagl_mem_get(v_,
-                          2 * count * sizeof(*v),
-                          v)) {
-            res = false;
-            goto out;
-        }
-    }
-
-    ctx->driver->Uniform2iv(location, count, v);
-
-out:
-    return res;
+    ctx->driver->Uniform2iv(location, (v_count / 2), v);
 }
 
-bool yagl_host_glUniform3f(GLint location,
+void yagl_host_glUniform3f(GLint location,
     GLfloat x,
     GLfloat y,
     GLfloat z)
@@ -1745,36 +1275,17 @@ bool yagl_host_glUniform3f(GLint location,
     YAGL_GET_CTX(glUniform3f);
 
     ctx->driver->Uniform3f(location, x, y, z);
-
-    return true;
 }
 
-bool yagl_host_glUniform3fv(GLint location,
-    GLsizei count,
-    target_ulong /* const GLfloat* */ v_)
+void yagl_host_glUniform3fv(GLint location,
+    const GLfloat *v, int32_t v_count)
 {
-    bool res = true;
-    GLfloat *v = NULL;
-
     YAGL_GET_CTX(glUniform3fv);
 
-    if (v_) {
-        v = yagl_gles_context_malloc(&ctx->base, 3 * count * sizeof(*v));
-        if (!yagl_mem_get(v_,
-                          3 * count * sizeof(*v),
-                          v)) {
-            res = false;
-            goto out;
-        }
-    }
-
-    ctx->driver->Uniform3fv(location, count, v);
-
-out:
-    return res;
+    ctx->driver->Uniform3fv(location, (v_count / 3), v);
 }
 
-bool yagl_host_glUniform3i(GLint location,
+void yagl_host_glUniform3i(GLint location,
     GLint x,
     GLint y,
     GLint z)
@@ -1782,36 +1293,17 @@ bool yagl_host_glUniform3i(GLint location,
     YAGL_GET_CTX(glUniform3i);
 
     ctx->driver->Uniform3i(location, x, y, z);
-
-    return true;
 }
 
-bool yagl_host_glUniform3iv(GLint location,
-    GLsizei count,
-    target_ulong /* const GLint* */ v_)
+void yagl_host_glUniform3iv(GLint location,
+    const GLint *v, int32_t v_count)
 {
-    bool res = true;
-    GLint *v = NULL;
-
     YAGL_GET_CTX(glUniform3iv);
 
-    if (v_) {
-        v = yagl_gles_context_malloc(&ctx->base, 3 * count * sizeof(*v));
-        if (!yagl_mem_get(v_,
-                          3 * count * sizeof(*v),
-                          v)) {
-            res = false;
-            goto out;
-        }
-    }
-
-    ctx->driver->Uniform3iv(location, count, v);
-
-out:
-    return res;
+    ctx->driver->Uniform3iv(location, (v_count / 3), v);
 }
 
-bool yagl_host_glUniform4f(GLint location,
+void yagl_host_glUniform4f(GLint location,
     GLfloat x,
     GLfloat y,
     GLfloat z,
@@ -1820,36 +1312,17 @@ bool yagl_host_glUniform4f(GLint location,
     YAGL_GET_CTX(glUniform4f);
 
     ctx->driver->Uniform4f(location, x, y, z, w);
-
-    return true;
 }
 
-bool yagl_host_glUniform4fv(GLint location,
-    GLsizei count,
-    target_ulong /* const GLfloat* */ v_)
+void yagl_host_glUniform4fv(GLint location,
+    const GLfloat *v, int32_t v_count)
 {
-    bool res = true;
-    GLfloat *v = NULL;
-
     YAGL_GET_CTX(glUniform4fv);
 
-    if (v_) {
-        v = yagl_gles_context_malloc(&ctx->base, 4 * count * sizeof(*v));
-        if (!yagl_mem_get(v_,
-                          4 * count * sizeof(*v),
-                          v)) {
-            res = false;
-            goto out;
-        }
-    }
-
-    ctx->driver->Uniform4fv(location, count, v);
-
-out:
-    return res;
+    ctx->driver->Uniform4fv(location, (v_count / 4), v);
 }
 
-bool yagl_host_glUniform4i(GLint location,
+void yagl_host_glUniform4i(GLint location,
     GLint x,
     GLint y,
     GLint z,
@@ -1858,114 +1331,44 @@ bool yagl_host_glUniform4i(GLint location,
     YAGL_GET_CTX(glUniform4i);
 
     ctx->driver->Uniform4i(location, x, y, z, w);
-
-    return true;
 }
 
-bool yagl_host_glUniform4iv(GLint location,
-    GLsizei count,
-    target_ulong /* const GLint* */ v_)
+void yagl_host_glUniform4iv(GLint location,
+    const GLint *v, int32_t v_count)
 {
-    bool res = true;
-    GLint *v = NULL;
-
     YAGL_GET_CTX(glUniform4iv);
 
-    if (v_) {
-        v = yagl_gles_context_malloc(&ctx->base, 4 * count * sizeof(*v));
-        if (!yagl_mem_get(v_,
-                          4 * count * sizeof(*v),
-                          v)) {
-            res = false;
-            goto out;
-        }
-    }
-
-    ctx->driver->Uniform4iv(location, count, v);
-
-out:
-    return res;
+    ctx->driver->Uniform4iv(location, (v_count / 4), v);
 }
 
-bool yagl_host_glUniformMatrix2fv(GLint location,
-    GLsizei count,
+void yagl_host_glUniformMatrix2fv(GLint location,
     GLboolean transpose,
-    target_ulong /* const GLfloat* */ value_)
+    const GLfloat *value, int32_t value_count)
 {
-    bool res = true;
-    GLfloat *value = NULL;
-
     YAGL_GET_CTX(glUniformMatrix2fv);
 
-    if (value_) {
-        value = yagl_gles_context_malloc(&ctx->base, 2 * 2 * count * sizeof(*value));
-        if (!yagl_mem_get(value_,
-                          2 * 2 * count * sizeof(*value),
-                          value)) {
-            res = false;
-            goto out;
-        }
-    }
-
-    ctx->driver->UniformMatrix2fv(location, count, transpose, value);
-
-out:
-    return res;
+    ctx->driver->UniformMatrix2fv(location, value_count / (2 * 2), transpose, value);
 }
 
-bool yagl_host_glUniformMatrix3fv(GLint location,
-    GLsizei count,
+void yagl_host_glUniformMatrix3fv(GLint location,
     GLboolean transpose,
-    target_ulong /* const GLfloat* */ value_)
+    const GLfloat *value, int32_t value_count)
 {
-    bool res = true;
-    GLfloat *value = NULL;
-
     YAGL_GET_CTX(glUniformMatrix3fv);
 
-    if (value_) {
-        value = yagl_gles_context_malloc(&ctx->base, 3 * 3 * count * sizeof(*value));
-        if (!yagl_mem_get(value_,
-                          3 * 3 * count * sizeof(*value),
-                          value)) {
-            res = false;
-            goto out;
-        }
-    }
-
-    ctx->driver->UniformMatrix3fv(location, count, transpose, value);
-
-out:
-    return res;
+    ctx->driver->UniformMatrix3fv(location, value_count / (3 * 3), transpose, value);
 }
 
-bool yagl_host_glUniformMatrix4fv(GLint location,
-    GLsizei count,
+void yagl_host_glUniformMatrix4fv(GLint location,
     GLboolean transpose,
-    target_ulong /* const GLfloat* */ value_)
+    const GLfloat *value, int32_t value_count)
 {
-    bool res = true;
-    GLfloat *value = NULL;
-
     YAGL_GET_CTX(glUniformMatrix4fv);
 
-    if (value_) {
-        value = yagl_gles_context_malloc(&ctx->base, 4 * 4 * count * sizeof(*value));
-        if (!yagl_mem_get(value_,
-                          4 * 4 * count * sizeof(*value),
-                          value)) {
-            res = false;
-            goto out;
-        }
-    }
-
-    ctx->driver->UniformMatrix4fv(location, count, transpose, value);
-
-out:
-    return res;
+    ctx->driver->UniformMatrix4fv(location, value_count / (4 * 4), transpose, value);
 }
 
-bool yagl_host_glUseProgram(GLuint program)
+void yagl_host_glUseProgram(GLuint program)
 {
     struct yagl_gles2_program *program_obj = NULL;
 
@@ -1992,11 +1395,9 @@ bool yagl_host_glUseProgram(GLuint program)
 
 out:
     yagl_gles2_program_release(program_obj);
-
-    return true;
 }
 
-bool yagl_host_glValidateProgram(GLuint program)
+void yagl_host_glValidateProgram(GLuint program)
 {
     struct yagl_gles2_program *program_obj = NULL;
 
@@ -2019,74 +1420,42 @@ bool yagl_host_glValidateProgram(GLuint program)
 
 out:
     yagl_gles2_program_release(program_obj);
-
-    return true;
 }
 
-bool yagl_host_glVertexAttrib1f(GLuint indx,
+void yagl_host_glVertexAttrib1f(GLuint indx,
     GLfloat x)
 {
     YAGL_GET_CTX(glVertexAttrib1f);
 
     ctx->driver->VertexAttrib1f(indx, x);
-
-    return true;
 }
 
-bool yagl_host_glVertexAttrib1fv(GLuint indx,
-    target_ulong /* const GLfloat* */ values_)
+void yagl_host_glVertexAttrib1fv(GLuint indx,
+    const GLfloat *values, int32_t values_count)
 {
-    GLfloat values[1];
-
     YAGL_GET_CTX(glVertexAttrib1fv);
 
-    if (values_) {
-        if (!yagl_mem_get(values_,
-                          sizeof(values),
-                          &values[0])) {
-            return false;
-        }
-    }
-
-    ctx->driver->VertexAttrib1fv(indx,
-                                 (values_ ? &values[0] : NULL));
-
-    return true;
+    ctx->driver->VertexAttrib1fv(indx, values);
 }
 
-bool yagl_host_glVertexAttrib2f(GLuint indx,
+void yagl_host_glVertexAttrib2f(GLuint indx,
     GLfloat x,
     GLfloat y)
 {
     YAGL_GET_CTX(glVertexAttrib2f);
 
     ctx->driver->VertexAttrib2f(indx, x, y);
-
-    return true;
 }
 
-bool yagl_host_glVertexAttrib2fv(GLuint indx,
-    target_ulong /* const GLfloat* */ values_)
+void yagl_host_glVertexAttrib2fv(GLuint indx,
+    const GLfloat *values, int32_t values_count)
 {
-    GLfloat values[2];
-
     YAGL_GET_CTX(glVertexAttrib2fv);
 
-    if (values_) {
-        if (!yagl_mem_get(values_,
-                          sizeof(values),
-                          &values[0])) {
-            return false;
-        }
-    }
-
-    ctx->driver->VertexAttrib2fv(indx,
-                                 (values_ ? &values[0] : NULL));
-
-    return true;
+    ctx->driver->VertexAttrib2fv(indx, values);
 }
 
-bool yagl_host_glVertexAttrib3f(GLuint indx,
+void yagl_host_glVertexAttrib3f(GLuint indx,
     GLfloat x,
     GLfloat y,
     GLfloat z)
@@ -2094,32 +1463,17 @@ bool yagl_host_glVertexAttrib3f(GLuint indx,
     YAGL_GET_CTX(glVertexAttrib3f);
 
     ctx->driver->VertexAttrib3f(indx, x, y, z);
-
-    return true;
 }
 
-bool yagl_host_glVertexAttrib3fv(GLuint indx,
-    target_ulong /* const GLfloat* */ values_)
+void yagl_host_glVertexAttrib3fv(GLuint indx,
+    const GLfloat *values, int32_t values_count)
 {
-    GLfloat values[3];
-
     YAGL_GET_CTX(glVertexAttrib3fv);
 
-    if (values_) {
-        if (!yagl_mem_get(values_,
-                          sizeof(values),
-                          &values[0])) {
-            return false;
-        }
-    }
-
-    ctx->driver->VertexAttrib3fv(indx,
-                                 (values_ ? &values[0] : NULL));
-
-    return true;
+    ctx->driver->VertexAttrib3fv(indx, values);
 }
 
-bool yagl_host_glVertexAttrib4f(GLuint indx,
+void yagl_host_glVertexAttrib4f(GLuint indx,
     GLfloat x,
     GLfloat y,
     GLfloat z,
@@ -2128,37 +1482,22 @@ bool yagl_host_glVertexAttrib4f(GLuint indx,
     YAGL_GET_CTX(glVertexAttrib4f);
 
     ctx->driver->VertexAttrib4f(indx, x, y, z, w);
-
-    return true;
 }
 
-bool yagl_host_glVertexAttrib4fv(GLuint indx,
-    target_ulong /* const GLfloat* */ values_)
+void yagl_host_glVertexAttrib4fv(GLuint indx,
+    const GLfloat *values, int32_t values_count)
 {
-    GLfloat values[4];
-
     YAGL_GET_CTX(glVertexAttrib4fv);
 
-    if (values_) {
-        if (!yagl_mem_get(values_,
-                          sizeof(values),
-                          &values[0])) {
-            return false;
-        }
-    }
-
-    ctx->driver->VertexAttrib4fv(indx,
-                                 (values_ ? &values[0] : NULL));
-
-    return true;
+    ctx->driver->VertexAttrib4fv(indx, values);
 }
 
-bool yagl_host_glVertexAttribPointer(GLuint indx,
+void yagl_host_glVertexAttribPointer(GLuint indx,
     GLint size,
     GLenum type,
     GLboolean normalized,
     GLsizei stride,
-    target_ulong /* const GLvoid* */ ptr)
+    target_ulong ptr)
 {
     struct yagl_gles_array *array = NULL;
 
@@ -2168,7 +1507,7 @@ bool yagl_host_glVertexAttribPointer(GLuint indx,
 
     if (!array) {
         YAGL_SET_ERR(GL_INVALID_VALUE);
-        return true;
+        return;
     }
 
     if (ctx->base.vbo) {
@@ -2194,6 +1533,4 @@ bool yagl_host_glVertexAttribPointer(GLuint indx,
             YAGL_SET_ERR(GL_INVALID_VALUE);
         }
     }
-
-    return true;
 }
index 5d7de16..9d190a2 100644 (file)
 
 struct yagl_api_ps *yagl_host_gles2_process_init(struct yagl_api *api);
 
-bool yagl_host_glAttachShader(GLuint program,
+void yagl_host_glAttachShader(GLuint program,
     GLuint shader);
-bool yagl_host_glBindAttribLocation(GLuint program,
+void yagl_host_glBindAttribLocation(GLuint program,
     GLuint index,
-    target_ulong /* const GLchar* */ name_);
-bool yagl_host_glBlendColor(GLclampf red,
+    const GLchar *name, int32_t name_count);
+void yagl_host_glBlendColor(GLclampf red,
     GLclampf green,
     GLclampf blue,
     GLclampf alpha);
-bool yagl_host_glCompileShader(GLuint shader);
-bool yagl_host_glCreateProgram(GLuint* retval);
-bool yagl_host_glCreateShader(GLuint* retval,
-    GLenum type);
-bool yagl_host_glDeleteProgram(GLuint program);
-bool yagl_host_glDeleteShader(GLuint shader);
-bool yagl_host_glDetachShader(GLuint program,
+void yagl_host_glCompileShader(GLuint shader);
+GLuint yagl_host_glCreateProgram(void);
+GLuint yagl_host_glCreateShader(GLenum type);
+void yagl_host_glDeleteProgram(GLuint program);
+void yagl_host_glDeleteShader(GLuint shader);
+void yagl_host_glDetachShader(GLuint program,
     GLuint shader);
-bool yagl_host_glDisableVertexAttribArray(GLuint index);
-bool yagl_host_glEnableVertexAttribArray(GLuint index);
-bool yagl_host_glGetActiveAttrib(GLuint program,
+void yagl_host_glDisableVertexAttribArray(GLuint index);
+void yagl_host_glEnableVertexAttribArray(GLuint index);
+void yagl_host_glGetActiveAttrib(GLuint program,
     GLuint index,
-    GLsizei bufsize,
-    target_ulong /* GLsizei* */ length_,
-    target_ulong /* GLint* */ size_,
-    target_ulong /* GLenum* */ type_,
-    target_ulong /* GLchar* */ name_);
-bool yagl_host_glGetActiveUniform(GLuint program,
+    GLint *size,
+    GLenum *type,
+    GLchar *name, int32_t name_maxcount, int32_t *name_count);
+void yagl_host_glGetActiveUniform(GLuint program,
     GLuint index,
-    GLsizei bufsize,
-    target_ulong /* GLsizei* */ length_,
-    target_ulong /* GLint* */ size_,
-    target_ulong /* GLenum* */ type_,
-    target_ulong /* GLchar* */ name_);
-bool yagl_host_glGetAttachedShaders(GLuint program,
-    GLsizei maxcount,
-    target_ulong /* GLsizei* */ count_,
-    target_ulong /* GLuint* */ shaders_);
-bool yagl_host_glGetAttribLocation(int* retval,
-    GLuint program,
-    target_ulong /* const GLchar* */ name_);
-bool yagl_host_glGetProgramiv(GLuint program,
+    GLint *size,
+    GLenum *type,
+    GLchar *name, int32_t name_maxcount, int32_t *name_count);
+void yagl_host_glGetAttachedShaders(GLuint program,
+    GLuint *shaders, int32_t shaders_maxcount, int32_t *shaders_count);
+int yagl_host_glGetAttribLocation(GLuint program,
+    const GLchar *name, int32_t name_count);
+void yagl_host_glGetProgramiv(GLuint program,
     GLenum pname,
-    target_ulong /* GLint* */ params_);
-bool yagl_host_glGetProgramInfoLog(GLuint program,
-    GLsizei bufsize,
-    target_ulong /* GLsizei* */ length_,
-    target_ulong /* GLchar* */ infolog_);
-bool yagl_host_glGetShaderiv(GLuint shader,
+    GLint *param);
+void yagl_host_glGetProgramInfoLog(GLuint program,
+    GLchar *infolog, int32_t infolog_maxcount, int32_t *infolog_count);
+void yagl_host_glGetShaderiv(GLuint shader,
     GLenum pname,
-    target_ulong /* GLint* */ params_);
-bool yagl_host_glGetShaderInfoLog(GLuint shader,
-    GLsizei bufsize,
-    target_ulong /* GLsizei* */ length_,
-    target_ulong /* GLchar* */ infolog_);
-bool yagl_host_glGetShaderPrecisionFormat(GLenum shadertype,
+    GLint *param);
+void yagl_host_glGetShaderInfoLog(GLuint shader,
+    GLchar *infolog, int32_t infolog_maxcount, int32_t *infolog_count);
+void yagl_host_glGetShaderPrecisionFormat(GLenum shadertype,
     GLenum precisiontype,
-    target_ulong /* GLint* */ range_,
-    target_ulong /* GLint* */ precision_);
-bool yagl_host_glGetShaderSource(GLuint shader,
-    GLsizei bufsize,
-    target_ulong /* GLsizei* */ length_,
-    target_ulong /* GLchar* */ source_);
-bool yagl_host_glGetUniformfv(GLuint program,
+    GLint *range, int32_t range_maxcount, int32_t *range_count,
+    GLint *precision);
+void yagl_host_glGetShaderSource(GLuint shader,
+    GLchar *source, int32_t source_maxcount, int32_t *source_count);
+void yagl_host_glGetUniformfv(GLuint program,
     GLint location,
-    target_ulong /* GLfloat* */ params_);
-bool yagl_host_glGetUniformiv(GLuint program,
+    GLfloat *params, int32_t params_maxcount, int32_t *params_count);
+void yagl_host_glGetUniformiv(GLuint program,
     GLint location,
-    target_ulong /* GLint* */ params_);
-bool yagl_host_glGetUniformLocation(int* retval,
-    GLuint program,
-    target_ulong /* const GLchar* */ name_);
-bool yagl_host_glGetVertexAttribfv(GLuint index,
+    GLint *params, int32_t params_maxcount, int32_t *params_count);
+int yagl_host_glGetUniformLocation(GLuint program,
+    const GLchar *name, int32_t name_count);
+void yagl_host_glGetVertexAttribfv(GLuint index,
     GLenum pname,
-    target_ulong /* GLfloat* */ params_);
-bool yagl_host_glGetVertexAttribiv(GLuint index,
+    GLfloat *params, int32_t params_maxcount, int32_t *params_count);
+void yagl_host_glGetVertexAttribiv(GLuint index,
     GLenum pname,
-    target_ulong /* GLint* */ params_);
-bool yagl_host_glGetVertexAttribPointerv(GLuint index,
+    GLint *params, int32_t params_maxcount, int32_t *params_count);
+void yagl_host_glGetVertexAttribPointerv(GLuint index,
     GLenum pname,
-    target_ulong /* GLvoid** */ pointer_);
-bool yagl_host_glIsProgram(GLboolean* retval,
-    GLuint program);
-bool yagl_host_glIsShader(GLboolean* retval,
-    GLuint shader);
-bool yagl_host_glLinkProgram(GLuint program);
-bool yagl_host_glReleaseShaderCompiler(void);
-bool yagl_host_glShaderBinary(GLsizei n,
-    target_ulong /* const GLuint* */ shaders,
+    target_ulong *pointer);
+GLboolean yagl_host_glIsProgram(GLuint program);
+GLboolean yagl_host_glIsShader(GLuint shader);
+void yagl_host_glLinkProgram(GLuint program);
+void yagl_host_glReleaseShaderCompiler(void);
+void yagl_host_glShaderBinary(const GLuint *shaders, int32_t shaders_count,
     GLenum binaryformat,
-    target_ulong /* const GLvoid* */ binary,
-    GLsizei length);
-bool yagl_host_glShaderSource(GLuint shader,
-    GLsizei count,
-    target_ulong /* const GLchar** */ string_,
-    target_ulong /* const GLint* */ length_);
-bool yagl_host_glStencilFuncSeparate(GLenum face,
+    const GLvoid *binary, int32_t binary_count);
+void yagl_host_glShaderSource(GLuint shader,
+    const GLchar *string, int32_t string_count);
+void yagl_host_glStencilFuncSeparate(GLenum face,
     GLenum func,
     GLint ref,
     GLuint mask);
-bool yagl_host_glStencilMaskSeparate(GLenum face,
+void yagl_host_glStencilMaskSeparate(GLenum face,
     GLuint mask);
-bool yagl_host_glStencilOpSeparate(GLenum face,
+void yagl_host_glStencilOpSeparate(GLenum face,
     GLenum fail,
     GLenum zfail,
     GLenum zpass);
-bool yagl_host_glUniform1f(GLint location,
+void yagl_host_glUniform1f(GLint location,
     GLfloat x);
-bool yagl_host_glUniform1fv(GLint location,
-    GLsizei count,
-    target_ulong /* const GLfloat* */ v_);
-bool yagl_host_glUniform1i(GLint location,
+void yagl_host_glUniform1fv(GLint location,
+    const GLfloat *v, int32_t v_count);
+void yagl_host_glUniform1i(GLint location,
     GLint x);
-bool yagl_host_glUniform1iv(GLint location,
-    GLsizei count,
-    target_ulong /* const GLint* */ v_);
-bool yagl_host_glUniform2f(GLint location,
+void yagl_host_glUniform1iv(GLint location,
+    const GLint *v, int32_t v_count);
+void yagl_host_glUniform2f(GLint location,
     GLfloat x,
     GLfloat y);
-bool yagl_host_glUniform2fv(GLint location,
-    GLsizei count,
-    target_ulong /* const GLfloat* */ v_);
-bool yagl_host_glUniform2i(GLint location,
+void yagl_host_glUniform2fv(GLint location,
+    const GLfloat *v, int32_t v_count);
+void yagl_host_glUniform2i(GLint location,
     GLint x,
     GLint y);
-bool yagl_host_glUniform2iv(GLint location,
-    GLsizei count,
-    target_ulong /* const GLint* */ v_);
-bool yagl_host_glUniform3f(GLint location,
+void yagl_host_glUniform2iv(GLint location,
+    const GLint *v, int32_t v_count);
+void yagl_host_glUniform3f(GLint location,
     GLfloat x,
     GLfloat y,
     GLfloat z);
-bool yagl_host_glUniform3fv(GLint location,
-    GLsizei count,
-    target_ulong /* const GLfloat* */ v_);
-bool yagl_host_glUniform3i(GLint location,
+void yagl_host_glUniform3fv(GLint location,
+    const GLfloat *v, int32_t v_count);
+void yagl_host_glUniform3i(GLint location,
     GLint x,
     GLint y,
     GLint z);
-bool yagl_host_glUniform3iv(GLint location,
-    GLsizei count,
-    target_ulong /* const GLint* */ v_);
-bool yagl_host_glUniform4f(GLint location,
+void yagl_host_glUniform3iv(GLint location,
+    const GLint *v, int32_t v_count);
+void yagl_host_glUniform4f(GLint location,
     GLfloat x,
     GLfloat y,
     GLfloat z,
     GLfloat w);
-bool yagl_host_glUniform4fv(GLint location,
-    GLsizei count,
-    target_ulong /* const GLfloat* */ v_);
-bool yagl_host_glUniform4i(GLint location,
+void yagl_host_glUniform4fv(GLint location,
+    const GLfloat *v, int32_t v_count);
+void yagl_host_glUniform4i(GLint location,
     GLint x,
     GLint y,
     GLint z,
     GLint w);
-bool yagl_host_glUniform4iv(GLint location,
-    GLsizei count,
-    target_ulong /* const GLint* */ v_);
-bool yagl_host_glUniformMatrix2fv(GLint location,
-    GLsizei count,
+void yagl_host_glUniform4iv(GLint location,
+    const GLint *v, int32_t v_count);
+void yagl_host_glUniformMatrix2fv(GLint location,
     GLboolean transpose,
-    target_ulong /* const GLfloat* */ value_);
-bool yagl_host_glUniformMatrix3fv(GLint location,
-    GLsizei count,
+    const GLfloat *value, int32_t value_count);
+void yagl_host_glUniformMatrix3fv(GLint location,
     GLboolean transpose,
-    target_ulong /* const GLfloat* */ value_);
-bool yagl_host_glUniformMatrix4fv(GLint location,
-    GLsizei count,
+    const GLfloat *value, int32_t value_count);
+void yagl_host_glUniformMatrix4fv(GLint location,
     GLboolean transpose,
-    target_ulong /* const GLfloat* */ value_);
-bool yagl_host_glUseProgram(GLuint program);
-bool yagl_host_glValidateProgram(GLuint program);
-bool yagl_host_glVertexAttrib1f(GLuint indx,
+    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,
     GLfloat x);
-bool yagl_host_glVertexAttrib1fv(GLuint indx,
-    target_ulong /* const GLfloat* */ values_);
-bool yagl_host_glVertexAttrib2f(GLuint indx,
+void yagl_host_glVertexAttrib1fv(GLuint indx,
+    const GLfloat *values, int32_t values_count);
+void yagl_host_glVertexAttrib2f(GLuint indx,
     GLfloat x,
     GLfloat y);
-bool yagl_host_glVertexAttrib2fv(GLuint indx,
-    target_ulong /* const GLfloat* */ values_);
-bool yagl_host_glVertexAttrib3f(GLuint indx,
+void yagl_host_glVertexAttrib2fv(GLuint indx,
+    const GLfloat *values, int32_t values_count);
+void yagl_host_glVertexAttrib3f(GLuint indx,
     GLfloat x,
     GLfloat y,
     GLfloat z);
-bool yagl_host_glVertexAttrib3fv(GLuint indx,
-    target_ulong /* const GLfloat* */ values_);
-bool yagl_host_glVertexAttrib4f(GLuint indx,
+void yagl_host_glVertexAttrib3fv(GLuint indx,
+    const GLfloat *values, int32_t values_count);
+void yagl_host_glVertexAttrib4f(GLuint indx,
     GLfloat x,
     GLfloat y,
     GLfloat z,
     GLfloat w);
-bool yagl_host_glVertexAttrib4fv(GLuint indx,
-    target_ulong /* const GLfloat* */ values_);
-bool yagl_host_glVertexAttribPointer(GLuint indx,
+void yagl_host_glVertexAttrib4fv(GLuint indx,
+    const GLfloat *values, int32_t values_count);
+void yagl_host_glVertexAttribPointer(GLuint indx,
     GLint size,
     GLenum type,
     GLboolean normalized,
     GLsizei stride,
-    target_ulong /* const GLvoid* */ ptr);
+    target_ulong ptr);
 
 #endif
index 05e1c20..49c85e0 100644 (file)
 
 YAGL_DECLARE_TLS(struct yagl_egl_offscreen_ts*, egl_offscreen_ts);
 
-static bool yagl_egl_offscreen_image_update(struct yagl_eglb_image *image,
+static void yagl_egl_offscreen_image_update(struct yagl_eglb_image *image,
                                             uint32_t width,
                                             uint32_t height,
                                             uint32_t bpp,
-                                            target_ulong pixels)
+                                            const void *pixels)
 {
     struct yagl_eglb_context *ctx =
         (egl_offscreen_ts->ctx ? &egl_offscreen_ts->ctx->base : NULL);
 
     if (!ctx) {
-        return true;
+        return;
     }
 
     if (!image->glegl_image) {
         image->glegl_image = ctx->client_ctx->create_image(ctx->client_ctx);
         if (!image->glegl_image) {
-            return true;
+            return;
         }
     }
 
-    return image->glegl_image->update(image->glegl_image, width, height, bpp, pixels);
+    image->glegl_image->update(image->glegl_image, width, height, bpp, pixels);
 }
 
 static void yagl_egl_offscreen_image_destroy(struct yagl_eglb_image *image)
index e66b7e7..8bec3ea 100644 (file)
@@ -10,14 +10,11 @@ struct yagl_client_image
 
     struct yagl_ref *data;
 
-    /*
-     * Returns 'false' on page fault while reading 'pixels'.
-     */
-    bool (*update)(struct yagl_client_image */*image*/,
+    void (*update)(struct yagl_client_image */*image*/,
                    uint32_t /*width*/,
                    uint32_t /*height*/,
                    uint32_t /*bpp*/,
-                   target_ulong /*pixels*/);
+                   const void */*pixels*/);
 };
 
 void yagl_client_image_init(struct yagl_client_image *image,
index 1d805a2..54b808d 100644 (file)
@@ -1,7 +1,6 @@
 #include "yagl_server.h"
 #include "yagl_log.h"
 #include "yagl_handle_gen.h"
-#include "yagl_marshal.h"
 #include "yagl_stats.h"
 #include "yagl_process.h"
 #include "yagl_thread.h"
@@ -33,7 +32,7 @@
 
 struct yagl_user
 {
-    uint8_t *buff;
+    bool activated;
     yagl_pid process_id;
     yagl_tid thread_id;
 };
@@ -46,83 +45,66 @@ typedef struct YaGLState
     MemoryRegion iomem;
     struct yagl_server_state *ss;
     struct yagl_user users[YAGL_MAX_USERS];
-
-    /*
-     * YAGL_MARSHAL_MAX_RESPONSE byte buffer to hold the response.
-     */
-    uint8_t *in_buff;
 } YaGLState;
 
 #define TYPE_YAGL_DEVICE "yagl"
 
-static void yagl_device_operate(YaGLState *s,
-                                int user_index,
-                                hwaddr buff_pa)
+static void yagl_device_operate(YaGLState *s, int user_index, hwaddr buff_pa)
 {
     yagl_pid target_pid;
     yagl_tid target_tid;
-    hwaddr buff_len = YAGL_MARSHAL_SIZE;
-    uint8_t *buff = NULL, *tmp = NULL;
+    hwaddr buff_len = TARGET_PAGE_SIZE;
+    uint8_t *buff = NULL;
 
     YAGL_LOG_FUNC_ENTER(yagl_device_operate,
-                        "user_index = %d, buff_ptr = 0x%X",
+                        "user_index = %d, buff_pa = 0x%X",
                         user_index,
                         (uint32_t)buff_pa);
 
-    if (buff_pa && s->users[user_index].buff) {
-        YAGL_LOG_CRITICAL("user %d is already activated", user_index);
-        goto out;
-    }
-
-    if (!buff_pa && !s->users[user_index].buff) {
+    if (!buff_pa && !s->users[user_index].activated) {
         YAGL_LOG_CRITICAL("user %d is not activated", user_index);
         goto out;
     }
 
     if (buff_pa) {
-        /*
-         * Activate user.
-         */
-
         buff = cpu_physical_memory_map(buff_pa, &buff_len, false);
 
-        if (!buff || (buff_len != YAGL_MARSHAL_SIZE)) {
-            YAGL_LOG_CRITICAL("cpu_physical_memory_map(read) failed for user %d, buff_ptr = 0x%X",
+        if (!buff || (buff_len != TARGET_PAGE_SIZE)) {
+            YAGL_LOG_CRITICAL("cpu_physical_memory_map(read) failed for user %d, buff_pa = 0x%X",
                               user_index,
                               (uint32_t)buff_pa);
             goto out;
         }
 
-        tmp = buff;
-
-        yagl_marshal_skip(&tmp);
-
-        target_pid = yagl_marshal_get_pid(&tmp);
-        target_tid = yagl_marshal_get_tid(&tmp);
-
-        YAGL_LOG_TRACE("pid = %u, tid = %u", target_pid, target_tid);
-
-        if (!target_pid || !target_tid) {
-            YAGL_LOG_CRITICAL(
-                "target-host protocol error, zero pid or tid from target");
-            goto out;
-        }
-
-        if (yagl_server_dispatch_init(s->ss,
-                                      target_pid,
-                                      target_tid,
-                                      buff,
-                                      s->in_buff)) {
-
-            memcpy(buff, s->in_buff, YAGL_MARSHAL_MAX_RESPONSE);
-
-            s->users[user_index].buff = buff;
-            s->users[user_index].process_id = target_pid;
-            s->users[user_index].thread_id = target_tid;
-
-            buff = NULL;
-
-            YAGL_LOG_INFO("user %d activated", user_index);
+        if (s->users[user_index].activated) {
+            /*
+             * Update user.
+             */
+
+            yagl_server_dispatch_update(s->ss,
+                                        s->users[user_index].process_id,
+                                        s->users[user_index].thread_id,
+                                        buff);
+        } else {
+            /*
+             * Activate user.
+             */
+
+            if (yagl_server_dispatch_init(s->ss,
+                                          buff,
+                                          &target_pid,
+                                          &target_tid)) {
+                s->users[user_index].activated = true;
+                s->users[user_index].process_id = target_pid;
+                s->users[user_index].thread_id = target_tid;
+
+                YAGL_LOG_INFO("user %d activated", user_index);
+
+                /*
+                 * The buff is now owned by client.
+                 */
+                buff = NULL;
+            }
         }
     } else {
         /*
@@ -133,11 +115,6 @@ static void yagl_device_operate(YaGLState *s,
                                   s->users[user_index].process_id,
                                   s->users[user_index].thread_id);
 
-        cpu_physical_memory_unmap(s->users[user_index].buff,
-                                  YAGL_MARSHAL_SIZE,
-                                  0,
-                                  YAGL_MARSHAL_SIZE);
-
         memset(&s->users[user_index], 0, sizeof(s->users[user_index]));
 
         YAGL_LOG_INFO("user %d deactivated", user_index);
@@ -146,32 +123,27 @@ static void yagl_device_operate(YaGLState *s,
 out:
     if (buff) {
         cpu_physical_memory_unmap(buff,
-                                  YAGL_MARSHAL_SIZE,
+                                  TARGET_PAGE_SIZE,
                                   0,
-                                  YAGL_MARSHAL_SIZE);
+                                  TARGET_PAGE_SIZE);
     }
 
     YAGL_LOG_FUNC_EXIT(NULL);
 }
 
-static void yagl_device_trigger(YaGLState *s, int user_index)
+static void yagl_device_trigger(YaGLState *s, int user_index, uint32_t offset)
 {
-    YAGL_LOG_FUNC_ENTER(yagl_device_trigger, "%d", user_index);
+    YAGL_LOG_FUNC_ENTER(yagl_device_trigger, "%d, %u", user_index, offset);
 
-    if (!s->users[user_index].buff) {
+    if (s->users[user_index].activated) {
+        yagl_server_dispatch_batch(s->ss,
+                                   s->users[user_index].process_id,
+                                   s->users[user_index].thread_id,
+                                   offset);
+    } else {
         YAGL_LOG_CRITICAL("user %d not activated", user_index);
-        goto out;
     }
 
-    yagl_server_dispatch(s->ss,
-                         s->users[user_index].process_id,
-                         s->users[user_index].thread_id,
-                         s->users[user_index].buff,
-                         s->in_buff);
-
-    memcpy(s->users[user_index].buff, s->in_buff, YAGL_MARSHAL_MAX_RESPONSE);
-
-out:
     YAGL_LOG_FUNC_EXIT(NULL);
 }
 
@@ -200,7 +172,7 @@ static void yagl_device_write(void *opaque, hwaddr offset,
         yagl_device_operate(s, user_index, value);
         break;
     case YAGL_REG_TRIGGER:
-        yagl_device_trigger(s, user_index);
+        yagl_device_trigger(s, user_index, value);
         break;
     default:
         YAGL_LOG_CRITICAL("user %d, bad offset = %d", user_index, offset);
@@ -235,8 +207,6 @@ static int yagl_device_init(PCIDevice *dev)
 
     yagl_handle_gen_init();
 
-    yagl_stats_init();
-
     egl_driver = yagl_egl_driver_create(s->display);
 
     if (!egl_driver) {
@@ -287,8 +257,6 @@ static int yagl_device_init(PCIDevice *dev)
         goto fail;
     }
 
-    s->in_buff = g_malloc(YAGL_MARSHAL_MAX_RESPONSE);
-
     pci_register_bar(&s->dev, 0, PCI_BASE_ADDRESS_SPACE_MEMORY, &s->iomem);
 
     YAGL_LOG_FUNC_EXIT(NULL);
@@ -312,8 +280,6 @@ fail:
         egl_driver->destroy(egl_driver);
     }
 
-    yagl_stats_cleanup();
-
     yagl_handle_gen_cleanup();
 
     YAGL_LOG_FUNC_EXIT(NULL);
@@ -349,13 +315,8 @@ static void yagl_device_exit(PCIDevice *dev)
 
     memory_region_destroy(&s->iomem);
 
-    g_free(s->in_buff);
-    s->in_buff = NULL;
-
     yagl_server_state_destroy(s->ss);
 
-    yagl_stats_cleanup();
-
     yagl_handle_gen_cleanup();
 
     YAGL_LOG_FUNC_EXIT(NULL);
index 0b87b1d..7e485cd 100644 (file)
@@ -17,14 +17,11 @@ struct yagl_eglb_image
      */
     struct yagl_client_image *glegl_image;
 
-    /*
-     * Returns 'false' on page fault while reading 'pixels'.
-     */
-    bool (*update_offscreen)(struct yagl_eglb_image */*image*/,
+    void (*update_offscreen)(struct yagl_eglb_image */*image*/,
                              uint32_t /*width*/,
                              uint32_t /*height*/,
                              uint32_t /*bpp*/,
-                             target_ulong /*pixels*/);
+                             const void */*pixels*/);
 
     void (*destroy)(struct yagl_eglb_image */*image*/);
 };
index 524ee19..8d6203c 100644 (file)
@@ -24,11 +24,6 @@ static struct
     { "EGLboolean", "%u" },
     { "EGLenum", "0x%x" },
     { "EGLint", "%d" },
-    { "EGLConfig", "%p" },
-    { "EGLContext", "%p" },
-    { "EGLDisplay", "%p" },
-    { "EGLSurface", "%p" },
-    { "EGLClientBuffer", "%p" },
     { "yagl_host_handle", "%u" },
     { "yagl_winsys_id", "%u" },
     { "uint32_t", "%u" },
diff --git a/hw/yagl_marshal.h b/hw/yagl_marshal.h
deleted file mode 100644 (file)
index 859b99c..0000000
+++ /dev/null
@@ -1,180 +0,0 @@
-#ifndef _QEMU_YAGL_MARSHAL_H
-#define _QEMU_YAGL_MARSHAL_H
-
-#include "yagl_types.h"
-#include "exec/memory.h"
-
-/*
- * All marshalling/unmarshalling must be done with 8-byte alignment,
- * since this is the maximum alignment possible. This way we can
- * just do assignments without "memcpy" calls and can be sure that
- * the code won't fail on architectures that don't support unaligned
- * memory access.
- */
-
-/*
- * Each marshalled value is aligned
- * at 8-byte boundary and there may be maximum
- * 2 values returned (status and return value)
- */
-#define YAGL_MARSHAL_MAX_RESPONSE (8 * 2)
-
-/*
- * Max marshal buffer size.
- */
-#define YAGL_MARSHAL_SIZE 0x8000
-
-typedef enum
-{
-    yagl_call_result_fail = 0,  /* Call failed, fatal error. */
-    yagl_call_result_retry = 1, /* Page fault on host, retry is required. */
-    yagl_call_result_ok = 2     /* Call is ok. */
-} yagl_call_result;
-
-static __inline int yagl_marshal_skip(uint8_t** buff)
-{
-    *buff += 8;
-    return 0;
-}
-
-static __inline void yagl_marshal_put_uint8(uint8_t** buff, uint8_t value)
-{
-    **buff = value;
-    *buff += 8;
-}
-
-static __inline uint8_t yagl_marshal_get_uint8(uint8_t** buff)
-{
-    uint8_t tmp = **buff;
-    *buff += 8;
-    return tmp;
-}
-
-static __inline void yagl_marshal_put_uint32(uint8_t** buff, uint32_t value)
-{
-    *(uint32_t*)(*buff) = cpu_to_le32(value);
-    *buff += 8;
-}
-
-static __inline uint32_t yagl_marshal_get_uint32(uint8_t** buff)
-{
-    uint32_t tmp = le32_to_cpu(*(uint32_t*)*buff);
-    *buff += 8;
-    return tmp;
-}
-
-static __inline void yagl_marshal_put_float(uint8_t** buff, float value)
-{
-    *(float*)(*buff) = value;
-    *buff += 8;
-}
-
-static __inline float yagl_marshal_get_float(uint8_t** buff)
-{
-    float tmp = *(float*)*buff;
-    *buff += 8;
-    return tmp;
-}
-
-static __inline target_ulong yagl_marshal_get_ptr(uint8_t** buff)
-{
-#if TARGET_LONG_SIZE == 4
-    target_ulong tmp = le32_to_cpu(*(uint32_t*)*buff);
-#else
-    target_ulong tmp = le64_to_cpu(*(uint64_t*)*buff);
-#endif
-    *buff += 8;
-    return tmp;
-}
-
-static __inline void yagl_marshal_put_host_handle(uint8_t** buff, yagl_host_handle value)
-{
-    *(uint32_t*)(*buff) = cpu_to_le32(value);
-    *buff += 8;
-}
-
-static __inline yagl_host_handle yagl_marshal_get_host_handle(uint8_t** buff)
-{
-    yagl_host_handle tmp = le32_to_cpu(*(uint32_t*)*buff);
-    *buff += 8;
-    return tmp;
-}
-
-static __inline void yagl_marshal_put_call_result(uint8_t** buff, yagl_call_result value)
-{
-    *(uint32_t*)(*buff) = cpu_to_le32(value);
-    *buff += 8;
-}
-
-static __inline void yagl_marshal_put_int8(uint8_t** buff, int8_t value)
-{
-    yagl_marshal_put_uint8(buff, value);
-}
-
-static __inline int8_t yagl_marshal_get_int8(uint8_t** buff)
-{
-    return yagl_marshal_get_uint8(buff);
-}
-
-static __inline void yagl_marshal_put_int32(uint8_t** buff, int32_t value)
-{
-    yagl_marshal_put_uint32(buff, value);
-}
-
-static __inline int32_t yagl_marshal_get_int32(uint8_t** buff)
-{
-    return yagl_marshal_get_uint32(buff);
-}
-
-static __inline void yagl_marshal_put_uint32_t(uint8_t** buff, uint32_t value)
-{
-    yagl_marshal_put_uint32(buff, value);
-}
-
-static __inline uint32_t yagl_marshal_get_uint32_t(uint8_t** buff)
-{
-    return yagl_marshal_get_uint32(buff);
-}
-
-static __inline void yagl_marshal_put_int(uint8_t** buff, int value)
-{
-    yagl_marshal_put_int32(buff, value);
-}
-
-static __inline int yagl_marshal_get_int(uint8_t** buff)
-{
-    return yagl_marshal_get_int32(buff);
-}
-
-static __inline yagl_pid yagl_marshal_get_pid(uint8_t** buff)
-{
-    return yagl_marshal_get_uint32(buff);
-}
-
-static __inline yagl_tid yagl_marshal_get_tid(uint8_t** buff)
-{
-    return yagl_marshal_get_uint32(buff);
-}
-
-static __inline yagl_api_id yagl_marshal_get_api_id(uint8_t** buff)
-{
-    return yagl_marshal_get_uint32(buff);
-}
-
-static __inline yagl_func_id yagl_marshal_get_func_id(uint8_t** buff)
-{
-    return yagl_marshal_get_uint32(buff);
-}
-
-static __inline void yagl_marshal_put_render_type(uint8_t** buff,
-                                                  yagl_render_type value)
-{
-    yagl_marshal_put_uint32(buff, value);
-}
-
-static __inline yagl_winsys_id yagl_marshal_get_yagl_winsys_id(uint8_t** buff)
-{
-    return yagl_marshal_get_uint32(buff);
-}
-
-#endif
diff --git a/hw/yagl_marshal_egl.h b/hw/yagl_marshal_egl.h
deleted file mode 100644 (file)
index 624a1b7..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-#ifndef _QEMU_YAGL_MARSHAL_EGL_H
-#define _QEMU_YAGL_MARSHAL_EGL_H
-
-#include "yagl_marshal.h"
-#include <EGL/egl.h>
-
-#define yagl_marshal_put_EGLBoolean(buff, value) yagl_marshal_put_uint32((buff), (value))
-#define yagl_marshal_get_EGLBoolean(buff) yagl_marshal_get_uint32(buff)
-#define yagl_marshal_put_EGLenum(buff, value) yagl_marshal_put_uint32((buff), (value))
-#define yagl_marshal_get_EGLenum(buff) yagl_marshal_get_uint32(buff)
-#define yagl_marshal_put_EGLint(buff, value) yagl_marshal_put_int32((buff), (value))
-#define yagl_marshal_get_EGLint(buff) yagl_marshal_get_int32(buff)
-
-#define yagl_marshal_get_EGLClientBuffer(buff) (EGLClientBuffer)yagl_marshal_skip(buff)
-#define yagl_marshal_get_EGLNativePixmapType(buff) (EGLNativePixmapType)yagl_marshal_skip(buff)
-#define yagl_marshal_get_EGLNativeWindowType(buff) (EGLNativeWindowType)yagl_marshal_skip(buff)
-
-#endif
diff --git a/hw/yagl_marshal_gl.h b/hw/yagl_marshal_gl.h
deleted file mode 100644 (file)
index ac3efd8..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-#ifndef _QEMU_YAGL_MARSHAL_GL_H
-#define _QEMU_YAGL_MARSHAL_GL_H
-
-#include "yagl_marshal.h"
-
-#define yagl_marshal_put_GLboolean(buff, value) yagl_marshal_put_uint8((buff), (value))
-#define yagl_marshal_get_GLboolean(buff) yagl_marshal_get_uint8(buff)
-#define yagl_marshal_put_GLenum(buff, value) yagl_marshal_put_uint32((buff), (value))
-#define yagl_marshal_get_GLenum(buff) yagl_marshal_get_uint32(buff)
-#define yagl_marshal_put_GLuint(buff, value) yagl_marshal_put_uint32((buff), (value))
-#define yagl_marshal_get_GLuint(buff) yagl_marshal_get_uint32(buff)
-#define yagl_marshal_put_GLbitfield(buff, value) yagl_marshal_put_uint32((buff), (value))
-#define yagl_marshal_get_GLbitfield(buff) yagl_marshal_get_uint32(buff)
-#define yagl_marshal_put_GLclampf(buff, value) yagl_marshal_put_float((buff), (value))
-#define yagl_marshal_get_GLclampf(buff) yagl_marshal_get_float(buff)
-#define yagl_marshal_put_GLfloat(buff, value) yagl_marshal_put_float((buff), (value))
-#define yagl_marshal_get_GLfloat(buff) yagl_marshal_get_float(buff)
-#define yagl_marshal_put_GLint(buff, value) yagl_marshal_put_int32((buff), (value))
-#define yagl_marshal_get_GLint(buff) yagl_marshal_get_int32(buff)
-#define yagl_marshal_put_GLsizei(buff, value) yagl_marshal_put_int32((buff), (value))
-#define yagl_marshal_get_GLsizei(buff) yagl_marshal_get_int32(buff)
-#define yagl_marshal_put_GLclampx(buff, value) yagl_marshal_put_int32((buff), (value))
-#define yagl_marshal_get_GLclampx(buff) yagl_marshal_get_int32(buff)
-#define yagl_marshal_put_GLfixed(buff, value) yagl_marshal_put_int32((buff), (value))
-#define yagl_marshal_get_GLfixed(buff) yagl_marshal_get_int32(buff)
-#define yagl_marshal_put_GLubyte(buff, value) yagl_marshal_put_uint8((buff), (value))
-#define yagl_marshal_get_GLubyte(buff) yagl_marshal_get_uint8(buff)
-#define yagl_marshal_put_GLintptr(buff, value) yagl_marshal_put_int32((buff), (int32_t)(value))
-#define yagl_marshal_get_GLintptr(buff) (GLintptr)yagl_marshal_get_int32(buff)
-#define yagl_marshal_put_GLsizeiptr(buff, value) yagl_marshal_put_int32((buff), (int32_t)(value))
-#define yagl_marshal_get_GLsizeiptr(buff) (GLsizeiptr)yagl_marshal_get_int32(buff)
-
-#endif
index 4e48ee4..7f98087 100644 (file)
 #include "yagl_mem.h"
-#include "yagl_log.h"
-#include "yagl_thread.h"
 #include "yagl_process.h"
-#include "yagl_vector.h"
+#include "yagl_thread.h"
+#include "yagl_log.h"
+#include "exec/cpu-all.h"
 
-bool yagl_mem_get_uint8(target_ulong va, uint8_t* value)
+struct yagl_mem_transfer *yagl_mem_transfer_create(void)
 {
-    int ret;
+    struct yagl_mem_transfer *mt;
 
-    YAGL_LOG_FUNC_ENTER(yagl_mem_get_uint8, "va = 0x%X", (uint32_t)va);
-
-    ret = cpu_memory_rw_debug(cur_ts->current_env, va, value, sizeof(*value), 0);
-
-    if (ret == -1) {
-        YAGL_LOG_WARN("page fault at 0x%X", (uint32_t)va);
-
-        YAGL_LOG_FUNC_EXIT(NULL);
-    } else {
-        YAGL_LOG_FUNC_EXIT("0x%X", (uint32_t)*value);
-    }
+    mt = g_malloc0(sizeof(*mt));
 
-    return ret != -1;
+    return mt;
 }
 
-bool yagl_mem_get_uint16(target_ulong va, uint16_t* value)
+void yagl_mem_transfer_destroy(struct yagl_mem_transfer *mt)
 {
-    int ret;
-
-    YAGL_LOG_FUNC_ENTER(yagl_mem_get_uint16, "va = 0x%X", (uint32_t)va);
-
-    ret = cpu_memory_rw_debug(cur_ts->current_env, va, (uint8_t*)value, sizeof(*value), 0);
-
-    if (ret == -1) {
-        YAGL_LOG_WARN("page fault at 0x%X", (uint32_t)va);
-
-        YAGL_LOG_FUNC_EXIT(NULL);
-    } else {
-        YAGL_LOG_FUNC_EXIT("0x%X", (uint32_t)*value);
-    }
-
-    return ret != -1;
+    g_free(mt->pages);
+    g_free(mt);
 }
 
-bool yagl_mem_get_uint32(target_ulong va, uint32_t* value)
+bool yagl_mem_prepare(struct yagl_mem_transfer *mt,
+                      target_ulong va,
+                      int len)
 {
-    int ret;
+    bool res = true;
+    int l;
+    hwaddr page_pa;
+    target_ulong page_va;
 
-    YAGL_LOG_FUNC_ENTER(yagl_mem_get_uint32, "va = 0x%X", (uint32_t)va);
+    YAGL_LOG_FUNC_ENTER(yagl_mem_prepare, "va = 0x%X, len = %d", (uint32_t)va, len);
 
-    ret = cpu_memory_rw_debug(cur_ts->current_env, va, (uint8_t*)value, sizeof(*value), 0);
+    if (len >= 0) {
+        int max_pages = ((len + TARGET_PAGE_SIZE - 1) / TARGET_PAGE_SIZE) + 1;
 
-    if (ret == -1) {
-        YAGL_LOG_WARN("page fault at 0x%X", (uint32_t)va);
+        if (max_pages > mt->max_pages) {
+            g_free(mt->pages);
+            mt->pages = g_malloc(sizeof(*mt->pages) * max_pages);
+        }
 
-        YAGL_LOG_FUNC_EXIT(NULL);
-    } else {
-        YAGL_LOG_FUNC_EXIT("0x%X", *value);
+        mt->max_pages = max_pages;
     }
 
-    return ret != -1;
-}
+    mt->va = va;
+    mt->offset = (va & ~TARGET_PAGE_MASK);
+    mt->len = len;
+    mt->num_pages = 0;
 
-bool yagl_mem_get_float(target_ulong va, float* value)
-{
-    int ret;
-
-    YAGL_LOG_FUNC_ENTER(yagl_mem_get_float, "va = 0x%X", (uint32_t)va);
-
-    ret = cpu_memory_rw_debug(cur_ts->current_env, va, (uint8_t*)value, sizeof(*value), 0);
-
-    if (ret == -1) {
-        YAGL_LOG_WARN("page fault at 0x%X", (uint32_t)va);
+    if (va) {
+        while (len > 0) {
+            page_va = va & TARGET_PAGE_MASK;
+            page_pa = cpu_get_phys_page_debug(cur_ts->current_env, page_va);
 
-        YAGL_LOG_FUNC_EXIT(NULL);
-    } else {
-        YAGL_LOG_FUNC_EXIT("%f", *value);
-    }
-
-    return ret != -1;
-}
+            if (page_pa == -1) {
+                YAGL_LOG_WARN("page fault at 0x%X", (uint32_t)page_va);
+                res = false;
+                break;
+            }
 
-bool yagl_mem_get(target_ulong va, uint32_t len, void* data)
-{
-    int ret;
+            l = (page_va + TARGET_PAGE_SIZE) - va;
+            if (l > len) {
+                l = len;
+            }
 
-    YAGL_LOG_FUNC_ENTER(yagl_mem_get, "va = 0x%X, len = %u", (uint32_t)va, len);
+            len -= l;
+            va += l;
 
-    ret = cpu_memory_rw_debug(cur_ts->current_env, va, data, len, 0);
+            assert(mt->num_pages < mt->max_pages);
 
-    if (ret == -1) {
-        YAGL_LOG_WARN("page fault at 0x%X", (uint32_t)va, len);
+            mt->pages[mt->num_pages++] = page_pa;
+        }
     }
 
     YAGL_LOG_FUNC_EXIT(NULL);
 
-    return ret != -1;
+    return res;
 }
 
-bool yagl_mem_get_array(target_ulong va,
-                        target_ulong el_size,
-                        yagl_mem_array_cb cb,
-                        void *user_data)
+void yagl_mem_put(struct yagl_mem_transfer *mt, const void *data, int len)
 {
-    uint8_t buff[TARGET_PAGE_SIZE];
-    target_ulong rem = 0;
-    bool res = true;
-
-    assert(el_size <= sizeof(buff));
+    int offset = mt->offset, i = 0;
 
-    YAGL_LOG_FUNC_ENTER(yagl_mem_get_array, "va = 0x%X, el_size = %u",
-                        (uint32_t)va, (uint32_t)el_size);
+    YAGL_LOG_FUNC_ENTER(yagl_mem_put, "va = 0X%X, data = %p, len = %d", (uint32_t)mt->va, data, len);
 
-    while (true) {
-        target_ulong i;
-        target_ulong len = TARGET_PAGE_SIZE - (va & (TARGET_PAGE_SIZE - 1));
-        len = MIN(len, (sizeof(buff) - rem));
-
-        if (cpu_memory_rw_debug(cur_ts->current_env,
-                                va,
-                                &buff[rem],
-                                len,
-                                0) == -1) {
-            YAGL_LOG_WARN("page fault at 0x%X:%u", (uint32_t)va, (uint32_t)len);
-            res = false;
-            break;
-        }
-
-        rem += len;
-        va += len;
-
-        if (rem < el_size) {
-            YAGL_LOG_WARN("array element crosses page boundaries ?");
-            continue;
-        }
+    if (!mt->va) {
+        assert(false);
+        YAGL_LOG_CRITICAL("mt->va is 0");
+        YAGL_LOG_FUNC_EXIT(NULL);
+        return;
+    }
 
-        assert(rem >= el_size);
+    while (len > 0) {
+        int l = MIN(len, (TARGET_PAGE_SIZE - offset));
 
-        len = (rem / el_size);
+        assert(i < mt->num_pages);
 
-        for (i = 0; i < len; ++i) {
-            if (!cb(&buff[0] + (el_size * i), user_data)) {
-                goto out;
-            }
-        }
+        cpu_physical_memory_write_rom(mt->pages[i++] + offset, data, l);
 
-        rem %= el_size;
+        offset = 0;
 
-        if (rem != 0) {
-            YAGL_LOG_WARN("array element crosses page boundaries ?");
-            memmove(&buff[0], &buff[len * el_size], rem);
-        }
+        data += l;
+        len -= l;
     }
 
-out:
     YAGL_LOG_FUNC_EXIT(NULL);
-
-    return res;
 }
 
-static bool yagl_mem_get_string_cb(const void *el, void *user_data)
+bool yagl_mem_get(target_ulong va, uint32_t len, void* data)
 {
-    const char *c = el;
-    struct yagl_vector *v = user_data;
+    int ret;
 
-    yagl_vector_push_back(v, c);
+    YAGL_LOG_FUNC_ENTER(yagl_mem_get, "va = 0x%X, len = %u", (uint32_t)va, len);
 
-    return (*c != 0);
-}
+    ret = cpu_memory_rw_debug(cur_ts->current_env, va, data, len, 0);
 
-char *yagl_mem_get_string(target_ulong va)
-{
-    struct yagl_vector v;
+    if (ret == -1) {
+        YAGL_LOG_WARN("page fault at 0x%X", (uint32_t)va, len);
+    }
 
-    yagl_vector_init(&v, sizeof(char), 0);
+    YAGL_LOG_FUNC_EXIT(NULL);
 
-    if (yagl_mem_get_array(va, sizeof(char),
-                           &yagl_mem_get_string_cb,
-                           &v)) {
-        return yagl_vector_detach(&v);
-    } else {
-        yagl_vector_cleanup(&v);
-        return NULL;
-    }
+    return ret != -1;
 }
index 6050caa..85bb53b 100644 (file)
 #define _QEMU_YAGL_MEM_H
 
 #include "yagl_types.h"
-#include "yagl_mem_transfer.h"
 
-bool yagl_mem_get_uint8(target_ulong va, uint8_t* value);
-
-bool yagl_mem_get_uint16(target_ulong va, uint16_t* value);
-
-bool yagl_mem_get_uint32(target_ulong va, uint32_t* value);
-
-bool yagl_mem_get_float(target_ulong va, float* value);
-
-bool yagl_mem_get(target_ulong va, uint32_t len, void* data);
+struct yagl_mem_transfer
+{
+    hwaddr *pages;
+    int max_pages;
 
-typedef bool (*yagl_mem_array_cb)(const void */*el*/, void */*user_data*/);
+    target_ulong va;
+    int offset;
+    int len;
+    int num_pages;
+};
 
 /*
- * Efficiently reads an array from target memory. It'll continue reading until
- * 'cb' returns false. Note that 'el_size' must be <= TARGET_PAGE_SIZE
- * in order for this function to work.
+ * Guaranteed to succeed.
  */
-bool yagl_mem_get_array(target_ulong va,
-                        target_ulong el_size,
-                        yagl_mem_array_cb cb,
-                        void *user_data);
-
-char *yagl_mem_get_string(target_ulong va);
-
-#define yagl_mem_prepare_char(mt, va) yagl_mem_prepare_uint8((mt), (va))
-#define yagl_mem_prepare_int8(mt, va) yagl_mem_prepare_uint8((mt), (va))
-#define yagl_mem_prepare_int16(mt, va) yagl_mem_prepare_uint16((mt), (va))
-#define yagl_mem_prepare_int32(mt, va) yagl_mem_prepare_uint32((mt), (va))
-#define yagl_mem_prepare_host_handle(mt, va) yagl_mem_prepare_uint32((mt), (va))
-
-static inline void yagl_mem_put_char(struct yagl_mem_transfer *mt, char value)
-{
-    yagl_mem_put_uint8(mt, value);
-}
-
-static inline void yagl_mem_put_int8(struct yagl_mem_transfer *mt, int8_t value)
-{
-    yagl_mem_put_uint8(mt, value);
-}
-
-static inline void yagl_mem_put_int16(struct yagl_mem_transfer *mt,
-                                      int16_t value)
-{
-    yagl_mem_put_uint16(mt, value);
-}
-
-static inline void yagl_mem_put_int32(struct yagl_mem_transfer *mt,
-                                      int32_t value)
-{
-    yagl_mem_put_uint32(mt, value);
-}
-
-static inline void yagl_mem_put_host_handle(struct yagl_mem_transfer *mt,
-                                            yagl_host_handle value)
-{
-    yagl_mem_put_uint32(mt, value);
-}
-
-static inline bool yagl_mem_get_char(target_ulong va, char *value)
-{
-    return yagl_mem_get_uint8(va, (uint8_t *)value);
-}
-
-static inline bool yagl_mem_get_int8(target_ulong va, int8_t *value)
-{
-    return yagl_mem_get_uint8(va, (uint8_t *)value);
-}
+struct yagl_mem_transfer *yagl_mem_transfer_create(void);
 
-static inline bool yagl_mem_get_int16(target_ulong va, int16_t *value)
-{
-    return yagl_mem_get_uint16(va, (uint16_t *)value);
-}
-
-static inline bool yagl_mem_get_int32(target_ulong va, int32_t *value)
-{
-    return yagl_mem_get_uint32(va, (uint32_t *)value);
-}
+void yagl_mem_transfer_destroy(struct yagl_mem_transfer *mt);
 
-static inline bool yagl_mem_get_host_handle(target_ulong va,
-                                            yagl_host_handle *value)
-{
-    return yagl_mem_get_uint32(va, value);
-}
+bool yagl_mem_prepare(struct yagl_mem_transfer *mt,
+                      target_ulong va,
+                      int len);
 
-#if TARGET_LONG_SIZE == 4
-#define yagl_mem_prepare_ptr(mt, va) yagl_mem_prepare_uint32((mt), (va))
+void yagl_mem_put(struct yagl_mem_transfer *mt, const void *data, int len);
 
-static inline void yagl_mem_put_ptr(struct yagl_mem_transfer *mt,
-                                    target_ulong value)
-{
-    yagl_mem_put_uint32(mt, value);
-}
-
-#else
-#error 64-bit ptr not supported
-#endif
+bool yagl_mem_get(target_ulong va, uint32_t len, void *data);
 
 #endif
diff --git a/hw/yagl_mem_egl.c b/hw/yagl_mem_egl.c
deleted file mode 100644 (file)
index 8d75fff..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-#include "yagl_mem_egl.h"
-#include "yagl_vector.h"
-#include "yagl_log.h"
-#include "yagl_thread.h"
-#include "yagl_process.h"
-
-EGLint *yagl_mem_get_attrib_list(target_ulong va)
-{
-    struct yagl_vector v;
-    int i = 0;
-
-    YAGL_LOG_FUNC_ENTER(yagl_mem_get_attrib_list, "va = 0x%X", (uint32_t)va);
-
-    yagl_vector_init(&v, sizeof(EGLint), 0);
-
-    while (true) {
-        EGLint tmp;
-
-        if (!yagl_mem_get_EGLint(va + (i * sizeof(EGLint)), &tmp)) {
-            goto fail;
-        }
-
-        yagl_vector_push_back(&v, &tmp);
-
-        ++i;
-
-        if (tmp == EGL_NONE) {
-            break;
-        }
-
-        if (!yagl_mem_get_EGLint(va + (i * sizeof(EGLint)), &tmp)) {
-            goto fail;
-        }
-
-        yagl_vector_push_back(&v, &tmp);
-
-        ++i;
-    }
-
-    YAGL_LOG_FUNC_EXIT(NULL);
-
-    return yagl_vector_detach(&v);
-
-fail:
-    yagl_vector_cleanup(&v);
-
-    YAGL_LOG_FUNC_EXIT(NULL);
-
-    return NULL;
-}
diff --git a/hw/yagl_mem_egl.h b/hw/yagl_mem_egl.h
deleted file mode 100644 (file)
index d0df5ce..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef _QEMU_YAGL_MEM_EGL_H
-#define _QEMU_YAGL_MEM_EGL_H
-
-#include "yagl_mem.h"
-#include <EGL/egl.h>
-
-#define yagl_mem_prepare_EGLint(mt, va) yagl_mem_prepare_int32((mt), (va))
-#define yagl_mem_put_EGLint(mt, value) yagl_mem_put_int32((mt), (value))
-#define yagl_mem_get_EGLint(va, value) yagl_mem_get_int32((va), (value))
-
-EGLint *yagl_mem_get_attrib_list(target_ulong va);
-
-#endif
diff --git a/hw/yagl_mem_gl.c b/hw/yagl_mem_gl.c
deleted file mode 100644 (file)
index 68b7d9d..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include "yagl_mem_gl.h"
diff --git a/hw/yagl_mem_gl.h b/hw/yagl_mem_gl.h
deleted file mode 100644 (file)
index 379bd64..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-#ifndef _QEMU_YAGL_MEM_GL_H
-#define _QEMU_YAGL_MEM_GL_H
-
-#include "yagl_mem.h"
-
-#define yagl_mem_prepare_GLint(mt, va) yagl_mem_prepare_int32((mt), (va))
-#define yagl_mem_put_GLint(mt, value) yagl_mem_put_int32((mt), (value))
-#define yagl_mem_get_GLint(va, value) yagl_mem_get_int32((va), (value))
-#define yagl_mem_prepare_GLuint(mt, va) yagl_mem_prepare_uint32((mt), (va))
-#define yagl_mem_put_GLuint(mt, value) yagl_mem_put_uint32((mt), (value))
-#define yagl_mem_get_GLuint(va, value) yagl_mem_get_uint32((va), (value))
-#define yagl_mem_prepare_GLsizei(mt, va) yagl_mem_prepare_int32((mt), (va))
-#define yagl_mem_put_GLsizei(mt, value) yagl_mem_put_int32((mt), (value))
-#define yagl_mem_get_GLsizei(va, value) yagl_mem_get_int32((va), (value))
-#define yagl_mem_prepare_GLenum(mt, va) yagl_mem_prepare_uint32((mt), (va))
-#define yagl_mem_put_GLenum(mt, value) yagl_mem_put_uint32((mt), (value))
-#define yagl_mem_get_GLenum(va, value) yagl_mem_get_uint32((va), (value))
-#define yagl_mem_prepare_GLfloat(mt, va) yagl_mem_prepare_float((mt), (va))
-#define yagl_mem_put_GLfloat(mt, value) yagl_mem_put_float((mt), (value))
-#define yagl_mem_get_GLfloat(va, value) yagl_mem_get_float((va), (value))
-#define yagl_mem_prepare_GLboolean(mt, va) yagl_mem_prepare_uint8((mt), (va))
-#define yagl_mem_put_GLboolean(mt, value) yagl_mem_put_uint8((mt), (value))
-#define yagl_mem_get_GLboolean(va, value) yagl_mem_get_uint8((va), (value))
-#define yagl_mem_prepare_GLfixed(mt, va) yagl_mem_prepare_int32((mt), (va))
-#define yagl_mem_put_GLfixed(mt, value) yagl_mem_put_int32((mt), (value))
-#define yagl_mem_get_GLfixed(va, value) yagl_mem_get_int32((va), (value))
-
-#endif
diff --git a/hw/yagl_mem_transfer.c b/hw/yagl_mem_transfer.c
deleted file mode 100644 (file)
index 21518f8..0000000
+++ /dev/null
@@ -1,146 +0,0 @@
-#include "yagl_mem_transfer.h"
-#include "yagl_process.h"
-#include "yagl_thread.h"
-#include "yagl_log.h"
-#include "exec/cpu-all.h"
-
-struct yagl_mem_transfer *yagl_mem_transfer_create(void)
-{
-    struct yagl_mem_transfer *mt;
-
-    mt = g_malloc0(sizeof(*mt));
-
-    return mt;
-}
-
-void yagl_mem_transfer_destroy(struct yagl_mem_transfer *mt)
-{
-    g_free(mt->pages);
-    g_free(mt);
-}
-
-bool yagl_mem_prepare(struct yagl_mem_transfer *mt,
-                      target_ulong va,
-                      int len)
-{
-    bool res = true;
-    int l;
-    hwaddr page_pa;
-    target_ulong page_va;
-
-    YAGL_LOG_FUNC_ENTER(yagl_mem_prepare, "va = 0x%X, len = %d", (uint32_t)va, len);
-
-    if (len >= 0) {
-        int max_pages = ((len + TARGET_PAGE_SIZE - 1) / TARGET_PAGE_SIZE) + 1;
-
-        if (max_pages > mt->max_pages) {
-            g_free(mt->pages);
-            mt->pages = g_malloc(sizeof(*mt->pages) * max_pages);
-        }
-
-        mt->max_pages = max_pages;
-    }
-
-    mt->va = va;
-    mt->offset = (va & ~TARGET_PAGE_MASK);
-    mt->len = len;
-    mt->num_pages = 0;
-
-    if (va) {
-        while (len > 0) {
-            page_va = va & TARGET_PAGE_MASK;
-            page_pa = cpu_get_phys_page_debug(cur_ts->current_env, page_va);
-
-            if (page_pa == -1) {
-                YAGL_LOG_WARN("page fault at 0x%X", (uint32_t)page_va);
-                res = false;
-                break;
-            }
-
-            l = (page_va + TARGET_PAGE_SIZE) - va;
-            if (l > len) {
-                l = len;
-            }
-
-            len -= l;
-            va += l;
-
-            assert(mt->num_pages < mt->max_pages);
-
-            mt->pages[mt->num_pages++] = page_pa;
-        }
-    }
-
-    YAGL_LOG_FUNC_EXIT(NULL);
-
-    return res;
-}
-
-static void yagl_mem_put_internal(struct yagl_mem_transfer *mt, const void *data)
-{
-    int len = mt->len, offset = mt->offset, i = 0;
-
-    if (!mt->va) {
-        assert(false);
-        YAGL_LOG_CRITICAL("mt->va is 0");
-        return;
-    }
-
-    while (len > 0) {
-        int l = MIN(len, (TARGET_PAGE_SIZE - offset));
-
-        assert(i < mt->num_pages);
-
-        cpu_physical_memory_write_rom(mt->pages[i++] + offset, data, l);
-
-        offset = 0;
-
-        data += l;
-        len -= l;
-    }
-}
-
-void yagl_mem_put(struct yagl_mem_transfer *mt, const void *data)
-{
-    YAGL_LOG_FUNC_ENTER(yagl_mem_put, "va = 0X%X, data = %p", (uint32_t)mt->va, data);
-
-    yagl_mem_put_internal(mt, data);
-
-    YAGL_LOG_FUNC_EXIT(NULL);
-}
-
-void yagl_mem_put_uint8(struct yagl_mem_transfer *mt, uint8_t value)
-{
-    YAGL_LOG_FUNC_ENTER(yagl_mem_put_uint8, "va = 0x%X, value = 0x%X", (uint32_t)mt->va, (uint32_t)value);
-
-    yagl_mem_put_internal(mt, &value);
-
-    YAGL_LOG_FUNC_EXIT(NULL);
-}
-
-void yagl_mem_put_uint16(struct yagl_mem_transfer *mt, uint16_t value)
-{
-    YAGL_LOG_FUNC_ENTER(yagl_mem_put_uint16, "va = 0x%X, value = 0x%X", (uint32_t)mt->va, (uint32_t)value);
-
-    yagl_mem_put_internal(mt, &value);
-
-    YAGL_LOG_FUNC_EXIT(NULL);
-}
-
-void yagl_mem_put_uint32(struct yagl_mem_transfer *mt, uint32_t value)
-{
-    YAGL_LOG_FUNC_ENTER(yagl_mem_put_uint32, "va = 0x%X, value = 0x%X", (uint32_t)mt->va, value);
-
-    yagl_mem_put_internal(mt, &value);
-
-    YAGL_LOG_FUNC_EXIT(NULL);
-}
-
-void yagl_mem_put_float(struct yagl_mem_transfer *mt, float value)
-{
-    YAGL_LOG_FUNC_ENTER(yagl_mem_put_float, "va = 0x%X, value = %f", (uint32_t)mt->va, value);
-
-    yagl_mem_put_internal(mt, &value);
-
-    YAGL_LOG_FUNC_EXIT(NULL);
-}
diff --git a/hw/yagl_mem_transfer.h b/hw/yagl_mem_transfer.h
deleted file mode 100644 (file)
index bdcdab8..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-#ifndef _QEMU_YAGL_MEM_TRANSFER_H
-#define _QEMU_YAGL_MEM_TRANSFER_H
-
-#include "yagl_types.h"
-
-struct yagl_mem_transfer
-{
-    hwaddr *pages;
-    int max_pages;
-
-    target_ulong va;
-    int offset;
-    int len;
-    int num_pages;
-};
-
-/*
- * Guaranteed to succeed.
- */
-struct yagl_mem_transfer *yagl_mem_transfer_create(void);
-
-void yagl_mem_transfer_destroy(struct yagl_mem_transfer *mt);
-
-bool yagl_mem_prepare(struct yagl_mem_transfer *mt,
-                      target_ulong va,
-                      int len);
-
-static __inline bool yagl_mem_prepare_uint8(struct yagl_mem_transfer *mt,
-                                            target_ulong va)
-{
-    return yagl_mem_prepare(mt, va, sizeof(uint8_t));
-}
-
-static __inline bool yagl_mem_prepare_uint16(struct yagl_mem_transfer *mt,
-                                             target_ulong va)
-{
-    return yagl_mem_prepare(mt, va, sizeof(uint16_t));
-}
-
-static __inline bool yagl_mem_prepare_uint32(struct yagl_mem_transfer *mt,
-                                             target_ulong va)
-{
-    return yagl_mem_prepare(mt, va, sizeof(uint32_t));
-}
-
-static __inline bool yagl_mem_prepare_float(struct yagl_mem_transfer *mt,
-                                            target_ulong va)
-{
-    return yagl_mem_prepare(mt, va, sizeof(float));
-}
-
-void yagl_mem_put(struct yagl_mem_transfer *mt, const void *data);
-
-void yagl_mem_put_uint8(struct yagl_mem_transfer *mt, uint8_t value);
-
-void yagl_mem_put_uint16(struct yagl_mem_transfer *mt, uint16_t value);
-
-void yagl_mem_put_uint32(struct yagl_mem_transfer *mt, uint32_t value);
-
-void yagl_mem_put_float(struct yagl_mem_transfer *mt, float value);
-
-#endif
index 42c532d..8bd852a 100644 (file)
@@ -2,9 +2,9 @@
 #include "yagl_api.h"
 #include "yagl_process.h"
 #include "yagl_thread.h"
-#include "yagl_marshal.h"
 #include "yagl_version.h"
 #include "yagl_log.h"
+#include "yagl_transport.h"
 #include "yagl_egl_backend.h"
 #include "yagl_egl_interface.h"
 #include "yagl_apis/egl/yagl_egl_api.h"
 #include "yagl_gles1_driver.h"
 #include "yagl_gles2_driver.h"
 
+static __inline void yagl_marshal_put_uint32_t(uint8_t** buff, uint32_t value)
+{
+    *(uint32_t*)(*buff) = value;
+    *buff += 8;
+}
+
+static __inline uint32_t yagl_marshal_get_uint32_t(uint8_t** buff)
+{
+    uint32_t tmp = *(uint32_t*)*buff;
+    *buff += 8;
+    return tmp;
+}
+
 static struct yagl_thread_state
     *yagl_server_find_thread(struct yagl_server_state *ss,
                              yagl_pid target_pid,
@@ -41,6 +54,16 @@ struct yagl_server_state
 
     QLIST_INIT(&ss->processes);
 
+    ss->t = yagl_transport_create();
+
+    if (!ss->t) {
+        egl_backend->destroy(egl_backend);
+        gles1_driver->destroy(gles1_driver);
+        gles2_driver->destroy(gles2_driver);
+
+        goto fail;
+    }
+
     ss->apis[yagl_api_id_egl - 1] = yagl_egl_api_create(egl_backend);
 
     if (!ss->apis[yagl_api_id_egl - 1]) {
@@ -78,6 +101,10 @@ fail:
         }
     }
 
+    if (ss->t) {
+        yagl_transport_destroy(ss->t);
+    }
+
     g_free(ss);
 
     return NULL;
@@ -96,6 +123,8 @@ void yagl_server_state_destroy(struct yagl_server_state *ss)
         }
     }
 
+    yagl_transport_destroy(ss->t);
+
     g_free(ss);
 }
 
@@ -112,31 +141,39 @@ void yagl_server_reset(struct yagl_server_state *ss)
 }
 
 /*
- * init command out_buff is:
- *  (uint32_t) version
- * in_buff must be:
- *  (uint32_t) 1 - init ok, 0 - init error
- *  (yagl_render_type), in case of init ok
+ * buff is:
+ *  IN (uint32_t) version
+ *  IN (uint32_t) pid
+ *  IN (uint32_t) tid
+ *  OUT (uint32_t) res: 1 - init ok, 0 - init error
+ *  OUT (uint32_t) render_type: in case of init ok
  */
 bool yagl_server_dispatch_init(struct yagl_server_state *ss,
-                               yagl_pid target_pid,
-                               yagl_tid target_tid,
-                               uint8_t *out_buff,
-                               uint8_t *in_buff)
+                               uint8_t *buff,
+                               yagl_pid *target_pid,
+                               yagl_tid *target_tid)
 {
-    uint32_t version = yagl_marshal_get_uint32(&out_buff);
+    uint8_t *orig_buff;
+    uint32_t version;
     struct yagl_process_state *ps = NULL;
     struct yagl_thread_state *ts = NULL;
+    uint8_t **pages;
 
     YAGL_LOG_FUNC_ENTER(yagl_server_dispatch_init, NULL);
 
+    orig_buff = buff;
+
+    version = yagl_marshal_get_uint32_t(&buff);
+    *target_pid = yagl_marshal_get_uint32_t(&buff);
+    *target_tid = yagl_marshal_get_uint32_t(&buff);
+
     if (version != YAGL_VERSION) {
         YAGL_LOG_CRITICAL(
             "target-host version mismatch, target version is %u, host version is %u",
             version,
             YAGL_VERSION);
 
-        yagl_marshal_put_uint32(&in_buff, 0);
+        yagl_marshal_put_uint32_t(&buff, 0);
 
         YAGL_LOG_FUNC_EXIT(NULL);
 
@@ -144,44 +181,38 @@ bool yagl_server_dispatch_init(struct yagl_server_state *ss,
     }
 
     QLIST_FOREACH(ps, &ss->processes, entry) {
-        if (ps->id == target_pid) {
+        if (ps->id == *target_pid) {
             /*
              * Process already exists.
              */
 
-            ts = yagl_process_find_thread(ps, target_tid);
+            ts = yagl_process_find_thread(ps, *target_tid);
 
             if (ts) {
                 YAGL_LOG_CRITICAL(
                     "thread %u already initialized in process %u",
-                    target_tid, target_pid);
+                    *target_tid, *target_pid);
 
-                yagl_marshal_put_uint32(&in_buff, 0);
+                yagl_marshal_put_uint32_t(&buff, 0);
 
                 YAGL_LOG_FUNC_EXIT(NULL);
 
                 return false;
             } else {
-                ts = yagl_process_add_thread(ps, target_tid);
+                ts = yagl_process_add_thread(ps, *target_tid);
 
                 if (!ts) {
                     YAGL_LOG_CRITICAL(
                         "cannot add thread %u to process %u",
-                        target_tid, target_pid);
+                        *target_tid, *target_pid);
 
-                    yagl_marshal_put_uint32(&in_buff, 0);
+                    yagl_marshal_put_uint32_t(&buff, 0);
 
                     YAGL_LOG_FUNC_EXIT(NULL);
 
                     return false;
                 } else {
-                    yagl_marshal_put_uint32(&in_buff, 1);
-                    yagl_marshal_put_render_type(&in_buff,
-                                                 ps->egl_iface->render_type);
-
-                    YAGL_LOG_FUNC_EXIT(NULL);
-
-                    return true;
+                    goto out;
                 }
             }
         }
@@ -191,30 +222,28 @@ bool yagl_server_dispatch_init(struct yagl_server_state *ss,
      * No process found, create one.
      */
 
-    ps = yagl_process_state_create(ss, target_pid);
+    ps = yagl_process_state_create(ss, *target_pid);
 
     if (!ps) {
-        YAGL_LOG_CRITICAL(
-            "cannot create process %u",
-            target_pid);
+        YAGL_LOG_CRITICAL("cannot create process %u", *target_pid);
 
-        yagl_marshal_put_uint32(&in_buff, 0);
+        yagl_marshal_put_uint32_t(&buff, 0);
 
         YAGL_LOG_FUNC_EXIT(NULL);
 
         return false;
     }
 
-    ts = yagl_process_add_thread(ps, target_tid);
+    ts = yagl_process_add_thread(ps, *target_tid);
 
     if (!ts) {
         YAGL_LOG_CRITICAL(
             "cannot add thread %u to process %u",
-            target_tid, target_pid);
+            *target_tid, *target_pid);
 
         yagl_process_state_destroy(ps);
 
-        yagl_marshal_put_uint32(&in_buff, 0);
+        yagl_marshal_put_uint32_t(&buff, 0);
 
         YAGL_LOG_FUNC_EXIT(NULL);
 
@@ -222,35 +251,110 @@ bool yagl_server_dispatch_init(struct yagl_server_state *ss,
     } else {
         QLIST_INSERT_HEAD(&ss->processes, ps, entry);
 
-        yagl_marshal_put_uint32(&in_buff, 1);
-        yagl_marshal_put_render_type(&in_buff, ps->egl_iface->render_type);
+        goto out;
+    }
 
-        YAGL_LOG_FUNC_EXIT(NULL);
+out:
+    pages = g_malloc0(2 * sizeof(*pages));
+
+    pages[0] = orig_buff;
+
+    yagl_thread_set_buffer(ts, pages);
+
+    yagl_marshal_put_uint32_t(&buff, 1);
+    yagl_marshal_put_uint32_t(&buff, ps->egl_iface->render_type);
+
+    YAGL_LOG_FUNC_EXIT(NULL);
+
+    return true;
+}
+
+/*
+ * buff is:
+ *  IN (uint32_t) count
+ *  IN (uint32_t) phys_addr
+ *  ...
+ *  IN (uint32_t) phys_addr
+ *  OUT (uint32_t) res: 1 - update ok, no change - update error
+ */
+void yagl_server_dispatch_update(struct yagl_server_state *ss,
+                                 yagl_pid target_pid,
+                                 yagl_tid target_tid,
+                                 uint8_t *buff)
+{
+    struct yagl_thread_state *ts;
+    uint32_t i, count = 0;
+    uint8_t **pages = NULL;
+
+    YAGL_LOG_FUNC_ENTER(yagl_server_dispatch_update, NULL);
+
+    ts = yagl_server_find_thread(ss, target_pid, target_tid);
 
-        return true;
+    if (!ts) {
+        YAGL_LOG_CRITICAL("process/thread %u/%u not found",
+                          target_pid, target_tid);
+        goto fail;
+    }
+
+    count = yagl_marshal_get_uint32_t(&buff);
+
+    if (count > ((TARGET_PAGE_SIZE / 8) - 2)) {
+        YAGL_LOG_CRITICAL("bad count = %u", count);
+        goto fail;
     }
+
+    pages = g_malloc0((count + 1) * sizeof(*pages));
+
+    for (i = 0; i < count; ++i) {
+        hwaddr page_pa = yagl_marshal_get_uint32_t(&buff);
+        hwaddr len = TARGET_PAGE_SIZE;
+
+        pages[i] = cpu_physical_memory_map(page_pa, &len, false);
+
+        if (!pages[i] || (len != TARGET_PAGE_SIZE)) {
+            YAGL_LOG_CRITICAL("cpu_physical_memory_map(read) failed for page_pa = 0x%X",
+                              (uint32_t)page_pa);
+            goto fail;
+        }
+    }
+
+    yagl_thread_set_buffer(ts, pages);
+
+    yagl_marshal_put_uint32_t(&buff, 1);
+
+    goto out;
+
+fail:
+    for (i = count; i > 0; --i) {
+        if (pages[i - 1]) {
+            cpu_physical_memory_unmap(pages[i - 1],
+                                      TARGET_PAGE_SIZE,
+                                      false,
+                                      TARGET_PAGE_SIZE);
+        }
+    }
+    g_free(pages);
+
+out:
+    YAGL_LOG_FUNC_EXIT(NULL);
 }
 
-void yagl_server_dispatch(struct yagl_server_state *ss,
-                          yagl_pid target_pid,
-                          yagl_tid target_tid,
-                          uint8_t *out_buff,
-                          uint8_t *in_buff)
+void yagl_server_dispatch_batch(struct yagl_server_state *ss,
+                                yagl_pid target_pid,
+                                yagl_tid target_tid,
+                                uint32_t offset)
 {
     struct yagl_thread_state *ts;
 
-    YAGL_LOG_FUNC_ENTER(yagl_server_dispatch, NULL);
+    YAGL_LOG_FUNC_ENTER(yagl_server_dispatch_batch, NULL);
 
     ts = yagl_server_find_thread(ss, target_pid, target_tid);
 
     if (ts) {
-        yagl_thread_call(ts, out_buff, in_buff);
+        yagl_thread_call(ts, offset);
     } else {
-        YAGL_LOG_CRITICAL(
-            "process/thread %u/%u not found",
-            target_pid, target_tid);
-
-        yagl_marshal_put_call_result(&in_buff, yagl_call_result_fail);
+        YAGL_LOG_CRITICAL("process/thread %u/%u not found",
+                          target_pid, target_tid);
     }
 
     YAGL_LOG_FUNC_EXIT(NULL);
@@ -267,9 +371,8 @@ void yagl_server_dispatch_exit(struct yagl_server_state *ss,
     YAGL_LOG_FUNC_ENTER(yagl_server_dispatch_exit, NULL);
 
     if (!ts) {
-        YAGL_LOG_CRITICAL(
-            "process/thread %u/%u not found",
-            target_pid, target_tid);
+        YAGL_LOG_CRITICAL("process/thread %u/%u not found",
+                          target_pid, target_tid);
 
         YAGL_LOG_FUNC_EXIT(NULL);
 
index 25204e8..4122a1c 100644 (file)
@@ -9,12 +9,18 @@ struct yagl_process_state;
 struct yagl_egl_backend;
 struct yagl_gles1_driver;
 struct yagl_gles2_driver;
+struct yagl_transport;
 
 struct yagl_server_state
 {
     struct yagl_api *apis[YAGL_NUM_APIS];
 
     QLIST_HEAD(, yagl_process_state) processes;
+
+    /*
+     * Single transport that's used by all threads.
+     */
+    struct yagl_transport *t;
 };
 
 /*
@@ -24,8 +30,8 @@ struct yagl_server_state
  */
 
 /*
- * 'egl_backend' and 'gles2_driver' will be owned by returned server state
- * or destroyed in case of error.
+ * 'egl_backend', 'gles1_driver' and 'gles2_driver' will be owned by
+ * returned server state or destroyed in case of error.
  */
 struct yagl_server_state
     *yagl_server_state_create(struct yagl_egl_backend *egl_backend,
@@ -46,19 +52,25 @@ void yagl_server_reset(struct yagl_server_state *ss);
  * This is called for first YaGL call.
  */
 bool yagl_server_dispatch_init(struct yagl_server_state *ss,
-                               yagl_pid target_pid,
-                               yagl_tid target_tid,
-                               uint8_t *out_buff,
-                               uint8_t *in_buff);
+                               uint8_t *buff,
+                               yagl_pid *target_pid,
+                               yagl_tid *target_tid);
+
+/*
+ * This is called for each YaGL transport buffer update.
+ */
+void yagl_server_dispatch_update(struct yagl_server_state *ss,
+                                 yagl_pid target_pid,
+                                 yagl_tid target_tid,
+                                 uint8_t *buff);
 
 /*
  * This is called for each YaGL batch.
  */
-void yagl_server_dispatch(struct yagl_server_state *ss,
-                          yagl_pid target_pid,
-                          yagl_tid target_tid,
-                          uint8_t *out_buff,
-                          uint8_t *in_buff);
+void yagl_server_dispatch_batch(struct yagl_server_state *ss,
+                                yagl_pid target_pid,
+                                yagl_tid target_tid,
+                                uint32_t offset);
 
 /*
  * This is called for last YaGL call.
index c607360..f48e209 100644 (file)
 static uint32_t g_num_refs = 0;
 
 static uint32_t g_num_batches = 0;
-static uint32_t g_num_calls = 0;
-static uint32_t g_bytes_unused = UINT32_MAX;
 
-void yagl_stats_init(void)
-{
-}
+static uint32_t g_num_calls_min = UINT32_MAX;
+static uint32_t g_num_calls_max = 0;
 
-void yagl_stats_cleanup(void)
-{
-}
+static uint32_t g_bytes_used_min = UINT32_MAX;
+static uint32_t g_bytes_used_max = 0;
 
 void yagl_stats_new_ref(void)
 {
@@ -33,22 +29,32 @@ void yagl_stats_delete_ref(void)
     }
 }
 
-void yagl_stats_batch(uint32_t num_calls, uint32_t bytes_unused)
+void yagl_stats_batch(uint32_t num_calls, uint32_t bytes_used)
 {
-    if (num_calls > g_num_calls) {
-        g_num_calls = num_calls;
+    if (num_calls > g_num_calls_max) {
+        g_num_calls_max = num_calls;
+    }
+
+    if (bytes_used > g_bytes_used_max) {
+        g_bytes_used_max = bytes_used;
+    }
+
+    if (num_calls < g_num_calls_min) {
+        g_num_calls_min = num_calls;
     }
 
-    if (bytes_unused < g_bytes_unused) {
-        g_bytes_unused = bytes_unused;
+    if (bytes_used < g_bytes_used_min) {
+        g_bytes_used_min = bytes_used;
     }
 
     if (++g_num_batches >= YAGL_STATS_MAX_BATCHES) {
         yagl_stats_dump();
 
         g_num_batches = 0;
-        g_num_calls = 0;
-        g_bytes_unused = UINT32_MAX;
+        g_num_calls_min = UINT32_MAX;
+        g_num_calls_max = 0;
+        g_bytes_used_min = UINT32_MAX;
+        g_bytes_used_max = 0;
     }
 }
 
@@ -57,11 +63,13 @@ void yagl_stats_dump(void)
     YAGL_LOG_FUNC_ENTER(yagl_stats_dump, NULL);
 
     YAGL_LOG_DEBUG("<<STATS");
-    YAGL_LOG_DEBUG("num yagl_ref's: %u", g_num_refs);
-    YAGL_LOG_DEBUG("# of calls per batch: %u",
-                   g_num_calls);
-    YAGL_LOG_DEBUG("# of bytes unused per batch: %u",
-                   ((g_bytes_unused == UINT32_MAX) ? 0 : g_bytes_unused));
+    YAGL_LOG_DEBUG("# yagl_ref's: %u", g_num_refs);
+    YAGL_LOG_DEBUG("# of calls per batch: %u - %u",
+                   ((g_num_calls_min == UINT32_MAX) ? 0 : g_num_calls_min),
+                   g_num_calls_max);
+    YAGL_LOG_DEBUG("# of bytes used per batch: %u - %u",
+                   ((g_bytes_used_min == UINT32_MAX) ? 0 : g_bytes_used_min),
+                   g_bytes_used_max);
     YAGL_LOG_DEBUG(">>STATS");
 
     YAGL_LOG_FUNC_EXIT(NULL);
index 106c224..45e8852 100644 (file)
@@ -5,23 +5,17 @@
 
 #ifdef CONFIG_YAGL_STATS
 
-void yagl_stats_init(void);
-
-void yagl_stats_cleanup(void);
-
 void yagl_stats_new_ref(void);
 void yagl_stats_delete_ref(void);
 
-void yagl_stats_batch(uint32_t num_calls, uint32_t bytes_unused);
+void yagl_stats_batch(uint32_t num_calls, uint32_t bytes_used);
 
 void yagl_stats_dump(void);
 
 #else
-#define yagl_stats_init()
-#define yagl_stats_cleanup()
 #define yagl_stats_new_ref()
 #define yagl_stats_delete_ref()
-#define yagl_stats_batch(num_calls, bytes_unused)
+#define yagl_stats_batch(num_calls, bytes_used)
 #define yagl_stats_dump()
 #endif
 
index eded5b5..92ff3ef 100644 (file)
@@ -3,9 +3,8 @@
 #include "yagl_server.h"
 #include "yagl_api.h"
 #include "yagl_log.h"
-#include "yagl_marshal.h"
 #include "yagl_stats.h"
-#include "yagl_mem_transfer.h"
+#include "yagl_transport.h"
 #include "sysemu/kvm.h"
 #include "sysemu/hax.h"
 
@@ -27,6 +26,7 @@ static __inline void yagl_cpu_synchronize_state(struct yagl_process_state *ps)
 static void *yagl_thread_func(void* arg)
 {
     struct yagl_thread_state *ts = arg;
+    struct yagl_transport *t = ts->ps->ss->t;
     int i;
 
     cur_ts = ts;
@@ -59,12 +59,7 @@ static void *yagl_thread_func(void* arg)
     }
 
     while (true) {
-        yagl_call_result res = yagl_call_result_ok;
-        uint8_t *current_buff;
-        uint8_t *tmp;
-#ifdef CONFIG_YAGL_STATS
         uint32_t num_calls = 0;
-#endif
 
         yagl_event_wait(&ts->call_event);
 
@@ -72,19 +67,9 @@ static void *yagl_thread_func(void* arg)
             break;
         }
 
-        current_buff = ts->current_out_buff;
-
         YAGL_LOG_TRACE("batch started");
 
-        /*
-         * current_buff is:
-         *  (yagl_api_id) api_id
-         *  (yagl_func_id) func_id
-         *  ... api_id/func_id dependent
-         * current_in_buff must be:
-         *  (uint32_t) 1/0 - call ok/failed
-         *  ... api_id/func_id dependent
-         */
+        yagl_transport_begin(t, ts->pages, ts->offset);
 
         while (true) {
             yagl_api_id api_id;
@@ -92,31 +77,17 @@ static void *yagl_thread_func(void* arg)
             struct yagl_api_ps *api_ps;
             yagl_api_func func;
 
-            if (current_buff >= (ts->current_out_buff + YAGL_MARSHAL_SIZE)) {
-                YAGL_LOG_CRITICAL("batch passes the end of buffer, protocol error");
-
-                res = yagl_call_result_fail;
-
-                break;
-            }
-
-            api_id = yagl_marshal_get_api_id(&current_buff);
+            yagl_transport_begin_call(t, &api_id, &func_id);
 
             if (api_id == 0) {
                 /*
                  * Batch ended.
                  */
-
                 break;
             }
 
-            func_id = yagl_marshal_get_func_id(&current_buff);
-
             if ((api_id <= 0) || (api_id > YAGL_NUM_APIS)) {
                 YAGL_LOG_CRITICAL("target-host protocol error, bad api_id - %u", api_id);
-
-                res = yagl_call_result_fail;
-
                 break;
             }
 
@@ -124,60 +95,33 @@ static void *yagl_thread_func(void* arg)
 
             if (!api_ps) {
                 YAGL_LOG_CRITICAL("uninitialized api - %u. host logic error", api_id);
-
-                res = yagl_call_result_fail;
-
                 break;
             }
 
             func = api_ps->get_func(api_ps, func_id);
 
             if (func) {
-                tmp = ts->current_in_buff;
-
-                yagl_marshal_skip(&tmp);
-
-                if (!func(&current_buff, tmp)) {
+                if (func(t)) {
+                    yagl_transport_end_call(t);
+                } else {
                     /*
-                     * Retry is requested. Check if this is the last function
-                     * in the batch, if it's not, then there's a logic error
-                     * in target <-> host interaction.
+                     * Retry is requested.
                      */
-
-                    if (((current_buff + 8) > (ts->current_out_buff + YAGL_MARSHAL_SIZE)) ||
-                        (yagl_marshal_get_api_id(&current_buff) != 0)) {
-                        YAGL_LOG_CRITICAL("retry request not at the end of the batch");
-
-                        res = yagl_call_result_fail;
-                    } else {
-                        res = yagl_call_result_retry;
-                    }
-
                     break;
                 }
             } else {
                 YAGL_LOG_CRITICAL("bad function call (api = %u, func = %u)",
                                   api_id,
                                   func_id);
-
-                res = yagl_call_result_fail;
-
                 break;
             }
 
-#ifdef CONFIG_YAGL_STATS
             ++num_calls;
-#endif
         }
 
         YAGL_LOG_TRACE("batch ended");
 
-        tmp = ts->current_in_buff;
-
-        yagl_stats_batch(num_calls,
-            (ts->current_out_buff + YAGL_MARSHAL_SIZE - current_buff));
-
-        yagl_marshal_put_call_result(&tmp, res);
+        yagl_stats_batch(num_calls, yagl_transport_bytes_processed(t));
 
         yagl_event_set(&ts->call_processed_event);
     }
@@ -234,11 +178,6 @@ struct yagl_thread_state
     ts->id = id;
     ts->is_first = is_first;
 
-    ts->mt1 = yagl_mem_transfer_create();
-    ts->mt2 = yagl_mem_transfer_create();
-    ts->mt3 = yagl_mem_transfer_create();
-    ts->mt4 = yagl_mem_transfer_create();
-
     yagl_event_init(&ts->call_event, 0, 0);
     yagl_event_init(&ts->call_processed_event, 0, 0);
 
@@ -270,23 +209,36 @@ void yagl_thread_state_destroy(struct yagl_thread_state *ts,
     yagl_event_cleanup(&ts->call_processed_event);
     yagl_event_cleanup(&ts->call_event);
 
-    yagl_mem_transfer_destroy(ts->mt1);
-    yagl_mem_transfer_destroy(ts->mt2);
-    yagl_mem_transfer_destroy(ts->mt3);
-    yagl_mem_transfer_destroy(ts->mt4);
+    yagl_thread_set_buffer(ts, NULL);
 
     g_free(ts);
 }
 
-void yagl_thread_call(struct yagl_thread_state *ts,
-                      uint8_t *out_buff,
-                      uint8_t *in_buff)
+void yagl_thread_set_buffer(struct yagl_thread_state *ts, uint8_t **pages)
+{
+    if (ts->pages) {
+        uint8_t **tmp;
+
+        for (tmp = ts->pages; *tmp; ++tmp) {
+            cpu_physical_memory_unmap(*tmp,
+                                      TARGET_PAGE_SIZE,
+                                      false,
+                                      TARGET_PAGE_SIZE);
+        }
+
+        g_free(ts->pages);
+        ts->pages = NULL;
+    }
+
+    ts->pages = pages;
+}
+
+void yagl_thread_call(struct yagl_thread_state *ts, uint32_t offset)
 {
     assert(current_cpu);
 
-    ts->current_out_buff = out_buff;
-    ts->current_in_buff = in_buff;
     ts->current_env = current_cpu;
+    ts->offset = offset;
 
     yagl_cpu_synchronize_state(ts->ps);
 
@@ -294,4 +246,5 @@ void yagl_thread_call(struct yagl_thread_state *ts,
     yagl_event_wait(&ts->call_processed_event);
 
     ts->current_env = NULL;
+    ts->offset = 0;
 }
index 0879956..95b67d4 100644 (file)
@@ -8,7 +8,6 @@
 #include "qemu/thread.h"
 
 struct yagl_process_state;
-struct yagl_mem_transfer;
 
 struct yagl_thread_state
 {
@@ -18,27 +17,12 @@ struct yagl_thread_state
 
     yagl_tid id;
 
-    /*
-     * Memory transfers cached for speed. To be used
-     * in EGL/GL implementations.
-     * @{
-     */
-
-    struct yagl_mem_transfer *mt1;
-    struct yagl_mem_transfer *mt2;
-    struct yagl_mem_transfer *mt3;
-    struct yagl_mem_transfer *mt4;
-
-    /*
-     * @}
-     */
-
     QemuThread host_thread;
 
-    volatile bool destroying; /* true when thread is being destroyed */
+    bool destroying; /* true when thread is being destroyed */
 
-    volatile bool is_first; /* true when this is first thread of a process */
-    volatile bool is_last; /* true when this is last thread of a process */
+    bool is_first; /* true when this is first thread of a process */
+    bool is_last; /* true when this is last thread of a process */
 
     /*
      * These events are auto reset.
@@ -50,19 +34,14 @@ struct yagl_thread_state
      * @}
      */
 
-    /*
-     * Allocated by the caller of yagl_thread_call,
-     * invalidated after function return.
-     */
-    uint8_t * volatile current_out_buff;
-    uint8_t * volatile current_in_buff;
+    uint8_t **pages;
 
     /*
      * Set by the caller of yagl_thread_call for
-     * the time of call. This is the time when host thread can
-     * read/write target memory.
+     * the time of call.
      */
-    CPUState * volatile current_env;
+    uint32_t offset;
+    CPUState *current_env;
 };
 
 YAGL_DECLARE_TLS(struct yagl_thread_state*, cur_ts);
@@ -75,8 +54,8 @@ struct yagl_thread_state
 void yagl_thread_state_destroy(struct yagl_thread_state *ts,
                                bool is_last);
 
-void yagl_thread_call(struct yagl_thread_state *ts,
-                      uint8_t *out_buff,
-                      uint8_t *in_buff);
+void yagl_thread_set_buffer(struct yagl_thread_state *ts, uint8_t **pages);
+
+void yagl_thread_call(struct yagl_thread_state *ts, uint32_t offset);
 
 #endif
diff --git a/hw/yagl_transport.c b/hw/yagl_transport.c
new file mode 100644 (file)
index 0000000..4da1954
--- /dev/null
@@ -0,0 +1,267 @@
+#include "yagl_transport.h"
+#include "yagl_mem.h"
+
+typedef enum
+{
+    yagl_call_result_ok = 0xA,    /* Call is ok. */
+    yagl_call_result_retry = 0xB, /* Page fault on host, retry is required. */
+} yagl_call_result;
+
+static void yagl_transport_copy_from(struct yagl_transport *t,
+                                     uint8_t *data,
+                                     uint32_t size)
+{
+    while (size > 0) {
+        uint32_t rem = t->next_page - t->ptr;
+        rem = MIN(rem, size);
+
+        memcpy(data, t->ptr, rem);
+
+        size -= rem;
+        data += rem;
+
+        yagl_transport_advance(t, rem);
+    }
+}
+
+static void yagl_transport_copy_to(struct yagl_transport *t,
+                                   uint32_t page_index,
+                                   uint8_t *ptr,
+                                   uint8_t *data,
+                                   uint32_t size)
+{
+    while (size > 0) {
+        uint32_t rem = t->pages[page_index] + TARGET_PAGE_SIZE - ptr;
+        rem = MIN(rem, size);
+
+        memcpy(ptr, data, rem);
+
+        size -= rem;
+        data += rem;
+
+        ++page_index;
+        ptr = t->pages[page_index];
+    }
+}
+
+struct yagl_transport *yagl_transport_create(void)
+{
+    struct yagl_transport *t;
+    uint32_t i;
+
+    t = g_malloc0(sizeof(*t));
+
+    for (i = 0; i < YAGL_TRANSPORT_MAX_OUT; ++i) {
+        yagl_vector_init(&t->out_arrays[i], 1, 0);
+    }
+
+    for (i = 0; i < YAGL_TRANSPORT_MAX_IN; ++i) {
+        yagl_vector_init(&t->in_arrays[i].v, 1, 0);
+        t->in_arrays[i].mt = yagl_mem_transfer_create();
+    }
+
+    return t;
+}
+
+void yagl_transport_destroy(struct yagl_transport *t)
+{
+    uint32_t i;
+
+    for (i = 0; i < YAGL_TRANSPORT_MAX_OUT; ++i) {
+        yagl_vector_cleanup(&t->out_arrays[i]);
+    }
+
+    for (i = 0; i < YAGL_TRANSPORT_MAX_IN; ++i) {
+        yagl_vector_cleanup(&t->in_arrays[i].v);
+        yagl_mem_transfer_destroy(t->in_arrays[i].mt);
+    }
+
+    g_free(t);
+}
+
+void yagl_transport_begin(struct yagl_transport *t,
+                          uint8_t **pages,
+                          uint32_t offset)
+{
+    t->pages = pages;
+    t->offset = offset;
+    t->page_index = offset / TARGET_PAGE_SIZE;
+    t->ptr = t->pages[t->page_index] + (offset & ~TARGET_PAGE_MASK);
+    t->next_page = t->pages[t->page_index] + TARGET_PAGE_SIZE;
+}
+
+void yagl_transport_begin_call(struct yagl_transport *t,
+                               yagl_api_id *api_id,
+                               yagl_func_id *func_id)
+{
+    *api_id = yagl_transport_get_out_uint32_t(t);
+
+    if (!*api_id) {
+        return;
+    }
+
+    *func_id = yagl_transport_get_out_uint32_t(t);
+
+    t->res = (uint32_t*)t->ptr;
+    t->direct = yagl_transport_get_out_uint32_t(t);
+    t->num_out_arrays = t->num_in_arrays = 0;
+}
+
+void yagl_transport_end_call(struct yagl_transport *t)
+{
+    uint32_t i;
+
+    for (i = 0; i < t->num_in_arrays; ++i) {
+        struct yagl_transport_in_array *in_array = &t->in_arrays[i];
+
+        if (*in_array->count > 0) {
+            if (t->direct) {
+                yagl_mem_put(in_array->mt,
+                             yagl_vector_data(&in_array->v),
+                             *in_array->count * in_array->el_size);
+            } else {
+                yagl_transport_copy_to(t,
+                                       in_array->page_index,
+                                       in_array->ptr,
+                                       yagl_vector_data(&in_array->v),
+                                       *in_array->count * in_array->el_size);
+            }
+        }
+    }
+
+    *t->res = yagl_call_result_ok;
+}
+
+uint32_t yagl_transport_bytes_processed(struct yagl_transport *t)
+{
+    uint32_t start_page_index = t->offset / TARGET_PAGE_SIZE;
+    uint32_t start_page_offset = t->offset & ~TARGET_PAGE_MASK;
+    uint32_t end_page_offset = t->ptr - t->pages[t->page_index];
+
+    return (t->page_index - start_page_index) * TARGET_PAGE_SIZE +
+           end_page_offset - start_page_offset;
+}
+
+bool yagl_transport_get_out_array(struct yagl_transport *t,
+                                  int32_t el_size,
+                                  const void **data,
+                                  int32_t *count)
+{
+    target_ulong va = (target_ulong)yagl_transport_get_out_uint32_t(t);
+    uint32_t size;
+    struct yagl_vector *v;
+
+    *count = yagl_transport_get_out_uint32_t(t);
+
+    if (!va) {
+        *data = NULL;
+        return true;
+    }
+
+    size = (*count > 0) ? (*count * el_size) : 0;
+
+    if (t->direct) {
+        v = &t->out_arrays[t->num_out_arrays];
+
+        yagl_vector_resize(v, size);
+
+        if (!yagl_mem_get(va, size, yagl_vector_data(v))) {
+            *t->res = yagl_call_result_retry;
+            return false;
+        }
+
+        ++t->num_out_arrays;
+
+        *data = yagl_vector_data(v);
+
+        return true;
+    }
+
+    if ((t->ptr + size) <= t->next_page) {
+        *data = t->ptr;
+
+        yagl_transport_advance(t, (size + 7U) & ~7U);
+
+        return true;
+    }
+
+    v = &t->out_arrays[t->num_out_arrays];
+
+    yagl_vector_resize(v, size);
+
+    yagl_transport_copy_from(t, yagl_vector_data(v), size);
+    yagl_transport_advance(t, 7U - ((size + 7U) & 7U));
+
+    ++t->num_out_arrays;
+
+    *data = yagl_vector_data(v);
+
+    return true;
+}
+
+bool yagl_transport_get_in_array(struct yagl_transport *t,
+                                 int32_t el_size,
+                                 void **data,
+                                 int32_t *maxcount,
+                                 int32_t **count)
+{
+    target_ulong va = (target_ulong)yagl_transport_get_out_uint32_t(t);
+    uint32_t size;
+    struct yagl_transport_in_array *in_array;
+
+    *count = (int32_t*)t->ptr;
+    *maxcount = yagl_transport_get_out_uint32_t(t);
+
+    if (!va) {
+        *data = NULL;
+        return true;
+    }
+
+    size = (*maxcount > 0) ? (*maxcount * el_size) : 0;
+
+    if (t->direct) {
+        in_array = &t->in_arrays[t->num_in_arrays];
+
+        if (!yagl_mem_prepare(in_array->mt, va, size)) {
+            *t->res = yagl_call_result_retry;
+            return false;
+        }
+
+        yagl_vector_resize(&in_array->v, size);
+
+        in_array->el_size = el_size;
+        in_array->count = *count;
+
+        ++t->num_in_arrays;
+
+        *data = yagl_vector_data(&in_array->v);
+
+        return true;
+    }
+
+    if ((t->ptr + size) <= t->next_page) {
+        *data = t->ptr;
+
+        yagl_transport_advance(t, (size + 7U) & ~7U);
+
+        return true;
+    }
+
+    in_array = &t->in_arrays[t->num_in_arrays];
+
+    in_array->page_index = t->page_index;
+    in_array->ptr = t->ptr;
+
+    yagl_vector_resize(&in_array->v, size);
+
+    in_array->el_size = el_size;
+    in_array->count = *count;
+
+    yagl_transport_advance(t, (size + 7U) & ~7U);
+
+    ++t->num_in_arrays;
+
+    *data = yagl_vector_data(&in_array->v);
+
+    return true;
+}
diff --git a/hw/yagl_transport.h b/hw/yagl_transport.h
new file mode 100644 (file)
index 0000000..092c1a7
--- /dev/null
@@ -0,0 +1,153 @@
+#ifndef _QEMU_YAGL_TRANSPORT_H
+#define _QEMU_YAGL_TRANSPORT_H
+
+#include "yagl_types.h"
+#include "yagl_vector.h"
+
+#define YAGL_TRANSPORT_MAX_IN 8
+#define YAGL_TRANSPORT_MAX_OUT 8
+
+struct yagl_mem_transfer;
+
+struct yagl_transport_in_array
+{
+    struct yagl_mem_transfer *mt;
+    struct yagl_vector v;
+
+    uint32_t page_index;
+    uint8_t *ptr;
+
+    int32_t el_size;
+    int32_t *count;
+};
+
+struct yagl_transport
+{
+    /*
+     * per-batch.
+     * @{
+     */
+
+    uint8_t **pages;
+    uint32_t offset;
+
+    uint32_t page_index;
+    uint8_t *next_page;
+
+    uint8_t *ptr;
+
+    /*
+     * @}
+     */
+
+    /*
+     * per-call.
+     * @{
+     */
+
+    bool direct;
+
+    uint32_t *res;
+
+    uint32_t num_out_arrays;
+    uint32_t num_in_arrays;
+
+    struct yagl_vector out_arrays[YAGL_TRANSPORT_MAX_OUT];
+    struct yagl_transport_in_array in_arrays[YAGL_TRANSPORT_MAX_IN];
+
+    /*
+     * @}
+     */
+};
+
+struct yagl_transport *yagl_transport_create(void);
+
+void yagl_transport_destroy(struct yagl_transport *t);
+
+void yagl_transport_begin(struct yagl_transport *t,
+                          uint8_t **pages,
+                          uint32_t offset);
+
+void yagl_transport_begin_call(struct yagl_transport *t,
+                               yagl_api_id *api_id,
+                               yagl_func_id *func_id);
+
+void yagl_transport_end_call(struct yagl_transport *t);
+
+uint32_t yagl_transport_bytes_processed(struct yagl_transport *t);
+
+bool yagl_transport_get_out_array(struct yagl_transport *t,
+                                  int32_t el_size,
+                                  const void **data,
+                                  int32_t *count);
+
+bool yagl_transport_get_in_array(struct yagl_transport *t,
+                                 int32_t el_size,
+                                 void **data,
+                                 int32_t *maxcount,
+                                 int32_t **count);
+
+static __inline void yagl_transport_advance(struct yagl_transport *t,
+                                            uint32_t size)
+{
+    t->ptr += size;
+
+    if (t->ptr >= t->next_page) {
+        uint32_t offset = t->ptr - t->next_page;
+
+        t->page_index += 1 + (offset / TARGET_PAGE_SIZE);
+        t->ptr = t->pages[t->page_index] + (offset & ~TARGET_PAGE_MASK);
+        t->next_page = t->pages[t->page_index] + TARGET_PAGE_SIZE;
+    }
+}
+
+static __inline uint8_t yagl_transport_get_out_uint8_t(struct yagl_transport *t)
+{
+    uint8_t tmp = *t->ptr;
+    yagl_transport_advance(t, 8);
+    return tmp;
+}
+
+static __inline uint32_t yagl_transport_get_out_uint32_t(struct yagl_transport *t)
+{
+    uint32_t tmp = *(uint32_t*)t->ptr;
+    yagl_transport_advance(t, 8);
+    return tmp;
+}
+
+static __inline float yagl_transport_get_out_float(struct yagl_transport *t)
+{
+    float tmp = *(float*)t->ptr;
+    yagl_transport_advance(t, 8);
+    return tmp;
+}
+
+static __inline void yagl_transport_get_in_arg(struct yagl_transport *t,
+                                               void **value)
+{
+    target_ulong va = (target_ulong)yagl_transport_get_out_uint32_t(t);
+
+    if (va) {
+        *value = t->ptr;
+        yagl_transport_advance(t, 8);
+    } else {
+        *value = NULL;
+    }
+}
+
+static __inline yagl_host_handle yagl_transport_get_out_yagl_host_handle(struct yagl_transport *t)
+{
+    return yagl_transport_get_out_uint32_t(t);
+}
+
+static __inline yagl_winsys_id yagl_transport_get_out_yagl_winsys_id(struct yagl_transport *t)
+{
+    return yagl_transport_get_out_uint32_t(t);
+}
+
+static __inline target_ulong yagl_transport_get_out_va(struct yagl_transport *t)
+{
+    return (target_ulong)yagl_transport_get_out_uint32_t(t);
+}
+
+#endif
diff --git a/hw/yagl_transport_egl.h b/hw/yagl_transport_egl.h
new file mode 100644 (file)
index 0000000..b76b931
--- /dev/null
@@ -0,0 +1,18 @@
+#ifndef _QEMU_YAGL_TRANSPORT_EGL_H
+#define _QEMU_YAGL_TRANSPORT_EGL_H
+
+#include "yagl_types.h"
+#include "yagl_transport.h"
+#include <EGL/egl.h>
+
+static __inline EGLint yagl_transport_get_out_EGLint(struct yagl_transport *t)
+{
+    return yagl_transport_get_out_uint32_t(t);
+}
+
+static __inline EGLenum yagl_transport_get_out_EGLenum(struct yagl_transport *t)
+{
+    return yagl_transport_get_out_uint32_t(t);
+}
+
+#endif
diff --git a/hw/yagl_transport_gl1.h b/hw/yagl_transport_gl1.h
new file mode 100644 (file)
index 0000000..304c567
--- /dev/null
@@ -0,0 +1,62 @@
+#ifndef _QEMU_YAGL_TRANSPORT_GL_H
+#define _QEMU_YAGL_TRANSPORT_GL_H
+
+#include "yagl_types.h"
+#include "yagl_transport.h"
+
+static __inline GLbitfield yagl_transport_get_out_GLbitfield(struct yagl_transport *t)
+{
+    return yagl_transport_get_out_uint32_t(t);
+}
+
+static __inline GLboolean yagl_transport_get_out_GLboolean(struct yagl_transport *t)
+{
+    return yagl_transport_get_out_uint8_t(t);
+}
+
+static __inline GLubyte yagl_transport_get_out_GLubyte(struct yagl_transport *t)
+{
+    return yagl_transport_get_out_uint8_t(t);
+}
+
+static __inline GLclampf yagl_transport_get_out_GLclampf(struct yagl_transport *t)
+{
+    return yagl_transport_get_out_float(t);
+}
+
+static __inline GLclampx yagl_transport_get_out_GLclampx(struct yagl_transport *t)
+{
+    return yagl_transport_get_out_uint32_t(t);
+}
+
+static __inline GLfixed yagl_transport_get_out_GLfixed(struct yagl_transport *t)
+{
+    return yagl_transport_get_out_uint32_t(t);
+}
+
+static __inline GLenum yagl_transport_get_out_GLenum(struct yagl_transport *t)
+{
+    return yagl_transport_get_out_uint32_t(t);
+}
+
+static __inline GLfloat yagl_transport_get_out_GLfloat(struct yagl_transport *t)
+{
+    return yagl_transport_get_out_float(t);
+}
+
+static __inline GLint yagl_transport_get_out_GLint(struct yagl_transport *t)
+{
+    return yagl_transport_get_out_uint32_t(t);
+}
+
+static __inline GLsizei yagl_transport_get_out_GLsizei(struct yagl_transport *t)
+{
+    return yagl_transport_get_out_uint32_t(t);
+}
+
+static __inline GLuint yagl_transport_get_out_GLuint(struct yagl_transport *t)
+{
+    return yagl_transport_get_out_uint32_t(t);
+}
+
+#endif
diff --git a/hw/yagl_transport_gl2.h b/hw/yagl_transport_gl2.h
new file mode 100644 (file)
index 0000000..13d4505
--- /dev/null
@@ -0,0 +1,47 @@
+#ifndef _QEMU_YAGL_TRANSPORT_GL_H
+#define _QEMU_YAGL_TRANSPORT_GL_H
+
+#include "yagl_types.h"
+#include "yagl_transport.h"
+
+static __inline GLbitfield yagl_transport_get_out_GLbitfield(struct yagl_transport *t)
+{
+    return yagl_transport_get_out_uint32_t(t);
+}
+
+static __inline GLboolean yagl_transport_get_out_GLboolean(struct yagl_transport *t)
+{
+    return yagl_transport_get_out_uint8_t(t);
+}
+
+static __inline GLclampf yagl_transport_get_out_GLclampf(struct yagl_transport *t)
+{
+    return yagl_transport_get_out_float(t);
+}
+
+static __inline GLenum yagl_transport_get_out_GLenum(struct yagl_transport *t)
+{
+    return yagl_transport_get_out_uint32_t(t);
+}
+
+static __inline GLfloat yagl_transport_get_out_GLfloat(struct yagl_transport *t)
+{
+    return yagl_transport_get_out_float(t);
+}
+
+static __inline GLint yagl_transport_get_out_GLint(struct yagl_transport *t)
+{
+    return yagl_transport_get_out_uint32_t(t);
+}
+
+static __inline GLsizei yagl_transport_get_out_GLsizei(struct yagl_transport *t)
+{
+    return yagl_transport_get_out_uint32_t(t);
+}
+
+static __inline GLuint yagl_transport_get_out_GLuint(struct yagl_transport *t)
+{
+    return yagl_transport_get_out_uint32_t(t);
+}
+
+#endif
index 87f7dac..df09306 100644 (file)
@@ -10,6 +10,8 @@ typedef uint32_t yagl_host_handle;
 typedef uint32_t yagl_object_name;
 typedef uint32_t yagl_winsys_id;
 
+struct yagl_transport;
+
 /*
  * YaGL supported render types.
  */
@@ -44,8 +46,7 @@ typedef enum
 
 #define YAGL_NUM_CLIENT_APIS 4
 
-typedef bool (*yagl_api_func)(uint8_t **/*out_buff*/,
-                              uint8_t */*in_buff*/);
+typedef bool (*yagl_api_func)(struct yagl_transport */*t*/);
 
 static inline float yagl_fixed_to_float(int32_t x)
 {
index 46679fa..5eee7ee 100644 (file)
@@ -6,6 +6,6 @@
 /*
  * Whenever protocol changes be sure to bump this.
  */
-#define YAGL_VERSION 19
+#define YAGL_VERSION 20
 
 #endif