YaGL: Patches for the 64bit addressing 97/50997/2
authorjinhyung.jo <jinhyung.jo@samsung.com>
Wed, 4 Nov 2015 09:48:16 +0000 (18:48 +0900)
committerjinhyung.jo <jinhyung.jo@samsung.com>
Wed, 4 Nov 2015 10:11:04 +0000 (19:11 +0900)
Tizen 3.0 supports a 64bit guest.
However current yagl is implemented by assumed to use 32bit address.
So modify the address related parts.
The qemu device sources were also modifed.
And remove the warnings:
  -Wint-to-pointer-cast/-Wpointer-to-int-cast/-Wunused-variables
TODO: fix the warning - 'wl_client_add_resource' is deprecated

Change-Id: Id3875eefa012240df34fffbc7d12f36c9584b4f1
Signed-off-by: Jinhyung Jo <jinhyung.jo@samsung.com>
23 files changed:
EGL/wayland/yagl_wayland_window.c
EGL/yagl_client_image.c
EGL/yagl_display.c
EGL/yagl_egl_calls.c
EGL/yagl_onscreen_image_tizen_sfc.c
EGL/yagl_onscreen_image_wl_buffer.c
EGL/yagl_surface.c
GLES_common/yagl_gles_array.c
GLES_common/yagl_gles_array.h
GLES_common/yagl_gles_buffer.c
GLES_common/yagl_gles_buffer.h
GLES_common/yagl_gles_calls.c
GLES_common/yagl_gles_calls.in
GLES_common/yagl_gles_context.c
GLES_common/yagl_host_gles_calls.c
GLES_common/yagl_host_gles_calls.h
GLES_common/yagl_transport_gl.h
GLESv1_CM/yagl_gles1_calls.c
GLESv2/yagl_gles2_calls.c
GLESv2/yagl_gles3_calls.c
include/yagl_transport.h
include/yagl_types.h
packaging/emulator-yagl.spec

