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>
{
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;
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;
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();
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;
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;
goto out;
}
- ret = (EGLDisplay)dpy->host_dpy;
+ ret = (EGLDisplay)INT2VOIDP(dpy->host_dpy);
YAGL_LOG_FUNC_EXIT_SPLIT(yagl_host_handle, dpy->host_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,
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,
}
/* 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);
}
surface = yagl_get_backend()->create_window_surface(dpy,
- (yagl_host_handle)config,
+ (yagl_host_handle)VOIDP2INT(config),
native_win,
attrib_list);
}
surface = yagl_get_backend()->create_pbuffer_surface(dpy,
- (yagl_host_handle)config,
+ (yagl_host_handle)VOIDP2INT(config),
attrib_list);
if (!surface) {
}
surface = yagl_get_backend()->create_pixmap_surface(dpy,
- (yagl_host_handle)config,
+ (yagl_host_handle)VOIDP2INT(config),
native_pixmap,
attrib_list);
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);
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);
YAGL_LOG_FUNC_EXIT("%u", host_context);
- return (EGLContext)host_context;
+ return (EGLContext)INT2VOIDP(host_context);
}
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;
}
* 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)) {
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));
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)
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_,
break;
default:
res = yagl_host_eglQueryContext(dpy->host_dpy,
- (yagl_host_handle)ctx_,
+ (yagl_host_handle)VOIDP2INT(ctx_),
attribute,
value,
&error);
image = yagl_get_backend()->create_image_gl_texture_2d(dpy,
ctx,
- (yagl_object_name)buffer,
+ (yagl_object_name)VOIDP2INT(buffer),
iface);
if (!image) {
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);
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);
{
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;
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;
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)) {
const GLvoid *ptr;
struct
{
- GLint offset;
- GLint actual_offset;
+ GLintptr offset;
+ GLintptr actual_offset;
};
};
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);
}
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)
}
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)) {
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) ||
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;
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);
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
width, height,
pf->dst_format,
pf->dst_type,
- (GLsizei)pixels);
+ (uintptr_t)pixels);
} else {
GLvoid *pixels_from;
border,
pf->dst_format,
pf->dst_type,
- (GLsizei)pixels);
+ (uintptr_t)pixels);
} else {
yagl_host_glTexImage2DData(target,
level,
height,
pf->dst_format,
pf->dst_type,
- (GLsizei)pixels);
+ (uintptr_t)pixels);
} else {
yagl_host_glTexSubImage2DData(target,
level,
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);
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)
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)
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)
void glGetTexParameterfv(GLenum target, GLenum pname, GLfloat ¶m)
void glGetTexParameteriv(GLenum target, GLenum pname, GLint ¶m)
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)
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)
if (ctx->vao->ebo) {
if (!yagl_gles_buffer_get_minmax_index(ctx->vao->ebo,
type,
- (GLint)indices,
+ (GLintptr)indices,
count,
&min_idx,
&max_idx)) {
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);
return 0;
}
- *pixels = ctx->unpack.pbo->map_pointer + (uint32_t)*pixels;
+ *pixels = ctx->unpack.pbo->map_pointer + (GLintptr)*pixels;
return 1;
}
return 0;
}
- *pixels = ctx->pack.pbo->map_pointer + (uint32_t)*pixels;
+ *pixels = ctx->pack.pbo->map_pointer + (GLintptr)*pixels;
return 1;
}
} else {
yagl_host_glBindBuffer(GL_PIXEL_PACK_BUFFER, 0);
yagl_gles_buffer_set_gpu_dirty(ctx->pack.pbo,
- (GLint)pixels,
+ (GLintptr)pixels,
size);
}
}
/*
* 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();
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);
}
/*
* 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();
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);
}
/*
* 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();
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);
}
/*
* 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);
}
/*
* 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();
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);
}
/*
* 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();
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);
}
/*
* 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();
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);
}
/*
* 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);
}
/*
* 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();
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);
}
/*
* 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();
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);
}
/*
* 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();
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);
}
/*
* 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();
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);
}
/*
* 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
/*
* 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
/*
* 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
/*
* 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
/*
* 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
/*
* 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
/*
* 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
/*
* 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
/*
* 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
/*
* 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
/*
* 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
/*
* 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
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)
{
GL_FALSE,
stride,
ctx->base.vbo,
- (GLint)pointer,
+ (GLintptr)pointer,
0)) {
YAGL_SET_ERR(GL_INVALID_ENUM);
}
GL_FALSE,
stride,
ctx->base.vbo,
- (GLint)pointer,
+ (GLintptr)pointer,
0)) {
YAGL_SET_ERR(GL_INVALID_ENUM);
}
GL_FALSE,
stride,
ctx->base.vbo,
- (GLint)pointer,
+ (GLintptr)pointer,
0)) {
YAGL_SET_ERR(GL_INVALID_ENUM);
}
GL_FALSE,
stride,
ctx->base.vbo,
- (GLint)pointer,
+ (GLintptr)pointer,
0)) {
YAGL_SET_ERR(GL_INVALID_ENUM);
}
GL_FALSE,
stride,
ctx->base.vbo,
- (GLint)pointer,
+ (GLintptr)pointer,
0)) {
YAGL_SET_ERR(GL_INVALID_ENUM);
}
normalized,
stride,
ctx->base.vbo,
- (GLint)ptr,
+ (GLintptr)ptr,
0)) {
YAGL_SET_ERR(GL_INVALID_ENUM);
}
border,
pf->dst_format,
pf->dst_type,
- (GLsizei)pixels);
+ (uintptr_t)pixels);
} else {
yagl_host_glTexImage3DData(target,
level,
depth,
pf->dst_format,
pf->dst_type,
- (GLsizei)pixels);
+ (uintptr_t)pixels);
} else {
yagl_host_glTexSubImage3DData(target,
level,
}
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);
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);
}
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);
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);
}
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);
}
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);
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);
GL_FALSE,
stride,
ctx->base.base.vbo,
- (GLint)pointer,
+ (GLintptr)pointer,
1)) {
YAGL_SET_ERR(GL_INVALID_ENUM);
}
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,
#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
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;
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)) {
{
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;
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,
#include <stdint.h>
#include <stddef.h>
+#include <inttypes.h>
#if defined(__i386) || defined(_M_IX86)
#define YAGL_LITTLE_ENDIAN
#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
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)
BuildRequires: pkgconfig(xext)
BuildRequires: pkgconfig(dri2proto)
%endif
-Requires: libtbm
Provides: opengl-es-drv
%if %{with emulator}
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