diff options
Diffstat (limited to 'opengl')
39 files changed, 1849 insertions, 1325 deletions
diff --git a/opengl/include/EGL/egl.h b/opengl/include/EGL/egl.h index c269976f4ad3..99ea342a4773 100644 --- a/opengl/include/EGL/egl.h +++ b/opengl/include/EGL/egl.h @@ -1,7 +1,7 @@ /* -*- mode: c; tab-width: 8; -*- */ /* vi: set sw=4 ts=8: */ /* Reference version of egl.h for EGL 1.4. - * $Revision: 7244 $ on $Date: 2009-01-20 17:06:59 -0800 (Tue, 20 Jan 2009) $ + * $Revision: 9356 $ on $Date: 2009-10-21 02:52:25 -0700 (Wed, 21 Oct 2009) $ */ /* @@ -109,7 +109,6 @@ typedef void *EGLClientBuffer; #define EGL_NATIVE_RENDERABLE 0x302D #define EGL_NATIVE_VISUAL_ID 0x302E #define EGL_NATIVE_VISUAL_TYPE 0x302F -#define EGL_PRESERVED_RESOURCES 0x3030 #define EGL_SAMPLES 0x3031 #define EGL_SAMPLE_BUFFERS 0x3032 #define EGL_SURFACE_TYPE 0x3033 diff --git a/opengl/include/EGL/eglext.h b/opengl/include/EGL/eglext.h index 545fd0e980bd..1ffcd563ff6e 100644 --- a/opengl/include/EGL/eglext.h +++ b/opengl/include/EGL/eglext.h @@ -6,7 +6,7 @@ extern "C" { #endif /* -** Copyright (c) 2007-2009 The Khronos Group Inc. +** Copyright (c) 2007-2010 The Khronos Group Inc. ** ** Permission is hereby granted, free of charge, to any person obtaining a ** copy of this software and/or associated documentation files (the @@ -34,8 +34,8 @@ extern "C" { /* Header file version number */ /* Current version at http://www.khronos.org/registry/egl/ */ -/* $Revision: 7244 $ on $Date: 2009-01-20 17:06:59 -0800 (Tue, 20 Jan 2009) $ */ -#define EGL_EGLEXT_VERSION 3 +/* $Revision: 11249 $ on $Date: 2010-05-05 09:54:28 -0700 (Wed, 05 May 2010) $ */ +#define EGL_EGLEXT_VERSION 5 #ifndef EGL_KHR_config_attribs #define EGL_KHR_config_attribs 1 @@ -120,6 +120,36 @@ typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYIMAGEKHRPROC) (EGLDisplay dpy, EGL #define EGL_GL_RENDERBUFFER_KHR 0x30B9 /* eglCreateImageKHR target */ #endif +#ifndef EGL_KHR_reusable_sync +#define EGL_KHR_reusable_sync 1 + +typedef void* EGLSyncKHR; +typedef khronos_utime_nanoseconds_t EGLTimeKHR; + +#define EGL_SYNC_STATUS_KHR 0x30F1 +#define EGL_SIGNALED_KHR 0x30F2 +#define EGL_UNSIGNALED_KHR 0x30F3 +#define EGL_TIMEOUT_EXPIRED_KHR 0x30F5 +#define EGL_CONDITION_SATISFIED_KHR 0x30F6 +#define EGL_SYNC_TYPE_KHR 0x30F7 +#define EGL_SYNC_REUSABLE_KHR 0x30FA +#define EGL_SYNC_FLUSH_COMMANDS_BIT_KHR 0x0001 /* eglClientWaitSyncKHR <flags> bitfield */ +#define EGL_FOREVER_KHR 0xFFFFFFFFFFFFFFFFull +#define EGL_NO_SYNC_KHR ((EGLSyncKHR)0) +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLSyncKHR EGLAPIENTRY eglCreateSyncKHR(EGLDisplay dpy, EGLenum type, const EGLint *attrib_list); +EGLAPI EGLBoolean EGLAPIENTRY eglDestroySyncKHR(EGLDisplay dpy, EGLSyncKHR sync); +EGLAPI EGLint EGLAPIENTRY eglClientWaitSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout); +EGLAPI EGLBoolean EGLAPIENTRY eglSignalSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode); +EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncAttribKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value); +#endif /* EGL_EGLEXT_PROTOTYPES */ +typedef EGLSyncKHR (EGLAPIENTRYP PFNEGLCREATESYNCKHRPROC) (EGLDisplay dpy, EGLenum type, const EGLint *attrib_list); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync); +typedef EGLint (EGLAPIENTRYP PFNEGLCLIENTWAITSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLSIGNALSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value); +#endif + #ifndef EGL_KHR_image_base #define EGL_KHR_image_base 1 /* Most interfaces defined by EGL_KHR_image_pixmap above */ @@ -131,6 +161,67 @@ typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYIMAGEKHRPROC) (EGLDisplay dpy, EGL /* Interfaces defined by EGL_KHR_image above */ #endif +#ifndef EGL_IMG_context_priority +#define EGL_IMG_context_priority 1 +#define EGL_CONTEXT_PRIORITY_LEVEL_IMG 0x3100 +#define EGL_CONTEXT_PRIORITY_HIGH_IMG 0x3101 +#define EGL_CONTEXT_PRIORITY_MEDIUM_IMG 0x3102 +#define EGL_CONTEXT_PRIORITY_LOW_IMG 0x3103 +#endif + +#ifndef EGL_NV_coverage_sample +#define EGL_NV_coverage_sample 1 +#define EGL_COVERAGE_BUFFERS_NV 0x30E0 +#define EGL_COVERAGE_SAMPLES_NV 0x30E1 +#endif + +#ifndef EGL_NV_depth_nonlinear +#define EGL_NV_depth_nonlinear 1 +#define EGL_DEPTH_ENCODING_NV 0x30E2 +#define EGL_DEPTH_ENCODING_NONE_NV 0 +#define EGL_DEPTH_ENCODING_NONLINEAR_NV 0x30E3 +#endif + +#ifndef EGL_NV_sync +#define EGL_NV_sync 1 +#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE_NV 0x30E6 +#define EGL_SYNC_STATUS_NV 0x30E7 +#define EGL_SIGNALED_NV 0x30E8 +#define EGL_UNSIGNALED_NV 0x30E9 +#define EGL_SYNC_FLUSH_COMMANDS_BIT_NV 0x0001 +#define EGL_FOREVER_NV 0xFFFFFFFFFFFFFFFFull +#define EGL_ALREADY_SIGNALED_NV 0x30EA +#define EGL_TIMEOUT_EXPIRED_NV 0x30EB +#define EGL_CONDITION_SATISFIED_NV 0x30EC +#define EGL_SYNC_TYPE_NV 0x30ED +#define EGL_SYNC_CONDITION_NV 0x30EE +#define EGL_SYNC_FENCE_NV 0x30EF +#define EGL_NO_SYNC_NV ((EGLSyncNV)0) +typedef void* EGLSyncNV; +typedef unsigned long long EGLTimeNV; +#ifdef EGL_EGLEXT_PROTOTYPES +EGLSyncNV eglCreateFenceSyncNV (EGLDisplay dpy, EGLenum condition, const EGLint *attrib_list); +EGLBoolean eglDestroySyncNV (EGLSyncNV sync); +EGLBoolean eglFenceNV (EGLSyncNV sync); +EGLint eglClientWaitSyncNV (EGLSyncNV sync, EGLint flags, EGLTimeNV timeout); +EGLBoolean eglSignalSyncNV (EGLSyncNV sync, EGLenum mode); +EGLBoolean eglGetSyncAttribNV (EGLSyncNV sync, EGLint attribute, EGLint *value); +#endif /* EGL_EGLEXT_PROTOTYPES */ +typedef EGLSyncNV (EGLAPIENTRYP PFNEGLCREATEFENCESYNCNVPROC) (EGLDisplay dpy, EGLenum condition, const EGLint *attrib_list); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSYNCNVPROC) (EGLSyncNV sync); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLFENCENVPROC) (EGLSyncNV sync); +typedef EGLint (EGLAPIENTRYP PFNEGLCLIENTWAITSYNCNVPROC) (EGLSyncNV sync, EGLint flags, EGLTimeNV timeout); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLSIGNALSYNCNVPROC) (EGLSyncNV sync, EGLenum mode); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBNVPROC) (EGLSyncNV sync, EGLint attribute, EGLint *value); +#endif + +#ifndef EGL_KHR_fence_sync +#define EGL_KHR_fence_sync 1 +/* Reuses most tokens and entry points from EGL_KHR_reusable_sync */ +#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE_KHR 0x30F0 +#define EGL_SYNC_CONDITION_KHR 0x30F8 +#define EGL_SYNC_FENCE_KHR 0x30F9 +#endif #ifndef EGL_ANDROID_image_native_buffer #define EGL_ANDROID_image_native_buffer 1 @@ -138,14 +229,6 @@ struct android_native_buffer_t; #define EGL_NATIVE_BUFFER_ANDROID 0x3140 /* eglCreateImageKHR target */ #endif -#ifndef EGL_ANDROID_get_render_buffer -#define EGL_ANDROID_get_render_buffer 1 -#ifdef EGL_EGLEXT_PROTOTYPES -EGLAPI EGLClientBuffer EGLAPIENTRY eglGetRenderBufferANDROID(EGLDisplay dpy, EGLSurface draw); -#endif -typedef EGLClientBuffer (EGLAPIENTRYP PFNEGLGETRENDERBUFFERANDROIDPROC) (EGLDisplay dpy, EGLSurface draw); -#endif - #ifndef EGL_ANDROID_swap_rectangle #define EGL_ANDROID_swap_rectangle 1 #ifdef EGL_EGLEXT_PROTOTYPES @@ -154,7 +237,6 @@ EGLAPI EGLBoolean EGLAPIENTRY eglSetSwapRectangleANDROID (EGLDisplay dpy, EGLSur typedef EGLBoolean (EGLAPIENTRYP PFNEGLSETSWAPRECTANGLEANDROIDPROC) (EGLDisplay dpy, EGLSurface draw, EGLint left, EGLint top, EGLint width, EGLint height); #endif - #ifdef __cplusplus } #endif diff --git a/opengl/include/EGL/eglplatform.h b/opengl/include/EGL/eglplatform.h index 53e9e61169b1..25d7697ee3be 100644 --- a/opengl/include/EGL/eglplatform.h +++ b/opengl/include/EGL/eglplatform.h @@ -25,7 +25,7 @@ */ /* Platform-specific types and definitions for egl.h - * $Revision: 7244 $ on $Date: 2009-01-20 17:06:59 -0800 (Tue, 20 Jan 2009) $ + * $Revision: 9724 $ on $Date: 2009-12-02 02:05:33 -0800 (Wed, 02 Dec 2009) $ * * Adopters may modify khrplatform.h and this file to suit their platform. * You are encouraged to submit all modifications to the Khronos group so that @@ -50,8 +50,10 @@ #define EGLAPI KHRONOS_APICALL #endif +#ifndef EGLAPIENTRY #define EGLAPIENTRY KHRONOS_APIENTRY -#define EGLAPIENTRYP KHRONOS_APIENTRY* +#endif +#define EGLAPIENTRYP EGLAPIENTRY* /* The types NativeDisplayType, NativeWindowType, and NativePixmapType * are aliases of window-system-dependent types, such as X Display * or @@ -89,10 +91,11 @@ typedef Window EGLNativeWindowType; #elif defined(ANDROID) -struct android_native_window_t; +#include <android/native_window.h> + struct egl_native_pixmap_t; -typedef struct android_native_window_t* EGLNativeWindowType; +typedef struct ANativeWindow* EGLNativeWindowType; typedef struct egl_native_pixmap_t* EGLNativePixmapType; typedef void* EGLNativeDisplayType; diff --git a/opengl/include/GLES/gl.h b/opengl/include/GLES/gl.h index 2e8b97107ac9..5b8d85a92097 100644 --- a/opengl/include/GLES/gl.h +++ b/opengl/include/GLES/gl.h @@ -1,7 +1,7 @@ #ifndef __gl_h_ #define __gl_h_ -/* $Revision: 7172 $ on $Date:: 2009-01-09 11:17:41 -0800 #$ */ +/* $Revision: 10601 $ on $Date:: 2010-03-04 22:15:27 -0800 #$ */ #include <GLES/glplatform.h> @@ -15,6 +15,7 @@ extern "C" { */ typedef void GLvoid; +typedef char GLchar; typedef unsigned int GLenum; typedef unsigned char GLboolean; typedef unsigned int GLbitfield; @@ -678,7 +679,7 @@ GL_API void GL_APIENTRY glGetFixedv (GLenum pname, GLfixed *params); GL_API void GL_APIENTRY glGetIntegerv (GLenum pname, GLint *params); GL_API void GL_APIENTRY glGetLightxv (GLenum light, GLenum pname, GLfixed *params); GL_API void GL_APIENTRY glGetMaterialxv (GLenum face, GLenum pname, GLfixed *params); -GL_API void GL_APIENTRY glGetPointerv (GLenum pname, void **params); +GL_API void GL_APIENTRY glGetPointerv (GLenum pname, GLvoid **params); GL_API const GLubyte * GL_APIENTRY glGetString (GLenum name); GL_API void GL_APIENTRY glGetTexEnviv (GLenum env, GLenum pname, GLint *params); GL_API void GL_APIENTRY glGetTexEnvxv (GLenum env, GLenum pname, GLfixed *params); diff --git a/opengl/include/GLES/glext.h b/opengl/include/GLES/glext.h index a8fe2e9d56f8..a5b3eada3f8f 100644 --- a/opengl/include/GLES/glext.h +++ b/opengl/include/GLES/glext.h @@ -1,7 +1,7 @@ #ifndef __glext_h_ #define __glext_h_ -/* $Revision: 7172 $ on $Date:: 2009-01-09 11:17:41 -0800 #$ */ +/* $Revision: 10965 $ on $Date:: 2010-04-09 02:11:29 -0700 #$ */ #ifdef __cplusplus extern "C" { @@ -68,6 +68,11 @@ extern "C" { typedef void* GLeglImageOES; #endif +/* GL_OES_element_index_uint */ +#ifndef GL_OES_element_index_uint +#define GL_UNSIGNED_INT 0x1405 +#endif + /* GL_OES_fixed_point */ #ifndef GL_OES_fixed_point #define GL_FIXED_OES 0x140C @@ -201,6 +206,16 @@ typedef void* GLeglImageOES; #define GL_MIRRORED_REPEAT_OES 0x8370 #endif +/* GL_OES_vertex_array_object */ +#ifndef GL_OES_vertex_array_object +#define GL_VERTEX_ARRAY_BINDING_OES 0x85B5 +#endif + +/* GL_OES_texture_external */ +#ifndef GL_TEXTURE_EXTERNAL_OES +#define GL_TEXTURE_EXTERNAL_OES 0x8D65 +#endif + /*------------------------------------------------------------------------* * AMD extension tokens *------------------------------------------------------------------------*/ @@ -219,15 +234,191 @@ typedef void* GLeglImageOES; #endif /*------------------------------------------------------------------------* + * APPLE extension tokens + *------------------------------------------------------------------------*/ + +/* GL_APPLE_texture_2D_limited_npot */ +/* No new tokens introduced by this extension. */ + +/*------------------------------------------------------------------------* * EXT extension tokens *------------------------------------------------------------------------*/ +/* GL_EXT_blend_minmax */ +#ifndef GL_EXT_blend_minmax +#define GL_MIN_EXT 0x8007 +#define GL_MAX_EXT 0x8008 +#endif + +/* GL_EXT_discard_framebuffer */ +#ifndef GL_EXT_discard_framebuffer +#define GL_COLOR_EXT 0x1800 +#define GL_DEPTH_EXT 0x1801 +#define GL_STENCIL_EXT 0x1802 +#endif + +/* GL_EXT_multi_draw_arrays */ +/* No new tokens introduced by this extension. */ + +/* GL_EXT_read_format_bgra */ +#ifndef GL_EXT_read_format_bgra +#define GL_BGRA_EXT 0x80E1 +#define GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT 0x8365 +#define GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT 0x8366 +#endif + /* GL_EXT_texture_filter_anisotropic */ #ifndef GL_EXT_texture_filter_anisotropic #define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE #define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF #endif +/* GL_EXT_texture_format_BGRA8888 */ +#ifndef GL_EXT_texture_format_BGRA8888 +#define GL_BGRA_EXT 0x80E1 +#endif + +/* GL_EXT_texture_lod_bias */ +#ifndef GL_EXT_texture_lod_bias +#define GL_MAX_TEXTURE_LOD_BIAS_EXT 0x84FD +#define GL_TEXTURE_FILTER_CONTROL_EXT 0x8500 +#define GL_TEXTURE_LOD_BIAS_EXT 0x8501 +#endif + +/*------------------------------------------------------------------------* + * IMG extension tokens + *------------------------------------------------------------------------*/ + +/* GL_IMG_read_format */ +#ifndef GL_IMG_read_format +#define GL_BGRA_IMG 0x80E1 +#define GL_UNSIGNED_SHORT_4_4_4_4_REV_IMG 0x8365 +#endif + +/* GL_IMG_texture_compression_pvrtc */ +#ifndef GL_IMG_texture_compression_pvrtc +#define GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG 0x8C00 +#define GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG 0x8C01 +#define GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG 0x8C02 +#define GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG 0x8C03 +#endif + +/* GL_IMG_texture_env_enhanced_fixed_function */ +#ifndef GL_IMG_texture_env_enhanced_fixed_function +#define GL_MODULATE_COLOR_IMG 0x8C04 +#define GL_RECIP_ADD_SIGNED_ALPHA_IMG 0x8C05 +#define GL_TEXTURE_ALPHA_MODULATE_IMG 0x8C06 +#define GL_FACTOR_ALPHA_MODULATE_IMG 0x8C07 +#define GL_FRAGMENT_ALPHA_MODULATE_IMG 0x8C08 +#define GL_ADD_BLEND_IMG 0x8C09 +#define GL_DOT3_RGBA_IMG 0x86AF +#endif + +/* GL_IMG_user_clip_plane */ +#ifndef GL_IMG_user_clip_plane +#define GL_CLIP_PLANE0_IMG 0x3000 +#define GL_CLIP_PLANE1_IMG 0x3001 +#define GL_CLIP_PLANE2_IMG 0x3002 +#define GL_CLIP_PLANE3_IMG 0x3003 +#define GL_CLIP_PLANE4_IMG 0x3004 +#define GL_CLIP_PLANE5_IMG 0x3005 +#define GL_MAX_CLIP_PLANES_IMG 0x0D32 +#endif + +/* GL_IMG_multisampled_render_to_texture */ +#ifndef GL_IMG_multisampled_render_to_texture +#define GL_RENDERBUFFER_SAMPLES_IMG 0x9133 +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_IMG 0x9134 +#define GL_MAX_SAMPLES_IMG 0x9135 +#define GL_TEXTURE_SAMPLES_IMG 0x9136 +#endif + +/*------------------------------------------------------------------------* + * NV extension tokens + *------------------------------------------------------------------------*/ + +/* GL_NV_fence */ +#ifndef GL_NV_fence +#define GL_ALL_COMPLETED_NV 0x84F2 +#define GL_FENCE_STATUS_NV 0x84F3 +#define GL_FENCE_CONDITION_NV 0x84F4 +#endif + +/*------------------------------------------------------------------------* + * QCOM extension tokens + *------------------------------------------------------------------------*/ + +/* GL_QCOM_driver_control */ +/* No new tokens introduced by this extension. */ + +/* GL_QCOM_extended_get */ +#ifndef GL_QCOM_extended_get +#define GL_TEXTURE_WIDTH_QCOM 0x8BD2 +#define GL_TEXTURE_HEIGHT_QCOM 0x8BD3 +#define GL_TEXTURE_DEPTH_QCOM 0x8BD4 +#define GL_TEXTURE_INTERNAL_FORMAT_QCOM 0x8BD5 +#define GL_TEXTURE_FORMAT_QCOM 0x8BD6 +#define GL_TEXTURE_TYPE_QCOM 0x8BD7 +#define GL_TEXTURE_IMAGE_VALID_QCOM 0x8BD8 +#define GL_TEXTURE_NUM_LEVELS_QCOM 0x8BD9 +#define GL_TEXTURE_TARGET_QCOM 0x8BDA +#define GL_TEXTURE_OBJECT_VALID_QCOM 0x8BDB +#define GL_STATE_RESTORE 0x8BDC +#endif + +/* GL_QCOM_extended_get2 */ +/* No new tokens introduced by this extension. */ + +/* GL_QCOM_perfmon_global_mode */ +#ifndef GL_QCOM_perfmon_global_mode +#define GL_PERFMON_GLOBAL_MODE_QCOM 0x8FA0 +#endif + +/* GL_QCOM_writeonly_rendering */ +#ifndef GL_QCOM_writeonly_rendering +#define GL_WRITEONLY_RENDERING_QCOM 0x8823 +#endif + +/* GL_QCOM_tiled_rendering */ +#ifndef GL_QCOM_tiled_rendering +#define GL_COLOR_BUFFER_BIT0_QCOM 0x00000001 +#define GL_COLOR_BUFFER_BIT1_QCOM 0x00000002 +#define GL_COLOR_BUFFER_BIT2_QCOM 0x00000004 +#define GL_COLOR_BUFFER_BIT3_QCOM 0x00000008 +#define GL_COLOR_BUFFER_BIT4_QCOM 0x00000010 +#define GL_COLOR_BUFFER_BIT5_QCOM 0x00000020 +#define GL_COLOR_BUFFER_BIT6_QCOM 0x00000040 +#define GL_COLOR_BUFFER_BIT7_QCOM 0x00000080 +#define GL_DEPTH_BUFFER_BIT0_QCOM 0x00000100 +#define GL_DEPTH_BUFFER_BIT1_QCOM 0x00000200 +#define GL_DEPTH_BUFFER_BIT2_QCOM 0x00000400 +#define GL_DEPTH_BUFFER_BIT3_QCOM 0x00000800 +#define GL_DEPTH_BUFFER_BIT4_QCOM 0x00001000 +#define GL_DEPTH_BUFFER_BIT5_QCOM 0x00002000 +#define GL_DEPTH_BUFFER_BIT6_QCOM 0x00004000 +#define GL_DEPTH_BUFFER_BIT7_QCOM 0x00008000 +#define GL_STENCIL_BUFFER_BIT0_QCOM 0x00010000 +#define GL_STENCIL_BUFFER_BIT1_QCOM 0x00020000 +#define GL_STENCIL_BUFFER_BIT2_QCOM 0x00040000 +#define GL_STENCIL_BUFFER_BIT3_QCOM 0x00080000 +#define GL_STENCIL_BUFFER_BIT4_QCOM 0x00100000 +#define GL_STENCIL_BUFFER_BIT5_QCOM 0x00200000 +#define GL_STENCIL_BUFFER_BIT6_QCOM 0x00400000 +#define GL_STENCIL_BUFFER_BIT7_QCOM 0x00800000 +#define GL_MULTISAMPLE_BUFFER_BIT0_QCOM 0x01000000 +#define GL_MULTISAMPLE_BUFFER_BIT1_QCOM 0x02000000 +#define GL_MULTISAMPLE_BUFFER_BIT2_QCOM 0x04000000 +#define GL_MULTISAMPLE_BUFFER_BIT3_QCOM 0x08000000 +#define GL_MULTISAMPLE_BUFFER_BIT4_QCOM 0x10000000 +#define GL_MULTISAMPLE_BUFFER_BIT5_QCOM 0x20000000 +#define GL_MULTISAMPLE_BUFFER_BIT6_QCOM 0x40000000 +#define GL_MULTISAMPLE_BUFFER_BIT7_QCOM 0x80000000 +#endif + +/*------------------------------------------------------------------------* + * End of extension tokens, start of corresponding extension functions + *------------------------------------------------------------------------*/ + /*------------------------------------------------------------------------* * OES extension functions *------------------------------------------------------------------------*/ @@ -456,11 +647,11 @@ typedef void (GL_APIENTRYP PFNGLGENERATEMIPMAPOESPROC) (GLenum target); #ifdef GL_GLEXT_PROTOTYPES GL_API void* GL_APIENTRY glMapBufferOES (GLenum target, GLenum access); GL_API GLboolean GL_APIENTRY glUnmapBufferOES (GLenum target); -GL_API void GL_APIENTRY glGetBufferPointervOES (GLenum target, GLenum pname, void** params); +GL_API void GL_APIENTRY glGetBufferPointervOES (GLenum target, GLenum pname, GLvoid ** params); #endif typedef void* (GL_APIENTRYP PFNGLMAPBUFFEROESPROC) (GLenum target, GLenum access); typedef GLboolean (GL_APIENTRYP PFNGLUNMAPBUFFEROESPROC) (GLenum target); -typedef void (GL_APIENTRYP PFNGLGETBUFFERPOINTERVOESPROC) (GLenum target, GLenum pname, void** params); +typedef void (GL_APIENTRYP PFNGLGETBUFFERPOINTERVOESPROC) (GLenum target, GLenum pname, GLvoid ** params); #endif /* GL_OES_matrix_get */ @@ -576,6 +767,26 @@ typedef void (GL_APIENTRYP PFNGLGETTEXGENXVOESPROC) (GLenum coord, GLenum pname, #define GL_OES_texture_mirrored_repeat 1 #endif +/* GL_OES_vertex_array_object */ +#ifndef GL_OES_vertex_array_object +#define GL_OES_vertex_array_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_API void GL_APIENTRY glBindVertexArrayOES (GLuint array); +GL_API void GL_APIENTRY glDeleteVertexArraysOES (GLsizei n, const GLuint *arrays); +GL_API void GL_APIENTRY glGenVertexArraysOES (GLsizei n, GLuint *arrays); +GL_API GLboolean GL_APIENTRY glIsVertexArrayOES (GLuint array); +#endif +typedef void (GL_APIENTRYP PFNGLBINDVERTEXARRAYOESPROC) (GLuint array); +typedef void (GL_APIENTRYP PFNGLDELETEVERTEXARRAYSOESPROC) (GLsizei n, const GLuint *arrays); +typedef void (GL_APIENTRYP PFNGLGENVERTEXARRAYSOESPROC) (GLsizei n, GLuint *arrays); +typedef GLboolean (GL_APIENTRYP PFNGLISVERTEXARRAYOESPROC) (GLuint array); +#endif + +/* GL_OES_texture_external */ +#ifndef GL_OES_texture_external +#define GL_OES_texture_external 1 +#endif + /*------------------------------------------------------------------------* * AMD extension functions *------------------------------------------------------------------------*/ @@ -591,14 +802,207 @@ typedef void (GL_APIENTRYP PFNGLGETTEXGENXVOESPROC) (GLenum coord, GLenum pname, #endif /*------------------------------------------------------------------------* + * APPLE extension functions + *------------------------------------------------------------------------*/ + +/* GL_APPLE_texture_2D_limited_npot */ +#ifndef GL_APPLE_texture_2D_limited_npot +#define GL_APPLE_texture_2D_limited_npot 1 +#endif + +/*------------------------------------------------------------------------* * EXT extension functions *------------------------------------------------------------------------*/ +/* GL_EXT_blend_minmax */ +#ifndef GL_EXT_blend_minmax +#define GL_EXT_blend_minmax 1 +#endif + +/* GL_EXT_discard_framebuffer */ +#ifndef GL_EXT_discard_framebuffer +#define GL_EXT_discard_framebuffer 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_API void GL_APIENTRY glDiscardFramebufferEXT (GLenum target, GLsizei numAttachments, const GLenum *attachments); +#endif +typedef void (GL_APIENTRYP PFNGLDISCARDFRAMEBUFFEREXTPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments); +#endif + +/* GL_EXT_multi_draw_arrays */ +#ifndef GL_EXT_multi_draw_arrays +#define GL_EXT_multi_draw_arrays 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_API void GL_APIENTRY glMultiDrawArraysEXT (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount); +GL_API void GL_APIENTRY glMultiDrawElementsEXT (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (GL_APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount); +typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount); +#endif + +/* GL_EXT_read_format_bgra */ +#ifndef GL_EXT_read_format_bgra +#define GL_EXT_read_format_bgra 1 +#endif + /* GL_EXT_texture_filter_anisotropic */ #ifndef GL_EXT_texture_filter_anisotropic #define GL_EXT_texture_filter_anisotropic 1 #endif +/* GL_EXT_texture_format_BGRA8888 */ +#ifndef GL_EXT_texture_format_BGRA8888 +#define GL_EXT_texture_format_BGRA8888 1 +#endif + +/* GL_EXT_texture_lod_bias */ +#ifndef GL_EXT_texture_lod_bias +#define GL_EXT_texture_lod_bias 1 +#endif + +/*------------------------------------------------------------------------* + * IMG extension functions + *------------------------------------------------------------------------*/ + +/* GL_IMG_read_format */ +#ifndef GL_IMG_read_format +#define GL_IMG_read_format 1 +#endif + +/* GL_IMG_texture_compression_pvrtc */ +#ifndef GL_IMG_texture_compression_pvrtc +#define GL_IMG_texture_compression_pvrtc 1 +#endif + +/* GL_IMG_texture_env_enhanced_fixed_function */ +#ifndef GL_IMG_texture_env_enhanced_fixed_function +#define GL_IMG_texture_env_enhanced_fixed_function 1 +#endif + +/* GL_IMG_user_clip_plane */ +#ifndef GL_IMG_user_clip_plane +#define GL_IMG_user_clip_plane 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_API void GL_APIENTRY glClipPlanefIMG (GLenum p, const GLfloat *eqn); +GL_API void GL_APIENTRY glClipPlanexIMG (GLenum p, const GLfixed *eqn); +#endif +typedef void (GL_APIENTRYP PFNGLCLIPPLANEFIMGPROC) (GLenum p, const GLfloat *eqn); +typedef void (GL_APIENTRYP PFNGLCLIPPLANEXIMGPROC) (GLenum p, const GLfixed *eqn); +#endif + +/* GL_IMG_multisampled_render_to_texture */ +#ifndef GL_IMG_multisampled_render_to_texture +#define GL_IMG_multisampled_render_to_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_API void GL_APIENTRY glRenderbufferStorageMultisampleIMG (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +GL_API void GL_APIENTRY glFramebufferTexture2DMultisampleIMG (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples); +#endif +typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEIMG) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEIMG) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples); +#endif + +/*------------------------------------------------------------------------* + * NV extension functions + *------------------------------------------------------------------------*/ + +/* NV_fence */ +#ifndef GL_NV_fence +#define GL_NV_fence 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_API void GL_APIENTRY glDeleteFencesNV (GLsizei n, const GLuint *fences); +GL_API void GL_APIENTRY glGenFencesNV (GLsizei n, GLuint *fences); +GL_API GLboolean GL_APIENTRY glIsFenceNV (GLuint fence); +GL_API GLboolean GL_APIENTRY glTestFenceNV (GLuint fence); +GL_API void GL_APIENTRY glGetFenceivNV (GLuint fence, GLenum pname, GLint *params); +GL_API void GL_APIENTRY glFinishFenceNV (GLuint fence); +GL_API void GL_APIENTRY glSetFenceNV (GLuint fence, GLenum condition); +#endif +typedef void (GL_APIENTRYP PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences); +typedef void (GL_APIENTRYP PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences); +typedef GLboolean (GL_APIENTRYP PFNGLISFENCENVPROC) (GLuint fence); +typedef GLboolean (GL_APIENTRYP PFNGLTESTFENCENVPROC) (GLuint fence); +typedef void (GL_APIENTRYP PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint *params); +typedef void (GL_APIENTRYP PFNGLFINISHFENCENVPROC) (GLuint fence); +typedef void (GL_APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition); +#endif + +/*------------------------------------------------------------------------* + * QCOM extension functions + *------------------------------------------------------------------------*/ + +/* GL_QCOM_driver_control */ +#ifndef GL_QCOM_driver_control +#define GL_QCOM_driver_control 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_API void GL_APIENTRY glGetDriverControlsQCOM (GLint *num, GLsizei size, GLuint *driverControls); +GL_API void GL_APIENTRY glGetDriverControlStringQCOM (GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString); +GL_API void GL_APIENTRY glEnableDriverControlQCOM (GLuint driverControl); +GL_API void GL_APIENTRY glDisableDriverControlQCOM (GLuint driverControl); +#endif +typedef void (GL_APIENTRYP PFNGLGETDRIVERCONTROLSQCOMPROC) (GLint *num, GLsizei size, GLuint *driverControls); +typedef void (GL_APIENTRYP PFNGLGETDRIVERCONTROLSTRINGQCOMPROC) (GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString); +typedef void (GL_APIENTRYP PFNGLENABLEDRIVERCONTROLQCOMPROC) (GLuint driverControl); +typedef void (GL_APIENTRYP PFNGLDISABLEDRIVERCONTROLQCOMPROC) (GLuint driverControl); +#endif + +/* GL_QCOM_extended_get */ +#ifndef GL_QCOM_extended_get +#define GL_QCOM_extended_get 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_API void GL_APIENTRY glExtGetTexturesQCOM (GLuint *textures, GLint maxTextures, GLint *numTextures); +GL_API void GL_APIENTRY glExtGetBuffersQCOM (GLuint *buffers, GLint maxBuffers, GLint *numBuffers); +GL_API void GL_APIENTRY glExtGetRenderbuffersQCOM (GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers); +GL_API void GL_APIENTRY glExtGetFramebuffersQCOM (GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers); +GL_API void GL_APIENTRY glExtGetTexLevelParameterivQCOM (GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params); +GL_API void GL_APIENTRY glExtTexObjectStateOverrideiQCOM (GLenum target, GLenum pname, GLint param); +GL_API void GL_APIENTRY glExtGetTexSubImageQCOM (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid *texels); +GL_API void GL_APIENTRY glExtGetBufferPointervQCOM (GLenum target, GLvoid **params); +#endif +typedef void (GL_APIENTRYP PFNGLEXTGETTEXTURESQCOMPROC) (GLuint *textures, GLint maxTextures, GLint *numTextures); +typedef void (GL_APIENTRYP PFNGLEXTGETBUFFERSQCOMPROC) (GLuint *buffers, GLint maxBuffers, GLint *numBuffers); +typedef void (GL_APIENTRYP PFNGLEXTGETRENDERBUFFERSQCOMPROC) (GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers); +typedef void (GL_APIENTRYP PFNGLEXTGETFRAMEBUFFERSQCOMPROC) (GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers); +typedef void (GL_APIENTRYP PFNGLEXTGETTEXLEVELPARAMETERIVQCOMPROC) (GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params); +typedef void (GL_APIENTRYP PFNGLEXTTEXOBJECTSTATEOVERRIDEIQCOMPROC) (GLenum target, GLenum pname, GLint param); +typedef void (GL_APIENTRYP PFNGLEXTGETTEXSUBIMAGEQCOMPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid *texels); +typedef void (GL_APIENTRYP PFNGLEXTGETBUFFERPOINTERVQCOMPROC) (GLenum target, GLvoid **params); +#endif + +/* GL_QCOM_extended_get2 */ +#ifndef GL_QCOM_extended_get2 +#define GL_QCOM_extended_get2 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_API void GL_APIENTRY glExtGetShadersQCOM (GLuint *shaders, GLint maxShaders, GLint *numShaders); +GL_API void GL_APIENTRY glExtGetProgramsQCOM (GLuint *programs, GLint maxPrograms, GLint *numPrograms); +GL_API GLboolean GL_APIENTRY glExtIsProgramBinaryQCOM (GLuint program); +GL_API void GL_APIENTRY glExtGetProgramBinarySourceQCOM (GLuint program, GLenum shadertype, GLchar *source, GLint *length); +#endif +typedef void (GL_APIENTRYP PFNGLEXTGETSHADERSQCOMPROC) (GLuint *shaders, GLint maxShaders, GLint *numShaders); +typedef void (GL_APIENTRYP PFNGLEXTGETPROGRAMSQCOMPROC) (GLuint *programs, GLint maxPrograms, GLint *numPrograms); +typedef GLboolean (GL_APIENTRYP PFNGLEXTISPROGRAMBINARYQCOMPROC) (GLuint program); +typedef void (GL_APIENTRYP PFNGLEXTGETPROGRAMBINARYSOURCEQCOMPROC) (GLuint program, GLenum shadertype, GLchar *source, GLint *length); +#endif + +/* GL_QCOM_perfmon_global_mode */ +#ifndef GL_QCOM_perfmon_global_mode +#define GL_QCOM_perfmon_global_mode 1 +#endif + +/* GL_QCOM_writeonly_rendering */ +#ifndef GL_QCOM_writeonly_rendering +#define GL_QCOM_writeonly_rendering 1 +#endif + +/* GL_QCOM_tiled_rendering */ +#ifndef GL_QCOM_tiled_rendering +#define GL_QCOM_tiled_rendering 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_API void GL_APIENTRY glStartTilingQCOM (GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask); +GL_API void GL_APIENTRY glEndTilingQCOM (GLbitfield preserveMask); +#endif +typedef void (GL_APIENTRYP PFNGLSTARTTILINGQCOMPROC) (GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask); +typedef void (GL_APIENTRYP PFNGLENDTILINGQCOMPROC) (GLbitfield preserveMask); +#endif + #ifdef __cplusplus } #endif diff --git a/opengl/include/GLES/glplatform.h b/opengl/include/GLES/glplatform.h index 198e679db270..2db6ee2ca68e 100644 --- a/opengl/include/GLES/glplatform.h +++ b/opengl/include/GLES/glplatform.h @@ -1,7 +1,7 @@ #ifndef __glplatform_h_ #define __glplatform_h_ -/* $Revision: 7172 $ on $Date:: 2009-01-09 11:17:41 -0800 #$ */ +/* $Revision: 10601 $ on $Date:: 2010-03-04 22:15:27 -0800 #$ */ /* * This document is licensed under the SGI Free Software B License Version @@ -9,7 +9,6 @@ */ /* Platform-specific types and definitions for OpenGL ES 1.X gl.h - * Last modified on 2008/12/19 * * Adopters may modify khrplatform.h and this file to suit their platform. * You are encouraged to submit all modifications to the Khronos group so that @@ -24,10 +23,8 @@ #define GL_API KHRONOS_APICALL #endif -#if defined(ANDROID) - +#ifndef GL_APIENTRY #define GL_APIENTRY KHRONOS_APIENTRY - #endif #endif /* __glplatform_h_ */ diff --git a/opengl/include/GLES2/gl2.h b/opengl/include/GLES2/gl2.h index 0182a676d1b4..e1d3b87cc59e 100644 --- a/opengl/include/GLES2/gl2.h +++ b/opengl/include/GLES2/gl2.h @@ -1,7 +1,7 @@ #ifndef __gl2_h_ #define __gl2_h_ -/* $Revision: 7173 $ on $Date:: 2009-01-09 11:18:21 -0800 #$ */ +/* $Revision: 10602 $ on $Date:: 2010-03-04 22:35:34 -0800 #$ */ #include <GLES2/gl2platform.h> @@ -19,6 +19,7 @@ extern "C" { *-----------------------------------------------------------------------*/ typedef void GLvoid; +typedef char GLchar; typedef unsigned int GLenum; typedef unsigned char GLboolean; typedef unsigned int GLbitfield; @@ -472,7 +473,7 @@ typedef khronos_ssize_t GLsizeiptr; GL_APICALL void GL_APIENTRY glActiveTexture (GLenum texture); GL_APICALL void GL_APIENTRY glAttachShader (GLuint program, GLuint shader); -GL_APICALL void GL_APIENTRY glBindAttribLocation (GLuint program, GLuint index, const char* name); +GL_APICALL void GL_APIENTRY glBindAttribLocation (GLuint program, GLuint index, const GLchar* name); GL_APICALL void GL_APIENTRY glBindBuffer (GLenum target, GLuint buffer); GL_APICALL void GL_APIENTRY glBindFramebuffer (GLenum target, GLuint framebuffer); GL_APICALL void GL_APIENTRY glBindRenderbuffer (GLenum target, GLuint renderbuffer); @@ -482,8 +483,8 @@ GL_APICALL void GL_APIENTRY glBlendEquation ( GLenum mode ); GL_APICALL void GL_APIENTRY glBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha); GL_APICALL void GL_APIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor); GL_APICALL void GL_APIENTRY glBlendFuncSeparate (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); -GL_APICALL void GL_APIENTRY glBufferData (GLenum target, GLsizeiptr size, const void* data, GLenum usage); -GL_APICALL void GL_APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const void* data); +GL_APICALL void GL_APIENTRY glBufferData (GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage); +GL_APICALL void GL_APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data); GL_APICALL GLenum GL_APIENTRY glCheckFramebufferStatus (GLenum target); GL_APICALL void GL_APIENTRY glClear (GLbitfield mask); GL_APICALL void GL_APIENTRY glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); @@ -491,8 +492,8 @@ GL_APICALL void GL_APIENTRY glClearDepthf (GLclampf depth); GL_APICALL void GL_APIENTRY glClearStencil (GLint s); GL_APICALL void GL_APIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); GL_APICALL void GL_APIENTRY glCompileShader (GLuint shader); -GL_APICALL void GL_APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data); -GL_APICALL void GL_APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data); +GL_APICALL void GL_APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid* data); +GL_APICALL void GL_APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid* data); GL_APICALL void GL_APIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); GL_APICALL void GL_APIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); GL_APICALL GLuint GL_APIENTRY glCreateProgram (void); @@ -511,7 +512,7 @@ GL_APICALL void GL_APIENTRY glDetachShader (GLuint program, GLuint shade GL_APICALL void GL_APIENTRY glDisable (GLenum cap); GL_APICALL void GL_APIENTRY glDisableVertexAttribArray (GLuint index); GL_APICALL void GL_APIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count); -GL_APICALL void GL_APIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const void* indices); +GL_APICALL void GL_APIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const GLvoid* indices); GL_APICALL void GL_APIENTRY glEnable (GLenum cap); GL_APICALL void GL_APIENTRY glEnableVertexAttribArray (GLuint index); GL_APICALL void GL_APIENTRY glFinish (void); @@ -524,10 +525,10 @@ GL_APICALL void GL_APIENTRY glGenerateMipmap (GLenum target); GL_APICALL void GL_APIENTRY glGenFramebuffers (GLsizei n, GLuint* framebuffers); GL_APICALL void GL_APIENTRY glGenRenderbuffers (GLsizei n, GLuint* renderbuffers); GL_APICALL void GL_APIENTRY glGenTextures (GLsizei n, GLuint* textures); -GL_APICALL void GL_APIENTRY glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name); -GL_APICALL void GL_APIENTRY glGetActiveUniform (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name); +GL_APICALL void GL_APIENTRY glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name); +GL_APICALL void GL_APIENTRY glGetActiveUniform (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name); GL_APICALL void GL_APIENTRY glGetAttachedShaders (GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders); -GL_APICALL int GL_APIENTRY glGetAttribLocation (GLuint program, const char* name); +GL_APICALL int GL_APIENTRY glGetAttribLocation (GLuint program, const GLchar* name); GL_APICALL void GL_APIENTRY glGetBooleanv (GLenum pname, GLboolean* params); GL_APICALL void GL_APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint* params); GL_APICALL GLenum GL_APIENTRY glGetError (void); @@ -535,21 +536,21 @@ GL_APICALL void GL_APIENTRY glGetFloatv (GLenum pname, GLfloat* params); GL_APICALL void GL_APIENTRY glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint* params); GL_APICALL void GL_APIENTRY glGetIntegerv (GLenum pname, GLint* params); GL_APICALL void GL_APIENTRY glGetProgramiv (GLuint program, GLenum pname, GLint* params); -GL_APICALL void GL_APIENTRY glGetProgramInfoLog (GLuint program, GLsizei bufsize, GLsizei* length, char* infolog); +GL_APICALL void GL_APIENTRY glGetProgramInfoLog (GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog); GL_APICALL void GL_APIENTRY glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint* params); GL_APICALL void GL_APIENTRY glGetShaderiv (GLuint shader, GLenum pname, GLint* params); -GL_APICALL void GL_APIENTRY glGetShaderInfoLog (GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog); +GL_APICALL void GL_APIENTRY glGetShaderInfoLog (GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* infolog); GL_APICALL void GL_APIENTRY glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision); -GL_APICALL void GL_APIENTRY glGetShaderSource (GLuint shader, GLsizei bufsize, GLsizei* length, char* source); +GL_APICALL void GL_APIENTRY glGetShaderSource (GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source); GL_APICALL const GLubyte* GL_APIENTRY glGetString (GLenum name); GL_APICALL void GL_APIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat* params); GL_APICALL void GL_APIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint* params); GL_APICALL void GL_APIENTRY glGetUniformfv (GLuint program, GLint location, GLfloat* params); GL_APICALL void GL_APIENTRY glGetUniformiv (GLuint program, GLint location, GLint* params); -GL_APICALL int GL_APIENTRY glGetUniformLocation (GLuint program, const char* name); +GL_APICALL int GL_APIENTRY glGetUniformLocation (GLuint program, const GLchar* name); GL_APICALL void GL_APIENTRY glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat* params); GL_APICALL void GL_APIENTRY glGetVertexAttribiv (GLuint index, GLenum pname, GLint* params); -GL_APICALL void GL_APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, void** pointer); +GL_APICALL void GL_APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, GLvoid** pointer); GL_APICALL void GL_APIENTRY glHint (GLenum target, GLenum mode); GL_APICALL GLboolean GL_APIENTRY glIsBuffer (GLuint buffer); GL_APICALL GLboolean GL_APIENTRY glIsEnabled (GLenum cap); @@ -562,25 +563,25 @@ GL_APICALL void GL_APIENTRY glLineWidth (GLfloat width); GL_APICALL void GL_APIENTRY glLinkProgram (GLuint program); GL_APICALL void GL_APIENTRY glPixelStorei (GLenum pname, GLint param); GL_APICALL void GL_APIENTRY glPolygonOffset (GLfloat factor, GLfloat units); -GL_APICALL void GL_APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void* pixels); +GL_APICALL void GL_APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels); GL_APICALL void GL_APIENTRY glReleaseShaderCompiler (void); GL_APICALL void GL_APIENTRY glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); GL_APICALL void GL_APIENTRY glSampleCoverage (GLclampf value, GLboolean invert); GL_APICALL void GL_APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height); -GL_APICALL void GL_APIENTRY glShaderBinary (GLsizei n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLsizei length); -GL_APICALL void GL_APIENTRY glShaderSource (GLuint shader, GLsizei count, const char** string, const GLint* length); +GL_APICALL void GL_APIENTRY glShaderBinary (GLsizei n, const GLuint* shaders, GLenum binaryformat, const GLvoid* binary, GLsizei length); +GL_APICALL void GL_APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar** string, const GLint* length); GL_APICALL void GL_APIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask); GL_APICALL void GL_APIENTRY glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask); GL_APICALL void GL_APIENTRY glStencilMask (GLuint mask); GL_APICALL void GL_APIENTRY glStencilMaskSeparate (GLenum face, GLuint mask); GL_APICALL void GL_APIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass); GL_APICALL void GL_APIENTRY glStencilOpSeparate (GLenum face, GLenum fail, GLenum zfail, GLenum zpass); -GL_APICALL void GL_APIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels); +GL_APICALL void GL_APIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels); GL_APICALL void GL_APIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param); GL_APICALL void GL_APIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat* params); GL_APICALL void GL_APIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param); GL_APICALL void GL_APIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint* params); -GL_APICALL void GL_APIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels); +GL_APICALL void GL_APIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels); GL_APICALL void GL_APIENTRY glUniform1f (GLint location, GLfloat x); GL_APICALL void GL_APIENTRY glUniform1fv (GLint location, GLsizei count, const GLfloat* v); GL_APICALL void GL_APIENTRY glUniform1i (GLint location, GLint x); @@ -610,7 +611,7 @@ GL_APICALL void GL_APIENTRY glVertexAttrib3f (GLuint indx, GLfloat x, GL GL_APICALL void GL_APIENTRY glVertexAttrib3fv (GLuint indx, const GLfloat* values); GL_APICALL void GL_APIENTRY glVertexAttrib4f (GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w); GL_APICALL void GL_APIENTRY glVertexAttrib4fv (GLuint indx, const GLfloat* values); -GL_APICALL void GL_APIENTRY glVertexAttribPointer (GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* ptr); +GL_APICALL void GL_APIENTRY glVertexAttribPointer (GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* ptr); GL_APICALL void GL_APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height); #ifdef __cplusplus diff --git a/opengl/include/GLES2/gl2ext.h b/opengl/include/GLES2/gl2ext.h index 72f1ae79ada9..de5d65a23114 100644 --- a/opengl/include/GLES2/gl2ext.h +++ b/opengl/include/GLES2/gl2ext.h @@ -1,7 +1,7 @@ #ifndef __gl2ext_h_ #define __gl2ext_h_ -/* $Revision: 8271 $ on $Date:: 2009-05-21 09:33:40 -0700 #$ */ +/* $Revision: 10969 $ on $Date:: 2010-04-09 02:27:15 -0700 #$ */ #ifdef __cplusplus extern "C" { @@ -57,6 +57,11 @@ extern "C" { typedef void* GLeglImageOES; #endif +/* GL_OES_element_index_uint */ +#ifndef GL_OES_element_index_uint +#define GL_UNSIGNED_INT 0x1405 +#endif + /* GL_OES_get_program_binary */ #ifndef GL_OES_get_program_binary #define GL_PROGRAM_BINARY_LENGTH_OES 0x8741 @@ -100,8 +105,8 @@ typedef void* GLeglImageOES; #define GL_STENCIL_INDEX4_OES 0x8D47 #endif -/* GL_OES_texture3D */ -#ifndef GL_OES_texture3D +/* GL_OES_texture_3D */ +#ifndef GL_OES_texture_3D #define GL_TEXTURE_WRAP_R_OES 0x8072 #define GL_TEXTURE_3D_OES 0x806F #define GL_TEXTURE_BINDING_3D_OES 0x806A @@ -110,11 +115,28 @@ typedef void* GLeglImageOES; #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_OES 0x8CD4 #endif +/* GL_OES_texture_float */ +/* No new tokens introduced by this extension. */ + +/* GL_OES_texture_float_linear */ +/* No new tokens introduced by this extension. */ + /* GL_OES_texture_half_float */ #ifndef GL_OES_texture_half_float #define GL_HALF_FLOAT_OES 0x8D61 #endif +/* GL_OES_texture_half_float_linear */ +/* No new tokens introduced by this extension. */ + +/* GL_OES_texture_npot */ +/* No new tokens introduced by this extension. */ + +/* GL_OES_vertex_array_object */ +#ifndef GL_OES_vertex_array_object +#define GL_VERTEX_ARRAY_BINDING_OES 0x85B5 +#endif + /* GL_OES_vertex_half_float */ /* GL_HALF_FLOAT_OES defined in GL_OES_texture_half_float already. */ @@ -124,6 +146,11 @@ typedef void* GLeglImageOES; #define GL_INT_10_10_10_2_OES 0x8DF7 #endif +/* GL_OES_texture_external */ +#ifndef GL_TEXTURE_EXTERNAL_OES +#define GL_TEXTURE_EXTERNAL_OES 0x8D65 +#endif + /*------------------------------------------------------------------------* * AMD extension tokens *------------------------------------------------------------------------*/ @@ -141,11 +168,6 @@ typedef void* GLeglImageOES; #define GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD 0x87EE #endif -/* GL_AMD_program_binary_Z400 */ -#ifndef GL_AMD_program_binary_Z400 -#define GL_Z400_BINARY_AMD 0x8740 -#endif - /* GL_AMD_performance_monitor */ #ifndef GL_AMD_performance_monitor #define GL_COUNTER_TYPE_AMD 0x8BC0 @@ -157,35 +179,78 @@ typedef void* GLeglImageOES; #define GL_PERFMON_RESULT_AMD 0x8BC6 #endif +/* GL_AMD_program_binary_Z400 */ +#ifndef GL_AMD_program_binary_Z400 +#define GL_Z400_BINARY_AMD 0x8740 +#endif + /*------------------------------------------------------------------------* * EXT extension tokens *------------------------------------------------------------------------*/ +/* GL_EXT_blend_minmax */ +#ifndef GL_EXT_blend_minmax +#define GL_MIN_EXT 0x8007 +#define GL_MAX_EXT 0x8008 +#endif + +/* GL_EXT_discard_framebuffer */ +#ifndef GL_EXT_discard_framebuffer +#define GL_COLOR_EXT 0x1800 +#define GL_DEPTH_EXT 0x1801 +#define GL_STENCIL_EXT 0x1802 +#endif + +/* GL_EXT_multi_draw_arrays */ +/* No new tokens introduced by this extension. */ + +/* GL_EXT_read_format_bgra */ +#ifndef GL_EXT_read_format_bgra +#define GL_BGRA_EXT 0x80E1 +#define GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT 0x8365 +#define GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT 0x8366 +#endif + /* GL_EXT_texture_filter_anisotropic */ #ifndef GL_EXT_texture_filter_anisotropic #define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE #define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF #endif +/* GL_EXT_texture_format_BGRA8888 */ +#ifndef GL_EXT_texture_format_BGRA8888 +#define GL_BGRA_EXT 0x80E1 +#endif + /* GL_EXT_texture_type_2_10_10_10_REV */ #ifndef GL_EXT_texture_type_2_10_10_10_REV #define GL_UNSIGNED_INT_2_10_10_10_REV_EXT 0x8368 #endif -/* GL_EXT_texture_format_BGRA8888 */ -#ifndef GL_EXT_texture_format_BGRA8888 -#define GL_BGRA 0x80E1 +/* GL_EXT_texture_compression_dxt1 */ +#ifndef GL_EXT_texture_compression_dxt1 +#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 +#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 #endif /*------------------------------------------------------------------------* * IMG extension tokens *------------------------------------------------------------------------*/ +/* GL_IMG_program_binary */ +#ifndef GL_IMG_program_binary +#define GL_SGX_PROGRAM_BINARY_IMG 0x9130 +#endif + /* GL_IMG_read_format */ #ifndef GL_IMG_read_format -#define GL_BGRA 0x80E1 -#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365 -#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 +#define GL_BGRA_IMG 0x80E1 +#define GL_UNSIGNED_SHORT_4_4_4_4_REV_IMG 0x8365 +#endif + +/* GL_IMG_shader_binary */ +#ifndef GL_IMG_shader_binary +#define GL_SGX_BINARY_IMG 0x8C0A #endif /* GL_IMG_texture_compression_pvrtc */ @@ -196,6 +261,14 @@ typedef void* GLeglImageOES; #define GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG 0x8C03 #endif +/* GL_IMG_multisampled_render_to_texture */ +#ifndef GL_IMG_multisampled_render_to_texture +#define GL_RENDERBUFFER_SAMPLES_IMG 0x9133 +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_IMG 0x9134 +#define GL_MAX_SAMPLES_IMG 0x9135 +#define GL_TEXTURE_SAMPLES_IMG 0x9136 +#endif + /*------------------------------------------------------------------------* * NV extension tokens *------------------------------------------------------------------------*/ @@ -207,6 +280,24 @@ typedef void* GLeglImageOES; #define GL_FENCE_CONDITION_NV 0x84F4 #endif +/* GL_NV_coverage_sample */ +#ifndef GL_NV_coverage_sample +#define GL_COVERAGE_COMPONENT_NV 0x8ED0 +#define GL_COVERAGE_COMPONENT4_NV 0x8ED1 +#define GL_COVERAGE_ATTACHMENT_NV 0x8ED2 +#define GL_COVERAGE_BUFFERS_NV 0x8ED3 +#define GL_COVERAGE_SAMPLES_NV 0x8ED4 +#define GL_COVERAGE_ALL_FRAGMENTS_NV 0x8ED5 +#define GL_COVERAGE_EDGE_FRAGMENTS_NV 0x8ED6 +#define GL_COVERAGE_AUTOMATIC_NV 0x8ED7 +#define GL_COVERAGE_BUFFER_BIT_NV 0x8000 +#endif + +/* GL_NV_depth_nonlinear */ +#ifndef GL_NV_depth_nonlinear +#define GL_DEPTH_COMPONENT16_NONLINEAR_NV 0x8E2C +#endif + /*------------------------------------------------------------------------* * QCOM extension tokens *------------------------------------------------------------------------*/ @@ -214,11 +305,70 @@ typedef void* GLeglImageOES; /* GL_QCOM_driver_control */ /* No new tokens introduced by this extension. */ +/* GL_QCOM_extended_get */ +#ifndef GL_QCOM_extended_get +#define GL_TEXTURE_WIDTH_QCOM 0x8BD2 +#define GL_TEXTURE_HEIGHT_QCOM 0x8BD3 +#define GL_TEXTURE_DEPTH_QCOM 0x8BD4 +#define GL_TEXTURE_INTERNAL_FORMAT_QCOM 0x8BD5 +#define GL_TEXTURE_FORMAT_QCOM 0x8BD6 +#define GL_TEXTURE_TYPE_QCOM 0x8BD7 +#define GL_TEXTURE_IMAGE_VALID_QCOM 0x8BD8 +#define GL_TEXTURE_NUM_LEVELS_QCOM 0x8BD9 +#define GL_TEXTURE_TARGET_QCOM 0x8BDA +#define GL_TEXTURE_OBJECT_VALID_QCOM 0x8BDB +#define GL_STATE_RESTORE 0x8BDC +#endif + +/* GL_QCOM_extended_get2 */ +/* No new tokens introduced by this extension. */ + /* GL_QCOM_perfmon_global_mode */ #ifndef GL_QCOM_perfmon_global_mode #define GL_PERFMON_GLOBAL_MODE_QCOM 0x8FA0 #endif +/* GL_QCOM_writeonly_rendering */ +#ifndef GL_QCOM_writeonly_rendering +#define GL_WRITEONLY_RENDERING_QCOM 0x8823 +#endif + +/* GL_QCOM_tiled_rendering */ +#ifndef GL_QCOM_tiled_rendering +#define GL_COLOR_BUFFER_BIT0_QCOM 0x00000001 +#define GL_COLOR_BUFFER_BIT1_QCOM 0x00000002 +#define GL_COLOR_BUFFER_BIT2_QCOM 0x00000004 +#define GL_COLOR_BUFFER_BIT3_QCOM 0x00000008 +#define GL_COLOR_BUFFER_BIT4_QCOM 0x00000010 +#define GL_COLOR_BUFFER_BIT5_QCOM 0x00000020 +#define GL_COLOR_BUFFER_BIT6_QCOM 0x00000040 +#define GL_COLOR_BUFFER_BIT7_QCOM 0x00000080 +#define GL_DEPTH_BUFFER_BIT0_QCOM 0x00000100 +#define GL_DEPTH_BUFFER_BIT1_QCOM 0x00000200 +#define GL_DEPTH_BUFFER_BIT2_QCOM 0x00000400 +#define GL_DEPTH_BUFFER_BIT3_QCOM 0x00000800 +#define GL_DEPTH_BUFFER_BIT4_QCOM 0x00001000 +#define GL_DEPTH_BUFFER_BIT5_QCOM 0x00002000 +#define GL_DEPTH_BUFFER_BIT6_QCOM 0x00004000 +#define GL_DEPTH_BUFFER_BIT7_QCOM 0x00008000 +#define GL_STENCIL_BUFFER_BIT0_QCOM 0x00010000 +#define GL_STENCIL_BUFFER_BIT1_QCOM 0x00020000 +#define GL_STENCIL_BUFFER_BIT2_QCOM 0x00040000 +#define GL_STENCIL_BUFFER_BIT3_QCOM 0x00080000 +#define GL_STENCIL_BUFFER_BIT4_QCOM 0x00100000 +#define GL_STENCIL_BUFFER_BIT5_QCOM 0x00200000 +#define GL_STENCIL_BUFFER_BIT6_QCOM 0x00400000 +#define GL_STENCIL_BUFFER_BIT7_QCOM 0x00800000 +#define GL_MULTISAMPLE_BUFFER_BIT0_QCOM 0x01000000 +#define GL_MULTISAMPLE_BUFFER_BIT1_QCOM 0x02000000 +#define GL_MULTISAMPLE_BUFFER_BIT2_QCOM 0x04000000 +#define GL_MULTISAMPLE_BUFFER_BIT3_QCOM 0x08000000 +#define GL_MULTISAMPLE_BUFFER_BIT4_QCOM 0x10000000 +#define GL_MULTISAMPLE_BUFFER_BIT5_QCOM 0x20000000 +#define GL_MULTISAMPLE_BUFFER_BIT6_QCOM 0x40000000 +#define GL_MULTISAMPLE_BUFFER_BIT7_QCOM 0x80000000 +#endif + /*------------------------------------------------------------------------* * End of extension tokens, start of corresponding extension functions *------------------------------------------------------------------------*/ @@ -237,17 +387,6 @@ typedef void* GLeglImageOES; #define GL_OES_compressed_paletted_texture 1 #endif -/* GL_OES_EGL_image */ -#ifndef GL_OES_EGL_image -#define GL_OES_EGL_image 1 -#ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glEGLImageTargetTexture2DOES (GLenum target, GLeglImageOES image); -GL_APICALL void GL_APIENTRY glEGLImageTargetRenderbufferStorageOES (GLenum target, GLeglImageOES image); -#endif -typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETTEXTURE2DOESPROC) (GLenum target, GLeglImageOES image); -typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLeglImageOES image); -#endif - /* GL_OES_depth24 */ #ifndef GL_OES_depth24 #define GL_OES_depth24 1 @@ -263,6 +402,17 @@ typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) (GLenu #define GL_OES_depth_texture 1 #endif +/* GL_OES_EGL_image */ +#ifndef GL_OES_EGL_image +#define GL_OES_EGL_image 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glEGLImageTargetTexture2DOES (GLenum target, GLeglImageOES image); +GL_APICALL void GL_APIENTRY glEGLImageTargetRenderbufferStorageOES (GLenum target, GLeglImageOES image); +#endif +typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETTEXTURE2DOESPROC) (GLenum target, GLeglImageOES image); +typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLeglImageOES image); +#endif + /* GL_OES_element_index_uint */ #ifndef GL_OES_element_index_uint #define GL_OES_element_index_uint 1 @@ -282,11 +432,11 @@ typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) (GLenu #ifndef GL_OES_get_program_binary #define GL_OES_get_program_binary 1 #ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glGetProgramBinaryOES (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary); -GL_APICALL void GL_APIENTRY glProgramBinaryOES (GLuint program, GLenum binaryFormat, const void *binary, GLint length); +GL_APICALL void GL_APIENTRY glGetProgramBinaryOES (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary); +GL_APICALL void GL_APIENTRY glProgramBinaryOES (GLuint program, GLenum binaryFormat, const GLvoid *binary, GLint length); #endif -typedef void (GL_APIENTRYP PFNGLGETPROGRAMBINARYOESPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary); -typedef void (GL_APIENTRYP PFNGLPROGRAMBINARYOESPROC) (GLuint program, GLenum binaryFormat, const void *binary, GLint length); +typedef void (GL_APIENTRYP PFNGLGETPROGRAMBINARYOESPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary); +typedef void (GL_APIENTRYP PFNGLPROGRAMBINARYOESPROC) (GLuint program, GLenum binaryFormat, const GLvoid *binary, GLint length); #endif /* GL_OES_mapbuffer */ @@ -295,11 +445,11 @@ typedef void (GL_APIENTRYP PFNGLPROGRAMBINARYOESPROC) (GLuint program, GLenum bi #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void* GL_APIENTRY glMapBufferOES (GLenum target, GLenum access); GL_APICALL GLboolean GL_APIENTRY glUnmapBufferOES (GLenum target); -GL_APICALL void GL_APIENTRY glGetBufferPointervOES (GLenum target, GLenum pname, void** params); +GL_APICALL void GL_APIENTRY glGetBufferPointervOES (GLenum target, GLenum pname, GLvoid** params); #endif typedef void* (GL_APIENTRYP PFNGLMAPBUFFEROESPROC) (GLenum target, GLenum access); typedef GLboolean (GL_APIENTRYP PFNGLUNMAPBUFFEROESPROC) (GLenum target); -typedef void (GL_APIENTRYP PFNGLGETBUFFERPOINTERVOESPROC) (GLenum target, GLenum pname, void** params); +typedef void (GL_APIENTRYP PFNGLGETBUFFERPOINTERVOESPROC) (GLenum target, GLenum pname, GLvoid** params); #endif /* GL_OES_packed_depth_stencil */ @@ -331,46 +481,61 @@ typedef void (GL_APIENTRYP PFNGLGETBUFFERPOINTERVOESPROC) (GLenum target, GLenum #ifndef GL_OES_texture_3D #define GL_OES_texture_3D 1 #ifdef GL_GLEXT_PROTOTYPES -GL_APICALL void GL_APIENTRY glTexImage3DOES (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void* pixels); -GL_APICALL void GL_APIENTRY glTexSubImage3DOES (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void* pixels); +GL_APICALL void GL_APIENTRY glTexImage3DOES (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels); +GL_APICALL void GL_APIENTRY glTexSubImage3DOES (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* pixels); GL_APICALL void GL_APIENTRY glCopyTexSubImage3DOES (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -GL_APICALL void GL_APIENTRY glCompressedTexImage3DOES (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void* data); -GL_APICALL void GL_APIENTRY glCompressedTexSubImage3DOES (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void* data); +GL_APICALL void GL_APIENTRY glCompressedTexImage3DOES (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data); +GL_APICALL void GL_APIENTRY glCompressedTexSubImage3DOES (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid* data); GL_APICALL void GL_APIENTRY glFramebufferTexture3DOES (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); #endif typedef void (GL_APIENTRYP PFNGLTEXIMAGE3DOESPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels); -typedef void (GL_APIENTRYP PFNGLTEXSUBIMAGE3DOESPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void* pixels); +typedef void (GL_APIENTRYP PFNGLTEXSUBIMAGE3DOESPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* pixels); typedef void (GL_APIENTRYP PFNGLCOPYTEXSUBIMAGE3DOESPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DOESPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void* data); -typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DOESPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void* data); +typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DOESPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data); +typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DOESPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid* data); typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DOES) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); #endif -/* GL_OES_texture_float_linear */ -#ifndef GL_OES_texture_float_linear -#define GL_OES_texture_float_linear 1 -#endif - -/* GL_OES_texture_half_float_linear */ -#ifndef GL_OES_texture_half_float_linear -#define GL_OES_texture_half_float_linear 1 -#endif - /* GL_OES_texture_float */ #ifndef GL_OES_texture_float #define GL_OES_texture_float 1 #endif +/* GL_OES_texture_float_linear */ +#ifndef GL_OES_texture_float_linear +#define GL_OES_texture_float_linear 1 +#endif + /* GL_OES_texture_half_float */ #ifndef GL_OES_texture_half_float #define GL_OES_texture_half_float 1 #endif +/* GL_OES_texture_half_float_linear */ +#ifndef GL_OES_texture_half_float_linear +#define GL_OES_texture_half_float_linear 1 +#endif + /* GL_OES_texture_npot */ #ifndef GL_OES_texture_npot #define GL_OES_texture_npot 1 #endif +/* GL_OES_vertex_array_object */ +#ifndef GL_OES_vertex_array_object +#define GL_OES_vertex_array_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glBindVertexArrayOES (GLuint array); +GL_APICALL void GL_APIENTRY glDeleteVertexArraysOES (GLsizei n, const GLuint *arrays); +GL_APICALL void GL_APIENTRY glGenVertexArraysOES (GLsizei n, GLuint *arrays); +GL_APICALL GLboolean GL_APIENTRY glIsVertexArrayOES (GLuint array); +#endif +typedef void (GL_APIENTRYP PFNGLBINDVERTEXARRAYOESPROC) (GLuint array); +typedef void (GL_APIENTRYP PFNGLDELETEVERTEXARRAYSOESPROC) (GLsizei n, const GLuint *arrays); +typedef void (GL_APIENTRYP PFNGLGENVERTEXARRAYSOESPROC) (GLsizei n, GLuint *arrays); +typedef GLboolean (GL_APIENTRYP PFNGLISVERTEXARRAYOESPROC) (GLuint array); +#endif + /* GL_OES_vertex_half_float */ #ifndef GL_OES_vertex_half_float #define GL_OES_vertex_half_float 1 @@ -381,6 +546,11 @@ typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DOES) (GLenum target, GLenum #define GL_OES_vertex_type_10_10_10_2 1 #endif +/* GL_OES_texture_external */ +#ifndef GL_OES_texture_external +#define GL_OES_texture_external 1 +#endif + /*------------------------------------------------------------------------* * AMD extension functions *------------------------------------------------------------------------*/ @@ -395,20 +565,15 @@ typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DOES) (GLenum target, GLenum #define GL_AMD_compressed_ATC_texture 1 #endif -/* GL_AMD_program_binary_Z400 */ -#ifndef GL_AMD_program_binary_Z400 -#define GL_AMD_program_binary_Z400 1 -#endif - /* AMD_performance_monitor */ #ifndef GL_AMD_performance_monitor #define GL_AMD_performance_monitor 1 #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glGetPerfMonitorGroupsAMD (GLint *numGroups, GLsizei groupsSize, GLuint *groups); GL_APICALL void GL_APIENTRY glGetPerfMonitorCountersAMD (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters); -GL_APICALL void GL_APIENTRY glGetPerfMonitorGroupStringAMD (GLuint group, GLsizei bufSize, GLsizei *length, char *groupString); -GL_APICALL void GL_APIENTRY glGetPerfMonitorCounterStringAMD (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, char *counterString); -GL_APICALL void GL_APIENTRY glGetPerfMonitorCounterInfoAMD (GLuint group, GLuint counter, GLenum pname, void *data); +GL_APICALL void GL_APIENTRY glGetPerfMonitorGroupStringAMD (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString); +GL_APICALL void GL_APIENTRY glGetPerfMonitorCounterStringAMD (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString); +GL_APICALL void GL_APIENTRY glGetPerfMonitorCounterInfoAMD (GLuint group, GLuint counter, GLenum pname, GLvoid *data); GL_APICALL void GL_APIENTRY glGenPerfMonitorsAMD (GLsizei n, GLuint *monitors); GL_APICALL void GL_APIENTRY glDeletePerfMonitorsAMD (GLsizei n, GLuint *monitors); GL_APICALL void GL_APIENTRY glSelectPerfMonitorCountersAMD (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *countersList); @@ -418,9 +583,9 @@ GL_APICALL void GL_APIENTRY glGetPerfMonitorCounterDataAMD (GLuint monitor, GLen #endif typedef void (GL_APIENTRYP PFNGLGETPERFMONITORGROUPSAMDPROC) (GLint *numGroups, GLsizei groupsSize, GLuint *groups); typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERSAMDPROC) (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters); -typedef void (GL_APIENTRYP PFNGLGETPERFMONITORGROUPSTRINGAMDPROC) (GLuint group, GLsizei bufSize, GLsizei *length, char *groupString); -typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC) (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, char *counterString); -typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERINFOAMDPROC) (GLuint group, GLuint counter, GLenum pname, void *data); +typedef void (GL_APIENTRYP PFNGLGETPERFMONITORGROUPSTRINGAMDPROC) (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString); +typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC) (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString); +typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERINFOAMDPROC) (GLuint group, GLuint counter, GLenum pname, GLvoid *data); typedef void (GL_APIENTRYP PFNGLGENPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors); typedef void (GL_APIENTRYP PFNGLDELETEPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors); typedef void (GL_APIENTRYP PFNGLSELECTPERFMONITORCOUNTERSAMDPROC) (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *countersList); @@ -429,39 +594,99 @@ typedef void (GL_APIENTRYP PFNGLENDPERFMONITORAMDPROC) (GLuint monitor); typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERDATAAMDPROC) (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten); #endif +/* GL_AMD_program_binary_Z400 */ +#ifndef GL_AMD_program_binary_Z400 +#define GL_AMD_program_binary_Z400 1 +#endif + /*------------------------------------------------------------------------* * EXT extension functions *------------------------------------------------------------------------*/ +/* GL_EXT_blend_minmax */ +#ifndef GL_EXT_blend_minmax +#define GL_EXT_blend_minmax 1 +#endif + +/* GL_EXT_discard_framebuffer */ +#ifndef GL_EXT_discard_framebuffer +#define GL_EXT_discard_framebuffer 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glDiscardFramebufferEXT (GLenum target, GLsizei numAttachments, const GLenum *attachments); +#endif +typedef void (GL_APIENTRYP PFNGLDISCARDFRAMEBUFFEREXTPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments); +#endif + +#ifndef GL_EXT_multi_draw_arrays +#define GL_EXT_multi_draw_arrays 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glMultiDrawArraysEXT (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount); +GL_APICALL void GL_APIENTRY glMultiDrawElementsEXT (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (GL_APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount); +typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount); +#endif + +/* GL_EXT_read_format_bgra */ +#ifndef GL_EXT_read_format_bgra +#define GL_EXT_read_format_bgra 1 +#endif + /* GL_EXT_texture_filter_anisotropic */ #ifndef GL_EXT_texture_filter_anisotropic #define GL_EXT_texture_filter_anisotropic 1 #endif +/* GL_EXT_texture_format_BGRA8888 */ +#ifndef GL_EXT_texture_format_BGRA8888 +#define GL_EXT_texture_format_BGRA8888 1 +#endif + /* GL_EXT_texture_type_2_10_10_10_REV */ #ifndef GL_EXT_texture_type_2_10_10_10_REV #define GL_EXT_texture_type_2_10_10_10_REV 1 #endif -/* GL_EXT_texture_format_BGRA8888 */ -#ifndef GL_EXT_texture_format_BGRA8888 -#define GL_EXT_texture_format_BGRA8888 1 +/* GL_EXT_texture_compression_dxt1 */ +#ifndef GL_EXT_texture_compression_dxt1 +#define GL_EXT_texture_compression_dxt1 1 #endif /*------------------------------------------------------------------------* * IMG extension functions *------------------------------------------------------------------------*/ +/* GL_IMG_program_binary */ +#ifndef GL_IMG_program_binary +#define GL_IMG_program_binary 1 +#endif + /* GL_IMG_read_format */ #ifndef GL_IMG_read_format #define GL_IMG_read_format 1 #endif +/* GL_IMG_shader_binary */ +#ifndef GL_IMG_shader_binary +#define GL_IMG_shader_binary 1 +#endif + /* GL_IMG_texture_compression_pvrtc */ #ifndef GL_IMG_texture_compression_pvrtc #define GL_IMG_texture_compression_pvrtc 1 #endif +/* GL_IMG_multisampled_render_to_texture */ +#ifndef GL_IMG_multisampled_render_to_texture +#define GL_IMG_multisampled_render_to_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleIMG (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +GL_APICALL void GL_APIENTRY glFramebufferTexture2DMultisampleIMG (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples); +#endif +typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEIMG) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEIMG) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples); +#endif + /*------------------------------------------------------------------------* * NV extension functions *------------------------------------------------------------------------*/ @@ -487,6 +712,22 @@ typedef void (GL_APIENTRYP PFNGLFINISHFENCENVPROC) (GLuint fence); typedef void (GL_APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition); #endif +/* GL_NV_coverage_sample */ +#ifndef GL_NV_coverage_sample +#define GL_NV_coverage_sample 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glCoverageMaskNV (GLboolean mask); +GL_APICALL void GL_APIENTRY glCoverageOperationNV (GLenum operation); +#endif +typedef void (GL_APIENTRYP PFNGLCOVERAGEMASKNVPROC) (GLboolean mask); +typedef void (GL_APIENTRYP PFNGLCOVERAGEOPERATIONNVPROC) (GLenum operation); +#endif + +/* GL_NV_depth_nonlinear */ +#ifndef GL_NV_depth_nonlinear +#define GL_NV_depth_nonlinear 1 +#endif + /*------------------------------------------------------------------------* * QCOM extension functions *------------------------------------------------------------------------*/ @@ -496,21 +737,75 @@ typedef void (GL_APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition) #define GL_QCOM_driver_control 1 #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glGetDriverControlsQCOM (GLint *num, GLsizei size, GLuint *driverControls); -GL_APICALL void GL_APIENTRY glGetDriverControlStringQCOM (GLuint driverControl, GLsizei bufSize, GLsizei *length, char *driverControlString); +GL_APICALL void GL_APIENTRY glGetDriverControlStringQCOM (GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString); GL_APICALL void GL_APIENTRY glEnableDriverControlQCOM (GLuint driverControl); GL_APICALL void GL_APIENTRY glDisableDriverControlQCOM (GLuint driverControl); #endif typedef void (GL_APIENTRYP PFNGLGETDRIVERCONTROLSQCOMPROC) (GLint *num, GLsizei size, GLuint *driverControls); -typedef void (GL_APIENTRYP PFNGLGETDRIVERCONTROLSTRINGQCOMPROC) (GLuint driverControl, GLsizei bufSize, GLsizei *length, char *driverControlString); +typedef void (GL_APIENTRYP PFNGLGETDRIVERCONTROLSTRINGQCOMPROC) (GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString); typedef void (GL_APIENTRYP PFNGLENABLEDRIVERCONTROLQCOMPROC) (GLuint driverControl); typedef void (GL_APIENTRYP PFNGLDISABLEDRIVERCONTROLQCOMPROC) (GLuint driverControl); #endif +/* GL_QCOM_extended_get */ +#ifndef GL_QCOM_extended_get +#define GL_QCOM_extended_get 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glExtGetTexturesQCOM (GLuint *textures, GLint maxTextures, GLint *numTextures); +GL_APICALL void GL_APIENTRY glExtGetBuffersQCOM (GLuint *buffers, GLint maxBuffers, GLint *numBuffers); +GL_APICALL void GL_APIENTRY glExtGetRenderbuffersQCOM (GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers); +GL_APICALL void GL_APIENTRY glExtGetFramebuffersQCOM (GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers); +GL_APICALL void GL_APIENTRY glExtGetTexLevelParameterivQCOM (GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params); +GL_APICALL void GL_APIENTRY glExtTexObjectStateOverrideiQCOM (GLenum target, GLenum pname, GLint param); +GL_APICALL void GL_APIENTRY glExtGetTexSubImageQCOM (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid *texels); +GL_APICALL void GL_APIENTRY glExtGetBufferPointervQCOM (GLenum target, GLvoid **params); +#endif +typedef void (GL_APIENTRYP PFNGLEXTGETTEXTURESQCOMPROC) (GLuint *textures, GLint maxTextures, GLint *numTextures); +typedef void (GL_APIENTRYP PFNGLEXTGETBUFFERSQCOMPROC) (GLuint *buffers, GLint maxBuffers, GLint *numBuffers); +typedef void (GL_APIENTRYP PFNGLEXTGETRENDERBUFFERSQCOMPROC) (GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers); +typedef void (GL_APIENTRYP PFNGLEXTGETFRAMEBUFFERSQCOMPROC) (GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers); +typedef void (GL_APIENTRYP PFNGLEXTGETTEXLEVELPARAMETERIVQCOMPROC) (GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params); +typedef void (GL_APIENTRYP PFNGLEXTTEXOBJECTSTATEOVERRIDEIQCOMPROC) (GLenum target, GLenum pname, GLint param); +typedef void (GL_APIENTRYP PFNGLEXTGETTEXSUBIMAGEQCOMPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid *texels); +typedef void (GL_APIENTRYP PFNGLEXTGETBUFFERPOINTERVQCOMPROC) (GLenum target, GLvoid **params); +#endif + +/* GL_QCOM_extended_get2 */ +#ifndef GL_QCOM_extended_get2 +#define GL_QCOM_extended_get2 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glExtGetShadersQCOM (GLuint *shaders, GLint maxShaders, GLint *numShaders); +GL_APICALL void GL_APIENTRY glExtGetProgramsQCOM (GLuint *programs, GLint maxPrograms, GLint *numPrograms); +GL_APICALL GLboolean GL_APIENTRY glExtIsProgramBinaryQCOM (GLuint program); +GL_APICALL void GL_APIENTRY glExtGetProgramBinarySourceQCOM (GLuint program, GLenum shadertype, GLchar *source, GLint *length); +#endif +typedef void (GL_APIENTRYP PFNGLEXTGETSHADERSQCOMPROC) (GLuint *shaders, GLint maxShaders, GLint *numShaders); +typedef void (GL_APIENTRYP PFNGLEXTGETPROGRAMSQCOMPROC) (GLuint *programs, GLint maxPrograms, GLint *numPrograms); +typedef GLboolean (GL_APIENTRYP PFNGLEXTISPROGRAMBINARYQCOMPROC) (GLuint program); +typedef void (GL_APIENTRYP PFNGLEXTGETPROGRAMBINARYSOURCEQCOMPROC) (GLuint program, GLenum shadertype, GLchar *source, GLint *length); +#endif + /* GL_QCOM_perfmon_global_mode */ #ifndef GL_QCOM_perfmon_global_mode #define GL_QCOM_perfmon_global_mode 1 #endif +/* GL_QCOM_writeonly_rendering */ +#ifndef GL_QCOM_writeonly_rendering +#define GL_QCOM_writeonly_rendering 1 +#endif + +/* GL_QCOM_tiled_rendering */ +#ifndef GL_QCOM_tiled_rendering +#define GL_QCOM_tiled_rendering 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glStartTilingQCOM (GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask); +GL_APICALL void GL_APIENTRY glEndTilingQCOM (GLbitfield preserveMask); +#endif +typedef void (GL_APIENTRYP PFNGLSTARTTILINGQCOMPROC) (GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask); +typedef void (GL_APIENTRYP PFNGLENDTILINGQCOMPROC) (GLbitfield preserveMask); +#endif + #ifdef __cplusplus } #endif diff --git a/opengl/include/GLES2/gl2platform.h b/opengl/include/GLES2/gl2platform.h index 3e9036c162c6..c9fa3c4d64bd 100644 --- a/opengl/include/GLES2/gl2platform.h +++ b/opengl/include/GLES2/gl2platform.h @@ -1,7 +1,7 @@ #ifndef __gl2platform_h_ #define __gl2platform_h_ -/* $Revision: 7173 $ on $Date:: 2009-01-09 11:18:21 -0800 #$ */ +/* $Revision: 10602 $ on $Date:: 2010-03-04 22:35:34 -0800 #$ */ /* * This document is licensed under the SGI Free Software B License Version @@ -9,7 +9,6 @@ */ /* Platform-specific types and definitions for OpenGL ES 2.X gl2.h - * Last modified on 2008/12/19 * * Adopters may modify khrplatform.h and this file to suit their platform. * You are encouraged to submit all modifications to the Khronos group so that @@ -24,6 +23,8 @@ #define GL_APICALL KHRONOS_APICALL #endif +#ifndef GL_APIENTRY #define GL_APIENTRY KHRONOS_APIENTRY +#endif #endif /* __gl2platform_h_ */ diff --git a/opengl/java/android/opengl/GLES10.java b/opengl/java/android/opengl/GLES10.java index db52b821eee6..790acbd3395e 100644 --- a/opengl/java/android/opengl/GLES10.java +++ b/opengl/java/android/opengl/GLES10.java @@ -669,6 +669,22 @@ public class GLES10 { java.nio.IntBuffer params ); +/* + * Copyright (C) 2009 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + // C function const GLubyte * glGetString ( GLenum name ) public static native String glGetString( diff --git a/opengl/java/android/opengl/GLES20.java b/opengl/java/android/opengl/GLES20.java index b8aac0eb0a15..635f811e72f6 100644 --- a/opengl/java/android/opengl/GLES20.java +++ b/opengl/java/android/opengl/GLES20.java @@ -670,6 +670,15 @@ public class GLES20 { int count ); + // C function void glDrawElements ( GLenum mode, GLsizei count, GLenum type, GLint offset ) + + public static native void glDrawElements( + int mode, + int count, + int type, + int offset + ); + // C function void glDrawElements ( GLenum mode, GLsizei count, GLenum type, const GLvoid *indices ) public static native void glDrawElements( @@ -978,6 +987,22 @@ public class GLES20 { java.nio.IntBuffer params ); +/* + * Copyright (C) 2009 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + // C function void glGetProgramInfoLog( GLuint program, GLsizei maxLength, GLsizei * length, // GLchar * infoLog); @@ -1018,6 +1043,22 @@ public class GLES20 { java.nio.IntBuffer params ); +/* + * Copyright (C) 2009 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + // C function void glGetShaderInfoLog( GLuint shader, GLsizei maxLength, GLsizei * length, // GLchar * infoLog); @@ -1064,6 +1105,22 @@ public class GLES20 { byte source ); +/* + * Copyright (C) 2009 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + // C function const GLubyte * glGetString ( GLenum name ) public static native String glGetString( @@ -1316,6 +1373,22 @@ public class GLES20 { int length ); +/* + * Copyright (C) 2009 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + // C function void glShaderSource ( GLuint shader, GLsizei count, const GLchar ** string, const GLint* length ) public static native void glShaderSource( @@ -1814,6 +1887,17 @@ public class GLES20 { java.nio.FloatBuffer values ); + // C function void glVertexAttribPointer ( GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLint offset ) + + public static native void glVertexAttribPointer( + int indx, + int size, + int type, + boolean normalized, + int stride, + int offset + ); + // C function void glVertexAttribPointer ( GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *ptr ) private static native void glVertexAttribPointerBounds( diff --git a/opengl/java/android/opengl/GLSurfaceView.java b/opengl/java/android/opengl/GLSurfaceView.java index f904cdf6babb..41207f77285a 100644 --- a/opengl/java/android/opengl/GLSurfaceView.java +++ b/opengl/java/android/opengl/GLSurfaceView.java @@ -222,7 +222,10 @@ public class GLSurfaceView extends SurfaceView implements SurfaceHolder.Callback // underlying surface is created and destroyed SurfaceHolder holder = getHolder(); holder.addCallback(this); - holder.setFormat(PixelFormat.RGB_565); + // setFormat is done by SurfaceView in SDK 2.3 and newer. Uncomment + // this statement if back-porting to 2.2 or older: + // holder.setFormat(PixelFormat.RGB_565); + // // setType is not needed for SDK 2.0 or newer. Uncomment this // statement if back-porting this code to older SDKs. // holder.setType(SurfaceHolder.SURFACE_TYPE_GPU); @@ -1104,7 +1107,6 @@ public class GLSurfaceView extends SurfaceView implements SurfaceHolder.Callback mRenderer = renderer; } - @Override public void run() { setName("GLThread " + getId()); @@ -1155,6 +1157,7 @@ public class GLSurfaceView extends SurfaceView implements SurfaceHolder.Callback boolean sizeChanged = false; boolean wantRenderNotification = false; boolean doRenderNotification = false; + boolean askedToReleaseEglContext = false; int w = 0; int h = 0; Runnable event = null; @@ -1180,6 +1183,17 @@ public class GLSurfaceView extends SurfaceView implements SurfaceHolder.Callback } } + // Do we need to give up the EGL context? + if (mShouldReleaseEglContext) { + if (LOG_SURFACE) { + Log.i("GLThread", "releasing EGL context because asked to tid=" + getId()); + } + stopEglSurfaceLocked(); + stopEglContextLocked(); + mShouldReleaseEglContext = false; + askedToReleaseEglContext = true; + } + // Have we lost the EGL context? if (lostEglContext) { stopEglSurfaceLocked(); @@ -1229,6 +1243,9 @@ public class GLSurfaceView extends SurfaceView implements SurfaceHolder.Callback } if (doRenderNotification) { + if (LOG_SURFACE) { + Log.i("GLThread", "sending render notification tid=" + getId()); + } wantRenderNotification = false; doRenderNotification = false; mRenderComplete = true; @@ -1236,22 +1253,24 @@ public class GLSurfaceView extends SurfaceView implements SurfaceHolder.Callback } // Ready to draw? - if ((!mPaused) && mHasSurface - && (mWidth > 0) && (mHeight > 0) - && (mRequestRender || (mRenderMode == RENDERMODE_CONTINUOUSLY))) { + if (readyToDraw()) { // If we don't have an EGL context, try to acquire one. - if ((! mHaveEglContext) && sGLThreadManager.tryAcquireEglContextLocked(this)) { - try { - mEglHelper.start(); - } catch (RuntimeException t) { - sGLThreadManager.releaseEglContextLocked(this); - throw t; - } - mHaveEglContext = true; - createEglContext = true; + if (! mHaveEglContext) { + if (askedToReleaseEglContext) { + askedToReleaseEglContext = false; + } else if (sGLThreadManager.tryAcquireEglContextLocked(this)) { + try { + mEglHelper.start(); + } catch (RuntimeException t) { + sGLThreadManager.releaseEglContextLocked(this); + throw t; + } + mHaveEglContext = true; + createEglContext = true; - sGLThreadManager.notifyAll(); + sGLThreadManager.notifyAll(); + } } if (mHaveEglContext && !mHaveEglSurface) { @@ -1266,6 +1285,9 @@ public class GLSurfaceView extends SurfaceView implements SurfaceHolder.Callback w = mWidth; h = mHeight; wantRenderNotification = true; + if (LOG_SURFACE) { + Log.i("GLThread", "noticing that we want render notification tid=" + getId()); + } if (DRAW_TWICE_AFTER_SIZE_CHANGED) { // We keep mRequestRender true so that we draw twice after the size changes. @@ -1285,7 +1307,16 @@ public class GLSurfaceView extends SurfaceView implements SurfaceHolder.Callback // By design, this is the only place in a GLThread thread where we wait(). if (LOG_THREADS) { - Log.i("GLThread", "waiting tid=" + getId()); + Log.i("GLThread", "waiting tid=" + getId() + + " mHaveEglContext: " + mHaveEglContext + + " mHaveEglSurface: " + mHaveEglSurface + + " mPaused: " + mPaused + + " mHasSurface: " + mHasSurface + + " mWaitingForSurface: " + mWaitingForSurface + + " mWidth: " + mWidth + + " mHeight: " + mHeight + + " mRequestRender: " + mRequestRender + + " mRenderMode: " + mRenderMode); } sGLThreadManager.wait(); } @@ -1327,7 +1358,7 @@ public class GLSurfaceView extends SurfaceView implements SurfaceHolder.Callback } if (LOG_RENDERER_DRAW_FRAME) { - Log.w("GLThread", "onDrawFrame"); + Log.w("GLThread", "onDrawFrame tid=" + getId()); } mRenderer.onDrawFrame(gl); if (!mEglHelper.swap()) { @@ -1353,6 +1384,16 @@ public class GLSurfaceView extends SurfaceView implements SurfaceHolder.Callback } } + public boolean ableToDraw() { + return mHaveEglContext && mHaveEglSurface && readyToDraw(); + } + + private boolean readyToDraw() { + return (!mPaused) && mHasSurface + && (mWidth > 0) && (mHeight > 0) + && (mRequestRender || (mRenderMode == RENDERMODE_CONTINUOUSLY)); + } + public void setRenderMode(int renderMode) { if ( !((RENDERMODE_WHEN_DIRTY <= renderMode) && (renderMode <= RENDERMODE_CONTINUOUSLY)) ) { throw new IllegalArgumentException("renderMode"); @@ -1462,9 +1503,10 @@ public class GLSurfaceView extends SurfaceView implements SurfaceHolder.Callback sGLThreadManager.notifyAll(); // Wait for thread to react to resize and render a frame - while (! mExited && !mPaused && !mRenderComplete ) { + while (! mExited && !mPaused && !mRenderComplete + && (mGLThread != null && mGLThread.ableToDraw())) { if (LOG_SURFACE) { - Log.i("Main thread", "onWindowResize waiting for render complete."); + Log.i("Main thread", "onWindowResize waiting for render complete from tid=" + mGLThread.getId()); } try { sGLThreadManager.wait(); @@ -1491,6 +1533,11 @@ public class GLSurfaceView extends SurfaceView implements SurfaceHolder.Callback } } + public void requestReleaseEglContextLocked() { + mShouldReleaseEglContext = true; + sGLThreadManager.notifyAll(); + } + /** * Queue an "event" to be run on the GL rendering thread. * @param r the runnable to be run on the GL rendering thread. @@ -1515,6 +1562,7 @@ public class GLSurfaceView extends SurfaceView implements SurfaceHolder.Callback private boolean mWaitingForSurface; private boolean mHaveEglContext; private boolean mHaveEglSurface; + private boolean mShouldReleaseEglContext; private int mWidth; private int mHeight; private int mRenderMode; @@ -1599,6 +1647,13 @@ public class GLSurfaceView extends SurfaceView implements SurfaceHolder.Callback if (mMultipleGLESContextsAllowed) { return true; } + // Notify the owning thread that it should release the context. + // TODO: implement a fairness policy. Currently + // if the owning thread is drawing continuously it will just + // reacquire the EGL context. + if (mEglOwner != null) { + mEglOwner.requestReleaseEglContextLocked(); + } return false; } diff --git a/opengl/java/android/opengl/GLWallpaperService.java b/opengl/java/android/opengl/GLWallpaperService.java new file mode 100644 index 000000000000..c954fed1b076 --- /dev/null +++ b/opengl/java/android/opengl/GLWallpaperService.java @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2010 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.opengl; + +/** + * reserve this namespace for future use + * (making sure external developers don't use it) + * @hide + */ +class GLWallpaperService { +} diff --git a/opengl/java/com/google/android/gles_jni/GLImpl.java b/opengl/java/com/google/android/gles_jni/GLImpl.java index 30b9325e651e..090c0cb7c1d9 100644 --- a/opengl/java/com/google/android/gles_jni/GLImpl.java +++ b/opengl/java/com/google/android/gles_jni/GLImpl.java @@ -19,7 +19,7 @@ package com.google.android.gles_jni; -import android.app.ActivityThread; +import android.app.AppGlobals; import android.content.pm.ApplicationInfo; import android.content.pm.IPackageManager; import android.os.Build; @@ -65,7 +65,7 @@ public class GLImpl implements GL10, GL10Ext, GL11, GL11Ext, GL11ExtensionPack { private static boolean allowIndirectBuffers(String appName) { boolean result = false; int version = 0; - IPackageManager pm = ActivityThread.getPackageManager(); + IPackageManager pm = AppGlobals.getPackageManager(); try { ApplicationInfo applicationInfo = pm.getApplicationInfo(appName, 0); if (applicationInfo != null) { diff --git a/opengl/libagl/Android.mk b/opengl/libagl/Android.mk index 6cb146c06094..b5c018f46252 100644 --- a/opengl/libagl/Android.mk +++ b/opengl/libagl/Android.mk @@ -6,9 +6,6 @@ LOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS) -# Set to 1 to use gralloc and copybits -LIBAGL_USE_GRALLOC_COPYBITS := 1 - LOCAL_SRC_FILES:= \ egl.cpp \ state.cpp \ @@ -37,6 +34,10 @@ ifeq ($(TARGET_ARCH),arm) LOCAL_CFLAGS += -fstrict-aliasing endif +ifeq ($(ARCH_ARM_HAVE_TLS_REGISTER),true) + LOCAL_CFLAGS += -DHAVE_ARM_TLS_REGISTER +endif + ifneq ($(TARGET_SIMULATOR),true) # we need to access the private Bionic header <bionic_tls.h> # on ARM platforms, we need to mirror the ARCH_ARM_HAVE_TLS_REGISTER @@ -47,13 +48,6 @@ ifneq ($(TARGET_SIMULATOR),true) LOCAL_C_INCLUDES += bionic/libc/private endif -ifeq ($(LIBAGL_USE_GRALLOC_COPYBITS),1) - LOCAL_CFLAGS += -DLIBAGL_USE_GRALLOC_COPYBITS - LOCAL_SRC_FILES += copybit.cpp - LOCAL_SHARED_LIBRARIES += libui -endif - - LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/egl LOCAL_MODULE:= libGLES_android diff --git a/opengl/libagl/TextureObjectManager.cpp b/opengl/libagl/TextureObjectManager.cpp index 255ccac3565b..bbb82fc48a9c 100644 --- a/opengl/libagl/TextureObjectManager.cpp +++ b/opengl/libagl/TextureObjectManager.cpp @@ -55,9 +55,6 @@ void EGLTextureObject::init() memset(crop_rect, 0, sizeof(crop_rect)); generate_mipmap = GL_FALSE; direct = GL_FALSE; -#ifdef LIBAGL_USE_GRALLOC_COPYBITS - try_copybit = false; -#endif // LIBAGL_USE_GRALLOC_COPYBITS buffer = 0; } diff --git a/opengl/libagl/TextureObjectManager.h b/opengl/libagl/TextureObjectManager.h index 279e0406c212..70e3bef6e774 100644 --- a/opengl/libagl/TextureObjectManager.h +++ b/opengl/libagl/TextureObjectManager.h @@ -80,9 +80,6 @@ public: GLint crop_rect[4]; GLint generate_mipmap; GLint direct; -#ifdef LIBAGL_USE_GRALLOC_COPYBITS - bool try_copybit; -#endif // LIBAGL_USE_GRALLOC_COPYBITS android_native_buffer_t* buffer; }; diff --git a/opengl/libagl/array.cpp b/opengl/libagl/array.cpp index 71825c502a03..7fbe9b5f96ae 100644 --- a/opengl/libagl/array.cpp +++ b/opengl/libagl/array.cpp @@ -26,9 +26,6 @@ #include "primitives.h" #include "texture.h" #include "BufferObjectManager.h" -#ifdef LIBAGL_USE_GRALLOC_COPYBITS -#include "copybit.h" -#endif // LIBAGL_USE_GRALLOC_COPYBITS // ---------------------------------------------------------------------------- @@ -688,8 +685,8 @@ static void drawPrimitivesTriangleFanOrStrip(ogles_context_t* c, } while (num); } if (count) { - v0 = c->vc.vBuffer + 2 + num - 2; - v1 = c->vc.vBuffer + 2 + num - 1; + v0 = c->vc.vBuffer + 2 + vcs - 2; + v1 = c->vc.vBuffer + 2 + vcs - 1; if ((winding&2) == 0) { // for strips copy back the two last compiled vertices c->vc.vBuffer[0] = *v0; @@ -707,12 +704,6 @@ void drawPrimitivesTriangleStrip(ogles_context_t* c, void drawPrimitivesTriangleFan(ogles_context_t* c, GLint first, GLsizei count) { -#ifdef LIBAGL_USE_GRALLOC_COPYBITS - if (drawTriangleFanWithCopybit(c, first, count)) { - return; - } -#endif // LIBAGL_USE_GRALLOC_COPYBITS - drawPrimitivesTriangleFanOrStrip(c, first, count, 2); } diff --git a/opengl/libagl/copybit.cpp b/opengl/libagl/copybit.cpp deleted file mode 100644 index 67d1ce70be1a..000000000000 --- a/opengl/libagl/copybit.cpp +++ /dev/null @@ -1,618 +0,0 @@ -/* -** -** Copyright 2009, The Android Open Source Project -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -*/ - -#include <stdlib.h> -#include <stdio.h> - -#include "context.h" -#include "fp.h" -#include "state.h" -#include "matrix.h" -#include "vertex.h" -#include "light.h" -#include "primitives.h" -#include "texture.h" -#include "BufferObjectManager.h" -#include "TextureObjectManager.h" - -#include <hardware/gralloc.h> -#include <hardware/copybit.h> -#include <private/ui/android_natives_priv.h> - -#include <ui/GraphicBuffer.h> -#include <ui/Region.h> -#include <ui/Rect.h> - - -#define DEBUG_COPYBIT false - -// ---------------------------------------------------------------------------- - -namespace android { - -static void textureToCopyBitImage( - const GGLSurface* surface, int32_t opFormat, - android_native_buffer_t* buffer, copybit_image_t* img) -{ - img->w = surface->stride; - img->h = surface->height; - img->format = opFormat; - img->base = surface->data; - img->handle = (native_handle_t *)buffer->handle; -} - -struct clipRectRegion : public copybit_region_t { - clipRectRegion(ogles_context_t* c) - { - scissor_t const* scissor = &c->rasterizer.state.scissor; - r.l = scissor->left; - r.t = scissor->top; - r.r = scissor->right; - r.b = scissor->bottom; - next = iterate; - } -private: - static int iterate(copybit_region_t const * self, copybit_rect_t* rect) { - *rect = static_cast<clipRectRegion const*>(self)->r; - const_cast<copybit_region_t *>(self)->next = iterate_done; - return 1; - } - static int iterate_done(copybit_region_t const *, copybit_rect_t*) { - return 0; - } -public: - copybit_rect_t r; -}; - -static bool supportedCopybitsFormat(int format) { - switch (format) { - case COPYBIT_FORMAT_RGBA_8888: - case COPYBIT_FORMAT_RGBX_8888: - case COPYBIT_FORMAT_RGB_888: - case COPYBIT_FORMAT_RGB_565: - case COPYBIT_FORMAT_BGRA_8888: - case COPYBIT_FORMAT_RGBA_5551: - case COPYBIT_FORMAT_RGBA_4444: - return true; - default: - return false; - } -} - -static bool hasAlpha(int format) { - switch (format) { - case COPYBIT_FORMAT_RGBA_8888: - case COPYBIT_FORMAT_BGRA_8888: - case COPYBIT_FORMAT_RGBA_5551: - case COPYBIT_FORMAT_RGBA_4444: - return true; - default: - return false; - } -} - -static inline int fixedToByte(GGLfixed val) { - return (val - (val >> 8)) >> 8; -} - -/** - * Performs a quick check of the rendering state. If this function returns - * false we cannot use the copybit driver. - */ - -static bool checkContext(ogles_context_t* c) { - - // By convention copybitQuickCheckContext() has already returned true. - // avoid checking the same information again. - - if (c->copybits.blitEngine == NULL) { - LOGD_IF(DEBUG_COPYBIT, "no copybit hal"); - return false; - } - - if (c->rasterizer.state.enables - & (GGL_ENABLE_DEPTH_TEST|GGL_ENABLE_FOG)) { - LOGD_IF(DEBUG_COPYBIT, "depth test and/or fog"); - return false; - } - - // Note: The drawSurfaceBuffer is only set for destination - // surfaces types that are supported by the hardware and - // do not have an alpha channel. So we don't have to re-check that here. - - static const int tmu = 0; - texture_unit_t& u(c->textures.tmu[tmu]); - EGLTextureObject* textureObject = u.texture; - - if (!supportedCopybitsFormat(textureObject->surface.format)) { - LOGD_IF(DEBUG_COPYBIT, "texture format not supported"); - return false; - } - return true; -} - - -static bool copybit(GLint x, GLint y, - GLint w, GLint h, - EGLTextureObject* textureObject, - const GLint* crop_rect, - int transform, - ogles_context_t* c) -{ - status_t err = NO_ERROR; - - // We assume checkContext has already been called and has already - // returned true. - - const GGLSurface& cbSurface = c->rasterizer.state.buffers.color.s; - - y = cbSurface.height - (y + h); - - const GLint Ucr = crop_rect[0]; - const GLint Vcr = crop_rect[1]; - const GLint Wcr = crop_rect[2]; - const GLint Hcr = crop_rect[3]; - - GLint screen_w = w; - GLint screen_h = h; - int32_t dsdx = Wcr << 16; // dsdx = ((Wcr/screen_w)/Wt)*Wt - int32_t dtdy = Hcr << 16; // dtdy = -((Hcr/screen_h)/Ht)*Ht - if (transform & COPYBIT_TRANSFORM_ROT_90) { - swap(screen_w, screen_h); - } - if (dsdx!=screen_w || dtdy!=screen_h) { - // in most cases the divide is not needed - dsdx /= screen_w; - dtdy /= screen_h; - } - dtdy = -dtdy; // see equation of dtdy above - - // copybit doesn't say anything about filtering, so we can't - // discriminate. On msm7k, copybit will always filter. - // the code below handles min/mag filters, we keep it as a reference. - -#ifdef MIN_MAG_FILTER - int32_t texelArea = gglMulx(dtdy, dsdx); - if (texelArea < FIXED_ONE && textureObject->mag_filter != GL_LINEAR) { - // Non-linear filtering on a texture enlargement. - LOGD_IF(DEBUG_COPYBIT, "mag filter is not GL_LINEAR"); - return false; - } - if (texelArea > FIXED_ONE && textureObject->min_filter != GL_LINEAR) { - // Non-linear filtering on an texture shrink. - LOGD_IF(DEBUG_COPYBIT, "min filter is not GL_LINEAR"); - return false; - } -#endif - - const uint32_t enables = c->rasterizer.state.enables; - int planeAlpha = 255; - bool alphaPlaneWorkaround = false; - static const int tmu = 0; - texture_t& tev(c->rasterizer.state.texture[tmu]); - int32_t opFormat = textureObject->surface.format; - const bool srcTextureHasAlpha = hasAlpha(opFormat); - if (!srcTextureHasAlpha) { - planeAlpha = fixedToByte(c->currentColorClamped.a); - } - - const bool cbHasAlpha = hasAlpha(cbSurface.format); - bool blending = false; - if ((enables & GGL_ENABLE_BLENDING) - && !(c->rasterizer.state.blend.src == GL_ONE - && c->rasterizer.state.blend.dst == GL_ZERO)) { - // Blending is OK if it is - // the exact kind of blending that the copybits hardware supports. - // Note: The hardware only supports - // GL_SRC_ALPHA / GL_ONE_MINUS_SRC_ALPHA, - // But the surface flinger uses GL_ONE / GL_ONE_MINUS_SRC_ALPHA. - // We substitute GL_SRC_ALPHA / GL_ONE_MINUS_SRC_ALPHA in that case, - // because the performance is worth it, even if the results are - // not correct. - if (!((c->rasterizer.state.blend.src == GL_SRC_ALPHA - || c->rasterizer.state.blend.src == GL_ONE) - && c->rasterizer.state.blend.dst == GL_ONE_MINUS_SRC_ALPHA - && c->rasterizer.state.blend.alpha_separate == 0)) { - // Incompatible blend mode. - LOGD_IF(DEBUG_COPYBIT, "incompatible blend mode"); - return false; - } - blending = true; - } else { - if (cbHasAlpha) { - // NOTE: the result will be slightly wrong in this case because - // the destination alpha channel will be set to 1.0 instead of - // the iterated alpha value. *shrug*. - } - // disable plane blending and src blending for supported formats - planeAlpha = 255; - if (opFormat == COPYBIT_FORMAT_RGBA_8888) { - opFormat = COPYBIT_FORMAT_RGBX_8888; - } else { - if (srcTextureHasAlpha) { - LOGD_IF(DEBUG_COPYBIT, "texture format requires blending"); - return false; - } - } - } - - switch (tev.env) { - case GGL_REPLACE: - break; - case GGL_MODULATE: - // only cases allowed is: - // RGB source, color={1,1,1,a} -> can be done with GL_REPLACE - // RGBA source, color={1,1,1,1} -> can be done with GL_REPLACE - if (blending) { - if (c->currentColorClamped.r == c->currentColorClamped.a && - c->currentColorClamped.g == c->currentColorClamped.a && - c->currentColorClamped.b == c->currentColorClamped.a) { - // TODO: RGBA source, color={1,1,1,a} / regular-blending - // is equivalent - alphaPlaneWorkaround = true; - break; - } - } - LOGD_IF(DEBUG_COPYBIT, "GGL_MODULATE"); - return false; - default: - // Incompatible texture environment. - LOGD_IF(DEBUG_COPYBIT, "incompatible texture environment"); - return false; - } - - copybit_device_t* copybit = c->copybits.blitEngine; - copybit_image_t src; - textureToCopyBitImage(&textureObject->surface, opFormat, - textureObject->buffer, &src); - copybit_rect_t srect = { Ucr, Vcr + Hcr, Ucr + Wcr, Vcr }; - - /* - * Below we perform extra passes needed to emulate things the h/w - * cannot do. - */ - - const GLfixed minScaleInv = gglDivQ(0x10000, c->copybits.minScale, 16); - const GLfixed maxScaleInv = gglDivQ(0x10000, c->copybits.maxScale, 16); - - sp<GraphicBuffer> tempBitmap; - - if (dsdx < maxScaleInv || dsdx > minScaleInv || - dtdy < maxScaleInv || dtdy > minScaleInv) - { - // The requested scale is out of the range the hardware - // can support. - LOGD_IF(DEBUG_COPYBIT, - "scale out of range dsdx=%08x (Wcr=%d / w=%d), " - "dtdy=%08x (Hcr=%d / h=%d), Ucr=%d, Vcr=%d", - dsdx, Wcr, w, dtdy, Hcr, h, Ucr, Vcr); - - int32_t xscale=0x10000, yscale=0x10000; - if (dsdx > minScaleInv) xscale = c->copybits.minScale; - else if (dsdx < maxScaleInv) xscale = c->copybits.maxScale; - if (dtdy > minScaleInv) yscale = c->copybits.minScale; - else if (dtdy < maxScaleInv) yscale = c->copybits.maxScale; - dsdx = gglMulx(dsdx, xscale); - dtdy = gglMulx(dtdy, yscale); - - /* we handle only one step of resizing below. Handling an arbitrary - * number is relatively easy (replace "if" above by "while"), but requires - * two intermediate buffers and so far we never had the need. - */ - - if (dsdx < maxScaleInv || dsdx > minScaleInv || - dtdy < maxScaleInv || dtdy > minScaleInv) { - LOGD_IF(DEBUG_COPYBIT, - "scale out of range dsdx=%08x (Wcr=%d / w=%d), " - "dtdy=%08x (Hcr=%d / h=%d), Ucr=%d, Vcr=%d", - dsdx, Wcr, w, dtdy, Hcr, h, Ucr, Vcr); - return false; - } - - const int tmp_w = gglMulx(srect.r - srect.l, xscale, 16); - const int tmp_h = gglMulx(srect.b - srect.t, yscale, 16); - - LOGD_IF(DEBUG_COPYBIT, - "xscale=%08x, yscale=%08x, dsdx=%08x, dtdy=%08x, tmp_w=%d, tmp_h=%d", - xscale, yscale, dsdx, dtdy, tmp_w, tmp_h); - - tempBitmap = new GraphicBuffer( - tmp_w, tmp_h, src.format, - GraphicBuffer::USAGE_HW_2D); - - err = tempBitmap->initCheck(); - if (err == NO_ERROR) { - copybit_image_t tmp_dst; - copybit_rect_t tmp_rect; - tmp_dst.w = tmp_w; - tmp_dst.h = tmp_h; - tmp_dst.format = tempBitmap->format; - tmp_dst.handle = (native_handle_t*)tempBitmap->getNativeBuffer()->handle; - tmp_rect.l = 0; - tmp_rect.t = 0; - tmp_rect.r = tmp_dst.w; - tmp_rect.b = tmp_dst.h; - region_iterator tmp_it(Region(Rect(tmp_rect.r, tmp_rect.b))); - copybit->set_parameter(copybit, COPYBIT_TRANSFORM, 0); - copybit->set_parameter(copybit, COPYBIT_PLANE_ALPHA, 0xFF); - copybit->set_parameter(copybit, COPYBIT_DITHER, COPYBIT_DISABLE); - err = copybit->stretch(copybit, - &tmp_dst, &src, &tmp_rect, &srect, &tmp_it); - src = tmp_dst; - srect = tmp_rect; - } - } - - copybit_image_t dst; - textureToCopyBitImage(&cbSurface, cbSurface.format, - c->copybits.drawSurfaceBuffer, &dst); - copybit_rect_t drect = {x, y, x+w, y+h}; - - - /* and now the alpha-plane hack. This handles the "Fade" case of a - * texture with an alpha channel. - */ - if (alphaPlaneWorkaround) { - sp<GraphicBuffer> tempCb = new GraphicBuffer( - w, h, COPYBIT_FORMAT_RGB_565, - GraphicBuffer::USAGE_HW_2D); - - err = tempCb->initCheck(); - - copybit_image_t tmpCbImg; - copybit_rect_t tmpCbRect; - copybit_rect_t tmpdrect = drect; - tmpCbImg.w = w; - tmpCbImg.h = h; - tmpCbImg.format = tempCb->format; - tmpCbImg.handle = (native_handle_t*)tempCb->getNativeBuffer()->handle; - tmpCbRect.l = 0; - tmpCbRect.t = 0; - - if (drect.l < 0) { - tmpCbRect.l = -tmpdrect.l; - tmpdrect.l = 0; - } - if (drect.t < 0) { - tmpCbRect.t = -tmpdrect.t; - tmpdrect.t = 0; - } - if (drect.l + tmpCbImg.w > dst.w) { - tmpCbImg.w = dst.w - drect.l; - tmpdrect.r = dst.w; - } - if (drect.t + tmpCbImg.h > dst.h) { - tmpCbImg.h = dst.h - drect.t; - tmpdrect.b = dst.h; - } - - tmpCbRect.r = tmpCbImg.w; - tmpCbRect.b = tmpCbImg.h; - - if (!err) { - // first make a copy of the destination buffer - region_iterator tmp_it(Region(Rect(w, h))); - copybit->set_parameter(copybit, COPYBIT_TRANSFORM, 0); - copybit->set_parameter(copybit, COPYBIT_PLANE_ALPHA, 0xFF); - copybit->set_parameter(copybit, COPYBIT_DITHER, COPYBIT_DISABLE); - err = copybit->stretch(copybit, - &tmpCbImg, &dst, &tmpCbRect, &tmpdrect, &tmp_it); - } - if (!err) { - // then proceed as usual, but without the alpha plane - copybit->set_parameter(copybit, COPYBIT_TRANSFORM, transform); - copybit->set_parameter(copybit, COPYBIT_PLANE_ALPHA, 0xFF); - copybit->set_parameter(copybit, COPYBIT_DITHER, - (enables & GGL_ENABLE_DITHER) ? - COPYBIT_ENABLE : COPYBIT_DISABLE); - clipRectRegion it(c); - err = copybit->stretch(copybit, &dst, &src, &drect, &srect, &it); - } - if (!err) { - // finally copy back the destination on top with 1-alphaplane - int invPlaneAlpha = 0xFF - fixedToByte(c->currentColorClamped.a); - clipRectRegion it(c); - copybit->set_parameter(copybit, COPYBIT_TRANSFORM, 0); - copybit->set_parameter(copybit, COPYBIT_PLANE_ALPHA, invPlaneAlpha); - copybit->set_parameter(copybit, COPYBIT_DITHER, COPYBIT_ENABLE); - err = copybit->stretch(copybit, - &dst, &tmpCbImg, &tmpdrect, &tmpCbRect, &it); - } - } else { - copybit->set_parameter(copybit, COPYBIT_TRANSFORM, transform); - copybit->set_parameter(copybit, COPYBIT_PLANE_ALPHA, planeAlpha); - copybit->set_parameter(copybit, COPYBIT_DITHER, - (enables & GGL_ENABLE_DITHER) ? - COPYBIT_ENABLE : COPYBIT_DISABLE); - clipRectRegion it(c); - - LOGD_IF(0, - "dst={%d, %d, %d, %p, %p}, " - "src={%d, %d, %d, %p, %p}, " - "drect={%d,%d,%d,%d}, " - "srect={%d,%d,%d,%d}, " - "it={%d,%d,%d,%d}, " , - dst.w, dst.h, dst.format, dst.base, dst.handle, - src.w, src.h, src.format, src.base, src.handle, - drect.l, drect.t, drect.r, drect.b, - srect.l, srect.t, srect.r, srect.b, - it.r.l, it.r.t, it.r.r, it.r.b - ); - - err = copybit->stretch(copybit, &dst, &src, &drect, &srect, &it); - } - if (err != NO_ERROR) { - c->textures.tmu[0].texture->try_copybit = false; - } - return err == NO_ERROR ? true : false; -} - -/* - * Try to draw a triangle fan with copybit, return false if we fail. - */ -bool drawTriangleFanWithCopybit_impl(ogles_context_t* c, GLint first, GLsizei count) -{ - if (!checkContext(c)) { - return false; - } - - // FIXME: we should handle culling here - c->arrays.compileElements(c, c->vc.vBuffer, 0, 4); - - // we detect if we're dealing with a rectangle, by comparing the - // rectangles {v0,v2} and {v1,v3} which should be identical. - - // NOTE: we should check that the rectangle is window aligned, however - // if we do that, the optimization won't be taken in a lot of cases. - // Since this code is intended to be used with SurfaceFlinger only, - // so it's okay... - - const vec4_t& v0 = c->vc.vBuffer[0].window; - const vec4_t& v1 = c->vc.vBuffer[1].window; - const vec4_t& v2 = c->vc.vBuffer[2].window; - const vec4_t& v3 = c->vc.vBuffer[3].window; - int l = min(v0.x, v2.x); - int b = min(v0.y, v2.y); - int r = max(v0.x, v2.x); - int t = max(v0.y, v2.y); - if ((l != min(v1.x, v3.x)) || (b != min(v1.y, v3.y)) || - (r != max(v1.x, v3.x)) || (t != max(v1.y, v3.y))) { - LOGD_IF(DEBUG_COPYBIT, "geometry not a rectangle"); - return false; - } - - // fetch and transform texture coordinates - // NOTE: maybe it would be better to have a "compileElementsAll" method - // that would ensure all vertex data are fetched and transformed - const transform_t& tr = c->transforms.texture[0].transform; - for (size_t i=0 ; i<4 ; i++) { - const GLubyte* tp = c->arrays.texture[0].element(i); - vertex_t* const v = &c->vc.vBuffer[i]; - c->arrays.texture[0].fetch(c, v->texture[0].v, tp); - // FIXME: we should bail if q!=1 - c->arrays.tex_transform[0](&tr, &v->texture[0], &v->texture[0]); - } - - const vec4_t& t0 = c->vc.vBuffer[0].texture[0]; - const vec4_t& t1 = c->vc.vBuffer[1].texture[0]; - const vec4_t& t2 = c->vc.vBuffer[2].texture[0]; - const vec4_t& t3 = c->vc.vBuffer[3].texture[0]; - int txl = min(t0.x, t2.x); - int txb = min(t0.y, t2.y); - int txr = max(t0.x, t2.x); - int txt = max(t0.y, t2.y); - if ((txl != min(t1.x, t3.x)) || (txb != min(t1.y, t3.y)) || - (txr != max(t1.x, t3.x)) || (txt != max(t1.y, t3.y))) { - LOGD_IF(DEBUG_COPYBIT, "texcoord not a rectangle"); - return false; - } - if ((txl != 0) || (txb != 0) || - (txr != FIXED_ONE) || (txt != FIXED_ONE)) { - // we could probably handle this case, if we wanted to - LOGD_IF(DEBUG_COPYBIT, "texture is cropped: %08x,%08x,%08x,%08x", - txl, txb, txr, txt); - return false; - } - - // at this point, we know we are dealing with a rectangle, so we - // only need to consider 3 vertices for computing the jacobians - - const int dx01 = v1.x - v0.x; - const int dx02 = v2.x - v0.x; - const int dy01 = v1.y - v0.y; - const int dy02 = v2.y - v0.y; - const int ds01 = t1.S - t0.S; - const int ds02 = t2.S - t0.S; - const int dt01 = t1.T - t0.T; - const int dt02 = t2.T - t0.T; - const int area = dx01*dy02 - dy01*dx02; - int dsdx, dsdy, dtdx, dtdy; - if (area >= 0) { - dsdx = ds01*dy02 - ds02*dy01; - dtdx = dt01*dy02 - dt02*dy01; - dsdy = ds02*dx01 - ds01*dx02; - dtdy = dt02*dx01 - dt01*dx02; - } else { - dsdx = ds02*dy01 - ds01*dy02; - dtdx = dt02*dy01 - dt01*dy02; - dsdy = ds01*dx02 - ds02*dx01; - dtdy = dt01*dx02 - dt02*dx01; - } - - // here we rely on the fact that we know the transform is - // a rigid-body transform AND that it can only rotate in 90 degrees - // increments - - int transform = 0; - if (dsdx == 0) { - // 90 deg rotation case - // [ 0 dtdx ] - // [ dsdx 0 ] - transform |= COPYBIT_TRANSFORM_ROT_90; - // FIXME: not sure if FLIP_H and FLIP_V shouldn't be inverted - if (dtdx > 0) - transform |= COPYBIT_TRANSFORM_FLIP_H; - if (dsdy < 0) - transform |= COPYBIT_TRANSFORM_FLIP_V; - } else { - // [ dsdx 0 ] - // [ 0 dtdy ] - if (dsdx < 0) - transform |= COPYBIT_TRANSFORM_FLIP_H; - if (dtdy < 0) - transform |= COPYBIT_TRANSFORM_FLIP_V; - } - - //LOGD("l=%d, b=%d, w=%d, h=%d, tr=%d", x, y, w, h, transform); - //LOGD("A=%f\tB=%f\nC=%f\tD=%f", - // dsdx/65536.0, dtdx/65536.0, dsdy/65536.0, dtdy/65536.0); - - int x = l >> 4; - int y = b >> 4; - int w = (r-l) >> 4; - int h = (t-b) >> 4; - texture_unit_t& u(c->textures.tmu[0]); - EGLTextureObject* textureObject = u.texture; - GLint tWidth = textureObject->surface.width; - GLint tHeight = textureObject->surface.height; - GLint crop_rect[4] = {0, tHeight, tWidth, -tHeight}; - const GGLSurface& cbSurface = c->rasterizer.state.buffers.color.s; - y = cbSurface.height - (y + h); - return copybit(x, y, w, h, textureObject, crop_rect, transform, c); -} - -/* - * Try to drawTexiOESWithCopybit, return false if we fail. - */ - -bool drawTexiOESWithCopybit_impl(GLint x, GLint y, GLint z, - GLint w, GLint h, ogles_context_t* c) -{ - // quickly process empty rects - if ((w|h) <= 0) { - return true; - } - if (!checkContext(c)) { - return false; - } - texture_unit_t& u(c->textures.tmu[0]); - EGLTextureObject* textureObject = u.texture; - return copybit(x, y, w, h, textureObject, textureObject->crop_rect, 0, c); -} - -} // namespace android - diff --git a/opengl/libagl/copybit.h b/opengl/libagl/copybit.h deleted file mode 100644 index b8b5afda2656..000000000000 --- a/opengl/libagl/copybit.h +++ /dev/null @@ -1,75 +0,0 @@ -/* -** -** Copyright 2009, The Android Open Source Project -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -*/ - -#ifndef ANDROID_OPENGLES_COPYBIT_H -#define ANDROID_OPENGLES_COPYBIT_H - -#include <stdlib.h> - -#include <GLES/gl.h> - -#include "TextureObjectManager.h" -namespace android { -#ifdef LIBAGL_USE_GRALLOC_COPYBITS - -bool drawTexiOESWithCopybit_impl(GLint x, GLint y, GLint z, - GLint w, GLint h, ogles_context_t* c); - -bool drawTriangleFanWithCopybit_impl(ogles_context_t* c, GLint first, - GLsizei count); - -inline bool copybitQuickCheckContext(ogles_context_t* c) { - return c->copybits.drawSurfaceBuffer != 0 - && c->rasterizer.state.enabled_tmu == 1 - && c->textures.tmu[0].texture->try_copybit; -} - -/* - * Tries to draw a drawTexiOES using copybit hardware. - * Returns true if successful. - */ -inline bool drawTexiOESWithCopybit(GLint x, GLint y, GLint z, - GLint w, GLint h, ogles_context_t* c) { - if (!copybitQuickCheckContext(c)) { - return false; - } - - return drawTexiOESWithCopybit_impl(x, y, z, w, h, c); -} - -/* - * Tries to draw a triangle fan using copybit hardware. - * Returns true if successful. - */ -inline bool drawTriangleFanWithCopybit(ogles_context_t* c, GLint first, - GLsizei count) { - /* - * We are looking for the glDrawArrays call made by SurfaceFlinger. - */ - - if ((count!=4) || first || !copybitQuickCheckContext(c)) - return false; - - return drawTriangleFanWithCopybit_impl(c, first, count); -} - - -#endif // LIBAGL_USE_GRALLOC_COPYBITS - -} // namespace android - -#endif // ANDROID_OPENGLES_COPYBIT_H diff --git a/opengl/libagl/egl.cpp b/opengl/libagl/egl.cpp index b6e0aae74ee8..163b2dbcd3a4 100644 --- a/opengl/libagl/egl.cpp +++ b/opengl/libagl/egl.cpp @@ -158,7 +158,6 @@ struct egl_surface_t virtual EGLint getSwapBehavior() const; virtual EGLBoolean swapBuffers(); virtual EGLBoolean setSwapRectangle(EGLint l, EGLint t, EGLint w, EGLint h); - virtual EGLClientBuffer getRenderBuffer() const; protected: GGLSurface depth; }; @@ -202,9 +201,6 @@ EGLBoolean egl_surface_t::setSwapRectangle( { return EGL_FALSE; } -EGLClientBuffer egl_surface_t::getRenderBuffer() const { - return 0; -} // ---------------------------------------------------------------------------- @@ -213,7 +209,7 @@ struct egl_window_surface_v2_t : public egl_surface_t egl_window_surface_v2_t( EGLDisplay dpy, EGLConfig config, int32_t depthFormat, - android_native_window_t* window); + ANativeWindow* window); ~egl_window_surface_v2_t(); @@ -230,12 +226,11 @@ struct egl_window_surface_v2_t : public egl_surface_t virtual EGLint getRefreshRate() const; virtual EGLint getSwapBehavior() const; virtual EGLBoolean setSwapRectangle(EGLint l, EGLint t, EGLint w, EGLint h); - virtual EGLClientBuffer getRenderBuffer() const; private: status_t lock(android_native_buffer_t* buf, int usage, void** vaddr); status_t unlock(android_native_buffer_t* buf); - android_native_window_t* nativeWindow; + ANativeWindow* nativeWindow; android_native_buffer_t* buffer; android_native_buffer_t* previousBuffer; gralloc_module_t const* module; @@ -355,7 +350,7 @@ private: egl_window_surface_v2_t::egl_window_surface_v2_t(EGLDisplay dpy, EGLConfig config, int32_t depthFormat, - android_native_window_t* window) + ANativeWindow* window) : egl_surface_t(dpy, config, depthFormat), nativeWindow(window), buffer(0), previousBuffer(0), module(0), blitengine(0), bits(NULL) @@ -576,41 +571,44 @@ EGLBoolean egl_window_surface_v2_t::swapBuffers() buffer = 0; // dequeue a new buffer - nativeWindow->dequeueBuffer(nativeWindow, &buffer); - - // TODO: lockBuffer should rather be executed when the very first - // direct rendering occurs. - nativeWindow->lockBuffer(nativeWindow, buffer); - - // reallocate the depth-buffer if needed - if ((width != buffer->width) || (height != buffer->height)) { - // TODO: we probably should reset the swap rect here - // if the window size has changed - width = buffer->width; - height = buffer->height; - if (depth.data) { - free(depth.data); - depth.width = width; - depth.height = height; - depth.stride = buffer->stride; - depth.data = (GGLubyte*)malloc(depth.stride*depth.height*2); - if (depth.data == 0) { - setError(EGL_BAD_ALLOC, EGL_FALSE); - return EGL_FALSE; + if (nativeWindow->dequeueBuffer(nativeWindow, &buffer) == NO_ERROR) { + + // TODO: lockBuffer should rather be executed when the very first + // direct rendering occurs. + nativeWindow->lockBuffer(nativeWindow, buffer); + + // reallocate the depth-buffer if needed + if ((width != buffer->width) || (height != buffer->height)) { + // TODO: we probably should reset the swap rect here + // if the window size has changed + width = buffer->width; + height = buffer->height; + if (depth.data) { + free(depth.data); + depth.width = width; + depth.height = height; + depth.stride = buffer->stride; + depth.data = (GGLubyte*)malloc(depth.stride*depth.height*2); + if (depth.data == 0) { + setError(EGL_BAD_ALLOC, EGL_FALSE); + return EGL_FALSE; + } } } - } - - // keep a reference on the buffer - buffer->common.incRef(&buffer->common); - // finally pin the buffer down - if (lock(buffer, GRALLOC_USAGE_SW_READ_OFTEN | - GRALLOC_USAGE_SW_WRITE_OFTEN, &bits) != NO_ERROR) { - LOGE("eglSwapBuffers() failed to lock buffer %p (%ux%u)", - buffer, buffer->width, buffer->height); - return setError(EGL_BAD_ACCESS, EGL_FALSE); - // FIXME: we should make sure we're not accessing the buffer anymore + // keep a reference on the buffer + buffer->common.incRef(&buffer->common); + + // finally pin the buffer down + if (lock(buffer, GRALLOC_USAGE_SW_READ_OFTEN | + GRALLOC_USAGE_SW_WRITE_OFTEN, &bits) != NO_ERROR) { + LOGE("eglSwapBuffers() failed to lock buffer %p (%ux%u)", + buffer, buffer->width, buffer->height); + return setError(EGL_BAD_ACCESS, EGL_FALSE); + // FIXME: we should make sure we're not accessing the buffer anymore + } + } else { + return setError(EGL_BAD_CURRENT_SURFACE, EGL_FALSE); } return EGL_TRUE; @@ -623,28 +621,6 @@ EGLBoolean egl_window_surface_v2_t::setSwapRectangle( return EGL_TRUE; } -EGLClientBuffer egl_window_surface_v2_t::getRenderBuffer() const -{ - return buffer; -} - -#ifdef LIBAGL_USE_GRALLOC_COPYBITS - -static bool supportedCopybitsDestinationFormat(int format) { - // Hardware supported - switch (format) { - case HAL_PIXEL_FORMAT_RGB_565: - case HAL_PIXEL_FORMAT_RGBA_8888: - case HAL_PIXEL_FORMAT_RGBX_8888: - case HAL_PIXEL_FORMAT_RGBA_4444: - case HAL_PIXEL_FORMAT_RGBA_5551: - case HAL_PIXEL_FORMAT_BGRA_8888: - return true; - } - return false; -} -#endif - EGLBoolean egl_window_surface_v2_t::bindDrawSurface(ogles_context_t* gl) { GGLSurface buffer; @@ -658,18 +634,6 @@ EGLBoolean egl_window_surface_v2_t::bindDrawSurface(ogles_context_t* gl) if (depth.data != gl->rasterizer.state.buffers.depth.data) gl->rasterizer.procs.depthBuffer(gl, &depth); -#ifdef LIBAGL_USE_GRALLOC_COPYBITS - gl->copybits.drawSurfaceBuffer = 0; - if (gl->copybits.blitEngine != NULL) { - if (supportedCopybitsDestinationFormat(buffer.format)) { - buffer_handle_t handle = this->buffer->handle; - if (handle != NULL) { - gl->copybits.drawSurfaceBuffer = this->buffer; - } - } - } -#endif // LIBAGL_USE_GRALLOC_COPYBITS - return EGL_TRUE; } EGLBoolean egl_window_surface_v2_t::bindReadSurface(ogles_context_t* gl) @@ -883,7 +847,6 @@ static char const * const gExtensionsString = // "KHR_image_pixmap " "EGL_ANDROID_image_native_buffer " "EGL_ANDROID_swap_rectangle " - "EGL_ANDROID_get_render_buffer " ; // ---------------------------------------------------------------------------- @@ -936,8 +899,6 @@ static const extention_map_t gExtentionMap[] = { (__eglMustCastToProperFunctionPointerType)&eglDestroyImageKHR }, { "eglSetSwapRectangleANDROID", (__eglMustCastToProperFunctionPointerType)&eglSetSwapRectangleANDROID }, - { "eglGetRenderBufferANDROID", - (__eglMustCastToProperFunctionPointerType)&eglGetRenderBufferANDROID }, }; /* @@ -1300,7 +1261,7 @@ static EGLSurface createWindowSurface(EGLDisplay dpy, EGLConfig config, if (!(surfaceType & EGL_WINDOW_BIT)) return setError(EGL_BAD_MATCH, EGL_NO_SURFACE); - if (static_cast<android_native_window_t*>(window)->common.magic != + if (static_cast<ANativeWindow*>(window)->common.magic != ANDROID_NATIVE_WINDOW_MAGIC) { return setError(EGL_BAD_NATIVE_WINDOW, EGL_NO_SURFACE); } @@ -1323,7 +1284,7 @@ static EGLSurface createWindowSurface(EGLDisplay dpy, EGLConfig config, egl_surface_t* surface; surface = new egl_window_surface_v2_t(dpy, config, depthFormat, - static_cast<android_native_window_t*>(window)); + static_cast<ANativeWindow*>(window)); if (!surface->initCheck()) { // there was a problem in the ctor, the error @@ -1525,8 +1486,13 @@ EGLBoolean eglChooseConfig( EGLDisplay dpy, const EGLint *attrib_list, } if (ggl_unlikely(attrib_list==0)) { - *num_config = 0; - return EGL_TRUE; + /* + * A NULL attrib_list should be treated as though it was an empty + * one (terminated with EGL_NONE) as defined in + * section 3.4.1 "Querying Configurations" in the EGL specification. + */ + static const EGLint dummy = EGL_NONE; + attrib_list = &dummy; } int numAttributes = 0; @@ -2150,18 +2116,3 @@ EGLBoolean eglSetSwapRectangleANDROID(EGLDisplay dpy, EGLSurface draw, return EGL_TRUE; } - -EGLClientBuffer eglGetRenderBufferANDROID(EGLDisplay dpy, EGLSurface draw) -{ - if (egl_display_t::is_valid(dpy) == EGL_FALSE) - return setError(EGL_BAD_DISPLAY, (EGLClientBuffer)0); - - egl_surface_t* d = static_cast<egl_surface_t*>(draw); - if (!d->isValid()) - return setError(EGL_BAD_SURFACE, (EGLClientBuffer)0); - if (d->dpy != dpy) - return setError(EGL_BAD_DISPLAY, (EGLClientBuffer)0); - - // post the surface - return d->getRenderBuffer(); -} diff --git a/opengl/libagl/state.cpp b/opengl/libagl/state.cpp index 27bb5454fd57..a0f720a0d19b 100644 --- a/opengl/libagl/state.cpp +++ b/opengl/libagl/state.cpp @@ -28,10 +28,6 @@ #include "BufferObjectManager.h" #include "TextureObjectManager.h" -#ifdef LIBAGL_USE_GRALLOC_COPYBITS -#include <hardware/copybit.h> -#endif // LIBAGL_USE_GRALLOC_COPYBITS - namespace android { // ---------------------------------------------------------------------------- @@ -101,35 +97,6 @@ ogles_context_t *ogles_init(size_t extra) // OpenGL enables dithering by default c->rasterizer.procs.enable(c, GL_DITHER); - c->copybits.blitEngine = NULL; - c->copybits.minScale = 0; - c->copybits.maxScale = 0; - c->copybits.drawSurfaceBuffer = 0; - -#ifdef LIBAGL_USE_GRALLOC_COPYBITS - hw_module_t const* module; - if (hw_get_module(COPYBIT_HARDWARE_MODULE_ID, &module) == 0) { - struct copybit_device_t* copyBits; - if (copybit_open(module, ©Bits) == 0) { - c->copybits.blitEngine = copyBits; - { - int minLim = copyBits->get(copyBits, - COPYBIT_MINIFICATION_LIMIT); - if (minLim != -EINVAL && minLim > 0) { - c->copybits.minScale = (1 << 16) / minLim; - } - } - { - int magLim = copyBits->get(copyBits, - COPYBIT_MAGNIFICATION_LIMIT); - if (magLim != -EINVAL && magLim > 0) { - c->copybits.maxScale = min(32*1024-1, magLim) << 16; - } - } - } - } -#endif // LIBAGL_USE_GRALLOC_COPYBITS - return c; } @@ -144,11 +111,6 @@ void ogles_uninit(ogles_context_t* c) c->bufferObjectManager->decStrong(c); ggl_uninit_context(&(c->rasterizer)); free(c->rasterizer.base); -#ifdef LIBAGL_USE_GRALLOC_COPYBITS - if (c->copybits.blitEngine != NULL) { - copybit_close((struct copybit_device_t*) c->copybits.blitEngine); - } -#endif // LIBAGL_USE_GRALLOC_COPYBITS } void _ogles_error(ogles_context_t* c, GLenum error) diff --git a/opengl/libagl/texture.cpp b/opengl/libagl/texture.cpp index 9407bd55305e..eb9689551fec 100644 --- a/opengl/libagl/texture.cpp +++ b/opengl/libagl/texture.cpp @@ -26,10 +26,6 @@ #include <private/ui/android_natives_priv.h> #include <ETC1/etc1.h> -#ifdef LIBAGL_USE_GRALLOC_COPYBITS -#include "copybit.h" -#endif // LIBAGL_USE_GRALLOC_COPYBITS - namespace android { // ---------------------------------------------------------------------------- @@ -763,17 +759,10 @@ static void drawTexxOESImp(GLfixed x, GLfixed y, GLfixed z, GLfixed w, GLfixed h static void drawTexxOES(GLfixed x, GLfixed y, GLfixed z, GLfixed w, GLfixed h, ogles_context_t* c) { -#ifdef LIBAGL_USE_GRALLOC_COPYBITS - if (drawTexiOESWithCopybit(gglFixedToIntRound(x), - gglFixedToIntRound(y), gglFixedToIntRound(z), - gglFixedToIntRound(w), gglFixedToIntRound(h), c)) { - return; - } -#else // quickly reject empty rects if ((w|h) <= 0) return; -#endif + drawTexxOESImp(x, y, z, w, h, c); } @@ -785,11 +774,6 @@ static void drawTexiOES(GLint x, GLint y, GLint z, GLint w, GLint h, ogles_conte // which is a lot faster. if (ggl_likely(c->rasterizer.state.enabled_tmu == 1)) { -#ifdef LIBAGL_USE_GRALLOC_COPYBITS - if (drawTexiOESWithCopybit(x, y, z, w, h, c)) { - return; - } -#endif const int tmu = 0; texture_unit_t& u(c->textures.tmu[tmu]); EGLTextureObject* textureObject = u.texture; @@ -797,9 +781,7 @@ static void drawTexiOES(GLint x, GLint y, GLint z, GLint w, GLint h, ogles_conte const GLint Hcr = textureObject->crop_rect[3]; if ((w == Wcr) && (h == -Hcr)) { -#ifndef LIBAGL_USE_GRALLOC_COPYBITS if ((w|h) <= 0) return; // quickly reject empty rects -#endif if (u.dirty) { c->rasterizer.procs.activeTexture(c, tmu); @@ -1515,7 +1497,7 @@ void glReadPixels( ogles_error(c, GL_INVALID_VALUE); return; } - if (x<0 || x<0) { + if (x<0 || y<0) { ogles_error(c, GL_INVALID_VALUE); return; } @@ -1646,13 +1628,6 @@ void glEGLImageTargetTexture2DOES(GLenum target, GLeglImageOES image) // bind it to the texture unit sp<EGLTextureObject> tex = getAndBindActiveTextureObject(c); tex->setImage(native_buffer); - -#ifdef LIBAGL_USE_GRALLOC_COPYBITS - tex->try_copybit = false; - if (c->copybits.blitEngine != NULL) { - tex->try_copybit = true; - } -#endif // LIBAGL_USE_GRALLOC_COPYBITS } void glEGLImageTargetRenderbufferStorageOES(GLenum target, GLeglImageOES image) diff --git a/opengl/libs/Android.mk b/opengl/libs/Android.mk index 6b7020ff0a62..ae924cd6e5ba 100644 --- a/opengl/libs/Android.mk +++ b/opengl/libs/Android.mk @@ -6,10 +6,11 @@ LOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS) -LOCAL_SRC_FILES:= \ - EGL/egl.cpp \ - EGL/hooks.cpp \ - EGL/Loader.cpp \ +LOCAL_SRC_FILES:= \ + EGL/egl.cpp \ + EGL/getProcAddress.cpp.arm \ + EGL/hooks.cpp \ + EGL/Loader.cpp \ # LOCAL_SHARED_LIBRARIES += libcutils libutils diff --git a/opengl/libs/EGL/egl.cpp b/opengl/libs/EGL/egl.cpp index 89b3e1f2abca..df21358dc784 100644 --- a/opengl/libs/EGL/egl.cpp +++ b/opengl/libs/EGL/egl.cpp @@ -37,12 +37,13 @@ #include <cutils/memory.h> #include <utils/SortedVector.h> +#include <utils/KeyedVector.h> +#include <utils/String8.h> #include "hooks.h" #include "egl_impl.h" #include "Loader.h" -#define MAKE_CONFIG(_impl, _index) ((EGLConfig)(((_impl)<<24) | (_index))) #define setError(_e, _r) setErrorEtc(__FUNCTION__, __LINE__, _e, _r) // ---------------------------------------------------------------------------- @@ -60,7 +61,6 @@ static char const * const gExtensionString = "EGL_KHR_image_pixmap " "EGL_ANDROID_image_native_buffer " "EGL_ANDROID_swap_rectangle " - "EGL_ANDROID_get_render_buffer " ; // ---------------------------------------------------------------------------- @@ -143,6 +143,22 @@ public: SortedVector<egl_object_t*> egl_object_t::sObjects; Mutex egl_object_t::sLock; + +struct egl_config_t { + egl_config_t() {} + egl_config_t(int impl, EGLConfig config) + : impl(impl), config(config), configId(0), implConfigId(0) { } + int impl; // the implementation this config is for + EGLConfig config; // the implementation's EGLConfig + EGLint configId; // our CONFIG_ID + EGLint implConfigId; // the implementation's CONFIG_ID + inline bool operator < (const egl_config_t& rhs) const { + if (impl < rhs.impl) return true; + if (impl > rhs.impl) return false; + return config < rhs.config; + } +}; + struct egl_display_t { enum { NOT_INITIALIZED, INITIALIZED, TERMINATED }; @@ -163,13 +179,14 @@ struct egl_display_t { strings_t queryString; }; - uint32_t magic; - DisplayImpl disp[IMPL_NUM_IMPLEMENTATIONS]; - EGLint numTotalConfigs; - uint32_t refs; - Mutex lock; + uint32_t magic; + DisplayImpl disp[IMPL_NUM_IMPLEMENTATIONS]; + EGLint numTotalConfigs; + egl_config_t* configs; + uint32_t refs; + Mutex lock; - egl_display_t() : magic('_dpy'), numTotalConfigs(0) { } + egl_display_t() : magic('_dpy'), numTotalConfigs(0), configs(0) { } ~egl_display_t() { magic = 0; } inline bool isValid() const { return magic == '_dpy'; } inline bool isAlive() const { return isValid(); } @@ -179,14 +196,15 @@ struct egl_surface_t : public egl_object_t { typedef egl_object_t::LocalRef<egl_surface_t, EGLSurface> Ref; - egl_surface_t(EGLDisplay dpy, EGLSurface surface, + egl_surface_t(EGLDisplay dpy, EGLSurface surface, EGLConfig config, int impl, egl_connection_t const* cnx) - : dpy(dpy), surface(surface), impl(impl), cnx(cnx) { + : dpy(dpy), surface(surface), config(config), impl(impl), cnx(cnx) { } ~egl_surface_t() { } EGLDisplay dpy; EGLSurface surface; + EGLConfig config; int impl; egl_connection_t const* cnx; }; @@ -195,7 +213,7 @@ struct egl_context_t : public egl_object_t { typedef egl_object_t::LocalRef<egl_context_t, EGLContext> Ref; - egl_context_t(EGLDisplay dpy, EGLContext context, + egl_context_t(EGLDisplay dpy, EGLContext context, EGLConfig config, int impl, egl_connection_t const* cnx, int version) : dpy(dpy), context(context), read(0), draw(0), impl(impl), cnx(cnx), version(version) @@ -203,6 +221,7 @@ struct egl_context_t : public egl_object_t } EGLDisplay dpy; EGLContext context; + EGLConfig config; EGLSurface read; EGLSurface draw; int impl; @@ -220,7 +239,7 @@ struct egl_image_t : public egl_object_t memset(images, 0, sizeof(images)); } EGLDisplay dpy; - EGLConfig context; + EGLContext context; EGLImageKHR images[IMPL_NUM_IMPLEMENTATIONS]; }; @@ -239,7 +258,7 @@ struct tls_t // ---------------------------------------------------------------------------- -egl_connection_t gEGLImpl[IMPL_NUM_IMPLEMENTATIONS]; +static egl_connection_t gEGLImpl[IMPL_NUM_IMPLEMENTATIONS]; static egl_display_t gDisplay[NUM_DISPLAYS]; static pthread_mutex_t gThreadLocalStorageKeyMutex = PTHREAD_MUTEX_INITIALIZER; static pthread_key_t gEGLThreadLocalStorageKey = -1; @@ -354,7 +373,7 @@ int binarySearch( { while (first <= last) { int mid = (first + last) / 2; - if (key > sortedArray[mid]) { + if (sortedArray[mid] < key) { first = mid + 1; } else if (key < sortedArray[mid]) { last = mid - 1; @@ -365,26 +384,11 @@ int binarySearch( return -1; } -static EGLint configToUniqueId(egl_display_t const* dp, int i, int index) -{ - // NOTE: this mapping works only if we have no more than two EGLimpl - return (i>0 ? dp->disp[0].numConfigs : 0) + index; -} - -static void uniqueIdToConfig(egl_display_t const* dp, EGLint configId, - int& i, int& index) -{ - // NOTE: this mapping works only if we have no more than two EGLimpl - size_t numConfigs = dp->disp[0].numConfigs; - i = configId / numConfigs; - index = configId % numConfigs; -} - static int cmp_configs(const void* a, const void *b) { - EGLConfig c0 = *(EGLConfig const *)a; - EGLConfig c1 = *(EGLConfig const *)b; - return c0<c1 ? -1 : (c0>c1 ? 1 : 0); + const egl_config_t& c0 = *(egl_config_t const *)a; + const egl_config_t& c1 = *(egl_config_t const *)b; + return c0<c1 ? -1 : (c1<c0 ? 1 : 0); } struct extention_map_t { @@ -403,11 +407,13 @@ static const extention_map_t gExtentionMap[] = { (__eglMustCastToProperFunctionPointerType)&eglDestroyImageKHR }, { "eglSetSwapRectangleANDROID", (__eglMustCastToProperFunctionPointerType)&eglSetSwapRectangleANDROID }, - { "eglGetRenderBufferANDROID", - (__eglMustCastToProperFunctionPointerType)&eglGetRenderBufferANDROID }, }; -static extention_map_t gGLExtentionMap[MAX_NUMBER_OF_GL_EXTENSIONS]; +extern const __eglMustCastToProperFunctionPointerType gExtensionForwarders[MAX_NUMBER_OF_GL_EXTENSIONS]; + +// accesses protected by gInitDriverMutex +static DefaultKeyedVector<String8, __eglMustCastToProperFunctionPointerType> gGLExtentionMap; +static int gGLExtentionSlot = 0; static void(*findProcAddress(const char* name, const extention_map_t* map, size_t n))() @@ -477,20 +483,15 @@ egl_image_t* get_image(EGLImageKHR image) { static egl_connection_t* validate_display_config( EGLDisplay dpy, EGLConfig config, - egl_display_t const*& dp, int& impl, int& index) + egl_display_t const*& dp) { dp = get_display(dpy); if (!dp) return setError(EGL_BAD_DISPLAY, (egl_connection_t*)NULL); - impl = uintptr_t(config)>>24; - if (uint32_t(impl) >= IMPL_NUM_IMPLEMENTATIONS) { - return setError(EGL_BAD_CONFIG, (egl_connection_t*)NULL); - } - index = uintptr_t(config) & 0xFFFFFF; - if (index >= dp->disp[impl].numConfigs) { + if (intptr_t(config) >= dp->numTotalConfigs) { return setError(EGL_BAD_CONFIG, (egl_connection_t*)NULL); } - egl_connection_t* const cnx = &gEGLImpl[impl]; + egl_connection_t* const cnx = &gEGLImpl[dp->configs[intptr_t(config)].impl]; if (cnx->dso == 0) { return setError(EGL_BAD_CONFIG, (egl_connection_t*)NULL); } @@ -718,11 +719,6 @@ EGLBoolean eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor) dp->disp[i].dpy, dp->disp[i].config, n, &dp->disp[i].numConfigs)) { - // sort the configurations so we can do binary searches - qsort( dp->disp[i].config, - dp->disp[i].numConfigs, - sizeof(EGLConfig), cmp_configs); - dp->numTotalConfigs += n; res = EGL_TRUE; } @@ -732,6 +728,30 @@ EGLBoolean eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor) } if (res == EGL_TRUE) { + dp->configs = new egl_config_t[ dp->numTotalConfigs ]; + for (int i=0, k=0 ; i<IMPL_NUM_IMPLEMENTATIONS ; i++) { + egl_connection_t* const cnx = &gEGLImpl[i]; + if (cnx->dso && cnx->major>=0 && cnx->minor>=0) { + for (int j=0 ; j<dp->disp[i].numConfigs ; j++) { + dp->configs[k].impl = i; + dp->configs[k].config = dp->disp[i].config[j]; + dp->configs[k].configId = k + 1; // CONFIG_ID start at 1 + // store the implementation's CONFIG_ID + cnx->egl.eglGetConfigAttrib( + dp->disp[i].dpy, + dp->disp[i].config[j], + EGL_CONFIG_ID, + &dp->configs[k].implConfigId); + k++; + } + } + } + + // sort our configurations so we can do binary-searches + qsort( dp->configs, + dp->numTotalConfigs, + sizeof(egl_config_t), cmp_configs); + dp->refs++; if (major != NULL) *major = VERSION_MAJOR; if (minor != NULL) *minor = VERSION_MINOR; @@ -784,6 +804,7 @@ EGLBoolean eglTerminate(EGLDisplay dpy) dp->refs--; dp->numTotalConfigs = 0; + delete [] dp->configs; clearTLS(); return res; } @@ -804,14 +825,13 @@ EGLBoolean eglGetConfigs( EGLDisplay dpy, *num_config = numConfigs; return EGL_TRUE; } + GLint n = 0; - for (int j=0 ; j<IMPL_NUM_IMPLEMENTATIONS ; j++) { - for (int i=0 ; i<dp->disp[j].numConfigs && config_size ; i++) { - *configs++ = MAKE_CONFIG(j, i); - config_size--; - n++; - } - } + for (intptr_t i=0 ; i<dp->numTotalConfigs && config_size ; i++) { + *configs++ = EGLConfig(i); + config_size--; + n++; + } *num_config = n; return EGL_TRUE; @@ -834,7 +854,7 @@ EGLBoolean eglChooseConfig( EGLDisplay dpy, const EGLint *attrib_list, // It is unfortunate, but we need to remap the EGL_CONFIG_IDs, - // to do this, we have to go through the attrib_list array once + // to do this, we have to go through the attrib_list array once // to figure out both its size and if it contains an EGL_CONFIG_ID // key. If so, the full array is copied and patched. // NOTE: we assume that there can be only one occurrence @@ -843,10 +863,12 @@ EGLBoolean eglChooseConfig( EGLDisplay dpy, const EGLint *attrib_list, EGLint patch_index = -1; GLint attr; size_t size = 0; - while ((attr=attrib_list[size]) != EGL_NONE) { - if (attr == EGL_CONFIG_ID) - patch_index = size; - size += 2; + if (attrib_list) { + while ((attr=attrib_list[size]) != EGL_NONE) { + if (attr == EGL_CONFIG_ID) + patch_index = size; + size += 2; + } } if (patch_index >= 0) { size += 2; // we need copy the sentinel as well @@ -856,16 +878,20 @@ EGLBoolean eglChooseConfig( EGLDisplay dpy, const EGLint *attrib_list, memcpy(new_list, attrib_list, size*sizeof(EGLint)); // patch the requested EGL_CONFIG_ID - int i, index; + bool found = false; + EGLConfig ourConfig(0); EGLint& configId(new_list[patch_index+1]); - uniqueIdToConfig(dp, configId, i, index); - - egl_connection_t* const cnx = &gEGLImpl[i]; - if (cnx->dso) { - cnx->egl.eglGetConfigAttrib( - dp->disp[i].dpy, dp->disp[i].config[index], - EGL_CONFIG_ID, &configId); + for (intptr_t i=0 ; i<dp->numTotalConfigs ; i++) { + if (dp->configs[i].configId == configId) { + ourConfig = EGLConfig(i); + configId = dp->configs[i].implConfigId; + found = true; + break; + } + } + egl_connection_t* const cnx = &gEGLImpl[dp->configs[intptr_t(ourConfig)].impl]; + if (found && cnx->dso) { // and switch to the new list attrib_list = const_cast<const EGLint *>(new_list); @@ -878,12 +904,13 @@ EGLBoolean eglChooseConfig( EGLDisplay dpy, const EGLint *attrib_list, // which one. res = cnx->egl.eglChooseConfig( - dp->disp[i].dpy, attrib_list, configs, config_size, &n); + dp->disp[ dp->configs[intptr_t(ourConfig)].impl ].dpy, + attrib_list, configs, config_size, &n); if (res && n>0) { // n has to be 0 or 1, by construction, and we already know // which config it will return (since there can be only one). if (configs) { - configs[0] = MAKE_CONFIG(i, index); + configs[0] = ourConfig; } *num_config = 1; } @@ -893,6 +920,7 @@ EGLBoolean eglChooseConfig( EGLDisplay dpy, const EGLint *attrib_list, return res; } + for (int i=0 ; i<IMPL_NUM_IMPLEMENTATIONS ; i++) { egl_connection_t* const cnx = &gEGLImpl[i]; if (cnx->dso) { @@ -900,15 +928,14 @@ EGLBoolean eglChooseConfig( EGLDisplay dpy, const EGLint *attrib_list, dp->disp[i].dpy, attrib_list, configs, config_size, &n)) { if (configs) { // now we need to convert these client EGLConfig to our - // internal EGLConfig format. This is done in O(n log n). + // internal EGLConfig format. + // This is done in O(n Log(n)) time. for (int j=0 ; j<n ; j++) { - int index = binarySearch<EGLConfig>( - dp->disp[i].config, 0, - dp->disp[i].numConfigs-1, configs[j]); + egl_config_t key(i, configs[j]); + intptr_t index = binarySearch<egl_config_t>( + dp->configs, 0, dp->numTotalConfigs, key); if (index >= 0) { - if (configs) { - configs[j] = MAKE_CONFIG(i, index); - } + configs[j] = EGLConfig(index); } else { return setError(EGL_BAD_CONFIG, EGL_FALSE); } @@ -928,18 +955,16 @@ EGLBoolean eglGetConfigAttrib(EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value) { egl_display_t const* dp = 0; - int i=0, index=0; - egl_connection_t* cnx = validate_display_config(dpy, config, dp, i, index); + egl_connection_t* cnx = validate_display_config(dpy, config, dp); if (!cnx) return EGL_FALSE; if (attribute == EGL_CONFIG_ID) { - // EGL_CONFIG_IDs must be unique, just use the order of the selected - // EGLConfig. - *value = configToUniqueId(dp, i, index); + *value = dp->configs[intptr_t(config)].configId; return EGL_TRUE; } return cnx->egl.eglGetConfigAttrib( - dp->disp[i].dpy, dp->disp[i].config[index], attribute, value); + dp->disp[ dp->configs[intptr_t(config)].impl ].dpy, + dp->configs[intptr_t(config)].config, attribute, value); } // ---------------------------------------------------------------------------- @@ -951,13 +976,14 @@ EGLSurface eglCreateWindowSurface( EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list) { egl_display_t const* dp = 0; - int i=0, index=0; - egl_connection_t* cnx = validate_display_config(dpy, config, dp, i, index); + egl_connection_t* cnx = validate_display_config(dpy, config, dp); if (cnx) { EGLSurface surface = cnx->egl.eglCreateWindowSurface( - dp->disp[i].dpy, dp->disp[i].config[index], window, attrib_list); + dp->disp[ dp->configs[intptr_t(config)].impl ].dpy, + dp->configs[intptr_t(config)].config, window, attrib_list); if (surface != EGL_NO_SURFACE) { - egl_surface_t* s = new egl_surface_t(dpy, surface, i, cnx); + egl_surface_t* s = new egl_surface_t(dpy, surface, config, + dp->configs[intptr_t(config)].impl, cnx); return s; } } @@ -969,13 +995,14 @@ EGLSurface eglCreatePixmapSurface( EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list) { egl_display_t const* dp = 0; - int i=0, index=0; - egl_connection_t* cnx = validate_display_config(dpy, config, dp, i, index); + egl_connection_t* cnx = validate_display_config(dpy, config, dp); if (cnx) { EGLSurface surface = cnx->egl.eglCreatePixmapSurface( - dp->disp[i].dpy, dp->disp[i].config[index], pixmap, attrib_list); + dp->disp[ dp->configs[intptr_t(config)].impl ].dpy, + dp->configs[intptr_t(config)].config, pixmap, attrib_list); if (surface != EGL_NO_SURFACE) { - egl_surface_t* s = new egl_surface_t(dpy, surface, i, cnx); + egl_surface_t* s = new egl_surface_t(dpy, surface, config, + dp->configs[intptr_t(config)].impl, cnx); return s; } } @@ -986,13 +1013,14 @@ EGLSurface eglCreatePbufferSurface( EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list) { egl_display_t const* dp = 0; - int i=0, index=0; - egl_connection_t* cnx = validate_display_config(dpy, config, dp, i, index); + egl_connection_t* cnx = validate_display_config(dpy, config, dp); if (cnx) { EGLSurface surface = cnx->egl.eglCreatePbufferSurface( - dp->disp[i].dpy, dp->disp[i].config[index], attrib_list); + dp->disp[ dp->configs[intptr_t(config)].impl ].dpy, + dp->configs[intptr_t(config)].config, attrib_list); if (surface != EGL_NO_SURFACE) { - egl_surface_t* s = new egl_surface_t(dpy, surface, i, cnx); + egl_surface_t* s = new egl_surface_t(dpy, surface, config, + dp->configs[intptr_t(config)].impl, cnx); return s; } } @@ -1028,23 +1056,35 @@ EGLBoolean eglQuerySurface( EGLDisplay dpy, EGLSurface surface, egl_display_t const * const dp = get_display(dpy); egl_surface_t const * const s = get_surface(surface); - return s->cnx->egl.eglQuerySurface( - dp->disp[s->impl].dpy, s->surface, attribute, value); + EGLBoolean result(EGL_TRUE); + if (attribute == EGL_CONFIG_ID) { + // We need to remap EGL_CONFIG_IDs + *value = dp->configs[intptr_t(s->config)].configId; + } else { + result = s->cnx->egl.eglQuerySurface( + dp->disp[s->impl].dpy, s->surface, attribute, value); + } + + return result; } // ---------------------------------------------------------------------------- -// contextes +// Contexts // ---------------------------------------------------------------------------- EGLContext eglCreateContext(EGLDisplay dpy, EGLConfig config, EGLContext share_list, const EGLint *attrib_list) { egl_display_t const* dp = 0; - int i=0, index=0; - egl_connection_t* cnx = validate_display_config(dpy, config, dp, i, index); + egl_connection_t* cnx = validate_display_config(dpy, config, dp); if (cnx) { + if (share_list != EGL_NO_CONTEXT) { + egl_context_t* const c = get_context(share_list); + share_list = c->context; + } EGLContext context = cnx->egl.eglCreateContext( - dp->disp[i].dpy, dp->disp[i].config[index], + dp->disp[ dp->configs[intptr_t(config)].impl ].dpy, + dp->configs[intptr_t(config)].config, share_list, attrib_list); if (context != EGL_NO_CONTEXT) { // figure out if it's a GLESv1 or GLESv2 @@ -1062,7 +1102,8 @@ EGLContext eglCreateContext(EGLDisplay dpy, EGLConfig config, } }; } - egl_context_t* c = new egl_context_t(dpy, context, i, cnx, version); + egl_context_t* c = new egl_context_t(dpy, context, config, + dp->configs[intptr_t(config)].impl, cnx, version); return c; } } @@ -1207,8 +1248,16 @@ EGLBoolean eglQueryContext( EGLDisplay dpy, EGLContext ctx, egl_display_t const * const dp = get_display(dpy); egl_context_t * const c = get_context(ctx); - return c->cnx->egl.eglQueryContext( - dp->disp[c->impl].dpy, c->context, attribute, value); + EGLBoolean result(EGL_TRUE); + if (attribute == EGL_CONFIG_ID) { + *value = dp->configs[intptr_t(c->config)].configId; + } else { + // We need to remap EGL_CONFIG_IDs + result = c->cnx->egl.eglQueryContext( + dp->disp[c->impl].dpy, c->context, attribute, value); + } + + return result; } EGLContext eglGetCurrentContext(void) @@ -1323,55 +1372,55 @@ __eglMustCastToProperFunctionPointerType eglGetProcAddress(const char *procname) addr = findProcAddress(procname, gExtentionMap, NELEM(gExtentionMap)); if (addr) return addr; - return NULL; // TODO: finish implementation below + // this protects accesses to gGLExtentionMap and gGLExtentionSlot + pthread_mutex_lock(&gInitDriverMutex); - addr = findProcAddress(procname, gGLExtentionMap, NELEM(gGLExtentionMap)); - if (addr) return addr; - - addr = 0; - int slot = -1; - for (int i=0 ; i<IMPL_NUM_IMPLEMENTATIONS ; i++) { - egl_connection_t* const cnx = &gEGLImpl[i]; - if (cnx->dso) { - if (cnx->egl.eglGetProcAddress) { - addr = cnx->egl.eglGetProcAddress(procname); - if (addr) { - if (slot == -1) { - slot = 0; // XXX: find free slot - if (slot == -1) { - addr = 0; - break; - } - } - //cnx->hooks->ext.extensions[slot] = addr; + /* + * Since eglGetProcAddress() is not associated to anything, it needs + * to return a function pointer that "works" regardless of what + * the current context is. + * + * For this reason, we return a "forwarder", a small stub that takes + * care of calling the function associated with the context + * currently bound. + * + * We first look for extensions we've already resolved, if we're seeing + * this extension for the first time, we go through all our + * implementations and call eglGetProcAddress() and record the + * result in the appropriate implementation hooks and return the + * address of the forwarder corresponding to that hook set. + * + */ + + const String8 name(procname); + addr = gGLExtentionMap.valueFor(name); + const int slot = gGLExtentionSlot; + + LOGE_IF(slot >= MAX_NUMBER_OF_GL_EXTENSIONS, + "no more slots for eglGetProcAddress(\"%s\")", + procname); + + if (!addr && (slot < MAX_NUMBER_OF_GL_EXTENSIONS)) { + bool found = false; + for (int i=0 ; i<IMPL_NUM_IMPLEMENTATIONS ; i++) { + egl_connection_t* const cnx = &gEGLImpl[i]; + if (cnx->dso && cnx->egl.eglGetProcAddress) { + found = true; + // Extensions are independent of the bound context + cnx->hooks[GLESv1_INDEX]->ext.extensions[slot] = + cnx->hooks[GLESv2_INDEX]->ext.extensions[slot] = + cnx->egl.eglGetProcAddress(procname); } } + if (found) { + addr = gExtensionForwarders[slot]; + gGLExtentionMap.add(name, addr); + gGLExtentionSlot++; + } } - } - - if (slot >= 0) { - addr = 0; // XXX: address of stub 'slot' - gGLExtentionMap[slot].name = strdup(procname); - gGLExtentionMap[slot].address = addr; - } - - return addr; - - /* - * TODO: For OpenGL ES extensions, we must generate a stub - * that looks like - * mov r12, #0xFFFF0FFF - * ldr r12, [r12, #-15] - * ldr r12, [r12, #TLS_SLOT_OPENGL_API*4] - * mov r12, [r12, #api_offset] - * ldrne pc, r12 - * mov pc, #unsupported_extension - * - * and write the address of the extension in *all* - * gl_hooks_t::gl_ext_t at offset "api_offset" from gl_hooks_t - * - */ + pthread_mutex_unlock(&gInitDriverMutex); + return addr; } EGLBoolean eglSwapBuffers(EGLDisplay dpy, EGLSurface draw) @@ -1580,13 +1629,13 @@ EGLSurface eglCreatePbufferFromClientBuffer( EGLConfig config, const EGLint *attrib_list) { egl_display_t const* dp = 0; - int i=0, index=0; - egl_connection_t* cnx = validate_display_config(dpy, config, dp, i, index); + egl_connection_t* cnx = validate_display_config(dpy, config, dp); if (!cnx) return EGL_FALSE; if (cnx->egl.eglCreatePbufferFromClientBuffer) { return cnx->egl.eglCreatePbufferFromClientBuffer( - dp->disp[i].dpy, buftype, buffer, - dp->disp[i].config[index], attrib_list); + dp->disp[ dp->configs[intptr_t(config)].impl ].dpy, + buftype, buffer, + dp->configs[intptr_t(config)].config, attrib_list); } return setError(EGL_BAD_CONFIG, EGL_NO_SURFACE); } @@ -1720,7 +1769,7 @@ EGLBoolean eglDestroyImageKHR(EGLDisplay dpy, EGLImageKHR img) egl_connection_t* const cnx = &gEGLImpl[i]; if (image->images[i] != EGL_NO_IMAGE_KHR) { if (cnx->dso) { - if (cnx->egl.eglCreateImageKHR) { + if (cnx->egl.eglDestroyImageKHR) { if (cnx->egl.eglDestroyImageKHR( dp->disp[i].dpy, image->images[i])) { success = true; @@ -1758,19 +1807,3 @@ EGLBoolean eglSetSwapRectangleANDROID(EGLDisplay dpy, EGLSurface draw, } return setError(EGL_BAD_DISPLAY, NULL); } - -EGLClientBuffer eglGetRenderBufferANDROID(EGLDisplay dpy, EGLSurface draw) -{ - SurfaceRef _s(draw); - if (!_s.get()) return setError(EGL_BAD_SURFACE, (EGLClientBuffer*)0); - - if (!validate_display_surface(dpy, draw)) - return 0; - egl_display_t const * const dp = get_display(dpy); - egl_surface_t const * const s = get_surface(draw); - if (s->cnx->egl.eglGetRenderBufferANDROID) { - return s->cnx->egl.eglGetRenderBufferANDROID( - dp->disp[s->impl].dpy, s->surface); - } - return setError(EGL_BAD_DISPLAY, (EGLClientBuffer*)0); -} diff --git a/opengl/libs/EGL/getProcAddress.cpp b/opengl/libs/EGL/getProcAddress.cpp new file mode 100644 index 000000000000..dcf8735c634d --- /dev/null +++ b/opengl/libs/EGL/getProcAddress.cpp @@ -0,0 +1,122 @@ +/* + ** Copyright 2009, The Android Open Source Project + ** + ** Licensed under the Apache License, Version 2.0 (the "License"); + ** you may not use this file except in compliance with the License. + ** You may obtain a copy of the License at + ** + ** http://www.apache.org/licenses/LICENSE-2.0 + ** + ** Unless required by applicable law or agreed to in writing, software + ** distributed under the License is distributed on an "AS IS" BASIS, + ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ** See the License for the specific language governing permissions and + ** limitations under the License. + */ + +#include <ctype.h> +#include <stdlib.h> +#include <errno.h> + +#include <cutils/log.h> + +#include "hooks.h" + +// ---------------------------------------------------------------------------- +namespace android { +// ---------------------------------------------------------------------------- + +#undef API_ENTRY +#undef CALL_GL_EXTENSION_API +#undef GL_EXTENSION +#undef GL_EXTENSION_NAME +#undef GL_EXTENSION_ARRAY +#undef GL_EXTENSION_LIST +#undef GET_TLS + +#if defined(__arm__) + + #ifdef HAVE_ARM_TLS_REGISTER + #define GET_TLS(reg) \ + "mrc p15, 0, " #reg ", c13, c0, 3 \n" + #else + #define GET_TLS(reg) \ + "mov " #reg ", #0xFFFF0FFF \n" \ + "ldr " #reg ", [" #reg ", #-15] \n" + #endif + + #define API_ENTRY(_api) __attribute__((naked)) _api + + #define CALL_GL_EXTENSION_API(_api) \ + asm volatile( \ + GET_TLS(r12) \ + "ldr r12, [r12, %[tls]] \n" \ + "cmp r12, #0 \n" \ + "ldrne r12, [r12, %[api]] \n" \ + "cmpne r12, #0 \n" \ + "bxne r12 \n" \ + "bx lr \n" \ + : \ + : [tls] "J"(TLS_SLOT_OPENGL_API*4), \ + [api] "J"(__builtin_offsetof(gl_hooks_t, \ + ext.extensions[_api])) \ + : \ + ); + + #define GL_EXTENSION_NAME(_n) __glExtFwd##_n + + #define GL_EXTENSION(_n) \ + void API_ENTRY(GL_EXTENSION_NAME(_n))() { \ + CALL_GL_EXTENSION_API(_n); \ + } + + +#else + + #define GL_EXTENSION_NAME(_n) NULL + + #define GL_EXTENSION(_n) + + #warning "eglGetProcAddress() partially supported on this architecture" + +#endif + +#define GL_EXTENSION_LIST(name) \ + name(0) name(1) name(2) name(3) \ + name(4) name(5) name(6) name(7) \ + name(8) name(9) name(10) name(11) \ + name(12) name(13) name(14) name(15) \ + name(16) name(17) name(18) name(19) \ + name(20) name(21) name(22) name(23) \ + name(24) name(25) name(26) name(27) \ + name(28) name(29) name(30) name(31) \ + name(32) name(33) name(34) name(35) \ + name(36) name(37) name(38) name(39) \ + name(40) name(41) name(42) name(43) \ + name(44) name(45) name(46) name(47) \ + name(48) name(49) name(50) name(51) \ + name(52) name(53) name(54) name(55) \ + name(56) name(57) name(58) name(59) \ + name(60) name(61) name(62) name(63) + + +GL_EXTENSION_LIST( GL_EXTENSION ) + +#define GL_EXTENSION_ARRAY(_n) GL_EXTENSION_NAME(_n), + +extern const __eglMustCastToProperFunctionPointerType gExtensionForwarders[MAX_NUMBER_OF_GL_EXTENSIONS] = { + GL_EXTENSION_LIST( GL_EXTENSION_ARRAY ) + }; + +#undef GET_TLS +#undef GL_EXTENSION_LIST +#undef GL_EXTENSION_ARRAY +#undef GL_EXTENSION_NAME +#undef GL_EXTENSION +#undef API_ENTRY +#undef CALL_GL_EXTENSION_API + +// ---------------------------------------------------------------------------- +}; // namespace android +// ---------------------------------------------------------------------------- + diff --git a/opengl/libs/GLES2/gl2_api.in b/opengl/libs/GLES2/gl2_api.in index 9c2e69aea0a3..5164450ba99f 100644 --- a/opengl/libs/GLES2/gl2_api.in +++ b/opengl/libs/GLES2/gl2_api.in @@ -4,7 +4,7 @@ void API_ENTRY(glActiveTexture)(GLenum texture) { void API_ENTRY(glAttachShader)(GLuint program, GLuint shader) { CALL_GL_API(glAttachShader, program, shader); } -void API_ENTRY(glBindAttribLocation)(GLuint program, GLuint index, const char* name) { +void API_ENTRY(glBindAttribLocation)(GLuint program, GLuint index, const GLchar* name) { CALL_GL_API(glBindAttribLocation, program, index, name); } void API_ENTRY(glBindBuffer)(GLenum target, GLuint buffer) { @@ -34,10 +34,10 @@ void API_ENTRY(glBlendFunc)(GLenum sfactor, GLenum dfactor) { void API_ENTRY(glBlendFuncSeparate)(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha) { CALL_GL_API(glBlendFuncSeparate, srcRGB, dstRGB, srcAlpha, dstAlpha); } -void API_ENTRY(glBufferData)(GLenum target, GLsizeiptr size, const void* data, GLenum usage) { +void API_ENTRY(glBufferData)(GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage) { CALL_GL_API(glBufferData, target, size, data, usage); } -void API_ENTRY(glBufferSubData)(GLenum target, GLintptr offset, GLsizeiptr size, const void* data) { +void API_ENTRY(glBufferSubData)(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data) { CALL_GL_API(glBufferSubData, target, offset, size, data); } GLenum API_ENTRY(glCheckFramebufferStatus)(GLenum target) { @@ -61,10 +61,10 @@ void API_ENTRY(glColorMask)(GLboolean red, GLboolean green, GLboolean blue, GLbo void API_ENTRY(glCompileShader)(GLuint shader) { CALL_GL_API(glCompileShader, shader); } -void API_ENTRY(glCompressedTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data) { +void API_ENTRY(glCompressedTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid* data) { CALL_GL_API(glCompressedTexImage2D, target, level, internalformat, width, height, border, imageSize, data); } -void API_ENTRY(glCompressedTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data) { +void API_ENTRY(glCompressedTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid* data) { CALL_GL_API(glCompressedTexSubImage2D, target, level, xoffset, yoffset, width, height, format, imageSize, data); } void API_ENTRY(glCopyTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) { @@ -121,7 +121,7 @@ void API_ENTRY(glDisableVertexAttribArray)(GLuint index) { void API_ENTRY(glDrawArrays)(GLenum mode, GLint first, GLsizei count) { CALL_GL_API(glDrawArrays, mode, first, count); } -void API_ENTRY(glDrawElements)(GLenum mode, GLsizei count, GLenum type, const void* indices) { +void API_ENTRY(glDrawElements)(GLenum mode, GLsizei count, GLenum type, const GLvoid* indices) { CALL_GL_API(glDrawElements, mode, count, type, indices); } void API_ENTRY(glEnable)(GLenum cap) { @@ -160,16 +160,16 @@ void API_ENTRY(glGenRenderbuffers)(GLsizei n, GLuint* renderbuffers) { void API_ENTRY(glGenTextures)(GLsizei n, GLuint* textures) { CALL_GL_API(glGenTextures, n, textures); } -void API_ENTRY(glGetActiveAttrib)(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name) { +void API_ENTRY(glGetActiveAttrib)(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name) { CALL_GL_API(glGetActiveAttrib, program, index, bufsize, length, size, type, name); } -void API_ENTRY(glGetActiveUniform)(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name) { +void API_ENTRY(glGetActiveUniform)(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name) { CALL_GL_API(glGetActiveUniform, program, index, bufsize, length, size, type, name); } void API_ENTRY(glGetAttachedShaders)(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders) { CALL_GL_API(glGetAttachedShaders, program, maxcount, count, shaders); } -int API_ENTRY(glGetAttribLocation)(GLuint program, const char* name) { +int API_ENTRY(glGetAttribLocation)(GLuint program, const GLchar* name) { CALL_GL_API_RETURN(glGetAttribLocation, program, name); } void API_ENTRY(glGetBooleanv)(GLenum pname, GLboolean* params) { @@ -193,7 +193,7 @@ void API_ENTRY(glGetIntegerv)(GLenum pname, GLint* params) { void API_ENTRY(glGetProgramiv)(GLuint program, GLenum pname, GLint* params) { CALL_GL_API(glGetProgramiv, program, pname, params); } -void API_ENTRY(glGetProgramInfoLog)(GLuint program, GLsizei bufsize, GLsizei* length, char* infolog) { +void API_ENTRY(glGetProgramInfoLog)(GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog) { CALL_GL_API(glGetProgramInfoLog, program, bufsize, length, infolog); } void API_ENTRY(glGetRenderbufferParameteriv)(GLenum target, GLenum pname, GLint* params) { @@ -202,13 +202,13 @@ void API_ENTRY(glGetRenderbufferParameteriv)(GLenum target, GLenum pname, GLint* void API_ENTRY(glGetShaderiv)(GLuint shader, GLenum pname, GLint* params) { CALL_GL_API(glGetShaderiv, shader, pname, params); } -void API_ENTRY(glGetShaderInfoLog)(GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog) { +void API_ENTRY(glGetShaderInfoLog)(GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* infolog) { CALL_GL_API(glGetShaderInfoLog, shader, bufsize, length, infolog); } void API_ENTRY(glGetShaderPrecisionFormat)(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision) { CALL_GL_API(glGetShaderPrecisionFormat, shadertype, precisiontype, range, precision); } -void API_ENTRY(glGetShaderSource)(GLuint shader, GLsizei bufsize, GLsizei* length, char* source) { +void API_ENTRY(glGetShaderSource)(GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source) { CALL_GL_API(glGetShaderSource, shader, bufsize, length, source); } const GLubyte* API_ENTRY(glGetString)(GLenum name) { @@ -226,7 +226,7 @@ void API_ENTRY(glGetUniformfv)(GLuint program, GLint location, GLfloat* params) void API_ENTRY(glGetUniformiv)(GLuint program, GLint location, GLint* params) { CALL_GL_API(glGetUniformiv, program, location, params); } -int API_ENTRY(glGetUniformLocation)(GLuint program, const char* name) { +int API_ENTRY(glGetUniformLocation)(GLuint program, const GLchar* name) { CALL_GL_API_RETURN(glGetUniformLocation, program, name); } void API_ENTRY(glGetVertexAttribfv)(GLuint index, GLenum pname, GLfloat* params) { @@ -235,7 +235,7 @@ void API_ENTRY(glGetVertexAttribfv)(GLuint index, GLenum pname, GLfloat* params) void API_ENTRY(glGetVertexAttribiv)(GLuint index, GLenum pname, GLint* params) { CALL_GL_API(glGetVertexAttribiv, index, pname, params); } -void API_ENTRY(glGetVertexAttribPointerv)(GLuint index, GLenum pname, void** pointer) { +void API_ENTRY(glGetVertexAttribPointerv)(GLuint index, GLenum pname, GLvoid** pointer) { CALL_GL_API(glGetVertexAttribPointerv, index, pname, pointer); } void API_ENTRY(glHint)(GLenum target, GLenum mode) { @@ -274,7 +274,7 @@ void API_ENTRY(glPixelStorei)(GLenum pname, GLint param) { void API_ENTRY(glPolygonOffset)(GLfloat factor, GLfloat units) { CALL_GL_API(glPolygonOffset, factor, units); } -void API_ENTRY(glReadPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void* pixels) { +void API_ENTRY(glReadPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels) { CALL_GL_API(glReadPixels, x, y, width, height, format, type, pixels); } void API_ENTRY(glReleaseShaderCompiler)(void) { @@ -289,10 +289,10 @@ void API_ENTRY(glSampleCoverage)(GLclampf value, GLboolean invert) { void API_ENTRY(glScissor)(GLint x, GLint y, GLsizei width, GLsizei height) { CALL_GL_API(glScissor, x, y, width, height); } -void API_ENTRY(glShaderBinary)(GLsizei n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLsizei length) { +void API_ENTRY(glShaderBinary)(GLsizei n, const GLuint* shaders, GLenum binaryformat, const GLvoid* binary, GLsizei length) { CALL_GL_API(glShaderBinary, n, shaders, binaryformat, binary, length); } -void API_ENTRY(glShaderSource)(GLuint shader, GLsizei count, const char** string, const GLint* length) { +void API_ENTRY(glShaderSource)(GLuint shader, GLsizei count, const GLchar** string, const GLint* length) { CALL_GL_API(glShaderSource, shader, count, string, length); } void API_ENTRY(glStencilFunc)(GLenum func, GLint ref, GLuint mask) { @@ -313,7 +313,7 @@ void API_ENTRY(glStencilOp)(GLenum fail, GLenum zfail, GLenum zpass) { void API_ENTRY(glStencilOpSeparate)(GLenum face, GLenum fail, GLenum zfail, GLenum zpass) { CALL_GL_API(glStencilOpSeparate, face, fail, zfail, zpass); } -void API_ENTRY(glTexImage2D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels) { +void API_ENTRY(glTexImage2D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels) { CALL_GL_API(glTexImage2D, target, level, internalformat, width, height, border, format, type, pixels); } void API_ENTRY(glTexParameterf)(GLenum target, GLenum pname, GLfloat param) { @@ -328,7 +328,7 @@ void API_ENTRY(glTexParameteri)(GLenum target, GLenum pname, GLint param) { void API_ENTRY(glTexParameteriv)(GLenum target, GLenum pname, const GLint* params) { CALL_GL_API(glTexParameteriv, target, pname, params); } -void API_ENTRY(glTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels) { +void API_ENTRY(glTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels) { CALL_GL_API(glTexSubImage2D, target, level, xoffset, yoffset, width, height, format, type, pixels); } void API_ENTRY(glUniform1f)(GLint location, GLfloat x) { @@ -418,7 +418,7 @@ void API_ENTRY(glVertexAttrib4f)(GLuint indx, GLfloat x, GLfloat y, GLfloat z, G void API_ENTRY(glVertexAttrib4fv)(GLuint indx, const GLfloat* values) { CALL_GL_API(glVertexAttrib4fv, indx, values); } -void API_ENTRY(glVertexAttribPointer)(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* ptr) { +void API_ENTRY(glVertexAttribPointer)(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* ptr) { CALL_GL_API(glVertexAttribPointer, indx, size, type, normalized, stride, ptr); } void API_ENTRY(glViewport)(GLint x, GLint y, GLsizei width, GLsizei height) { diff --git a/opengl/libs/GLES2/gl2ext_api.in b/opengl/libs/GLES2/gl2ext_api.in index 6eeecb33dc19..e965625178ee 100644 --- a/opengl/libs/GLES2/gl2ext_api.in +++ b/opengl/libs/GLES2/gl2ext_api.in @@ -4,10 +4,10 @@ void API_ENTRY(__glEGLImageTargetTexture2DOES)(GLenum target, GLeglImageOES imag void API_ENTRY(__glEGLImageTargetRenderbufferStorageOES)(GLenum target, GLeglImageOES image) { CALL_GL_API(glEGLImageTargetRenderbufferStorageOES, target, image); } -void API_ENTRY(glGetProgramBinaryOES)(GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary) { +void API_ENTRY(glGetProgramBinaryOES)(GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary) { CALL_GL_API(glGetProgramBinaryOES, program, bufSize, length, binaryFormat, binary); } -void API_ENTRY(glProgramBinaryOES)(GLuint program, GLenum binaryFormat, const void *binary, GLint length) { +void API_ENTRY(glProgramBinaryOES)(GLuint program, GLenum binaryFormat, const GLvoid *binary, GLint length) { CALL_GL_API(glProgramBinaryOES, program, binaryFormat, binary, length); } void* API_ENTRY(glMapBufferOES)(GLenum target, GLenum access) { @@ -16,40 +16,52 @@ void* API_ENTRY(glMapBufferOES)(GLenum target, GLenum access) { GLboolean API_ENTRY(glUnmapBufferOES)(GLenum target) { CALL_GL_API_RETURN(glUnmapBufferOES, target); } -void API_ENTRY(glGetBufferPointervOES)(GLenum target, GLenum pname, void** params) { +void API_ENTRY(glGetBufferPointervOES)(GLenum target, GLenum pname, GLvoid** params) { CALL_GL_API(glGetBufferPointervOES, target, pname, params); } -void API_ENTRY(glTexImage3DOES)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void* pixels) { +void API_ENTRY(glTexImage3DOES)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels) { CALL_GL_API(glTexImage3DOES, target, level, internalformat, width, height, depth, border, format, type, pixels); } -void API_ENTRY(glTexSubImage3DOES)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void* pixels) { +void API_ENTRY(glTexSubImage3DOES)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* pixels) { CALL_GL_API(glTexSubImage3DOES, target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); } void API_ENTRY(glCopyTexSubImage3DOES)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) { CALL_GL_API(glCopyTexSubImage3DOES, target, level, xoffset, yoffset, zoffset, x, y, width, height); } -void API_ENTRY(glCompressedTexImage3DOES)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void* data) { +void API_ENTRY(glCompressedTexImage3DOES)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data) { CALL_GL_API(glCompressedTexImage3DOES, target, level, internalformat, width, height, depth, border, imageSize, data); } -void API_ENTRY(glCompressedTexSubImage3DOES)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void* data) { +void API_ENTRY(glCompressedTexSubImage3DOES)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid* data) { CALL_GL_API(glCompressedTexSubImage3DOES, target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data); } void API_ENTRY(glFramebufferTexture3DOES)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset) { CALL_GL_API(glFramebufferTexture3DOES, target, attachment, textarget, texture, level, zoffset); } +void API_ENTRY(glBindVertexArrayOES)(GLuint array) { + CALL_GL_API(glBindVertexArrayOES, array); +} +void API_ENTRY(glDeleteVertexArraysOES)(GLsizei n, const GLuint *arrays) { + CALL_GL_API(glDeleteVertexArraysOES, n, arrays); +} +void API_ENTRY(glGenVertexArraysOES)(GLsizei n, GLuint *arrays) { + CALL_GL_API(glGenVertexArraysOES, n, arrays); +} +GLboolean API_ENTRY(glIsVertexArrayOES)(GLuint array) { + CALL_GL_API_RETURN(glIsVertexArrayOES, array); +} void API_ENTRY(glGetPerfMonitorGroupsAMD)(GLint *numGroups, GLsizei groupsSize, GLuint *groups) { CALL_GL_API(glGetPerfMonitorGroupsAMD, numGroups, groupsSize, groups); } void API_ENTRY(glGetPerfMonitorCountersAMD)(GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters) { CALL_GL_API(glGetPerfMonitorCountersAMD, group, numCounters, maxActiveCounters, counterSize, counters); } -void API_ENTRY(glGetPerfMonitorGroupStringAMD)(GLuint group, GLsizei bufSize, GLsizei *length, char *groupString) { +void API_ENTRY(glGetPerfMonitorGroupStringAMD)(GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString) { CALL_GL_API(glGetPerfMonitorGroupStringAMD, group, bufSize, length, groupString); } -void API_ENTRY(glGetPerfMonitorCounterStringAMD)(GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, char *counterString) { +void API_ENTRY(glGetPerfMonitorCounterStringAMD)(GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString) { CALL_GL_API(glGetPerfMonitorCounterStringAMD, group, counter, bufSize, length, counterString); } -void API_ENTRY(glGetPerfMonitorCounterInfoAMD)(GLuint group, GLuint counter, GLenum pname, void *data) { +void API_ENTRY(glGetPerfMonitorCounterInfoAMD)(GLuint group, GLuint counter, GLenum pname, GLvoid *data) { CALL_GL_API(glGetPerfMonitorCounterInfoAMD, group, counter, pname, data); } void API_ENTRY(glGenPerfMonitorsAMD)(GLsizei n, GLuint *monitors) { @@ -70,6 +82,21 @@ void API_ENTRY(glEndPerfMonitorAMD)(GLuint monitor) { void API_ENTRY(glGetPerfMonitorCounterDataAMD)(GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten) { CALL_GL_API(glGetPerfMonitorCounterDataAMD, monitor, pname, dataSize, data, bytesWritten); } +void API_ENTRY(glDiscardFramebufferEXT)(GLenum target, GLsizei numAttachments, const GLenum *attachments) { + CALL_GL_API(glDiscardFramebufferEXT, target, numAttachments, attachments); +} +void API_ENTRY(glMultiDrawArraysEXT)(GLenum mode, GLint *first, GLsizei *count, GLsizei primcount) { + CALL_GL_API(glMultiDrawArraysEXT, mode, first, count, primcount); +} +void API_ENTRY(glMultiDrawElementsEXT)(GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount) { + CALL_GL_API(glMultiDrawElementsEXT, mode, count, type, indices, primcount); +} +void API_ENTRY(glRenderbufferStorageMultisampleIMG)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) { + CALL_GL_API(glRenderbufferStorageMultisampleIMG, target, samples, internalformat, width, height); +} +void API_ENTRY(glFramebufferTexture2DMultisampleIMG)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples) { + CALL_GL_API(glFramebufferTexture2DMultisampleIMG, target, attachment, textarget, texture, level, samples); +} void API_ENTRY(glDeleteFencesNV)(GLsizei n, const GLuint *fences) { CALL_GL_API(glDeleteFencesNV, n, fences); } @@ -91,10 +118,16 @@ void API_ENTRY(glFinishFenceNV)(GLuint fence) { void API_ENTRY(glSetFenceNV)(GLuint fence, GLenum condition) { CALL_GL_API(glSetFenceNV, fence, condition); } +void API_ENTRY(glCoverageMaskNV)(GLboolean mask) { + CALL_GL_API(glCoverageMaskNV, mask); +} +void API_ENTRY(glCoverageOperationNV)(GLenum operation) { + CALL_GL_API(glCoverageOperationNV, operation); +} void API_ENTRY(glGetDriverControlsQCOM)(GLint *num, GLsizei size, GLuint *driverControls) { CALL_GL_API(glGetDriverControlsQCOM, num, size, driverControls); } -void API_ENTRY(glGetDriverControlStringQCOM)(GLuint driverControl, GLsizei bufSize, GLsizei *length, char *driverControlString) { +void API_ENTRY(glGetDriverControlStringQCOM)(GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString) { CALL_GL_API(glGetDriverControlStringQCOM, driverControl, bufSize, length, driverControlString); } void API_ENTRY(glEnableDriverControlQCOM)(GLuint driverControl) { @@ -103,3 +136,45 @@ void API_ENTRY(glEnableDriverControlQCOM)(GLuint driverControl) { void API_ENTRY(glDisableDriverControlQCOM)(GLuint driverControl) { CALL_GL_API(glDisableDriverControlQCOM, driverControl); } +void API_ENTRY(glExtGetTexturesQCOM)(GLuint *textures, GLint maxTextures, GLint *numTextures) { + CALL_GL_API(glExtGetTexturesQCOM, textures, maxTextures, numTextures); +} +void API_ENTRY(glExtGetBuffersQCOM)(GLuint *buffers, GLint maxBuffers, GLint *numBuffers) { + CALL_GL_API(glExtGetBuffersQCOM, buffers, maxBuffers, numBuffers); +} +void API_ENTRY(glExtGetRenderbuffersQCOM)(GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers) { + CALL_GL_API(glExtGetRenderbuffersQCOM, renderbuffers, maxRenderbuffers, numRenderbuffers); +} +void API_ENTRY(glExtGetFramebuffersQCOM)(GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers) { + CALL_GL_API(glExtGetFramebuffersQCOM, framebuffers, maxFramebuffers, numFramebuffers); +} +void API_ENTRY(glExtGetTexLevelParameterivQCOM)(GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params) { + CALL_GL_API(glExtGetTexLevelParameterivQCOM, texture, face, level, pname, params); +} +void API_ENTRY(glExtTexObjectStateOverrideiQCOM)(GLenum target, GLenum pname, GLint param) { + CALL_GL_API(glExtTexObjectStateOverrideiQCOM, target, pname, param); +} +void API_ENTRY(glExtGetTexSubImageQCOM)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid *texels) { + CALL_GL_API(glExtGetTexSubImageQCOM, target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, texels); +} +void API_ENTRY(glExtGetBufferPointervQCOM)(GLenum target, GLvoid **params) { + CALL_GL_API(glExtGetBufferPointervQCOM, target, params); +} +void API_ENTRY(glExtGetShadersQCOM)(GLuint *shaders, GLint maxShaders, GLint *numShaders) { + CALL_GL_API(glExtGetShadersQCOM, shaders, maxShaders, numShaders); +} +void API_ENTRY(glExtGetProgramsQCOM)(GLuint *programs, GLint maxPrograms, GLint *numPrograms) { + CALL_GL_API(glExtGetProgramsQCOM, programs, maxPrograms, numPrograms); +} +GLboolean API_ENTRY(glExtIsProgramBinaryQCOM)(GLuint program) { + CALL_GL_API_RETURN(glExtIsProgramBinaryQCOM, program); +} +void API_ENTRY(glExtGetProgramBinarySourceQCOM)(GLuint program, GLenum shadertype, GLchar *source, GLint *length) { + CALL_GL_API(glExtGetProgramBinarySourceQCOM, program, shadertype, source, length); +} +void API_ENTRY(glStartTilingQCOM)(GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask) { + CALL_GL_API(glStartTilingQCOM, x, y, width, height, preserveMask); +} +void API_ENTRY(glEndTilingQCOM)(GLbitfield preserveMask) { + CALL_GL_API(glEndTilingQCOM, preserveMask); +} diff --git a/opengl/libs/GLES_CM/gl_api.in b/opengl/libs/GLES_CM/gl_api.in index 5437d47f20ff..7f20c4fda493 100644 --- a/opengl/libs/GLES_CM/gl_api.in +++ b/opengl/libs/GLES_CM/gl_api.in @@ -259,7 +259,7 @@ void API_ENTRY(glGetLightxv)(GLenum light, GLenum pname, GLfixed *params) { void API_ENTRY(glGetMaterialxv)(GLenum face, GLenum pname, GLfixed *params) { CALL_GL_API(glGetMaterialxv, face, pname, params); } -void API_ENTRY(glGetPointerv)(GLenum pname, void **params) { +void API_ENTRY(glGetPointerv)(GLenum pname, GLvoid **params) { CALL_GL_API(glGetPointerv, pname, params); } const GLubyte * API_ENTRY(glGetString)(GLenum name) { diff --git a/opengl/libs/GLES_CM/glext_api.in b/opengl/libs/GLES_CM/glext_api.in index 2c8648e259ba..5393fa61a056 100644 --- a/opengl/libs/GLES_CM/glext_api.in +++ b/opengl/libs/GLES_CM/glext_api.in @@ -205,7 +205,7 @@ void* API_ENTRY(glMapBufferOES)(GLenum target, GLenum access) { GLboolean API_ENTRY(glUnmapBufferOES)(GLenum target) { CALL_GL_API_RETURN(glUnmapBufferOES, target); } -void API_ENTRY(glGetBufferPointervOES)(GLenum target, GLenum pname, void** params) { +void API_ENTRY(glGetBufferPointervOES)(GLenum target, GLenum pname, GLvoid ** params) { CALL_GL_API(glGetBufferPointervOES, target, pname, params); } void API_ENTRY(glCurrentPaletteMatrixOES)(GLuint matrixpaletteindex) { @@ -268,3 +268,111 @@ void API_ENTRY(glGetTexGenivOES)(GLenum coord, GLenum pname, GLint *params) { void API_ENTRY(glGetTexGenxvOES)(GLenum coord, GLenum pname, GLfixed *params) { CALL_GL_API(glGetTexGenxvOES, coord, pname, params); } +void API_ENTRY(glBindVertexArrayOES)(GLuint array) { + CALL_GL_API(glBindVertexArrayOES, array); +} +void API_ENTRY(glDeleteVertexArraysOES)(GLsizei n, const GLuint *arrays) { + CALL_GL_API(glDeleteVertexArraysOES, n, arrays); +} +void API_ENTRY(glGenVertexArraysOES)(GLsizei n, GLuint *arrays) { + CALL_GL_API(glGenVertexArraysOES, n, arrays); +} +GLboolean API_ENTRY(glIsVertexArrayOES)(GLuint array) { + CALL_GL_API_RETURN(glIsVertexArrayOES, array); +} +void API_ENTRY(glDiscardFramebufferEXT)(GLenum target, GLsizei numAttachments, const GLenum *attachments) { + CALL_GL_API(glDiscardFramebufferEXT, target, numAttachments, attachments); +} +void API_ENTRY(glMultiDrawArraysEXT)(GLenum mode, GLint *first, GLsizei *count, GLsizei primcount) { + CALL_GL_API(glMultiDrawArraysEXT, mode, first, count, primcount); +} +void API_ENTRY(glMultiDrawElementsEXT)(GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount) { + CALL_GL_API(glMultiDrawElementsEXT, mode, count, type, indices, primcount); +} +void API_ENTRY(glClipPlanefIMG)(GLenum p, const GLfloat *eqn) { + CALL_GL_API(glClipPlanefIMG, p, eqn); +} +void API_ENTRY(glClipPlanexIMG)(GLenum p, const GLfixed *eqn) { + CALL_GL_API(glClipPlanexIMG, p, eqn); +} +void API_ENTRY(glRenderbufferStorageMultisampleIMG)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) { + CALL_GL_API(glRenderbufferStorageMultisampleIMG, target, samples, internalformat, width, height); +} +void API_ENTRY(glFramebufferTexture2DMultisampleIMG)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples) { + CALL_GL_API(glFramebufferTexture2DMultisampleIMG, target, attachment, textarget, texture, level, samples); +} +void API_ENTRY(glDeleteFencesNV)(GLsizei n, const GLuint *fences) { + CALL_GL_API(glDeleteFencesNV, n, fences); +} +void API_ENTRY(glGenFencesNV)(GLsizei n, GLuint *fences) { + CALL_GL_API(glGenFencesNV, n, fences); +} +GLboolean API_ENTRY(glIsFenceNV)(GLuint fence) { + CALL_GL_API_RETURN(glIsFenceNV, fence); +} +GLboolean API_ENTRY(glTestFenceNV)(GLuint fence) { + CALL_GL_API_RETURN(glTestFenceNV, fence); +} +void API_ENTRY(glGetFenceivNV)(GLuint fence, GLenum pname, GLint *params) { + CALL_GL_API(glGetFenceivNV, fence, pname, params); +} +void API_ENTRY(glFinishFenceNV)(GLuint fence) { + CALL_GL_API(glFinishFenceNV, fence); +} +void API_ENTRY(glSetFenceNV)(GLuint fence, GLenum condition) { + CALL_GL_API(glSetFenceNV, fence, condition); +} +void API_ENTRY(glGetDriverControlsQCOM)(GLint *num, GLsizei size, GLuint *driverControls) { + CALL_GL_API(glGetDriverControlsQCOM, num, size, driverControls); +} +void API_ENTRY(glGetDriverControlStringQCOM)(GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString) { + CALL_GL_API(glGetDriverControlStringQCOM, driverControl, bufSize, length, driverControlString); +} +void API_ENTRY(glEnableDriverControlQCOM)(GLuint driverControl) { + CALL_GL_API(glEnableDriverControlQCOM, driverControl); +} +void API_ENTRY(glDisableDriverControlQCOM)(GLuint driverControl) { + CALL_GL_API(glDisableDriverControlQCOM, driverControl); +} +void API_ENTRY(glExtGetTexturesQCOM)(GLuint *textures, GLint maxTextures, GLint *numTextures) { + CALL_GL_API(glExtGetTexturesQCOM, textures, maxTextures, numTextures); +} +void API_ENTRY(glExtGetBuffersQCOM)(GLuint *buffers, GLint maxBuffers, GLint *numBuffers) { + CALL_GL_API(glExtGetBuffersQCOM, buffers, maxBuffers, numBuffers); +} +void API_ENTRY(glExtGetRenderbuffersQCOM)(GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers) { + CALL_GL_API(glExtGetRenderbuffersQCOM, renderbuffers, maxRenderbuffers, numRenderbuffers); +} +void API_ENTRY(glExtGetFramebuffersQCOM)(GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers) { + CALL_GL_API(glExtGetFramebuffersQCOM, framebuffers, maxFramebuffers, numFramebuffers); +} +void API_ENTRY(glExtGetTexLevelParameterivQCOM)(GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params) { + CALL_GL_API(glExtGetTexLevelParameterivQCOM, texture, face, level, pname, params); +} +void API_ENTRY(glExtTexObjectStateOverrideiQCOM)(GLenum target, GLenum pname, GLint param) { + CALL_GL_API(glExtTexObjectStateOverrideiQCOM, target, pname, param); +} +void API_ENTRY(glExtGetTexSubImageQCOM)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid *texels) { + CALL_GL_API(glExtGetTexSubImageQCOM, target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, texels); +} +void API_ENTRY(glExtGetBufferPointervQCOM)(GLenum target, GLvoid **params) { + CALL_GL_API(glExtGetBufferPointervQCOM, target, params); +} +void API_ENTRY(glExtGetShadersQCOM)(GLuint *shaders, GLint maxShaders, GLint *numShaders) { + CALL_GL_API(glExtGetShadersQCOM, shaders, maxShaders, numShaders); +} +void API_ENTRY(glExtGetProgramsQCOM)(GLuint *programs, GLint maxPrograms, GLint *numPrograms) { + CALL_GL_API(glExtGetProgramsQCOM, programs, maxPrograms, numPrograms); +} +GLboolean API_ENTRY(glExtIsProgramBinaryQCOM)(GLuint program) { + CALL_GL_API_RETURN(glExtIsProgramBinaryQCOM, program); +} +void API_ENTRY(glExtGetProgramBinarySourceQCOM)(GLuint program, GLenum shadertype, GLchar *source, GLint *length) { + CALL_GL_API(glExtGetProgramBinarySourceQCOM, program, shadertype, source, length); +} +void API_ENTRY(glStartTilingQCOM)(GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask) { + CALL_GL_API(glStartTilingQCOM, x, y, width, height, preserveMask); +} +void API_ENTRY(glEndTilingQCOM)(GLbitfield preserveMask) { + CALL_GL_API(glEndTilingQCOM, preserveMask); +} diff --git a/opengl/libs/egl_impl.h b/opengl/libs/egl_impl.h index 1fba209f7707..c8f529ac0569 100644 --- a/opengl/libs/egl_impl.h +++ b/opengl/libs/egl_impl.h @@ -31,6 +31,7 @@ namespace android { struct egl_connection_t { + inline egl_connection_t() : dso(0) { } void * dso; gl_hooks_t * hooks[2]; EGLint major; diff --git a/opengl/libs/entries.in b/opengl/libs/entries.in index bbe3e236b2d6..61acb5f09eed 100644 --- a/opengl/libs/entries.in +++ b/opengl/libs/entries.in @@ -4,13 +4,14 @@ GL_ENTRY(void, glAlphaFuncx, GLenum func, GLclampx ref) GL_ENTRY(void, glAlphaFuncxOES, GLenum func, GLclampx ref) GL_ENTRY(void, glAttachShader, GLuint program, GLuint shader) GL_ENTRY(void, glBeginPerfMonitorAMD, GLuint monitor) -GL_ENTRY(void, glBindAttribLocation, GLuint program, GLuint index, const char* name) +GL_ENTRY(void, glBindAttribLocation, GLuint program, GLuint index, const GLchar* name) GL_ENTRY(void, glBindBuffer, GLenum target, GLuint buffer) GL_ENTRY(void, glBindFramebuffer, GLenum target, GLuint framebuffer) GL_ENTRY(void, glBindFramebufferOES, GLenum target, GLuint framebuffer) GL_ENTRY(void, glBindRenderbuffer, GLenum target, GLuint renderbuffer) GL_ENTRY(void, glBindRenderbufferOES, GLenum target, GLuint renderbuffer) GL_ENTRY(void, glBindTexture, GLenum target, GLuint texture) +GL_ENTRY(void, glBindVertexArrayOES, GLuint array) GL_ENTRY(void, glBlendColor, GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) GL_ENTRY(void, glBlendEquation, GLenum mode ) GL_ENTRY(void, glBlendEquationOES, GLenum mode) @@ -34,8 +35,10 @@ GL_ENTRY(void, glClearDepthxOES, GLclampx depth) GL_ENTRY(void, glClearStencil, GLint s) GL_ENTRY(void, glClientActiveTexture, GLenum texture) GL_ENTRY(void, glClipPlanef, GLenum plane, const GLfloat *equation) +GL_ENTRY(void, glClipPlanefIMG, GLenum p, const GLfloat *eqn) GL_ENTRY(void, glClipPlanefOES, GLenum plane, const GLfloat *equation) GL_ENTRY(void, glClipPlanex, GLenum plane, const GLfixed *equation) +GL_ENTRY(void, glClipPlanexIMG, GLenum p, const GLfixed *eqn) GL_ENTRY(void, glClipPlanexOES, GLenum plane, const GLfixed *equation) GL_ENTRY(void, glColor4f, GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) GL_ENTRY(void, glColor4ub, GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha) @@ -45,12 +48,14 @@ GL_ENTRY(void, glColorMask, GLboolean red, GLboolean green, GLboolean blue, GLbo GL_ENTRY(void, glColorPointer, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer) GL_ENTRY(void, glCompileShader, GLuint shader) GL_ENTRY(void, glCompressedTexImage2D, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data) -GL_ENTRY(void, glCompressedTexImage3DOES, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void* data) +GL_ENTRY(void, glCompressedTexImage3DOES, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data) GL_ENTRY(void, glCompressedTexSubImage2D, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data) -GL_ENTRY(void, glCompressedTexSubImage3DOES, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void* data) +GL_ENTRY(void, glCompressedTexSubImage3DOES, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid* data) GL_ENTRY(void, glCopyTexImage2D, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) GL_ENTRY(void, glCopyTexSubImage2D, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) GL_ENTRY(void, glCopyTexSubImage3DOES, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) +GL_ENTRY(void, glCoverageMaskNV, GLboolean mask) +GL_ENTRY(void, glCoverageOperationNV, GLenum operation) GL_ENTRY(GLuint, glCreateProgram, void) GL_ENTRY(GLuint, glCreateShader, GLenum type) GL_ENTRY(void, glCullFace, GLenum mode) @@ -65,6 +70,7 @@ GL_ENTRY(void, glDeleteRenderbuffers, GLsizei n, const GLuint* renderbuffers) GL_ENTRY(void, glDeleteRenderbuffersOES, GLsizei n, const GLuint* renderbuffers) GL_ENTRY(void, glDeleteShader, GLuint shader) GL_ENTRY(void, glDeleteTextures, GLsizei n, const GLuint *textures) +GL_ENTRY(void, glDeleteVertexArraysOES, GLsizei n, const GLuint *arrays) GL_ENTRY(void, glDepthFunc, GLenum func) GL_ENTRY(void, glDepthMask, GLboolean flag) GL_ENTRY(void, glDepthRangef, GLclampf zNear, GLclampf zFar) @@ -76,6 +82,7 @@ GL_ENTRY(void, glDisable, GLenum cap) GL_ENTRY(void, glDisableClientState, GLenum array) GL_ENTRY(void, glDisableDriverControlQCOM, GLuint driverControl) GL_ENTRY(void, glDisableVertexAttribArray, GLuint index) +GL_ENTRY(void, glDiscardFramebufferEXT, GLenum target, GLsizei numAttachments, const GLenum *attachments) GL_ENTRY(void, glDrawArrays, GLenum mode, GLint first, GLsizei count) GL_ENTRY(void, glDrawElements, GLenum mode, GLsizei count, GLenum type, const GLvoid *indices) GL_ENTRY(void, glDrawTexfOES, GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height) @@ -93,6 +100,19 @@ GL_ENTRY(void, glEnableClientState, GLenum array) GL_ENTRY(void, glEnableDriverControlQCOM, GLuint driverControl) GL_ENTRY(void, glEnableVertexAttribArray, GLuint index) GL_ENTRY(void, glEndPerfMonitorAMD, GLuint monitor) +GL_ENTRY(void, glEndTilingQCOM, GLbitfield preserveMask) +GL_ENTRY(void, glExtGetBufferPointervQCOM, GLenum target, GLvoid **params) +GL_ENTRY(void, glExtGetBuffersQCOM, GLuint *buffers, GLint maxBuffers, GLint *numBuffers) +GL_ENTRY(void, glExtGetFramebuffersQCOM, GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers) +GL_ENTRY(void, glExtGetProgramBinarySourceQCOM, GLuint program, GLenum shadertype, GLchar *source, GLint *length) +GL_ENTRY(void, glExtGetProgramsQCOM, GLuint *programs, GLint maxPrograms, GLint *numPrograms) +GL_ENTRY(void, glExtGetRenderbuffersQCOM, GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers) +GL_ENTRY(void, glExtGetShadersQCOM, GLuint *shaders, GLint maxShaders, GLint *numShaders) +GL_ENTRY(void, glExtGetTexLevelParameterivQCOM, GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params) +GL_ENTRY(void, glExtGetTexSubImageQCOM, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid *texels) +GL_ENTRY(void, glExtGetTexturesQCOM, GLuint *textures, GLint maxTextures, GLint *numTextures) +GL_ENTRY(GLboolean, glExtIsProgramBinaryQCOM, GLuint program) +GL_ENTRY(void, glExtTexObjectStateOverrideiQCOM, GLenum target, GLenum pname, GLint param) GL_ENTRY(void, glFinish, void) GL_ENTRY(void, glFinishFenceNV, GLuint fence) GL_ENTRY(void, glFlush, void) @@ -105,6 +125,7 @@ GL_ENTRY(void, glFogxvOES, GLenum pname, const GLfixed *params) GL_ENTRY(void, glFramebufferRenderbuffer, GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) GL_ENTRY(void, glFramebufferRenderbufferOES, GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) GL_ENTRY(void, glFramebufferTexture2D, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) +GL_ENTRY(void, glFramebufferTexture2DMultisampleIMG, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples) GL_ENTRY(void, glFramebufferTexture2DOES, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) GL_ENTRY(void, glFramebufferTexture3DOES, GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset) GL_ENTRY(void, glFrontFace, GLenum mode) @@ -120,20 +141,21 @@ GL_ENTRY(void, glGenPerfMonitorsAMD, GLsizei n, GLuint *monitors) GL_ENTRY(void, glGenRenderbuffers, GLsizei n, GLuint* renderbuffers) GL_ENTRY(void, glGenRenderbuffersOES, GLsizei n, GLuint* renderbuffers) GL_ENTRY(void, glGenTextures, GLsizei n, GLuint *textures) +GL_ENTRY(void, glGenVertexArraysOES, GLsizei n, GLuint *arrays) GL_ENTRY(void, glGenerateMipmap, GLenum target) GL_ENTRY(void, glGenerateMipmapOES, GLenum target) -GL_ENTRY(void, glGetActiveAttrib, GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name) -GL_ENTRY(void, glGetActiveUniform, GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name) +GL_ENTRY(void, glGetActiveAttrib, GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name) +GL_ENTRY(void, glGetActiveUniform, GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name) GL_ENTRY(void, glGetAttachedShaders, GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders) -GL_ENTRY(int, glGetAttribLocation, GLuint program, const char* name) +GL_ENTRY(int, glGetAttribLocation, GLuint program, const GLchar* name) GL_ENTRY(void, glGetBooleanv, GLenum pname, GLboolean *params) GL_ENTRY(void, glGetBufferParameteriv, GLenum target, GLenum pname, GLint *params) -GL_ENTRY(void, glGetBufferPointervOES, GLenum target, GLenum pname, void** params) +GL_ENTRY(void, glGetBufferPointervOES, GLenum target, GLenum pname, GLvoid ** params) GL_ENTRY(void, glGetClipPlanef, GLenum pname, GLfloat eqn[4]) GL_ENTRY(void, glGetClipPlanefOES, GLenum pname, GLfloat eqn[4]) GL_ENTRY(void, glGetClipPlanex, GLenum pname, GLfixed eqn[4]) GL_ENTRY(void, glGetClipPlanexOES, GLenum pname, GLfixed eqn[4]) -GL_ENTRY(void, glGetDriverControlStringQCOM, GLuint driverControl, GLsizei bufSize, GLsizei *length, char *driverControlString) +GL_ENTRY(void, glGetDriverControlStringQCOM, GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString) GL_ENTRY(void, glGetDriverControlsQCOM, GLint *num, GLsizei size, GLuint *driverControls) GL_ENTRY(GLenum, glGetError, void) GL_ENTRY(void, glGetFenceivNV, GLuint fence, GLenum pname, GLint *params) @@ -150,20 +172,20 @@ GL_ENTRY(void, glGetMaterialfv, GLenum face, GLenum pname, GLfloat *params) GL_ENTRY(void, glGetMaterialxv, GLenum face, GLenum pname, GLfixed *params) GL_ENTRY(void, glGetMaterialxvOES, GLenum face, GLenum pname, GLfixed *params) GL_ENTRY(void, glGetPerfMonitorCounterDataAMD, GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten) -GL_ENTRY(void, glGetPerfMonitorCounterInfoAMD, GLuint group, GLuint counter, GLenum pname, void *data) -GL_ENTRY(void, glGetPerfMonitorCounterStringAMD, GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, char *counterString) +GL_ENTRY(void, glGetPerfMonitorCounterInfoAMD, GLuint group, GLuint counter, GLenum pname, GLvoid *data) +GL_ENTRY(void, glGetPerfMonitorCounterStringAMD, GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString) GL_ENTRY(void, glGetPerfMonitorCountersAMD, GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters) -GL_ENTRY(void, glGetPerfMonitorGroupStringAMD, GLuint group, GLsizei bufSize, GLsizei *length, char *groupString) +GL_ENTRY(void, glGetPerfMonitorGroupStringAMD, GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString) GL_ENTRY(void, glGetPerfMonitorGroupsAMD, GLint *numGroups, GLsizei groupsSize, GLuint *groups) -GL_ENTRY(void, glGetPointerv, GLenum pname, void **params) -GL_ENTRY(void, glGetProgramBinaryOES, GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary) -GL_ENTRY(void, glGetProgramInfoLog, GLuint program, GLsizei bufsize, GLsizei* length, char* infolog) +GL_ENTRY(void, glGetPointerv, GLenum pname, GLvoid **params) +GL_ENTRY(void, glGetProgramBinaryOES, GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary) +GL_ENTRY(void, glGetProgramInfoLog, GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog) GL_ENTRY(void, glGetProgramiv, GLuint program, GLenum pname, GLint* params) GL_ENTRY(void, glGetRenderbufferParameteriv, GLenum target, GLenum pname, GLint* params) GL_ENTRY(void, glGetRenderbufferParameterivOES, GLenum target, GLenum pname, GLint* params) -GL_ENTRY(void, glGetShaderInfoLog, GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog) +GL_ENTRY(void, glGetShaderInfoLog, GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* infolog) GL_ENTRY(void, glGetShaderPrecisionFormat, GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision) -GL_ENTRY(void, glGetShaderSource, GLuint shader, GLsizei bufsize, GLsizei* length, char* source) +GL_ENTRY(void, glGetShaderSource, GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source) GL_ENTRY(void, glGetShaderiv, GLuint shader, GLenum pname, GLint* params) GL_ENTRY(const GLubyte *, glGetString, GLenum name) GL_ENTRY(void, glGetTexEnvfv, GLenum env, GLenum pname, GLfloat *params) @@ -177,10 +199,10 @@ GL_ENTRY(void, glGetTexParameterfv, GLenum target, GLenum pname, GLfloat *params GL_ENTRY(void, glGetTexParameteriv, GLenum target, GLenum pname, GLint *params) GL_ENTRY(void, glGetTexParameterxv, GLenum target, GLenum pname, GLfixed *params) GL_ENTRY(void, glGetTexParameterxvOES, GLenum target, GLenum pname, GLfixed *params) -GL_ENTRY(int, glGetUniformLocation, GLuint program, const char* name) +GL_ENTRY(int, glGetUniformLocation, GLuint program, const GLchar* name) GL_ENTRY(void, glGetUniformfv, GLuint program, GLint location, GLfloat* params) GL_ENTRY(void, glGetUniformiv, GLuint program, GLint location, GLint* params) -GL_ENTRY(void, glGetVertexAttribPointerv, GLuint index, GLenum pname, void** pointer) +GL_ENTRY(void, glGetVertexAttribPointerv, GLuint index, GLenum pname, GLvoid** pointer) GL_ENTRY(void, glGetVertexAttribfv, GLuint index, GLenum pname, GLfloat* params) GL_ENTRY(void, glGetVertexAttribiv, GLuint index, GLenum pname, GLint* params) GL_ENTRY(void, glHint, GLenum target, GLenum mode) @@ -194,6 +216,7 @@ GL_ENTRY(GLboolean, glIsRenderbuffer, GLuint renderbuffer) GL_ENTRY(GLboolean, glIsRenderbufferOES, GLuint renderbuffer) GL_ENTRY(GLboolean, glIsShader, GLuint shader) GL_ENTRY(GLboolean, glIsTexture, GLuint texture) +GL_ENTRY(GLboolean, glIsVertexArrayOES, GLuint array) GL_ENTRY(void, glLightModelf, GLenum pname, GLfloat param) GL_ENTRY(void, glLightModelfv, GLenum pname, const GLfloat *params) GL_ENTRY(void, glLightModelx, GLenum pname, GLfixed param) @@ -228,6 +251,8 @@ GL_ENTRY(void, glMatrixMode, GLenum mode) GL_ENTRY(void, glMultMatrixf, const GLfloat *m) GL_ENTRY(void, glMultMatrixx, const GLfixed *m) GL_ENTRY(void, glMultMatrixxOES, const GLfixed *m) +GL_ENTRY(void, glMultiDrawArraysEXT, GLenum mode, GLint *first, GLsizei *count, GLsizei primcount) +GL_ENTRY(void, glMultiDrawElementsEXT, GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount) GL_ENTRY(void, glMultiTexCoord4f, GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q) GL_ENTRY(void, glMultiTexCoord4x, GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q) GL_ENTRY(void, glMultiTexCoord4xOES, GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q) @@ -254,12 +279,13 @@ GL_ENTRY(void, glPolygonOffset, GLfloat factor, GLfloat units) GL_ENTRY(void, glPolygonOffsetx, GLfixed factor, GLfixed units) GL_ENTRY(void, glPolygonOffsetxOES, GLfixed factor, GLfixed units) GL_ENTRY(void, glPopMatrix, void) -GL_ENTRY(void, glProgramBinaryOES, GLuint program, GLenum binaryFormat, const void *binary, GLint length) +GL_ENTRY(void, glProgramBinaryOES, GLuint program, GLenum binaryFormat, const GLvoid *binary, GLint length) GL_ENTRY(void, glPushMatrix, void) GL_ENTRY(GLbitfield, glQueryMatrixxOES, GLfixed mantissa[16], GLint exponent[16]) GL_ENTRY(void, glReadPixels, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels) GL_ENTRY(void, glReleaseShaderCompiler, void) GL_ENTRY(void, glRenderbufferStorage, GLenum target, GLenum internalformat, GLsizei width, GLsizei height) +GL_ENTRY(void, glRenderbufferStorageMultisampleIMG, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) GL_ENTRY(void, glRenderbufferStorageOES, GLenum target, GLenum internalformat, GLsizei width, GLsizei height) GL_ENTRY(void, glRotatef, GLfloat angle, GLfloat x, GLfloat y, GLfloat z) GL_ENTRY(void, glRotatex, GLfixed angle, GLfixed x, GLfixed y, GLfixed z) @@ -274,8 +300,9 @@ GL_ENTRY(void, glScissor, GLint x, GLint y, GLsizei width, GLsizei height) GL_ENTRY(void, glSelectPerfMonitorCountersAMD, GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *countersList) GL_ENTRY(void, glSetFenceNV, GLuint fence, GLenum condition) GL_ENTRY(void, glShadeModel, GLenum mode) -GL_ENTRY(void, glShaderBinary, GLsizei n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLsizei length) -GL_ENTRY(void, glShaderSource, GLuint shader, GLsizei count, const char** string, const GLint* length) +GL_ENTRY(void, glShaderBinary, GLsizei n, const GLuint* shaders, GLenum binaryformat, const GLvoid* binary, GLsizei length) +GL_ENTRY(void, glShaderSource, GLuint shader, GLsizei count, const GLchar** string, const GLint* length) +GL_ENTRY(void, glStartTilingQCOM, GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask) GL_ENTRY(void, glStencilFunc, GLenum func, GLint ref, GLuint mask) GL_ENTRY(void, glStencilFuncSeparate, GLenum face, GLenum func, GLint ref, GLuint mask) GL_ENTRY(void, glStencilMask, GLuint mask) @@ -298,8 +325,8 @@ GL_ENTRY(void, glTexGeniOES, GLenum coord, GLenum pname, GLint param) GL_ENTRY(void, glTexGenivOES, GLenum coord, GLenum pname, const GLint *params) GL_ENTRY(void, glTexGenxOES, GLenum coord, GLenum pname, GLfixed param) GL_ENTRY(void, glTexGenxvOES, GLenum coord, GLenum pname, const GLfixed *params) -GL_ENTRY(void, glTexImage2D, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels) -GL_ENTRY(void, glTexImage3DOES, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void* pixels) +GL_ENTRY(void, glTexImage2D, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels) +GL_ENTRY(void, glTexImage3DOES, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels) GL_ENTRY(void, glTexParameterf, GLenum target, GLenum pname, GLfloat param) GL_ENTRY(void, glTexParameterfv, GLenum target, GLenum pname, const GLfloat *params) GL_ENTRY(void, glTexParameteri, GLenum target, GLenum pname, GLint param) @@ -309,7 +336,7 @@ GL_ENTRY(void, glTexParameterxOES, GLenum target, GLenum pname, GLfixed param) GL_ENTRY(void, glTexParameterxv, GLenum target, GLenum pname, const GLfixed *params) GL_ENTRY(void, glTexParameterxvOES, GLenum target, GLenum pname, const GLfixed *params) GL_ENTRY(void, glTexSubImage2D, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels) -GL_ENTRY(void, glTexSubImage3DOES, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void* pixels) +GL_ENTRY(void, glTexSubImage3DOES, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* pixels) GL_ENTRY(void, glTranslatef, GLfloat x, GLfloat y, GLfloat z) GL_ENTRY(void, glTranslatex, GLfixed x, GLfixed y, GLfixed z) GL_ENTRY(void, glTranslatexOES, GLfixed x, GLfixed y, GLfixed z) @@ -343,7 +370,7 @@ GL_ENTRY(void, glVertexAttrib3f, GLuint indx, GLfloat x, GLfloat y, GLfloat z) GL_ENTRY(void, glVertexAttrib3fv, GLuint indx, const GLfloat* values) GL_ENTRY(void, glVertexAttrib4f, GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w) GL_ENTRY(void, glVertexAttrib4fv, GLuint indx, const GLfloat* values) -GL_ENTRY(void, glVertexAttribPointer, GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* ptr) +GL_ENTRY(void, glVertexAttribPointer, GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* ptr) GL_ENTRY(void, glVertexPointer, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer) GL_ENTRY(void, glViewport, GLint x, GLint y, GLsizei width, GLsizei height) GL_ENTRY(void, glWeightPointerOES, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer) diff --git a/opengl/libs/hooks.h b/opengl/libs/hooks.h index f47f0930ba52..1ab58cc83349 100644 --- a/opengl/libs/hooks.h +++ b/opengl/libs/hooks.h @@ -37,7 +37,7 @@ #endif #undef NELEM #define NELEM(x) (sizeof(x)/sizeof(*(x))) -#define MAX_NUMBER_OF_GL_EXTENSIONS 32 +#define MAX_NUMBER_OF_GL_EXTENSIONS 64 #if defined(HAVE_ANDROID_OS) && !USE_SLOW_BINDING && __OPTIMIZE__ @@ -86,7 +86,7 @@ struct gl_hooks_t { #include "entries.in" } gl; struct gl_ext_t { - void (*extensions[MAX_NUMBER_OF_GL_EXTENSIONS])(void); + __eglMustCastToProperFunctionPointerType extensions[MAX_NUMBER_OF_GL_EXTENSIONS]; } ext; }; #undef GL_ENTRY diff --git a/opengl/tests/angeles/app-linux.cpp b/opengl/tests/angeles/app-linux.cpp index 06fa0c2bd711..4d10ee509924 100644 --- a/opengl/tests/angeles/app-linux.cpp +++ b/opengl/tests/angeles/app-linux.cpp @@ -63,7 +63,7 @@ using namespace android; int gAppAlive = 1; static const char sAppName[] = - "San Angeles Observation OpenGL ES version example (Linux)"; + "San Angeles Observation OpenGL ES version example (Linux)"; static int sWindowWidth = WINDOW_DEFAULT_WIDTH; static int sWindowHeight = WINDOW_DEFAULT_HEIGHT; @@ -74,22 +74,22 @@ static EGLSurface sEglSurface = EGL_NO_SURFACE; const char *egl_strerror(unsigned err) { switch(err){ - case EGL_SUCCESS: return "SUCCESS"; - case EGL_NOT_INITIALIZED: return "NOT INITIALIZED"; - case EGL_BAD_ACCESS: return "BAD ACCESS"; - case EGL_BAD_ALLOC: return "BAD ALLOC"; - case EGL_BAD_ATTRIBUTE: return "BAD_ATTRIBUTE"; - case EGL_BAD_CONFIG: return "BAD CONFIG"; - case EGL_BAD_CONTEXT: return "BAD CONTEXT"; - case EGL_BAD_CURRENT_SURFACE: return "BAD CURRENT SURFACE"; - case EGL_BAD_DISPLAY: return "BAD DISPLAY"; - case EGL_BAD_MATCH: return "BAD MATCH"; - case EGL_BAD_NATIVE_PIXMAP: return "BAD NATIVE PIXMAP"; - case EGL_BAD_NATIVE_WINDOW: return "BAD NATIVE WINDOW"; - case EGL_BAD_PARAMETER: return "BAD PARAMETER"; - case EGL_BAD_SURFACE: return "BAD_SURFACE"; -// case EGL_CONTEXT_LOST: return "CONTEXT LOST"; - default: return "UNKNOWN"; + case EGL_SUCCESS: return "SUCCESS"; + case EGL_NOT_INITIALIZED: return "NOT INITIALIZED"; + case EGL_BAD_ACCESS: return "BAD ACCESS"; + case EGL_BAD_ALLOC: return "BAD ALLOC"; + case EGL_BAD_ATTRIBUTE: return "BAD_ATTRIBUTE"; + case EGL_BAD_CONFIG: return "BAD CONFIG"; + case EGL_BAD_CONTEXT: return "BAD CONTEXT"; + case EGL_BAD_CURRENT_SURFACE: return "BAD CURRENT SURFACE"; + case EGL_BAD_DISPLAY: return "BAD DISPLAY"; + case EGL_BAD_MATCH: return "BAD MATCH"; + case EGL_BAD_NATIVE_PIXMAP: return "BAD NATIVE PIXMAP"; + case EGL_BAD_NATIVE_WINDOW: return "BAD NATIVE WINDOW"; + case EGL_BAD_PARAMETER: return "BAD PARAMETER"; + case EGL_BAD_SURFACE: return "BAD_SURFACE"; + // case EGL_CONTEXT_LOST: return "CONTEXT LOST"; + default: return "UNKNOWN"; } } @@ -118,52 +118,59 @@ static void checkEGLErrors() fprintf(stderr, "EGL Error: 0x%04x\n", (int)error); } -static int initGraphics() +static int initGraphics(unsigned samples) { EGLint configAttribs[] = { - EGL_DEPTH_SIZE, 16, - EGL_NONE - }; - - EGLint majorVersion; - EGLint minorVersion; - EGLContext context; - EGLConfig config; - EGLSurface surface; - EGLint w, h; - EGLDisplay dpy; - - EGLNativeWindowType window = android_createDisplaySurface(); - - dpy = eglGetDisplay(EGL_DEFAULT_DISPLAY); - eglInitialize(dpy, &majorVersion, &minorVersion); - - status_t err = EGLUtils::selectConfigForNativeWindow( - dpy, configAttribs, window, &config); - if (err) { - fprintf(stderr, "couldn't find an EGLConfig matching the screen format\n"); - return 0; - } - - surface = eglCreateWindowSurface(dpy, config, window, NULL); - egl_error("eglCreateWindowSurface"); - - fprintf(stderr,"surface = %p\n", surface); - - context = eglCreateContext(dpy, config, NULL, NULL); - egl_error("eglCreateContext"); - fprintf(stderr,"context = %p\n", context); - - eglMakeCurrent(dpy, surface, surface, context); - egl_error("eglMakeCurrent"); - - eglQuerySurface(dpy, surface, EGL_WIDTH, &sWindowWidth); - eglQuerySurface(dpy, surface, EGL_HEIGHT, &sWindowHeight); + EGL_DEPTH_SIZE, 16, + EGL_SAMPLE_BUFFERS, samples ? 1 : 0, + EGL_SAMPLES, samples, + EGL_NONE + }; + + EGLint majorVersion; + EGLint minorVersion; + EGLContext context; + EGLConfig config; + EGLSurface surface; + EGLint w, h; + EGLDisplay dpy; + + EGLNativeWindowType window = android_createDisplaySurface(); + + dpy = eglGetDisplay(EGL_DEFAULT_DISPLAY); + eglInitialize(dpy, &majorVersion, &minorVersion); + + status_t err = EGLUtils::selectConfigForNativeWindow( + dpy, configAttribs, window, &config); + if (err) { + fprintf(stderr, "couldn't find an EGLConfig matching the screen format\n"); + return 0; + } + + surface = eglCreateWindowSurface(dpy, config, window, NULL); + egl_error("eglCreateWindowSurface"); + + fprintf(stderr,"surface = %p\n", surface); + + context = eglCreateContext(dpy, config, NULL, NULL); + egl_error("eglCreateContext"); + fprintf(stderr,"context = %p\n", context); + + eglMakeCurrent(dpy, surface, surface, context); + egl_error("eglMakeCurrent"); + + eglQuerySurface(dpy, surface, EGL_WIDTH, &sWindowWidth); + eglQuerySurface(dpy, surface, EGL_HEIGHT, &sWindowHeight); sEglDisplay = dpy; sEglSurface = surface; sEglContext = context; + if (samples == 0) { + // GL_MULTISAMPLE is enabled by default + glDisable(GL_MULTISAMPLE); + } + return EGL_TRUE; } @@ -179,35 +186,47 @@ static void deinitGraphics() int main(int argc, char *argv[]) { - // not referenced: - argc = argc; - argv = argv; + unsigned samples = 0; + printf("usage: %s [samples]\n", argv[0]); + if (argc == 2) { + samples = atoi( argv[1] ); + printf("Multisample enabled: GL_SAMPLES = %u\n", samples); + } - if (!initGraphics()) + if (!initGraphics(samples)) { fprintf(stderr, "Graphics initialization failed.\n"); return EXIT_FAILURE; } appInit(); - + + struct timeval timeTemp; + int frameCount = 0; + gettimeofday(&timeTemp, NULL); + double totalTime = timeTemp.tv_usec/1000000.0 + timeTemp.tv_sec; + while (gAppAlive) { struct timeval timeNow; - if (gAppAlive) - { - gettimeofday(&timeNow, NULL); - appRender(timeNow.tv_sec * 1000 + timeNow.tv_usec / 1000, - sWindowWidth, sWindowHeight); - checkGLErrors(); - eglSwapBuffers(sEglDisplay, sEglSurface); - checkEGLErrors(); - } + gettimeofday(&timeNow, NULL); + appRender(timeNow.tv_sec * 1000 + timeNow.tv_usec / 1000, + sWindowWidth, sWindowHeight); + checkGLErrors(); + eglSwapBuffers(sEglDisplay, sEglSurface); + checkEGLErrors(); + frameCount++; } + gettimeofday(&timeTemp, NULL); + appDeinit(); deinitGraphics(); + totalTime = (timeTemp.tv_usec/1000000.0 + timeTemp.tv_sec) - totalTime; + printf("totalTime=%f s, frameCount=%d, %.2f fps\n", + totalTime, frameCount, frameCount/totalTime); + return EXIT_SUCCESS; } diff --git a/opengl/tests/gl2_basic/gl2_basic.cpp b/opengl/tests/gl2_basic/gl2_basic.cpp index 2361db5f3219..f274c7c4ef9a 100644 --- a/opengl/tests/gl2_basic/gl2_basic.cpp +++ b/opengl/tests/gl2_basic/gl2_basic.cpp @@ -195,7 +195,6 @@ void printEGLConfiguration(EGLDisplay dpy, EGLConfig config) { X(EGL_NATIVE_RENDERABLE), X(EGL_NATIVE_VISUAL_ID), X(EGL_NATIVE_VISUAL_TYPE), - X(EGL_PRESERVED_RESOURCES), X(EGL_SAMPLES), X(EGL_SAMPLE_BUFFERS), X(EGL_SURFACE_TYPE), diff --git a/opengl/tests/gl_basic/gl_basic.cpp b/opengl/tests/gl_basic/gl_basic.cpp index feb964a151aa..0cc8398a4ada 100644 --- a/opengl/tests/gl_basic/gl_basic.cpp +++ b/opengl/tests/gl_basic/gl_basic.cpp @@ -114,7 +114,6 @@ void printEGLConfiguration(EGLDisplay dpy, EGLConfig config) { X(EGL_NATIVE_RENDERABLE), X(EGL_NATIVE_VISUAL_ID), X(EGL_NATIVE_VISUAL_TYPE), - X(EGL_PRESERVED_RESOURCES), X(EGL_SAMPLES), X(EGL_SAMPLE_BUFFERS), X(EGL_SURFACE_TYPE), diff --git a/opengl/tests/gl_jni/jni/gl_code.cpp b/opengl/tests/gl_jni/jni/gl_code.cpp index 33b25ab6c775..f031c79cd33e 100644 --- a/opengl/tests/gl_jni/jni/gl_code.cpp +++ b/opengl/tests/gl_jni/jni/gl_code.cpp @@ -180,4 +180,5 @@ JNIEXPORT void JNICALL Java_com_android_gljni_GLJNILib_step(JNIEnv * env, jobjec JNIEXPORT void JNICALL Java_com_android_gljni_GLJNILib_changeBackground(JNIEnv * env, jobject obj) { background = 1.0f - background; -}
\ No newline at end of file +} + diff --git a/opengl/tools/glgen/specs/gles11/GLES20.spec b/opengl/tools/glgen/specs/gles11/GLES20.spec index 61094d17e4d0..ee88f592117d 100644 --- a/opengl/tools/glgen/specs/gles11/GLES20.spec +++ b/opengl/tools/glgen/specs/gles11/GLES20.spec @@ -39,6 +39,7 @@ void glDetachShader ( GLuint program, GLuint shader ) void glDisable ( GLenum cap )
void glDisableVertexAttribArray ( GLuint index )
void glDrawArrays ( GLenum mode, GLint first, GLsizei count )
+void glDrawElements ( GLenum mode, GLsizei count, GLenum type, GLint offset )
void glDrawElements ( GLenum mode, GLsizei count, GLenum type, const GLvoid *indices )
void glEnable ( GLenum cap )
void glEnableVertexAttribArray ( GLuint index )
@@ -138,5 +139,6 @@ void glVertexAttrib3f ( GLuint indx, GLfloat x, GLfloat y, GLfloat z ) void glVertexAttrib3fv ( GLuint indx, const GLfloat *values )
void glVertexAttrib4f ( GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w )
void glVertexAttrib4fv ( GLuint indx, const GLfloat *values )
+void glVertexAttribPointer ( GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLint offset )
void glVertexAttribPointer ( GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *ptr )
-void glViewport ( GLint x, GLint y, GLsizei width, GLsizei height )
\ No newline at end of file +void glViewport ( GLint x, GLint y, GLsizei width, GLsizei height )
diff --git a/opengl/tools/glgen/src/JniCodeEmitter.java b/opengl/tools/glgen/src/JniCodeEmitter.java index ebaca908d14b..9d8c5a061698 100644 --- a/opengl/tools/glgen/src/JniCodeEmitter.java +++ b/opengl/tools/glgen/src/JniCodeEmitter.java @@ -695,7 +695,7 @@ public class JniCodeEmitter { boolean isPointerFunc = isPointerFunc(jfunc); boolean isVBOPointerFunc = (outName.endsWith("Pointer") || outName.endsWith("PointerOES") || - outName.endsWith("DrawElements")) && + outName.endsWith("DrawElements") || outName.endsWith("VertexAttribPointer")) && !jfunc.getCFunc().hasPointerArg(); if (isPointerFunc) { outName += "Bounds"; |