index 27c22a06b89dc8330e3229eb2d0a90a5eebae9e7..345edd6b297ad97a6bba1da7b7ce7560764794f5 100644 (file)
@@ -278,7 +278,9 @@ static void yagl_wayland_window_swap_buffers(struct yagl_native_drawable *drawab
 {
     struct yagl_wayland_window *window = (struct yagl_wayland_window*)drawable;
     struct yagl_wayland_display *dpy = (struct yagl_wayland_display*)drawable->dpy;
+    /* XXX: unused variable
     struct wl_display *wl_dpy = YAGL_WAYLAND_DPY(drawable->dpy->os_dpy);
+    */
     struct wl_egl_window *egl_window = YAGL_WAYLAND_WINDOW(drawable->os_drawable);
     int i, ret = 0;
 
index 92b7ed8d2a94b61f673ed9f963be68853dc96b2d..4dc03cf70b3d508a1e62254fd7cce2852e00b22d 100644 (file)
@@ -72,7 +72,7 @@ struct yagl_client_image *yagl_acquire_client_image(yagl_host_handle handle)
         return NULL;
     }
 
-    image = yagl_display_image_acquire(ctx->dpy, (EGLImageKHR)handle);
+    image = yagl_display_image_acquire(ctx->dpy, (EGLImageKHR)INT2VOIDP(handle));
 
     if (!image) {
         return NULL;
index 9a9ef7b1747c1658c0155549f43bf8617dc9bac1..60b8d023bd825b4abacbec670c0cfdb0e86b9cfa 100644 (file)
@@ -120,7 +120,7 @@ void yagl_display_atfork(void)
 
 struct yagl_display *yagl_display_get(EGLDisplay handle)
 {
-    yagl_host_handle host_dpy = (yagl_host_handle)handle;
+    yagl_host_handle host_dpy = (yagl_host_handle)VOIDP2INT(handle);
     struct yagl_display *dpy;
 
     yagl_displays_init();
@@ -427,7 +427,7 @@ struct yagl_context *yagl_display_context_acquire(struct yagl_display *dpy,
     pthread_mutex_lock(&dpy->mutex);
 
     yagl_list_for_each(struct yagl_resource, res, &dpy->contexts, list) {
-        if (res->handle == (yagl_host_handle)handle) {
+        if (res->handle == (yagl_host_handle)VOIDP2INT(handle)) {
             yagl_resource_acquire(res);
             pthread_mutex_unlock(&dpy->mutex);
             return (struct yagl_context*)res;
@@ -447,7 +447,7 @@ void yagl_display_context_remove(struct yagl_display *dpy,
     pthread_mutex_lock(&dpy->mutex);
 
     yagl_list_for_each(struct yagl_resource, res, &dpy->contexts, list) {
-        if (res->handle == (yagl_host_handle)handle) {
+        if (res->handle == (yagl_host_handle)VOIDP2INT(handle)) {
             yagl_list_remove(&res->list);
             yagl_resource_release(res);
             break;
index 138488d2405d614567c60eebb9a1c9995c242cef..ee014101d343161912cc0ce7714ddabd5c33d004 100644 (file)
@@ -233,7 +233,7 @@ YAGL_API EGLDisplay eglGetDisplay(EGLNativeDisplayType display_id)
         goto out;
     }
 
-    ret = (EGLDisplay)dpy->host_dpy;
+    ret = (EGLDisplay)INT2VOIDP(dpy->host_dpy);
 
     YAGL_LOG_FUNC_EXIT_SPLIT(yagl_host_handle, dpy->host_dpy);
 
@@ -357,7 +357,7 @@ YAGL_API EGLBoolean eglGetConfigs(EGLDisplay dpy,
         goto fail;
     }
 
-    if (!yagl_host_eglGetConfigs((yagl_host_handle)dpy,
+    if (!yagl_host_eglGetConfigs((yagl_host_handle)VOIDP2INT(dpy),
                                  (yagl_host_handle*)configs,
                                  config_size,
                                  num_config,
@@ -391,7 +391,7 @@ YAGL_API EGLBoolean eglChooseConfig(EGLDisplay dpy,
         goto fail;
     }
 
-    if (!yagl_host_eglChooseConfig((yagl_host_handle)dpy,
+    if (!yagl_host_eglChooseConfig((yagl_host_handle)VOIDP2INT(dpy),
                                    attrib_list,
                                    yagl_transport_attrib_list_count(attrib_list),
                                    (yagl_host_handle*)configs,
@@ -460,8 +460,8 @@ YAGL_API EGLBoolean eglGetConfigAttrib(EGLDisplay dpy_,
         }
         /* Fall through. */
     default:
-        ret = yagl_host_eglGetConfigAttrib((yagl_host_handle)dpy_,
-                                           (yagl_host_handle)config,
+        ret = yagl_host_eglGetConfigAttrib((yagl_host_handle)VOIDP2INT(dpy_),
+                                           (yagl_host_handle)VOIDP2INT(config),
                                            attribute,
                                            value,
                                            &error);
@@ -514,7 +514,7 @@ YAGL_API EGLSurface eglCreateWindowSurface(EGLDisplay dpy_,
     }
 
     surface = yagl_get_backend()->create_window_surface(dpy,
-                                                        (yagl_host_handle)config,
+                                                        (yagl_host_handle)VOIDP2INT(config),
                                                         native_win,
                                                         attrib_list);
 
@@ -562,7 +562,7 @@ YAGL_API EGLSurface eglCreatePbufferSurface(EGLDisplay dpy_,
     }
 
     surface = yagl_get_backend()->create_pbuffer_surface(dpy,
-                                                         (yagl_host_handle)config,
+                                                         (yagl_host_handle)VOIDP2INT(config),
                                                          attrib_list);
 
     if (!surface) {
@@ -616,7 +616,7 @@ YAGL_API EGLSurface eglCreatePixmapSurface(EGLDisplay dpy_,
     }
 
     surface = yagl_get_backend()->create_pixmap_surface(dpy,
-                                                        (yagl_host_handle)config,
+                                                        (yagl_host_handle)VOIDP2INT(config),
                                                         native_pixmap,
                                                         attrib_list);
 
@@ -718,7 +718,7 @@ YAGL_API EGLBoolean eglQuerySurface(EGLDisplay dpy_,
     case EGL_BITMAP_POINTER_KHR:
         ptr = yagl_surface_map(surface, &stride);
         if (ptr) {
-            *value = (EGLint)ptr;
+            *value = (EGLint)VOIDP2INT(ptr);
             retval = EGL_TRUE;
         } else {
             YAGL_SET_ERR(EGL_BAD_ACCESS);
@@ -1121,8 +1121,8 @@ YAGL_API EGLContext eglCreateContext(EGLDisplay dpy_,
 
     host_context =
         yagl_host_eglCreateContext(dpy->host_dpy,
-                                   (yagl_host_handle)config,
-                                   (yagl_host_handle)share_context_,
+                                   (yagl_host_handle)VOIDP2INT(config),
+                                   (yagl_host_handle)VOIDP2INT(share_context_),
                                    attrib_list,
                                    yagl_transport_attrib_list_count(attrib_list),
                                    &error);
@@ -1147,7 +1147,7 @@ out:
 
     YAGL_LOG_FUNC_EXIT("%u", host_context);
 
-    return (EGLContext)host_context;
+    return (EGLContext)INT2VOIDP(host_context);
 }
 
 YAGL_API EGLBoolean eglDestroyContext(EGLDisplay dpy_, EGLContext ctx)
@@ -1164,7 +1164,7 @@ YAGL_API EGLBoolean eglDestroyContext(EGLDisplay dpy_, EGLContext ctx)
         goto fail;
     }
 
-    if (!yagl_host_eglDestroyContext(dpy->host_dpy, (yagl_host_handle)ctx, &error)) {
+    if (!yagl_host_eglDestroyContext(dpy->host_dpy, (yagl_host_handle)VOIDP2INT(ctx), &error)) {
         YAGL_SET_ERR(error);
         goto fail;
     }
@@ -1221,7 +1221,7 @@ YAGL_API EGLBoolean eglMakeCurrent(EGLDisplay dpy_,
                  * the current context.
                  */
 
-                dpy_ = (EGLDisplay)prev_ctx->dpy->host_dpy;
+                dpy_ = (EGLDisplay)INT2VOIDP(prev_ctx->dpy->host_dpy);
                 dpy = prev_ctx->dpy;
             } else {
                 if (!yagl_validate_display(dpy_, &dpy)) {
@@ -1301,7 +1301,7 @@ YAGL_API EGLBoolean eglMakeCurrent(EGLDisplay dpy_,
 
     yagl_render_invalidate(0);
 
-    yagl_host_eglMakeCurrent((yagl_host_handle)dpy_,
+    yagl_host_eglMakeCurrent((yagl_host_handle)VOIDP2INT(dpy_),
                              (draw ? draw->res.handle : 0),
                              (read ? read->res.handle : 0),
                              (ctx ? ctx->res.handle : 0));
@@ -1333,7 +1333,7 @@ YAGL_API EGLContext eglGetCurrentContext(void)
 
     YAGL_LOG_FUNC_EXIT("%u", (ctx ? ctx->res.handle : 0));
 
-    return (ctx ? (EGLContext)ctx->res.handle : EGL_NO_CONTEXT);
+    return (ctx ? (EGLContext)INT2VOIDP(ctx->res.handle) : EGL_NO_CONTEXT);
 }
 
 YAGL_API EGLSurface eglGetCurrentSurface(EGLint readdraw)
@@ -1368,7 +1368,7 @@ YAGL_API EGLDisplay eglGetCurrentDisplay(void)
 
     YAGL_LOG_FUNC_EXIT("%u", (ctx ? ctx->dpy->host_dpy : 0));
 
-    return (ctx ? (EGLDisplay)ctx->dpy->host_dpy : EGL_NO_DISPLAY);
+    return (ctx ? (EGLDisplay)INT2VOIDP(ctx->dpy->host_dpy) : EGL_NO_DISPLAY);
 }
 
 YAGL_API EGLBoolean eglQueryContext(EGLDisplay dpy_,
@@ -1453,7 +1453,7 @@ YAGL_API EGLBoolean eglQueryContext(EGLDisplay dpy_,
         break;
     default:
         res = yagl_host_eglQueryContext(dpy->host_dpy,
-                                        (yagl_host_handle)ctx_,
+                                        (yagl_host_handle)VOIDP2INT(ctx_),
                                         attribute,
                                         value,
                                         &error);
@@ -1761,7 +1761,7 @@ YAGL_API EGLImageKHR eglCreateImageKHR(EGLDisplay dpy_,
 
         image = yagl_get_backend()->create_image_gl_texture_2d(dpy,
                                                                ctx,
-                                                               (yagl_object_name)buffer,
+                                                               (yagl_object_name)VOIDP2INT(buffer),
                                                                iface);
 
         if (!image) {
index 4eaab324a150ae6703d64fb8a81c4f592b9e79c3..2ff5242a537b90aeae71bcde1d548947be30e592 100644 (file)
@@ -101,7 +101,7 @@ struct yagl_onscreen_image_tizen_sfc
     yagl_image_init(&image->base,
                     &yagl_onscreen_image_tizen_sfc_destroy,
                     dpy,
-                    (EGLImageKHR)drm_sfc->gem.name,
+                    (EGLImageKHR)INT2VOIDP(drm_sfc->gem.name),
                     client_image);
 
     yagl_client_image_release(client_image);
index 39bd29db304ae82dffb137622fbb75b83cb9f5ee..25075e133bcf3e55dbd8da82aad3dd597a8a7163 100644 (file)
@@ -95,7 +95,7 @@ struct yagl_onscreen_image_wl_buffer
     yagl_image_init(&image->base,
                     &yagl_onscreen_image_wl_buffer_destroy,
                     dpy,
-                    (EGLImageKHR)drm_sfc->gem.name,
+                    (EGLImageKHR)INT2VOIDP(drm_sfc->gem.name),
                     client_image);
 
     yagl_client_image_release(client_image);
index 15f78dbf4d227500e0b374536b74ee4a2033387c..5c62b6f8563b742a83fdd538a98706e8677cae42 100644 (file)
@@ -122,7 +122,7 @@ EGLSurface yagl_surface_get_handle(struct yagl_surface *sfc)
 {
     switch (sfc->type) {
     case EGL_PBUFFER_BIT:
-        return (EGLSurface)sfc->res.handle;
+        return (EGLSurface)INT2VOIDP(sfc->res.handle);
     case EGL_PIXMAP_BIT:
     case EGL_WINDOW_BIT:
         return (EGLSurface)sfc->native_drawable->os_drawable;
index 264384470104bbf5cb127309ed1968ede531ab4a..bd7f68ab397297468dd0031d81b16594f7f32b1a 100644 (file)
@@ -110,11 +110,11 @@ static __inline int yagl_get_el_size(GLenum type,
 
 static __inline void yagl_get_actual(GLenum type,
                                      GLsizei stride,
-                                     GLint offset,
+                                     GLintptr offset,
                                      int need_convert,
                                      GLenum *actual_type,
                                      GLsizei *actual_stride,
-                                     GLint *actual_offset)
+                                     GLintptr *actual_offset)
 {
     *actual_type = type;
     *actual_stride = stride;
@@ -282,7 +282,7 @@ int yagl_gles_array_update_vbo(struct yagl_gles_array *array,
                                GLboolean normalized,
                                GLsizei stride,
                                struct yagl_gles_buffer *vbo,
-                               GLint offset,
+                               GLintptr offset,
                                int integer)
 {
     if (!yagl_get_el_size(type, integer, &array->el_size, &type)) {
index d496361efe3335040579e391762a595972571781..84e1fe52803db807edf0ebd3a011b66ca984a372 100644 (file)
@@ -102,8 +102,8 @@ struct yagl_gles_array
         const GLvoid *ptr;
         struct
         {
-            GLint offset;
-            GLint actual_offset;
+            GLintptr offset;
+            GLintptr actual_offset;
         };
     };
 
@@ -136,7 +136,7 @@ int yagl_gles_array_update_vbo(struct yagl_gles_array *array,
                                GLboolean normalized,
                                GLsizei stride,
                                struct yagl_gles_buffer *vbo,
-                               GLint offset,
+                               GLintptr offset,
                                int integer);
 
 void yagl_gles_array_apply(struct yagl_gles_array *array);
index d4bc4edd9432d0f9478d3efdf021e07200991905..68ea04fad78070d7060edb315f94828d342b0dc1 100644 (file)
@@ -335,7 +335,7 @@ void yagl_gles_buffer_set_data(struct yagl_gles_buffer *buffer,
 }
 
 int yagl_gles_buffer_update_data(struct yagl_gles_buffer *buffer,
-                                 GLint offset,
+                                 GLintptr offset,
                                  GLint size,
                                  const void *data)
 {
@@ -368,7 +368,7 @@ int yagl_gles_buffer_update_data(struct yagl_gles_buffer *buffer,
 
 int yagl_gles_buffer_get_minmax_index(struct yagl_gles_buffer *buffer,
                                       GLenum type,
-                                      GLint offset,
+                                      GLintptr offset,
                                       GLint count,
                                       uint32_t *min_idx,
                                       uint32_t *max_idx)
@@ -647,7 +647,7 @@ int yagl_gles_buffer_is_cpu_dirty(struct yagl_gles_buffer *buffer,
 }
 
 void yagl_gles_buffer_set_gpu_dirty(struct yagl_gles_buffer *buffer,
-                                    GLint offset,
+                                    GLintptr offset,
                                     GLint size)
 {
     if ((offset < 0) || (size < 0) || ((offset + size) > buffer->size)) {
@@ -667,8 +667,8 @@ int yagl_gles_buffer_copy_gpu(struct yagl_gles_buffer *from_buffer,
                               GLenum from_target,
                               struct yagl_gles_buffer *to_buffer,
                               GLenum to_target,
-                              GLint from_offset,
-                              GLint to_offset,
+                              GLintptr from_offset,
+                              GLintptr to_offset,
                               GLint size)
 {
     if ((from_offset < 0) || (to_offset < 0) || (size < 0) ||
index 6f8e3b9ffd79554462dbee3a820357128bbaf58d..90715f83159666a39d389caa33093196bcb55710 100644 (file)
@@ -86,7 +86,7 @@ struct yagl_gles_buffer
 
     int cached_minmax_idx;
     GLenum cached_type;
-    GLint cached_offset;
+    GLintptr cached_offset;
     GLint cached_count;
     uint32_t cached_min_idx;
     uint32_t cached_max_idx;
@@ -110,13 +110,13 @@ void yagl_gles_buffer_set_data(struct yagl_gles_buffer *buffer,
                                GLenum usage);
 
 int yagl_gles_buffer_update_data(struct yagl_gles_buffer *buffer,
-                                 GLint offset,
+                                 GLintptr offset,
                                  GLint size,
                                  const void *data);
 
 int yagl_gles_buffer_get_minmax_index(struct yagl_gles_buffer *buffer,
                                       GLenum type,
-                                      GLint offset,
+                                      GLintptr offset,
                                       GLint count,
                                       uint32_t *min_idx,
                                       uint32_t *max_idx);
@@ -160,15 +160,15 @@ int yagl_gles_buffer_is_cpu_dirty(struct yagl_gles_buffer *buffer,
                                   int need_convert);
 
 void yagl_gles_buffer_set_gpu_dirty(struct yagl_gles_buffer *buffer,
-                                    GLint offset,
+                                    GLintptr offset,
                                     GLint size);
 
 int yagl_gles_buffer_copy_gpu(struct yagl_gles_buffer *from_buffer,
                               GLenum from_target,
                               struct yagl_gles_buffer *to_buffer,
                               GLenum to_target,
-                              GLint from_offset,
-                              GLint to_offset,
+                              GLintptr from_offset,
+                              GLintptr to_offset,
                               GLint size);
 
 #endif
index f25a10325f8895662144d90d1896a39aba3a08ea..4c64e8ac677aac441e9c8bae2bc8cff9433a56c7 100644 (file)
@@ -2181,7 +2181,7 @@ YAGL_API void glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLen
                                      width, height,
                                      pf->dst_format,
                                      pf->dst_type,
-                                     (GLsizei)pixels);
+                                     (uintptr_t)pixels);
     } else {
         GLvoid *pixels_from;
 
@@ -2297,7 +2297,7 @@ YAGL_API void glTexImage2D(GLenum target, GLint level, GLint internalformat, GLs
                                      border,
                                      pf->dst_format,
                                      pf->dst_type,
-                                     (GLsizei)pixels);
+                                     (uintptr_t)pixels);
     } else {
         yagl_host_glTexImage2DData(target,
                                    level,
@@ -2390,7 +2390,7 @@ YAGL_API void glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint y
                                         height,
                                         pf->dst_format,
                                         pf->dst_type,
-                                        (GLsizei)pixels);
+                                        (uintptr_t)pixels);
     } else {
         yagl_host_glTexSubImage2DData(target,
                                       level,
@@ -2430,7 +2430,7 @@ YAGL_API void glEGLImageTargetTexture2DOES(GLenum target, GLeglImageOES image)
         goto out;
     }
 
-    image_obj = (struct yagl_gles_image*)yagl_acquire_client_image((yagl_host_handle)image);
+    image_obj = (struct yagl_gles_image*)yagl_acquire_client_image((yagl_host_handle)VOIDP2INT(image));
 
     if (!image_obj) {
         YAGL_SET_ERR(GL_INVALID_OPERATION);
index ce21c1faf0765bece2618b55cb8c2c52b32a9cea..e0cf14eadcae97d5ce90aaf3ef0497b8e7a14383 100644 (file)
@@ -2,7 +2,7 @@
 void glDrawArrays(GLenum mode, GLint first, GLsizei count)
 void glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices)
 void glReadPixelsData(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels)
-void glReadPixelsOffset(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei pixels)
+void glReadPixelsOffset(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, uintptr_t pixels)
 void glDrawArraysInstanced(GLenum mode, GLint start, GLsizei count, GLsizei primcount)
 void glDrawElementsInstanced(GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount)
 void glDrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices)
@@ -13,20 +13,20 @@ void glBindVertexArray(GLuint array)
 void glDisableVertexAttribArray(GLuint index)
 void glEnableVertexAttribArray(GLuint index)
 void glVertexAttribPointerData(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLint first, const GLvoid *data)
-void glVertexAttribPointerOffset(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLsizei offset)
+void glVertexAttribPointerOffset(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, uintptr_t offset)
 void glVertexPointerData(GLint size, GLenum type, GLsizei stride, GLint first, const GLvoid *data)
-void glVertexPointerOffset(GLint size, GLenum type, GLsizei stride, GLsizei offset)
+void glVertexPointerOffset(GLint size, GLenum type, GLsizei stride, uintptr_t offset)
 void glNormalPointerData(GLenum type, GLsizei stride, GLint first, const GLvoid *data)
-void glNormalPointerOffset(GLenum type, GLsizei stride, GLsizei offset)
+void glNormalPointerOffset(GLenum type, GLsizei stride, uintptr_t offset)
 void glColorPointerData(GLint size, GLenum type, GLsizei stride, GLint first, const GLvoid *data)
-void glColorPointerOffset(GLint size, GLenum type, GLsizei stride, GLsizei offset)
+void glColorPointerOffset(GLint size, GLenum type, GLsizei stride, uintptr_t offset)
 void glTexCoordPointerData(GLint tex_id, GLint size, GLenum type, GLsizei stride, GLint first, const GLvoid *data)
-void glTexCoordPointerOffset(GLint size, GLenum type, GLsizei stride, GLsizei offset)
+void glTexCoordPointerOffset(GLint size, GLenum type, GLsizei stride, uintptr_t offset)
 void glDisableClientState(GLenum array)
 void glEnableClientState(GLenum array)
 void glVertexAttribDivisor(GLuint index, GLuint divisor)
 void glVertexAttribIPointerData(GLuint index, GLint size, GLenum type, GLsizei stride, GLint first, const GLvoid *data)
-void glVertexAttribIPointerOffset(GLuint index, GLint size, GLenum type, GLsizei stride, GLsizei offset)
+void glVertexAttribIPointerOffset(GLuint index, GLint size, GLenum type, GLsizei stride, uintptr_t offset)
 # Buffers
 void glGenBuffers(const GLuint *buffers)
 void glBindBuffer(GLenum target, GLuint buffer)
@@ -35,7 +35,7 @@ void glBufferSubData(GLenum target, GLsizei offset, const GLvoid *data)
 void glBindBufferBase(GLenum target, GLuint index, GLuint buffer)
 void glBindBufferRange(GLenum target, GLuint index, GLuint buffer, GLint offset, GLsizei size)
 void glMapBuffer(GLuint buffer, const GLuint *ranges, GLvoid *data)
-void glCopyBufferSubData(GLenum readTarget, GLenum writeTarget, GLint readOffset, GLint writeOffset, GLsizei size)
+void glCopyBufferSubData(GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizei size)
 # Textures
 void glGenTextures(const GLuint *textures)
 void glBindTexture(GLenum target, GLuint texture)
@@ -45,13 +45,13 @@ void glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffse
 void glGetTexParameterfv(GLenum target, GLenum pname, GLfloat &param)
 void glGetTexParameteriv(GLenum target, GLenum pname, GLint &param)
 void glTexImage2DData(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels)
-void glTexImage2DOffset(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, GLsizei pixels)
+void glTexImage2DOffset(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, uintptr_t pixels)
 void glTexParameterf(GLenum target, GLenum pname, GLfloat param)
 void glTexParameterfv(GLenum target, GLenum pname, const GLfloat* params)
 void glTexParameteri(GLenum target, GLenum pname, GLint param)
 void glTexParameteriv(GLenum target, GLenum pname, const GLint* params)
 void glTexSubImage2DData(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels)
-void glTexSubImage2DOffset(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei pixels)
+void glTexSubImage2DOffset(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, uintptr_t pixels)
 void glClientActiveTexture(GLenum texture)
 void glTexEnvi(GLenum target, GLenum pname, GLint param)
 void glTexEnvf(GLenum target, GLenum pname, GLfloat param)
@@ -61,9 +61,9 @@ void glTexEnvfv(GLenum target, GLenum pname, const GLfloat *params)
 void glGetTexEnviv(GLenum env, GLenum pname, GLint *params)
 void glGetTexEnvfv(GLenum env, GLenum pname, GLfloat *params)
 void glTexImage3DData(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels)
-void glTexImage3DOffset(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, GLsizei pixels)
+void glTexImage3DOffset(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, uintptr_t pixels)
 void glTexSubImage3DData(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels)
-void glTexSubImage3DOffset(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLsizei pixels)
+void glTexSubImage3DOffset(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, uintptr_t pixels)
 void glCopyTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height)
 # Framebuffers
 void glGenFramebuffers(const GLuint *framebuffers)
index 60b2a6f1f4185ce2003ce6b93a6cccab39479a66..9e43e3bddbbea20a01279336f9b30c150462594c 100644 (file)
@@ -2141,7 +2141,7 @@ void yagl_gles_context_draw_elements(struct yagl_gles_context *ctx,
             if (ctx->vao->ebo) {
                 if (!yagl_gles_buffer_get_minmax_index(ctx->vao->ebo,
                                                        type,
-                                                       (GLint)indices,
+                                                       (GLintptr)indices,
                                                        count,
                                                        &min_idx,
                                                        &max_idx)) {
@@ -2174,7 +2174,7 @@ void yagl_gles_context_draw_elements(struct yagl_gles_context *ctx,
                                   type,
                                   GL_ELEMENT_ARRAY_BUFFER,
                                   0);
-        ctx->draw_elements(ctx, mode, count, type, NULL, (int32_t)indices, primcount, max_idx);
+        ctx->draw_elements(ctx, mode, count, type, NULL, (int32_t)VOIDP2INT(indices), primcount, max_idx);
         yagl_host_glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
     } else {
         ctx->draw_elements(ctx, mode, count, type, indices, count * index_size, primcount, max_idx);
@@ -2213,7 +2213,7 @@ int yagl_gles_context_pre_unpack(struct yagl_gles_context *ctx,
         return 0;
     }
 
-    *pixels = ctx->unpack.pbo->map_pointer + (uint32_t)*pixels;
+    *pixels = ctx->unpack.pbo->map_pointer + (GLintptr)*pixels;
 
     return 1;
 }
@@ -2264,7 +2264,7 @@ int yagl_gles_context_pre_pack(struct yagl_gles_context *ctx,
         return 0;
     }
 
-    *pixels = ctx->pack.pbo->map_pointer + (uint32_t)*pixels;
+    *pixels = ctx->pack.pbo->map_pointer + (GLintptr)*pixels;
 
     return 1;
 }
@@ -2283,7 +2283,7 @@ void yagl_gles_context_post_pack(struct yagl_gles_context *ctx,
     } else {
         yagl_host_glBindBuffer(GL_PIXEL_PACK_BUFFER, 0);
         yagl_gles_buffer_set_gpu_dirty(ctx->pack.pbo,
-                                       (GLint)pixels,
+                                       (GLintptr)pixels,
                                        size);
     }
 }
index 0e606ab9c75e27e0309f1f89ceee4c4320c27b48..a810c022ce6318dd2c50d8ae6af49536e0e00ccc 100644 (file)
@@ -57,7 +57,7 @@ void yagl_host_glReadPixelsData(GLint x, GLint y, GLsizei width, GLsizei height,
 /*
  * glReadPixelsOffset wrapper. id = 4
  */
-void yagl_host_glReadPixelsOffset(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei pixels)
+void yagl_host_glReadPixelsOffset(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, uintptr_t pixels)
 {
     struct yagl_transport *t = yagl_get_transport();
 
@@ -68,7 +68,7 @@ void yagl_host_glReadPixelsOffset(GLint x, GLint y, GLsizei width, GLsizei heigh
     yagl_transport_put_out_GLsizei(t, height);
     yagl_transport_put_out_GLenum(t, format);
     yagl_transport_put_out_GLenum(t, type);
-    yagl_transport_put_out_GLsizei(t, pixels);
+    yagl_transport_put_out_uintptr_t(t, pixels);
     yagl_transport_end(t);
 }
 
@@ -189,7 +189,7 @@ void yagl_host_glVertexAttribPointerData(GLuint indx, GLint size, GLenum type, G
 /*
  * glVertexAttribPointerOffset wrapper. id = 13
  */
-void yagl_host_glVertexAttribPointerOffset(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLsizei offset)
+void yagl_host_glVertexAttribPointerOffset(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, uintptr_t offset)
 {
     struct yagl_transport *t = yagl_get_transport();
 
@@ -199,7 +199,7 @@ void yagl_host_glVertexAttribPointerOffset(GLuint indx, GLint size, GLenum type,
     yagl_transport_put_out_GLenum(t, type);
     yagl_transport_put_out_GLboolean(t, normalized);
     yagl_transport_put_out_GLsizei(t, stride);
-    yagl_transport_put_out_GLsizei(t, offset);
+    yagl_transport_put_out_uintptr_t(t, offset);
     yagl_transport_end(t);
 }
 
@@ -222,7 +222,7 @@ void yagl_host_glVertexPointerData(GLint size, GLenum type, GLsizei stride, GLin
 /*
  * glVertexPointerOffset wrapper. id = 15
  */
-void yagl_host_glVertexPointerOffset(GLint size, GLenum type, GLsizei stride, GLsizei offset)
+void yagl_host_glVertexPointerOffset(GLint size, GLenum type, GLsizei stride, uintptr_t offset)
 {
     struct yagl_transport *t = yagl_get_transport();
 
@@ -230,7 +230,7 @@ void yagl_host_glVertexPointerOffset(GLint size, GLenum type, GLsizei stride, GL
     yagl_transport_put_out_GLint(t, size);
     yagl_transport_put_out_GLenum(t, type);
     yagl_transport_put_out_GLsizei(t, stride);
-    yagl_transport_put_out_GLsizei(t, offset);
+    yagl_transport_put_out_uintptr_t(t, offset);
     yagl_transport_end(t);
 }
 
@@ -252,14 +252,14 @@ void yagl_host_glNormalPointerData(GLenum type, GLsizei stride, GLint first, con
 /*
  * glNormalPointerOffset wrapper. id = 17
  */
-void yagl_host_glNormalPointerOffset(GLenum type, GLsizei stride, GLsizei offset)
+void yagl_host_glNormalPointerOffset(GLenum type, GLsizei stride, uintptr_t offset)
 {
     struct yagl_transport *t = yagl_get_transport();
 
     yagl_transport_begin(t, yagl_api_id_gles, 17, 3 * 8, 3 * 8);
     yagl_transport_put_out_GLenum(t, type);
     yagl_transport_put_out_GLsizei(t, stride);
-    yagl_transport_put_out_GLsizei(t, offset);
+    yagl_transport_put_out_uintptr_t(t, offset);
     yagl_transport_end(t);
 }
 
@@ -282,7 +282,7 @@ void yagl_host_glColorPointerData(GLint size, GLenum type, GLsizei stride, GLint
 /*
  * glColorPointerOffset wrapper. id = 19
  */
-void yagl_host_glColorPointerOffset(GLint size, GLenum type, GLsizei stride, GLsizei offset)
+void yagl_host_glColorPointerOffset(GLint size, GLenum type, GLsizei stride, uintptr_t offset)
 {
     struct yagl_transport *t = yagl_get_transport();
 
@@ -290,7 +290,7 @@ void yagl_host_glColorPointerOffset(GLint size, GLenum type, GLsizei stride, GLs
     yagl_transport_put_out_GLint(t, size);
     yagl_transport_put_out_GLenum(t, type);
     yagl_transport_put_out_GLsizei(t, stride);
-    yagl_transport_put_out_GLsizei(t, offset);
+    yagl_transport_put_out_uintptr_t(t, offset);
     yagl_transport_end(t);
 }
 
@@ -314,7 +314,7 @@ void yagl_host_glTexCoordPointerData(GLint tex_id, GLint size, GLenum type, GLsi
 /*
  * glTexCoordPointerOffset wrapper. id = 21
  */
-void yagl_host_glTexCoordPointerOffset(GLint size, GLenum type, GLsizei stride, GLsizei offset)
+void yagl_host_glTexCoordPointerOffset(GLint size, GLenum type, GLsizei stride, uintptr_t offset)
 {
     struct yagl_transport *t = yagl_get_transport();
 
@@ -322,7 +322,7 @@ void yagl_host_glTexCoordPointerOffset(GLint size, GLenum type, GLsizei stride,
     yagl_transport_put_out_GLint(t, size);
     yagl_transport_put_out_GLenum(t, type);
     yagl_transport_put_out_GLsizei(t, stride);
-    yagl_transport_put_out_GLsizei(t, offset);
+    yagl_transport_put_out_uintptr_t(t, offset);
     yagl_transport_end(t);
 }
 
@@ -383,7 +383,7 @@ void yagl_host_glVertexAttribIPointerData(GLuint index, GLint size, GLenum type,
 /*
  * glVertexAttribIPointerOffset wrapper. id = 26
  */
-void yagl_host_glVertexAttribIPointerOffset(GLuint index, GLint size, GLenum type, GLsizei stride, GLsizei offset)
+void yagl_host_glVertexAttribIPointerOffset(GLuint index, GLint size, GLenum type, GLsizei stride, uintptr_t offset)
 {
     struct yagl_transport *t = yagl_get_transport();
 
@@ -392,7 +392,7 @@ void yagl_host_glVertexAttribIPointerOffset(GLuint index, GLint size, GLenum typ
     yagl_transport_put_out_GLint(t, size);
     yagl_transport_put_out_GLenum(t, type);
     yagl_transport_put_out_GLsizei(t, stride);
-    yagl_transport_put_out_GLsizei(t, offset);
+    yagl_transport_put_out_uintptr_t(t, offset);
     yagl_transport_end(t);
 }
 
@@ -496,15 +496,15 @@ void yagl_host_glMapBuffer(GLuint buffer, const GLuint *ranges, int32_t ranges_c
 /*
  * glCopyBufferSubData wrapper. id = 34
  */
-void yagl_host_glCopyBufferSubData(GLenum readTarget, GLenum writeTarget, GLint readOffset, GLint writeOffset, GLsizei size)
+void yagl_host_glCopyBufferSubData(GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizei size)
 {
     struct yagl_transport *t = yagl_get_transport();
 
     yagl_transport_begin(t, yagl_api_id_gles, 34, 5 * 8, 5 * 8);
     yagl_transport_put_out_GLenum(t, readTarget);
     yagl_transport_put_out_GLenum(t, writeTarget);
-    yagl_transport_put_out_GLint(t, readOffset);
-    yagl_transport_put_out_GLint(t, writeOffset);
+    yagl_transport_put_out_GLintptr(t, readOffset);
+    yagl_transport_put_out_GLintptr(t, writeOffset);
     yagl_transport_put_out_GLsizei(t, size);
     yagl_transport_end(t);
 }
@@ -635,7 +635,7 @@ void yagl_host_glTexImage2DData(GLenum target, GLint level, GLint internalformat
 /*
  * glTexImage2DOffset wrapper. id = 43
  */
-void yagl_host_glTexImage2DOffset(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, GLsizei pixels)
+void yagl_host_glTexImage2DOffset(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, uintptr_t pixels)
 {
     struct yagl_transport *t = yagl_get_transport();
 
@@ -648,7 +648,7 @@ void yagl_host_glTexImage2DOffset(GLenum target, GLint level, GLint internalform
     yagl_transport_put_out_GLint(t, border);
     yagl_transport_put_out_GLenum(t, format);
     yagl_transport_put_out_GLenum(t, type);
-    yagl_transport_put_out_GLsizei(t, pixels);
+    yagl_transport_put_out_uintptr_t(t, pixels);
     yagl_transport_end(t);
 }
 
@@ -731,7 +731,7 @@ void yagl_host_glTexSubImage2DData(GLenum target, GLint level, GLint xoffset, GL
 /*
  * glTexSubImage2DOffset wrapper. id = 49
  */
-void yagl_host_glTexSubImage2DOffset(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei pixels)
+void yagl_host_glTexSubImage2DOffset(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, uintptr_t pixels)
 {
     struct yagl_transport *t = yagl_get_transport();
 
@@ -744,7 +744,7 @@ void yagl_host_glTexSubImage2DOffset(GLenum target, GLint level, GLint xoffset,
     yagl_transport_put_out_GLsizei(t, height);
     yagl_transport_put_out_GLenum(t, format);
     yagl_transport_put_out_GLenum(t, type);
-    yagl_transport_put_out_GLsizei(t, pixels);
+    yagl_transport_put_out_uintptr_t(t, pixels);
     yagl_transport_end(t);
 }
 
@@ -884,7 +884,7 @@ void yagl_host_glTexImage3DData(GLenum target, GLint level, GLint internalformat
 /*
  * glTexImage3DOffset wrapper. id = 59
  */
-void yagl_host_glTexImage3DOffset(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, GLsizei pixels)
+void yagl_host_glTexImage3DOffset(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, uintptr_t pixels)
 {
     struct yagl_transport *t = yagl_get_transport();
 
@@ -898,7 +898,7 @@ void yagl_host_glTexImage3DOffset(GLenum target, GLint level, GLint internalform
     yagl_transport_put_out_GLint(t, border);
     yagl_transport_put_out_GLenum(t, format);
     yagl_transport_put_out_GLenum(t, type);
-    yagl_transport_put_out_GLsizei(t, pixels);
+    yagl_transport_put_out_uintptr_t(t, pixels);
     yagl_transport_end(t);
 }
 
@@ -927,7 +927,7 @@ void yagl_host_glTexSubImage3DData(GLenum target, GLint level, GLint xoffset, GL
 /*
  * glTexSubImage3DOffset wrapper. id = 61
  */
-void yagl_host_glTexSubImage3DOffset(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLsizei pixels)
+void yagl_host_glTexSubImage3DOffset(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, uintptr_t pixels)
 {
     struct yagl_transport *t = yagl_get_transport();
 
@@ -942,7 +942,7 @@ void yagl_host_glTexSubImage3DOffset(GLenum target, GLint level, GLint xoffset,
     yagl_transport_put_out_GLsizei(t, depth);
     yagl_transport_put_out_GLenum(t, format);
     yagl_transport_put_out_GLenum(t, type);
-    yagl_transport_put_out_GLsizei(t, pixels);
+    yagl_transport_put_out_uintptr_t(t, pixels);
     yagl_transport_end(t);
 }
 
index 7d8ff0050d69e79776e9e8a24eb9fde870161e59..af9a34fe190f48e6684c2fdce0b4826927d608c2 100644 (file)
@@ -25,7 +25,7 @@ void yagl_host_glReadPixelsData(GLint x, GLint y, GLsizei width, GLsizei height,
 /*
  * glReadPixelsOffset wrapper. id = 4
  */
-void yagl_host_glReadPixelsOffset(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei pixels);
+void yagl_host_glReadPixelsOffset(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, uintptr_t pixels);
 
 /*
  * glDrawArraysInstanced wrapper. id = 5
@@ -70,7 +70,7 @@ void yagl_host_glVertexAttribPointerData(GLuint indx, GLint size, GLenum type, G
 /*
  * glVertexAttribPointerOffset wrapper. id = 13
  */
-void yagl_host_glVertexAttribPointerOffset(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLsizei offset);
+void yagl_host_glVertexAttribPointerOffset(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, uintptr_t offset);
 
 /*
  * glVertexPointerData wrapper. id = 14
@@ -80,7 +80,7 @@ void yagl_host_glVertexPointerData(GLint size, GLenum type, GLsizei stride, GLin
 /*
  * glVertexPointerOffset wrapper. id = 15
  */
-void yagl_host_glVertexPointerOffset(GLint size, GLenum type, GLsizei stride, GLsizei offset);
+void yagl_host_glVertexPointerOffset(GLint size, GLenum type, GLsizei stride, uintptr_t offset);
 
 /*
  * glNormalPointerData wrapper. id = 16
@@ -90,7 +90,7 @@ void yagl_host_glNormalPointerData(GLenum type, GLsizei stride, GLint first, con
 /*
  * glNormalPointerOffset wrapper. id = 17
  */
-void yagl_host_glNormalPointerOffset(GLenum type, GLsizei stride, GLsizei offset);
+void yagl_host_glNormalPointerOffset(GLenum type, GLsizei stride, uintptr_t offset);
 
 /*
  * glColorPointerData wrapper. id = 18
@@ -100,7 +100,7 @@ void yagl_host_glColorPointerData(GLint size, GLenum type, GLsizei stride, GLint
 /*
  * glColorPointerOffset wrapper. id = 19
  */
-void yagl_host_glColorPointerOffset(GLint size, GLenum type, GLsizei stride, GLsizei offset);
+void yagl_host_glColorPointerOffset(GLint size, GLenum type, GLsizei stride, uintptr_t offset);
 
 /*
  * glTexCoordPointerData wrapper. id = 20
@@ -110,7 +110,7 @@ void yagl_host_glTexCoordPointerData(GLint tex_id, GLint size, GLenum type, GLsi
 /*
  * glTexCoordPointerOffset wrapper. id = 21
  */
-void yagl_host_glTexCoordPointerOffset(GLint size, GLenum type, GLsizei stride, GLsizei offset);
+void yagl_host_glTexCoordPointerOffset(GLint size, GLenum type, GLsizei stride, uintptr_t offset);
 
 /*
  * glDisableClientState wrapper. id = 22
@@ -135,7 +135,7 @@ void yagl_host_glVertexAttribIPointerData(GLuint index, GLint size, GLenum type,
 /*
  * glVertexAttribIPointerOffset wrapper. id = 26
  */
-void yagl_host_glVertexAttribIPointerOffset(GLuint index, GLint size, GLenum type, GLsizei stride, GLsizei offset);
+void yagl_host_glVertexAttribIPointerOffset(GLuint index, GLint size, GLenum type, GLsizei stride, uintptr_t offset);
 
 /*
  * glGenBuffers wrapper. id = 27
@@ -175,7 +175,7 @@ void yagl_host_glMapBuffer(GLuint buffer, const GLuint *ranges, int32_t ranges_c
 /*
  * glCopyBufferSubData wrapper. id = 34
  */
-void yagl_host_glCopyBufferSubData(GLenum readTarget, GLenum writeTarget, GLint readOffset, GLint writeOffset, GLsizei size);
+void yagl_host_glCopyBufferSubData(GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizei size);
 
 /*
  * glGenTextures wrapper. id = 35
@@ -220,7 +220,7 @@ void yagl_host_glTexImage2DData(GLenum target, GLint level, GLint internalformat
 /*
  * glTexImage2DOffset wrapper. id = 43
  */
-void yagl_host_glTexImage2DOffset(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, GLsizei pixels);
+void yagl_host_glTexImage2DOffset(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, uintptr_t pixels);
 
 /*
  * glTexParameterf wrapper. id = 44
@@ -250,7 +250,7 @@ void yagl_host_glTexSubImage2DData(GLenum target, GLint level, GLint xoffset, GL
 /*
  * glTexSubImage2DOffset wrapper. id = 49
  */
-void yagl_host_glTexSubImage2DOffset(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei pixels);
+void yagl_host_glTexSubImage2DOffset(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, uintptr_t pixels);
 
 /*
  * glClientActiveTexture wrapper. id = 50
@@ -300,7 +300,7 @@ void yagl_host_glTexImage3DData(GLenum target, GLint level, GLint internalformat
 /*
  * glTexImage3DOffset wrapper. id = 59
  */
-void yagl_host_glTexImage3DOffset(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, GLsizei pixels);
+void yagl_host_glTexImage3DOffset(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, uintptr_t pixels);
 
 /*
  * glTexSubImage3DData wrapper. id = 60
@@ -310,7 +310,7 @@ void yagl_host_glTexSubImage3DData(GLenum target, GLint level, GLint xoffset, GL
 /*
  * glTexSubImage3DOffset wrapper. id = 61
  */
-void yagl_host_glTexSubImage3DOffset(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLsizei pixels);
+void yagl_host_glTexSubImage3DOffset(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, uintptr_t pixels);
 
 /*
  * glCopyTexSubImage3D wrapper. id = 62
index c1ef2083ce5833c1863428b1382d3ea46d34cc10..0b36df993a8bf903d7303c629ddd2a7b4031dd74 100644 (file)
@@ -54,6 +54,12 @@ static __inline void yagl_transport_put_out_GLint(struct yagl_transport *t,
     yagl_transport_put_out_uint32_t(t, value);
 }
 
+static __inline void yagl_transport_put_out_GLintptr(struct yagl_transport *t,
+                                                     GLintptr value)
+{
+    yagl_transport_put_out_uintptr_t(t, value);
+}
+
 static __inline void yagl_transport_put_out_GLbitfield(struct yagl_transport *t,
                                                        GLbitfield value)
 {
index 59c0381333a918f9402fc93f6270f0a910ef93c4..029196d3549b7665d9fa5f66833d9fac17a3fb56 100644 (file)
@@ -1012,7 +1012,7 @@ YAGL_API void glNormalPointer(GLenum type, GLsizei stride, const GLvoid* pointer
                                         GL_FALSE,
                                         stride,
                                         ctx->base.vbo,
-                                        (GLint)pointer,
+                                        (GLintptr)pointer,
                                         0)) {
             YAGL_SET_ERR(GL_INVALID_ENUM);
         }
@@ -1075,7 +1075,7 @@ YAGL_API void glVertexPointer(GLint size, GLenum type, GLsizei stride, const GLv
                                         GL_FALSE,
                                         stride,
                                         ctx->base.vbo,
-                                        (GLint)pointer,
+                                        (GLintptr)pointer,
                                         0)) {
             YAGL_SET_ERR(GL_INVALID_ENUM);
         }
@@ -1137,7 +1137,7 @@ YAGL_API void glColorPointer(GLint size, GLenum type, GLsizei stride, const GLvo
                                         GL_FALSE,
                                         stride,
                                         ctx->base.vbo,
-                                        (GLint)pointer,
+                                        (GLintptr)pointer,
                                         0)) {
             YAGL_SET_ERR(GL_INVALID_ENUM);
         }
@@ -1200,7 +1200,7 @@ YAGL_API void glTexCoordPointer(GLint size, GLenum type, GLsizei stride, const G
                                         GL_FALSE,
                                         stride,
                                         ctx->base.vbo,
-                                        (GLint)pointer,
+                                        (GLintptr)pointer,
                                         0)) {
             YAGL_SET_ERR(GL_INVALID_ENUM);
         }
@@ -1262,7 +1262,7 @@ YAGL_API void glPointSizePointerOES(GLenum type, GLsizei stride, const GLvoid* p
                                         GL_FALSE,
                                         stride,
                                         ctx->base.vbo,
-                                        (GLint)pointer,
+                                        (GLintptr)pointer,
                                         0)) {
             YAGL_SET_ERR(GL_INVALID_ENUM);
         }
index 6d4bb24613a9d2878539f926bf85af9891025606..661603b868861c21b983538bdde4dcc319757b5a 100644 (file)
@@ -2303,7 +2303,7 @@ YAGL_API void glVertexAttribPointer(GLuint indx, GLint size, GLenum type, GLbool
                                         normalized,
                                         stride,
                                         ctx->base.vbo,
-                                        (GLint)ptr,
+                                        (GLintptr)ptr,
                                         0)) {
             YAGL_SET_ERR(GL_INVALID_ENUM);
         }
@@ -2503,7 +2503,7 @@ YAGL_API void glTexImage3D(GLenum target, GLint level, GLint internalformat, GLs
                                      border,
                                      pf->dst_format,
                                      pf->dst_type,
-                                     (GLsizei)pixels);
+                                     (uintptr_t)pixels);
     } else {
         yagl_host_glTexImage3DData(target,
                                    level,
@@ -2601,7 +2601,7 @@ YAGL_API void glTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint y
                                         depth,
                                         pf->dst_format,
                                         pf->dst_type,
-                                        (GLsizei)pixels);
+                                        (uintptr_t)pixels);
     } else {
         yagl_host_glTexSubImage3DData(target,
                                       level,
index 86a8521750893591dbd0ac27cdcb8fb61bf56e8d..b0d9e1fbf3b9c6698e56e6e97a5c209ced28addb 100644 (file)
@@ -1481,7 +1481,7 @@ YAGL_API GLsync glFenceSync(GLenum condition, GLbitfield flags)
     }
 
     yagl_sharegroup_add(ctx->base.sg, YAGL_NS_SYNC, &sync->base);
-    res = (GLsync)sync->base.local_name;
+    res = (GLsync)INT2VOIDP(sync->base.local_name);
 
     yagl_transport_flush(yagl_get_transport(), sync->egl_fence);
 
@@ -1503,7 +1503,7 @@ YAGL_API GLboolean glIsSync(GLsync sync)
     YAGL_GET_CTX_RET(GL_FALSE);
 
     sync_obj = (struct yagl_gles3_sync*)yagl_sharegroup_acquire_object(ctx->base.sg,
-        YAGL_NS_SYNC, (yagl_object_name)sync);
+        YAGL_NS_SYNC, (yagl_object_name)VOIDP2INT(sync));
 
     res = (sync_obj != NULL);
 
@@ -1527,7 +1527,7 @@ YAGL_API void glDeleteSync(GLsync sync)
     }
 
     sync_obj = (struct yagl_gles3_sync*)yagl_sharegroup_acquire_object(ctx->base.sg,
-        YAGL_NS_SYNC, (yagl_object_name)sync);
+        YAGL_NS_SYNC, (yagl_object_name)VOIDP2INT(sync));
 
     if (!sync_obj) {
         YAGL_SET_ERR(GL_INVALID_VALUE);
@@ -1536,7 +1536,7 @@ YAGL_API void glDeleteSync(GLsync sync)
 
     yagl_sharegroup_remove(ctx->base.sg,
                            YAGL_NS_SYNC,
-                           (yagl_object_name)sync);
+                           (yagl_object_name)VOIDP2INT(sync));
 
 out:
     yagl_gles3_sync_release(sync_obj);
@@ -1559,7 +1559,7 @@ YAGL_API GLenum glClientWaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout
     }
 
     sync_obj = (struct yagl_gles3_sync*)yagl_sharegroup_acquire_object(ctx->base.sg,
-        YAGL_NS_SYNC, (yagl_object_name)sync);
+        YAGL_NS_SYNC, (yagl_object_name)VOIDP2INT(sync));
 
     if (!sync_obj) {
         YAGL_SET_ERR(GL_INVALID_VALUE);
@@ -1606,7 +1606,7 @@ YAGL_API void glWaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout)
     }
 
     sync_obj = (struct yagl_gles3_sync*)yagl_sharegroup_acquire_object(ctx->base.sg,
-        YAGL_NS_SYNC, (yagl_object_name)sync);
+        YAGL_NS_SYNC, (yagl_object_name)VOIDP2INT(sync));
 
     if (!sync_obj) {
         YAGL_SET_ERR(GL_INVALID_VALUE);
@@ -1632,7 +1632,7 @@ YAGL_API void glGetSynciv(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *l
     YAGL_GET_CTX();
 
     sync_obj = (struct yagl_gles3_sync*)yagl_sharegroup_acquire_object(ctx->base.sg,
-        YAGL_NS_SYNC, (yagl_object_name)sync);
+        YAGL_NS_SYNC, (yagl_object_name)VOIDP2INT(sync));
 
     if (!sync_obj) {
         YAGL_SET_ERR(GL_INVALID_VALUE);
@@ -1855,7 +1855,7 @@ YAGL_API void glVertexAttribIPointer(GLuint index, GLint size, GLenum type, GLsi
                                         GL_FALSE,
                                         stride,
                                         ctx->base.base.vbo,
-                                        (GLint)pointer,
+                                        (GLintptr)pointer,
                                         1)) {
             YAGL_SET_ERR(GL_INVALID_ENUM);
         }
@@ -2806,7 +2806,7 @@ YAGL_API void glDrawRangeElements(GLenum mode, GLuint start, GLuint end,
                                   GL_ELEMENT_ARRAY_BUFFER,
                                   0);
         yagl_gles3_context_draw_range_elements(ctx, mode, start, end, count,
-                                               type, NULL, (int32_t)indices);
+                                               type, NULL, (int32_t)VOIDP2INT(indices));
         yagl_host_glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
     } else {
         yagl_gles3_context_draw_range_elements(ctx, mode, start, end, count,
index 3b214fab8a124fb685e4b34dca6e365f103c853d..62d4d6d2cf29f1b3701de11a32c129609c63875a 100644 (file)
@@ -38,6 +38,7 @@
 #include "yagl_types.h"
 #include <string.h>
 #include <assert.h>
+#include <limits.h>
 
 #define YAGL_TRANSPORT_MAX_IN_ARGS 8
 #define YAGL_TRANSPORT_MAX_IN_ARRAYS 8
@@ -180,13 +181,32 @@ static __inline void yagl_transport_put_out_float(struct yagl_transport *t,
     t->ptr += 8;
 }
 
+static __inline void yagl_transport_put_out_uint64_t(struct yagl_transport *t,
+                                                     uint64_t ptr)
+{
+    *(uint64_t*)t->ptr = ptr;
+    t->ptr += 8;
+}
+
+static __inline void yagl_transport_put_out_uintptr_t(struct yagl_transport *t,
+                                                      uintptr_t ptr)
+{
+    uint64_t value = 0;
+    if (sizeof(uintptr_t) == 4) {
+        value = ptr & UINT_MAX;
+    } else {
+        value = ptr;
+    }
+    yagl_transport_put_out_uint64_t(t, value);
+}
+
 static __inline void yagl_transport_put_in_arg_helper(struct yagl_transport *t,
                                                       void *value,
                                                       uint32_t size)
 {
-    yagl_transport_put_out_uint32_t(t, (uint32_t)value);
+    yagl_transport_put_out_uintptr_t(t, (uintptr_t)value);
 
-    t->in_args[t->num_in_args].arg_ptr = value;
+    t->in_args[t->num_in_args].arg_ptr = (uint8_t*)value;
     t->in_args[t->num_in_args].buff_ptr = t->ptr;
     t->in_args[t->num_in_args].size = size;
 
@@ -236,7 +256,7 @@ static __inline void yagl_transport_put_out_array(struct yagl_transport *t,
                                                   int32_t count,
                                                   int32_t el_size)
 {
-    yagl_transport_put_out_uint32_t(t, (uint32_t)data);
+    yagl_transport_put_out_uintptr_t(t, (uintptr_t)data);
     yagl_transport_put_out_uint32_t(t, count);
 
     if (!data || (count <= 0)) {
@@ -262,11 +282,11 @@ static __inline void yagl_transport_put_in_array(struct yagl_transport *t,
 {
     int32_t *count;
 
-    yagl_transport_put_out_uint32_t(t, (uint32_t)data);
+    yagl_transport_put_out_uintptr_t(t, (uintptr_t)data);
     count = (int32_t*)t->ptr;
     yagl_transport_put_out_uint32_t(t, maxcount);
 
-    t->in_arrays[t->num_in_arrays].arg_ptr = data;
+    t->in_arrays[t->num_in_arrays].arg_ptr = (uint8_t*)data;
     t->in_arrays[t->num_in_arrays].buff_ptr = t->ptr;
     t->in_arrays[t->num_in_arrays].el_size = el_size;
     t->in_arrays[t->num_in_arrays].count = count;
@@ -346,7 +366,7 @@ static __inline void yagl_transport_put_out_yagl_winsys_id(struct yagl_transport
 static __inline void yagl_transport_put_out_va(struct yagl_transport *t,
                                                const void *value)
 {
-    yagl_transport_put_out_uint32_t(t, (uint32_t)value);
+    yagl_transport_put_out_uintptr_t(t, (uintptr_t)value);
 }
 
 static __inline void yagl_transport_put_in_yagl_host_handle(struct yagl_transport *t,
index fda3c3ad1b6174e600fc054605f89f23094bdc61..58cc4e61f23deb321386a366c639871bd872f28d 100644 (file)
@@ -36,6 +36,7 @@
 
 #include <stdint.h>
 #include <stddef.h>
+#include <inttypes.h>
 
 #if defined(__i386) || defined(_M_IX86)
 #define YAGL_LITTLE_ENDIAN
@@ -98,4 +99,12 @@ typedef uint32_t yagl_object_name;
 
 #define yagl_containerof(ptr, type, member) ((type*)((char*)(ptr) - yagl_offsetof(type, member)))
 
+#ifndef INT2VOIDP
+#define INT2VOIDP(i) ((void*)((uintptr_t)(i)))
+#endif
+#ifndef VOIDP2INT
+#define VOIDP2INT(p) ((uintptr_t)(p))
+#endif
+
+
 #endif
index a33a820d4e8dfad41818b2ea4ebd49cb7a94b794..a00973d89fe9281dd6db2ea10184560319a0dc2f 100644 (file)
@@ -3,17 +3,18 @@
 
 Name:       emulator-yagl
 Summary:    YaGL - OpenGLES acceleration module for emulator
-Version:    1.4
-Release:    4
-License:    MIT and LPGL-3.0
+Version:    1.5
+Release:    1
+License:    MIT and LGPL-3.0
+Group:      SDK/Libraries
 #URL:        http://www.khronos.org
 Source0:    %{name}-%{version}.tar.gz
 Source1001:     emulator-yagl.manifest
 BuildRequires:  cmake
-BuildRequires:  pkgconfig(libdrm)
-BuildRequires:  pkgconfig(libtbm)
 BuildRequires:  flex
 BuildRequires:  bison
+BuildRequires:  pkgconfig(libdrm)
+BuildRequires:  pkgconfig(libtbm)
 %if %{with wayland}
 BuildRequires:  pkgconfig(gbm)
 BuildRequires:  pkgconfig(libudev)
@@ -28,7 +29,6 @@ BuildRequires:  pkgconfig(xcb)
 BuildRequires:  pkgconfig(xext)
 BuildRequires:  pkgconfig(dri2proto)
 %endif
-Requires:   libtbm
 Provides:   opengl-es-drv
 
 %if %{with emulator}
@@ -45,10 +45,11 @@ This package contains shared libraries libEGL, libGLES_CM, libGLESv2.
 Summary:    YaGL - OpenGLES acceleration module for emulator (devel)
 Provides:   opengl-es-drv-devel
 Requires:   %{name} = %{version}-%{release}
-Requires: pkgconfig(x11)
+Requires:   pkgconfig(x11)
 
 %description devel
 YaGL - OpenGLES acceleration module for emulator (devel)
+This package contains header files for EGL, GLESv1_CM, GLESv2, GLESv3, KHR.
 
 %prep
 %setup -q