Compare commits
22 Commits
mesa-19.2.
...
android-x8
Author | SHA1 | Date | |
---|---|---|---|
|
f189dfe9e9 | ||
|
d1ccafa5b7 | ||
|
f7a0636329 | ||
|
6269411b81 | ||
|
88721c8555 | ||
|
4128957d30 | ||
|
07a8209c3f | ||
|
b0a79b3512 | ||
|
121fc671f4 | ||
|
8148db591a | ||
|
0d4dcb2584 | ||
|
1337551451 | ||
|
6719d59a85 | ||
|
3fe7753b70 | ||
|
017c563cff | ||
|
bf21df37c6 | ||
|
17935c0191 | ||
|
7aceb74db7 | ||
|
88e9712a68 | ||
|
2e9e27c0f7 | ||
|
455a7585de | ||
|
25ed79d830 |
3
Android.mk
Normal file
3
Android.mk
Normal file
@@ -0,0 +1,3 @@
|
||||
ifneq ($(TARGET_SIMULATOR),true)
|
||||
include $(call all-subdir-makefiles)
|
||||
endif
|
@@ -376,6 +376,28 @@ typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSREGIONNOK) (EGLDisplay dpy, EG
|
||||
#define EGL_Y_INVERTED_NOK 0x307F
|
||||
#endif /* EGL_NOK_texture_from_pixmap */
|
||||
|
||||
#ifndef EGL_ANDROID_image_native_buffer
|
||||
#define EGL_ANDROID_image_native_buffer 1
|
||||
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
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglSetSwapRectangleANDROID (EGLDisplay dpy, EGLSurface draw, EGLint left, EGLint top, EGLint width, EGLint height);
|
||||
#endif /* EGL_EGLEXT_PROTOTYPES */
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSETSWAPRECTANGLEANDROIDPROC) (EGLDisplay dpy, EGLSurface draw, EGLint left, EGLint top, EGLint width, EGLint height);
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@@ -78,6 +78,15 @@ typedef int EGLNativeDisplayType;
|
||||
typedef void *EGLNativeWindowType;
|
||||
typedef void *EGLNativePixmapType;
|
||||
|
||||
#elif defined(ANDROID) /* Android */
|
||||
|
||||
struct android_native_window_t;
|
||||
struct egl_native_pixmap_t;
|
||||
|
||||
typedef struct android_native_window_t* EGLNativeWindowType;
|
||||
typedef struct egl_native_pixmap_t* EGLNativePixmapType;
|
||||
typedef void* EGLNativeDisplayType;
|
||||
|
||||
#elif defined(__unix__) || defined(__unix)
|
||||
|
||||
#ifdef MESA_EGL_NO_X11_HEADERS
|
||||
|
@@ -788,6 +788,7 @@ struct __DRIdri2ExtensionRec {
|
||||
#define __DRI_IMAGE_FORMAT_RGB565 0x1001
|
||||
#define __DRI_IMAGE_FORMAT_XRGB8888 0x1002
|
||||
#define __DRI_IMAGE_FORMAT_ARGB8888 0x1003
|
||||
#define __DRI_IMAGE_FORMAT_RGBA8888_REV 0x1004
|
||||
|
||||
#define __DRI_IMAGE_USE_SHARE 0x0001
|
||||
#define __DRI_IMAGE_USE_SCANOUT 0x0002
|
||||
|
96
src/Android.mk
Normal file
96
src/Android.mk
Normal file
@@ -0,0 +1,96 @@
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
# build classic static libraries
|
||||
MESA_BUILD_CLASSIC := false
|
||||
|
||||
# build gallium static libraries
|
||||
MESA_BUILD_GALLIUM := false
|
||||
|
||||
# build gralloc.i915
|
||||
MESA_BUILD_I915 := false
|
||||
|
||||
# build libGLES_i915c
|
||||
MESA_BUILD_I915C := false
|
||||
|
||||
# build libGLES_swrast
|
||||
MESA_BUILD_SWRAST := false
|
||||
|
||||
# build gralloc.vmwgfx
|
||||
MESA_BUILD_VMWGFX := false
|
||||
|
||||
# build libGLES_i915g
|
||||
MESA_BUILD_I915G := false
|
||||
|
||||
# for testing purpose
|
||||
#BOARD_USES_I915C := true
|
||||
#BOARD_USES_I915G := true
|
||||
#BOARD_USES_I965C := true
|
||||
#BOARD_USES_VMWGFX := true
|
||||
|
||||
MESA_GRALLOC_NAME :=
|
||||
MESA_GLES_NAME :=
|
||||
|
||||
ifeq ($(strip $(BOARD_USES_I915C)),true)
|
||||
MESA_BUILD_CLASSIC := true
|
||||
MESA_BUILD_I915 := true
|
||||
MESA_BUILD_I915C := true
|
||||
|
||||
MESA_GRALLOC_NAME := i915
|
||||
MESA_GLES_NAME := i915c
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(BOARD_USES_I915G)),true)
|
||||
MESA_BUILD_GALLIUM := true
|
||||
MESA_BUILD_I915 := true
|
||||
MESA_BUILD_I915G := true
|
||||
|
||||
MESA_GRALLOC_NAME := i915
|
||||
MESA_GLES_NAME := i915g
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(BOARD_USES_I965C)),true)
|
||||
MESA_BUILD_CLASSIC := true
|
||||
MESA_BUILD_I915 := true
|
||||
MESA_BUILD_I965C := true
|
||||
|
||||
MESA_GRALLOC_NAME := i915
|
||||
MESA_GLES_NAME := i965c
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(BOARD_USES_VMWGFX)),true)
|
||||
MESA_BUILD_GALLIUM := true
|
||||
MESA_BUILD_SWRAST := true
|
||||
MESA_BUILD_VMWGFX := true
|
||||
|
||||
MESA_GRALLOC_NAME := vmwgfx
|
||||
MESA_GLES_NAME := swrast
|
||||
endif
|
||||
|
||||
ifneq ($(strip $(MESA_GRALLOC_NAME) $(MESA_GLES_NAME)),)
|
||||
|
||||
# build the real modules
|
||||
include $(call all-subdir-makefiles)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
symlink := $(TARGET_OUT_SHARED_LIBRARIES)/hw/gralloc.$(TARGET_PRODUCT)$(TARGET_SHLIB_SUFFIX)
|
||||
symlink_to := gralloc.$(MESA_GRALLOC_NAME)$(TARGET_SHLIB_SUFFIX)
|
||||
$(symlink): PRIVATE_TO := $(symlink_to)
|
||||
$(symlink): $(TARGET_OUT_SHARED_LIBRARIES)/hw/$(symlink_to)
|
||||
@echo "Symlink: $@ -> $(PRIVATE_TO)"
|
||||
@mkdir -p $(dir $@)
|
||||
@rm -rf $@
|
||||
$(hide) ln -sf $(PRIVATE_TO) $@
|
||||
ALL_PREBUILT += $(symlink)
|
||||
|
||||
symlink := $(TARGET_OUT_SHARED_LIBRARIES)/egl/libGLES_mesa$(TARGET_SHLIB_SUFFIX)
|
||||
symlink_to := libGLES_$(MESA_GLES_NAME)$(TARGET_SHLIB_SUFFIX)
|
||||
$(symlink): PRIVATE_TO := $(symlink_to)
|
||||
$(symlink): $(TARGET_OUT_SHARED_LIBRARIES)/egl/$(symlink_to)
|
||||
@echo "Symlink: $@ -> $(PRIVATE_TO)"
|
||||
@mkdir -p $(dir $@)
|
||||
@rm -rf $@
|
||||
$(hide) ln -sf $(PRIVATE_TO) $@
|
||||
ALL_PREBUILT += $(symlink)
|
||||
|
||||
endif # MESA_GRALLOC_NAME || MESA_GLES_NAME
|
68
src/egl/Android.mk
Normal file
68
src/egl/Android.mk
Normal file
@@ -0,0 +1,68 @@
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
# from main/Makefile
|
||||
SOURCES = \
|
||||
eglapi.c \
|
||||
eglarray.c \
|
||||
eglconfig.c \
|
||||
eglcontext.c \
|
||||
eglcurrent.c \
|
||||
egldisplay.c \
|
||||
egldriver.c \
|
||||
eglfallbacks.c \
|
||||
eglglobals.c \
|
||||
eglimage.c \
|
||||
egllog.c \
|
||||
eglmisc.c \
|
||||
eglmode.c \
|
||||
eglscreen.c \
|
||||
eglstring.c \
|
||||
eglsurface.c \
|
||||
eglsync.c
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_SRC_FILES := \
|
||||
$(addprefix main/, $(SOURCES))
|
||||
|
||||
LOCAL_CFLAGS := \
|
||||
-DPTHREADS \
|
||||
-D_EGL_NATIVE_PLATFORM=_EGL_PLATFORM_ANDROID \
|
||||
-D_EGL_DRIVER_SEARCH_DIR=\"/system/lib/egl\" \
|
||||
-fvisibility=hidden \
|
||||
-Wno-sign-compare
|
||||
|
||||
LOCAL_C_INCLUDES := \
|
||||
external/mesa/include
|
||||
|
||||
LOCAL_MODULE := libmesa_egl
|
||||
|
||||
include $(BUILD_STATIC_LIBRARY)
|
||||
|
||||
ifeq ($(strip $(MESA_BUILD_CLASSIC)),true)
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_SRC_FILES := \
|
||||
drivers/android/egl_android.c \
|
||||
drivers/android/droid.c \
|
||||
drivers/android/droid_core.c \
|
||||
drivers/android/droid_image.c
|
||||
|
||||
|
||||
LOCAL_CFLAGS := \
|
||||
-DPTHREADS \
|
||||
-fvisibility=hidden \
|
||||
-Wno-sign-compare
|
||||
|
||||
LOCAL_C_INCLUDES := \
|
||||
external/mesa/include \
|
||||
external/mesa/src/mapi \
|
||||
external/mesa/src/egl/main \
|
||||
external/mesa/src/gralloc \
|
||||
external/drm \
|
||||
external/drm/include/drm
|
||||
|
||||
LOCAL_MODULE := libmesa_classic_egl
|
||||
|
||||
include $(BUILD_STATIC_LIBRARY)
|
||||
endif # MESA_BUILD_CLASSIC
|
649
src/egl/drivers/android/droid.c
Normal file
649
src/egl/drivers/android/droid.c
Normal file
@@ -0,0 +1,649 @@
|
||||
/*
|
||||
* Copyright © 2010 Intel Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* Authors:
|
||||
* Kristian Høgsberg <krh@bitplanet.net>
|
||||
*/
|
||||
|
||||
#define LOG_TAG "MESA-EGL"
|
||||
|
||||
#include <cutils/log.h>
|
||||
|
||||
#include "glapi/glapi.h"
|
||||
#include "droid.h"
|
||||
|
||||
static const __DRIuseInvalidateExtension use_invalidate = {
|
||||
{ __DRI_USE_INVALIDATE, 1 }
|
||||
};
|
||||
|
||||
static __DRIimage *
|
||||
droid_lookup_egl_image(__DRIscreen *screen, void *image, void *data)
|
||||
{
|
||||
_EGLDisplay *disp = data;
|
||||
struct droid_egl_image *dimg;
|
||||
_EGLImage *img;
|
||||
|
||||
(void) screen;
|
||||
|
||||
img = _eglLookupImage(image, disp);
|
||||
if (img == NULL) {
|
||||
_eglError(EGL_BAD_PARAMETER, "droid_lookup_egl_image");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
dimg = droid_egl_image(image);
|
||||
|
||||
return dimg->dri_image;
|
||||
}
|
||||
|
||||
static const __DRIimageLookupExtension image_lookup_extension = {
|
||||
{ __DRI_IMAGE_LOOKUP, 1 },
|
||||
droid_lookup_egl_image
|
||||
};
|
||||
|
||||
static int
|
||||
get_format_bpp(int native)
|
||||
{
|
||||
int bpp;
|
||||
|
||||
/* see libpixelflinger/format.cpp */
|
||||
switch (native) {
|
||||
case GGL_PIXEL_FORMAT_RGBA_8888:
|
||||
case GGL_PIXEL_FORMAT_RGBX_8888:
|
||||
case GGL_PIXEL_FORMAT_BGRA_8888:
|
||||
bpp = 4;
|
||||
break;
|
||||
case GGL_PIXEL_FORMAT_RGB_888:
|
||||
bpp = 3;
|
||||
break;
|
||||
case GGL_PIXEL_FORMAT_RGB_565:
|
||||
case GGL_PIXEL_FORMAT_RGBA_5551:
|
||||
case GGL_PIXEL_FORMAT_RGBA_4444:
|
||||
case GGL_PIXEL_FORMAT_LA_88:
|
||||
bpp = 2;
|
||||
break;
|
||||
case GGL_PIXEL_FORMAT_RGB_332:
|
||||
case GGL_PIXEL_FORMAT_A_8:
|
||||
case GGL_PIXEL_FORMAT_L_8:
|
||||
bpp = 1;
|
||||
break;
|
||||
default:
|
||||
bpp = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
return bpp;
|
||||
}
|
||||
|
||||
#include <gralloc_gem.h>
|
||||
int
|
||||
get_native_buffer_name(struct android_native_buffer_t *buf)
|
||||
{
|
||||
struct drm_bo_t *bo;
|
||||
|
||||
bo = drm_gem_get(buf->handle);
|
||||
|
||||
return (bo) ? bo->name : 0;
|
||||
}
|
||||
|
||||
EGLBoolean
|
||||
droid_dequeue_buffer(struct droid_egl_surface *dsurf)
|
||||
{
|
||||
__DRIbuffer *buf = &dsurf->dri_buffer;
|
||||
|
||||
if (dsurf->window->dequeueBuffer(dsurf->window, &dsurf->buffer))
|
||||
return EGL_FALSE;
|
||||
|
||||
dsurf->buffer->common.incRef(&dsurf->buffer->common);
|
||||
dsurf->window->lockBuffer(dsurf->window, dsurf->buffer);
|
||||
|
||||
buf->attachment = __DRI_BUFFER_FAKE_FRONT_LEFT;
|
||||
buf->name = get_native_buffer_name(dsurf->buffer);
|
||||
buf->cpp = get_format_bpp(dsurf->buffer->format);
|
||||
buf->pitch = dsurf->buffer->stride * buf->cpp;
|
||||
buf->flags = 0;
|
||||
|
||||
return EGL_TRUE;
|
||||
}
|
||||
|
||||
EGLBoolean
|
||||
droid_enqueue_buffer(struct droid_egl_surface *dsurf)
|
||||
{
|
||||
dsurf->window->queueBuffer(dsurf->window, dsurf->buffer);
|
||||
|
||||
dsurf->buffer->common.decRef(&dsurf->buffer->common);
|
||||
dsurf->buffer = NULL;
|
||||
|
||||
return EGL_TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
droid_flush_front_buffer(__DRIdrawable * driDrawable, void *loaderPrivate)
|
||||
{
|
||||
}
|
||||
|
||||
static __DRIbuffer *
|
||||
droid_get_buffers_with_format(__DRIdrawable * driDrawable,
|
||||
int *width, int *height,
|
||||
unsigned int *attachments, int count,
|
||||
int *out_count, void *loaderPrivate)
|
||||
{
|
||||
struct droid_egl_surface *dsurf = loaderPrivate;
|
||||
struct droid_egl_display *ddpy =
|
||||
droid_egl_display(dsurf->base.Resource.Display);
|
||||
|
||||
if (!dsurf->buffer) {
|
||||
if (!droid_dequeue_buffer(dsurf))
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (width)
|
||||
*width = dsurf->buffer->width;
|
||||
if (height)
|
||||
*height = dsurf->buffer->height;
|
||||
|
||||
*out_count = 1;
|
||||
|
||||
return &dsurf->dri_buffer;
|
||||
}
|
||||
|
||||
static const EGLint droid_to_egl_attribute_map[] = {
|
||||
0,
|
||||
EGL_BUFFER_SIZE, /* __DRI_ATTRIB_BUFFER_SIZE */
|
||||
EGL_LEVEL, /* __DRI_ATTRIB_LEVEL */
|
||||
EGL_RED_SIZE, /* __DRI_ATTRIB_RED_SIZE */
|
||||
EGL_GREEN_SIZE, /* __DRI_ATTRIB_GREEN_SIZE */
|
||||
EGL_BLUE_SIZE, /* __DRI_ATTRIB_BLUE_SIZE */
|
||||
EGL_LUMINANCE_SIZE, /* __DRI_ATTRIB_LUMINANCE_SIZE */
|
||||
EGL_ALPHA_SIZE, /* __DRI_ATTRIB_ALPHA_SIZE */
|
||||
0, /* __DRI_ATTRIB_ALPHA_MASK_SIZE */
|
||||
EGL_DEPTH_SIZE, /* __DRI_ATTRIB_DEPTH_SIZE */
|
||||
EGL_STENCIL_SIZE, /* __DRI_ATTRIB_STENCIL_SIZE */
|
||||
0, /* __DRI_ATTRIB_ACCUM_RED_SIZE */
|
||||
0, /* __DRI_ATTRIB_ACCUM_GREEN_SIZE */
|
||||
0, /* __DRI_ATTRIB_ACCUM_BLUE_SIZE */
|
||||
0, /* __DRI_ATTRIB_ACCUM_ALPHA_SIZE */
|
||||
EGL_SAMPLE_BUFFERS, /* __DRI_ATTRIB_SAMPLE_BUFFERS */
|
||||
EGL_SAMPLES, /* __DRI_ATTRIB_SAMPLES */
|
||||
0, /* __DRI_ATTRIB_RENDER_TYPE, */
|
||||
0, /* __DRI_ATTRIB_CONFIG_CAVEAT */
|
||||
0, /* __DRI_ATTRIB_CONFORMANT */
|
||||
0, /* __DRI_ATTRIB_DOUBLE_BUFFER */
|
||||
0, /* __DRI_ATTRIB_STEREO */
|
||||
0, /* __DRI_ATTRIB_AUX_BUFFERS */
|
||||
0, /* __DRI_ATTRIB_TRANSPARENT_TYPE */
|
||||
0, /* __DRI_ATTRIB_TRANSPARENT_INDEX_VALUE */
|
||||
0, /* __DRI_ATTRIB_TRANSPARENT_RED_VALUE */
|
||||
0, /* __DRI_ATTRIB_TRANSPARENT_GREEN_VALUE */
|
||||
0, /* __DRI_ATTRIB_TRANSPARENT_BLUE_VALUE */
|
||||
0, /* __DRI_ATTRIB_TRANSPARENT_ALPHA_VALUE */
|
||||
0, /* __DRI_ATTRIB_FLOAT_MODE */
|
||||
0, /* __DRI_ATTRIB_RED_MASK */
|
||||
0, /* __DRI_ATTRIB_GREEN_MASK */
|
||||
0, /* __DRI_ATTRIB_BLUE_MASK */
|
||||
0, /* __DRI_ATTRIB_ALPHA_MASK */
|
||||
EGL_MAX_PBUFFER_WIDTH, /* __DRI_ATTRIB_MAX_PBUFFER_WIDTH */
|
||||
EGL_MAX_PBUFFER_HEIGHT, /* __DRI_ATTRIB_MAX_PBUFFER_HEIGHT */
|
||||
EGL_MAX_PBUFFER_PIXELS, /* __DRI_ATTRIB_MAX_PBUFFER_PIXELS */
|
||||
0, /* __DRI_ATTRIB_OPTIMAL_PBUFFER_WIDTH */
|
||||
0, /* __DRI_ATTRIB_OPTIMAL_PBUFFER_HEIGHT */
|
||||
0, /* __DRI_ATTRIB_VISUAL_SELECT_GROUP */
|
||||
0, /* __DRI_ATTRIB_SWAP_METHOD */
|
||||
EGL_MAX_SWAP_INTERVAL, /* __DRI_ATTRIB_MAX_SWAP_INTERVAL */
|
||||
EGL_MIN_SWAP_INTERVAL, /* __DRI_ATTRIB_MIN_SWAP_INTERVAL */
|
||||
0, /* __DRI_ATTRIB_BIND_TO_TEXTURE_RGB */
|
||||
0, /* __DRI_ATTRIB_BIND_TO_TEXTURE_RGBA */
|
||||
0, /* __DRI_ATTRIB_BIND_TO_MIPMAP_TEXTURE */
|
||||
0, /* __DRI_ATTRIB_BIND_TO_TEXTURE_TARGETS */
|
||||
EGL_Y_INVERTED_NOK, /* __DRI_ATTRIB_YINVERTED */
|
||||
};
|
||||
|
||||
static struct droid_egl_config *
|
||||
droid_add_config(_EGLDisplay *dpy, const __DRIconfig *dri_config, int id,
|
||||
int depth, EGLint surface_type, int rgba_masks[4])
|
||||
{
|
||||
struct droid_egl_config *conf;
|
||||
struct droid_egl_display *ddpy;
|
||||
_EGLConfig base;
|
||||
unsigned int attrib, value, double_buffer;
|
||||
EGLint key, bind_to_texture_rgb, bind_to_texture_rgba;
|
||||
int dri_masks[4] = { 0, 0, 0, 0 };
|
||||
int i;
|
||||
|
||||
ddpy = dpy->DriverData;
|
||||
_eglInitConfig(&base, dpy, id);
|
||||
|
||||
i = 0;
|
||||
double_buffer = 0;
|
||||
bind_to_texture_rgb = 0;
|
||||
bind_to_texture_rgba = 0;
|
||||
|
||||
while (ddpy->core->indexConfigAttrib(dri_config, i++, &attrib, &value)) {
|
||||
switch (attrib) {
|
||||
case __DRI_ATTRIB_RENDER_TYPE:
|
||||
if (value & __DRI_ATTRIB_RGBA_BIT)
|
||||
value = EGL_RGB_BUFFER;
|
||||
else if (value & __DRI_ATTRIB_LUMINANCE_BIT)
|
||||
value = EGL_LUMINANCE_BUFFER;
|
||||
else
|
||||
assert(0);
|
||||
_eglSetConfigKey(&base, EGL_COLOR_BUFFER_TYPE, value);
|
||||
break;
|
||||
|
||||
case __DRI_ATTRIB_CONFIG_CAVEAT:
|
||||
if (value & __DRI_ATTRIB_NON_CONFORMANT_CONFIG)
|
||||
value = EGL_NON_CONFORMANT_CONFIG;
|
||||
else if (value & __DRI_ATTRIB_SLOW_BIT)
|
||||
value = EGL_SLOW_CONFIG;
|
||||
else
|
||||
value = EGL_NONE;
|
||||
_eglSetConfigKey(&base, EGL_CONFIG_CAVEAT, value);
|
||||
break;
|
||||
|
||||
case __DRI_ATTRIB_BIND_TO_TEXTURE_RGB:
|
||||
bind_to_texture_rgb = value;
|
||||
break;
|
||||
|
||||
case __DRI_ATTRIB_BIND_TO_TEXTURE_RGBA:
|
||||
bind_to_texture_rgba = value;
|
||||
break;
|
||||
|
||||
case __DRI_ATTRIB_DOUBLE_BUFFER:
|
||||
double_buffer = value;
|
||||
break;
|
||||
|
||||
case __DRI_ATTRIB_RED_MASK:
|
||||
dri_masks[0] = value;
|
||||
break;
|
||||
|
||||
case __DRI_ATTRIB_GREEN_MASK:
|
||||
dri_masks[1] = value;
|
||||
break;
|
||||
|
||||
case __DRI_ATTRIB_BLUE_MASK:
|
||||
dri_masks[2] = value;
|
||||
break;
|
||||
|
||||
case __DRI_ATTRIB_ALPHA_MASK:
|
||||
dri_masks[3] = value;
|
||||
break;
|
||||
|
||||
default:
|
||||
key = droid_to_egl_attribute_map[attrib];
|
||||
if (key != 0)
|
||||
_eglSetConfigKey(&base, key, value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* In EGL, double buffer or not isn't a config attribute. Pixmaps
|
||||
* surfaces are always single buffered, pbuffer surfaces are always
|
||||
* back buffers and windows can be either, selected by passing an
|
||||
* attribute at window surface construction time. To support this
|
||||
* we ignore all double buffer configs and manipulate the buffer we
|
||||
* return in the getBuffer callback to get the behaviour we want. */
|
||||
|
||||
if (double_buffer)
|
||||
return NULL;
|
||||
|
||||
if (depth > 0 && depth != _eglGetConfigKey(&base, EGL_BUFFER_SIZE))
|
||||
return NULL;
|
||||
|
||||
if (memcmp(dri_masks, rgba_masks, sizeof(rgba_masks)))
|
||||
return NULL;
|
||||
|
||||
_eglSetConfigKey(&base, EGL_NATIVE_RENDERABLE, EGL_TRUE);
|
||||
|
||||
_eglSetConfigKey(&base, EGL_SURFACE_TYPE, surface_type);
|
||||
if (surface_type & (EGL_PIXMAP_BIT | EGL_PBUFFER_BIT)) {
|
||||
_eglSetConfigKey(&base, EGL_BIND_TO_TEXTURE_RGB, bind_to_texture_rgb);
|
||||
if (_eglGetConfigKey(&base, EGL_ALPHA_SIZE) > 0)
|
||||
_eglSetConfigKey(&base,
|
||||
EGL_BIND_TO_TEXTURE_RGBA, bind_to_texture_rgba);
|
||||
}
|
||||
|
||||
_eglSetConfigKey(&base, EGL_RENDERABLE_TYPE, dpy->ClientAPIsMask);
|
||||
_eglSetConfigKey(&base, EGL_CONFORMANT, dpy->ClientAPIsMask);
|
||||
|
||||
if (!_eglValidateConfig(&base, EGL_FALSE)) {
|
||||
_eglLog(_EGL_DEBUG, "DRI2: failed to validate config %d", id);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
conf = calloc(1, sizeof(*conf));
|
||||
if (conf != NULL) {
|
||||
memcpy(&conf->base, &base, sizeof(base));
|
||||
conf->dri_config = dri_config;
|
||||
_eglLinkConfig(&conf->base);
|
||||
}
|
||||
|
||||
return conf;
|
||||
}
|
||||
|
||||
static EGLBoolean
|
||||
droid_add_configs_for_visuals(_EGLDriver *drv, _EGLDisplay *dpy)
|
||||
{
|
||||
struct droid_egl_display *ddpy = droid_egl_display(dpy);
|
||||
const struct {
|
||||
int format;
|
||||
int size;
|
||||
int rgba_masks[4];
|
||||
} visuals[] = {
|
||||
{ GGL_PIXEL_FORMAT_RGBA_8888, 32, { 0xff, 0xff00, 0xff0000, 0xff000000 } },
|
||||
{ GGL_PIXEL_FORMAT_RGBX_8888, 32, { 0xff, 0xff00, 0xff0000, 0x0 } },
|
||||
{ GGL_PIXEL_FORMAT_RGB_888, 24, { 0xff, 0xff00, 0xff0000, 0x0 } },
|
||||
{ GGL_PIXEL_FORMAT_RGB_565, 16, { 0xf800, 0x7e0, 0x1f, 0x0 } },
|
||||
{ GGL_PIXEL_FORMAT_BGRA_8888, 32, { 0xff0000, 0xff00, 0xff, 0xff000000 } },
|
||||
{ GGL_PIXEL_FORMAT_A_8, 8, { 0xf800, 0x7e0, 0x1f, 0x0 } },
|
||||
{ 0, 0, { 0, 0, 0, 0 } }
|
||||
};
|
||||
int count, i, j;
|
||||
|
||||
count = 0;
|
||||
for (i = 0; visuals[i].format; i++) {
|
||||
int format_count = 0;
|
||||
|
||||
for (j = 0; ddpy->dri_configs[j]; j++) {
|
||||
struct droid_egl_config *dconf;
|
||||
|
||||
dconf = droid_add_config(dpy, ddpy->dri_configs[j], count + 1,
|
||||
visuals[i].size, EGL_WINDOW_BIT, visuals[i].rgba_masks);
|
||||
if (dconf) {
|
||||
_eglSetConfigKey(&dconf->base,
|
||||
EGL_NATIVE_VISUAL_TYPE, visuals[i].format);
|
||||
count++;
|
||||
format_count++;
|
||||
}
|
||||
}
|
||||
|
||||
if (!format_count) {
|
||||
_eglLog(_EGL_DEBUG, "No DRI config supports native format 0x%x",
|
||||
visuals[i].format);
|
||||
}
|
||||
}
|
||||
|
||||
return (count != 0);
|
||||
}
|
||||
|
||||
struct droid_extension_match {
|
||||
const char *name;
|
||||
int version;
|
||||
int offset;
|
||||
};
|
||||
|
||||
static struct droid_extension_match droid_driver_extensions[] = {
|
||||
{ __DRI_CORE, 1, offsetof(struct droid_egl_display, core) },
|
||||
{ __DRI_DRI2, 1, offsetof(struct droid_egl_display, dri2) },
|
||||
{ NULL, 0, 0 }
|
||||
};
|
||||
|
||||
static struct droid_extension_match droid_core_extensions[] = {
|
||||
{ __DRI2_FLUSH, 1, offsetof(struct droid_egl_display, flush) },
|
||||
{ __DRI_IMAGE, 1, offsetof(struct droid_egl_display, image) },
|
||||
{ NULL, 0, 0 }
|
||||
};
|
||||
|
||||
extern const __DRIextension *__driDriverExtensions[];
|
||||
|
||||
static EGLBoolean
|
||||
droid_bind_extensions(struct droid_egl_display *ddpy,
|
||||
struct droid_extension_match *matches,
|
||||
const __DRIextension **extensions)
|
||||
{
|
||||
int i, j, ret = EGL_TRUE;
|
||||
void *field;
|
||||
|
||||
for (i = 0; extensions[i]; i++) {
|
||||
_eglLog(_EGL_DEBUG, "DRI2: found extension `%s'", extensions[i]->name);
|
||||
for (j = 0; matches[j].name; j++) {
|
||||
if (strcmp(extensions[i]->name, matches[j].name) == 0 &&
|
||||
extensions[i]->version >= matches[j].version) {
|
||||
field = ((char *) ddpy + matches[j].offset);
|
||||
*(const __DRIextension **) field = extensions[i];
|
||||
_eglLog(_EGL_INFO, "DRI2: found extension %s version %d",
|
||||
extensions[i]->name, extensions[i]->version);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (j = 0; matches[j].name; j++) {
|
||||
field = ((char *) ddpy + matches[j].offset);
|
||||
if (*(const __DRIextension **) field == NULL) {
|
||||
_eglLog(_EGL_FATAL, "DRI2: did not find extension %s version %d",
|
||||
matches[j].name, matches[j].version);
|
||||
ret = EGL_FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static EGLBoolean
|
||||
droid_create_screen(_EGLDisplay *dpy)
|
||||
{
|
||||
struct droid_egl_display *ddpy = droid_egl_display(dpy);
|
||||
const __DRIextension **extensions;
|
||||
unsigned int api_mask;
|
||||
|
||||
ddpy->dri_screen =
|
||||
ddpy->dri2->createNewScreen(0, ddpy->fd, ddpy->extensions,
|
||||
&ddpy->dri_configs, dpy);
|
||||
if (ddpy->dri_screen == NULL) {
|
||||
_eglLog(_EGL_WARNING, "failed to create dri screen");
|
||||
return EGL_FALSE;
|
||||
}
|
||||
|
||||
extensions = ddpy->core->getExtensions(ddpy->dri_screen);
|
||||
if (!droid_bind_extensions(ddpy, droid_core_extensions, extensions)) {
|
||||
ddpy->core->destroyScreen(ddpy->dri_screen);
|
||||
return EGL_FALSE;
|
||||
}
|
||||
|
||||
if (ddpy->dri2->base.version >= 2)
|
||||
api_mask = ddpy->dri2->getAPIMask(ddpy->dri_screen);
|
||||
else
|
||||
api_mask = __DRI_API_OPENGL;
|
||||
|
||||
dpy->ClientAPIsMask = 0;
|
||||
if (api_mask & (1 <<__DRI_API_OPENGL))
|
||||
dpy->ClientAPIsMask |= EGL_OPENGL_BIT;
|
||||
if (api_mask & (1 <<__DRI_API_GLES))
|
||||
dpy->ClientAPIsMask |= EGL_OPENGL_ES_BIT;
|
||||
if (api_mask & (1 << __DRI_API_GLES2))
|
||||
dpy->ClientAPIsMask |= EGL_OPENGL_ES2_BIT;
|
||||
|
||||
if (ddpy->dri2->base.version >= 2) {
|
||||
dpy->Extensions.KHR_surfaceless_gles1 = EGL_TRUE;
|
||||
dpy->Extensions.KHR_surfaceless_gles2 = EGL_TRUE;
|
||||
dpy->Extensions.KHR_surfaceless_opengl = EGL_TRUE;
|
||||
}
|
||||
|
||||
return EGL_TRUE;
|
||||
}
|
||||
|
||||
static EGLBoolean
|
||||
droid_load_driver(_EGLDisplay *disp)
|
||||
{
|
||||
struct droid_egl_display *ddpy = disp->DriverData;
|
||||
const __DRIextension **extensions;
|
||||
|
||||
extensions = __driDriverExtensions;
|
||||
|
||||
if (!droid_bind_extensions(ddpy, droid_driver_extensions, extensions))
|
||||
return EGL_FALSE;
|
||||
|
||||
return EGL_TRUE;
|
||||
}
|
||||
|
||||
static EGLBoolean
|
||||
droid_initialize_android(_EGLDriver *drv, _EGLDisplay *dpy,
|
||||
EGLint *major, EGLint *minor)
|
||||
{
|
||||
struct droid_egl_display *ddpy;
|
||||
int fd = -1, err, i;
|
||||
const hw_module_t *mod;
|
||||
|
||||
err = hw_get_module(GRALLOC_HARDWARE_MODULE_ID, &mod);
|
||||
if (!err) {
|
||||
const gralloc_module_t *gr = (gralloc_module_t *) mod;
|
||||
|
||||
err = -EINVAL;
|
||||
if (gr->perform)
|
||||
err = gr->perform(gr, GRALLOC_MODULE_PERFORM_GET_DRM_FD, &fd);
|
||||
}
|
||||
if (err || fd < 0) {
|
||||
_eglLog(_EGL_WARNING, "fail to get drm fd");
|
||||
return EGL_FALSE;
|
||||
}
|
||||
|
||||
ddpy = calloc(1, sizeof(*ddpy));
|
||||
if (!ddpy)
|
||||
return _eglError(EGL_BAD_ALLOC, "eglInitialize");
|
||||
|
||||
dpy->DriverData = (void *) ddpy;
|
||||
|
||||
ddpy->fd = fd;
|
||||
if (!droid_load_driver(dpy))
|
||||
return EGL_FALSE;
|
||||
|
||||
ddpy->loader_extension.base.name = __DRI_DRI2_LOADER;
|
||||
ddpy->loader_extension.base.version = 3;
|
||||
ddpy->loader_extension.getBuffers = NULL;
|
||||
ddpy->loader_extension.flushFrontBuffer = droid_flush_front_buffer;
|
||||
ddpy->loader_extension.getBuffersWithFormat =
|
||||
droid_get_buffers_with_format;
|
||||
|
||||
ddpy->extensions[0] = &ddpy->loader_extension.base;
|
||||
ddpy->extensions[1] = &image_lookup_extension.base;
|
||||
ddpy->extensions[2] = &use_invalidate.base;
|
||||
ddpy->extensions[3] = NULL;
|
||||
|
||||
if (!droid_create_screen(dpy)) {
|
||||
free(ddpy);
|
||||
return EGL_FALSE;
|
||||
}
|
||||
|
||||
if (!droid_add_configs_for_visuals(drv, dpy)) {
|
||||
ddpy->core->destroyScreen(ddpy->dri_screen);
|
||||
free(ddpy);
|
||||
}
|
||||
|
||||
dpy->Extensions.ANDROID_image_native_buffer = EGL_TRUE;
|
||||
dpy->Extensions.KHR_image_base = EGL_TRUE;
|
||||
|
||||
/* we're supporting EGL 1.4 */
|
||||
*major = 1;
|
||||
*minor = 4;
|
||||
|
||||
return EGL_TRUE;
|
||||
}
|
||||
|
||||
static EGLBoolean
|
||||
droid_terminate(_EGLDriver *drv, _EGLDisplay *dpy)
|
||||
{
|
||||
struct droid_egl_display *ddpy = droid_egl_display(dpy);
|
||||
|
||||
_eglReleaseDisplayResources(drv, dpy);
|
||||
_eglCleanupDisplay(dpy);
|
||||
|
||||
ddpy->core->destroyScreen(ddpy->dri_screen);
|
||||
free(ddpy);
|
||||
dpy->DriverData = NULL;
|
||||
|
||||
return EGL_TRUE;
|
||||
}
|
||||
|
||||
static EGLBoolean
|
||||
droid_initialize(_EGLDriver *drv, _EGLDisplay *dpy,
|
||||
EGLint *major, EGLint *minor)
|
||||
{
|
||||
switch (dpy->Platform) {
|
||||
case _EGL_PLATFORM_ANDROID:
|
||||
return droid_initialize_android(drv, dpy, major, minor);
|
||||
default:
|
||||
return EGL_FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
static _EGLProc
|
||||
droid_get_proc_address(_EGLDriver *drv, const char *procname)
|
||||
{
|
||||
return (_EGLProc) _glapi_get_proc_address(procname);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
droid_unload(_EGLDriver *drv)
|
||||
{
|
||||
struct droid_egl_driver *ddrv = droid_egl_driver(drv);
|
||||
|
||||
free(ddrv);
|
||||
}
|
||||
|
||||
static void
|
||||
droid_log(EGLint level, const char *msg)
|
||||
{
|
||||
switch (level) {
|
||||
case _EGL_DEBUG:
|
||||
LOGD(msg);
|
||||
break;
|
||||
case _EGL_INFO:
|
||||
LOGI(msg);
|
||||
break;
|
||||
case _EGL_WARNING:
|
||||
LOGW(msg);
|
||||
break;
|
||||
case _EGL_FATAL:
|
||||
LOG_FATAL(msg);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
_EGLDriver *
|
||||
droid_create_driver(void)
|
||||
{
|
||||
struct droid_egl_driver *ddrv;
|
||||
|
||||
ddrv = calloc(1, sizeof(*ddrv));
|
||||
if (!ddrv)
|
||||
return NULL;
|
||||
|
||||
_eglSetLogProc(droid_log);
|
||||
|
||||
ddrv->base.Name = "Droid";
|
||||
ddrv->base.Unload = droid_unload;
|
||||
|
||||
_eglInitDriverFallbacks(&ddrv->base);
|
||||
ddrv->base.API.Initialize = droid_initialize;
|
||||
ddrv->base.API.Terminate = droid_terminate;
|
||||
ddrv->base.API.GetProcAddress = droid_get_proc_address;
|
||||
|
||||
ddrv->glFlush =
|
||||
(void (*)(void)) droid_get_proc_address(&ddrv->base, "glFlush");
|
||||
ddrv->glFinish =
|
||||
(void (*)(void)) droid_get_proc_address(&ddrv->base, "glFinish");
|
||||
|
||||
return &ddrv->base;
|
||||
}
|
126
src/egl/drivers/android/droid.h
Normal file
126
src/egl/drivers/android/droid.h
Normal file
@@ -0,0 +1,126 @@
|
||||
/*
|
||||
* Copyright © 2010 Intel Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* Authors:
|
||||
* Kristian Høgsberg <krh@bitplanet.net>
|
||||
*/
|
||||
|
||||
#ifndef _DROID_H_
|
||||
#define _DROID_H_
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
#include <ui/egl/android_natives.h>
|
||||
#include <ui/android_native_buffer.h>
|
||||
#include <pixelflinger/format.h>
|
||||
|
||||
#include <GL/gl.h>
|
||||
#include <GL/internal/dri_interface.h>
|
||||
|
||||
#include "egldriver.h"
|
||||
#include "egldisplay.h"
|
||||
#include "eglcontext.h"
|
||||
#include "eglsurface.h"
|
||||
#include "eglconfig.h"
|
||||
#include "eglimage.h"
|
||||
#include "eglcurrent.h"
|
||||
#include "egllog.h"
|
||||
|
||||
struct droid_egl_driver
|
||||
{
|
||||
_EGLDriver base;
|
||||
|
||||
void (*glFlush)(void);
|
||||
void (*glFinish)(void);
|
||||
};
|
||||
|
||||
struct droid_egl_display
|
||||
{
|
||||
int fd;
|
||||
|
||||
__DRIscreen *dri_screen;
|
||||
const __DRIconfig **dri_configs;
|
||||
__DRIcoreExtension *core;
|
||||
__DRIdri2Extension *dri2;
|
||||
__DRI2flushExtension *flush;
|
||||
__DRIimageExtension *image;
|
||||
|
||||
__DRIdri2LoaderExtension loader_extension;
|
||||
const __DRIextension *extensions[8];
|
||||
};
|
||||
|
||||
struct droid_egl_context
|
||||
{
|
||||
_EGLContext base;
|
||||
|
||||
__DRIcontext *dri_context;
|
||||
};
|
||||
|
||||
struct droid_egl_surface
|
||||
{
|
||||
_EGLSurface base;
|
||||
|
||||
__DRIdrawable *dri_drawable;
|
||||
__DRIbuffer dri_buffer;
|
||||
|
||||
android_native_window_t *window;
|
||||
android_native_buffer_t *buffer;
|
||||
};
|
||||
|
||||
struct droid_egl_config
|
||||
{
|
||||
_EGLConfig base;
|
||||
|
||||
const __DRIconfig *dri_config;
|
||||
};
|
||||
|
||||
struct droid_egl_image
|
||||
{
|
||||
_EGLImage base;
|
||||
|
||||
__DRIimage *dri_image;
|
||||
};
|
||||
|
||||
/* standard typecasts */
|
||||
_EGL_DRIVER_STANDARD_TYPECASTS(droid_egl)
|
||||
_EGL_DRIVER_TYPECAST(droid_egl_image, _EGLImage, obj)
|
||||
|
||||
_EGLDriver *
|
||||
droid_create_driver(void);
|
||||
|
||||
void
|
||||
droid_init_core_functions(_EGLDriver *drv);
|
||||
|
||||
void
|
||||
droid_init_image_functions(_EGLDriver *drv);
|
||||
|
||||
EGLBoolean
|
||||
droid_dequeue_buffer(struct droid_egl_surface *dsurf);
|
||||
|
||||
EGLBoolean
|
||||
droid_enqueue_buffer(struct droid_egl_surface *dsurf);
|
||||
|
||||
int
|
||||
get_native_buffer_name(struct android_native_buffer_t *buf);
|
||||
|
||||
#endif /* _DROID_H_ */
|
327
src/egl/drivers/android/droid_core.c
Normal file
327
src/egl/drivers/android/droid_core.c
Normal file
@@ -0,0 +1,327 @@
|
||||
/*
|
||||
* Copyright © 2010 Intel Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* Authors:
|
||||
* Kristian Høgsberg <krh@bitplanet.net>
|
||||
*/
|
||||
|
||||
#include "droid.h"
|
||||
|
||||
static _EGLContext *
|
||||
droid_create_context(_EGLDriver *drv, _EGLDisplay *disp, _EGLConfig *conf,
|
||||
_EGLContext *share_list, const EGLint *attrib_list)
|
||||
{
|
||||
struct droid_egl_context *dctx;
|
||||
struct droid_egl_display *ddpy = droid_egl_display(disp);
|
||||
struct droid_egl_context *dctx_shared = droid_egl_context(share_list);
|
||||
struct droid_egl_config *dconf = droid_egl_config(conf);
|
||||
const __DRIconfig *dri_config;
|
||||
int api;
|
||||
|
||||
(void) drv;
|
||||
|
||||
dctx = calloc(1, sizeof *dctx);
|
||||
if (!dctx) {
|
||||
_eglError(EGL_BAD_ALLOC, "eglCreateContext");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!_eglInitContext(&dctx->base, disp, conf, attrib_list))
|
||||
goto cleanup;
|
||||
|
||||
switch (dctx->base.ClientAPI) {
|
||||
case EGL_OPENGL_ES_API:
|
||||
switch (dctx->base.ClientVersion) {
|
||||
case 1:
|
||||
api = __DRI_API_GLES;
|
||||
break;
|
||||
case 2:
|
||||
api = __DRI_API_GLES2;
|
||||
break;
|
||||
default:
|
||||
_eglError(EGL_BAD_PARAMETER, "eglCreateContext");
|
||||
return NULL;
|
||||
}
|
||||
break;
|
||||
case EGL_OPENGL_API:
|
||||
api = __DRI_API_OPENGL;
|
||||
break;
|
||||
default:
|
||||
_eglError(EGL_BAD_PARAMETER, "eglCreateContext");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (conf != NULL)
|
||||
dri_config = dconf->dri_config;
|
||||
else
|
||||
dri_config = NULL;
|
||||
|
||||
if (ddpy->dri2->base.version >= 2) {
|
||||
dctx->dri_context =
|
||||
ddpy->dri2->createNewContextForAPI(ddpy->dri_screen,
|
||||
api,
|
||||
dri_config,
|
||||
dctx_shared ?
|
||||
dctx_shared->dri_context : NULL,
|
||||
dctx);
|
||||
} else if (api == __DRI_API_OPENGL) {
|
||||
dctx->dri_context =
|
||||
ddpy->dri2->createNewContext(ddpy->dri_screen,
|
||||
dconf->dri_config,
|
||||
dctx_shared ?
|
||||
dctx_shared->dri_context : NULL,
|
||||
dctx);
|
||||
} else {
|
||||
/* fail */
|
||||
}
|
||||
|
||||
if (!dctx->dri_context)
|
||||
goto cleanup;
|
||||
|
||||
return &dctx->base;
|
||||
|
||||
cleanup:
|
||||
free(dctx);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static _EGLSurface *
|
||||
droid_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
|
||||
_EGLConfig *conf, EGLNativeWindowType window,
|
||||
const EGLint *attrib_list)
|
||||
{
|
||||
struct droid_egl_display *ddpy = droid_egl_display(disp);
|
||||
struct droid_egl_config *dconf = droid_egl_config(conf);
|
||||
struct droid_egl_surface *dsurf;
|
||||
int format, vis_type;
|
||||
|
||||
(void) drv;
|
||||
|
||||
if (!window || window->common.magic != ANDROID_NATIVE_WINDOW_MAGIC) {
|
||||
_eglError(EGL_BAD_NATIVE_WINDOW, "droid_create_surface");
|
||||
return NULL;
|
||||
}
|
||||
if (window->query(window, NATIVE_WINDOW_FORMAT, &format)) {
|
||||
_eglError(EGL_BAD_NATIVE_WINDOW, "droid_create_surface");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
vis_type = _eglGetConfigKey(&dconf->base, EGL_NATIVE_VISUAL_TYPE);
|
||||
if (format != vis_type) {
|
||||
_eglLog(_EGL_WARNING, "Native format mismatch: 0x%x != 0x%x",
|
||||
format, vis_type);
|
||||
}
|
||||
|
||||
dsurf = calloc(1, sizeof *dsurf);
|
||||
if (!dsurf) {
|
||||
_eglError(EGL_BAD_ALLOC, "droid_create_surface");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!_eglInitSurface(&dsurf->base, disp, type, conf, attrib_list))
|
||||
goto cleanup_surf;
|
||||
|
||||
dsurf->dri_drawable =
|
||||
(*ddpy->dri2->createNewDrawable) (ddpy->dri_screen,
|
||||
dconf->dri_config, dsurf);
|
||||
if (dsurf->dri_drawable == NULL) {
|
||||
_eglError(EGL_BAD_ALLOC, "dri2->createNewDrawable");
|
||||
goto cleanup_pixmap;
|
||||
}
|
||||
|
||||
window->common.incRef(&window->common);
|
||||
window->query(window, NATIVE_WINDOW_WIDTH, &dsurf->base.Width);
|
||||
window->query(window, NATIVE_WINDOW_HEIGHT, &dsurf->base.Height);
|
||||
|
||||
dsurf->window = window;
|
||||
|
||||
return &dsurf->base;
|
||||
|
||||
cleanup_dri_drawable:
|
||||
ddpy->core->destroyDrawable(dsurf->dri_drawable);
|
||||
cleanup_pixmap:
|
||||
cleanup_surf:
|
||||
free(dsurf);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static _EGLSurface *
|
||||
droid_create_window_surface(_EGLDriver *drv, _EGLDisplay *disp,
|
||||
_EGLConfig *conf, EGLNativeWindowType window,
|
||||
const EGLint *attrib_list)
|
||||
{
|
||||
return droid_create_surface(drv, disp, EGL_WINDOW_BIT, conf,
|
||||
window, attrib_list);
|
||||
}
|
||||
|
||||
static _EGLSurface *
|
||||
droid_create_pixmap_surface(_EGLDriver *drv, _EGLDisplay *disp,
|
||||
_EGLConfig *conf, EGLNativePixmapType pixmap,
|
||||
const EGLint *attrib_list)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static _EGLSurface *
|
||||
droid_create_pbuffer_surface(_EGLDriver *drv, _EGLDisplay *disp,
|
||||
_EGLConfig *conf, const EGLint *attrib_list)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static EGLBoolean
|
||||
droid_destroy_surface(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf)
|
||||
{
|
||||
struct droid_egl_display *ddpy = droid_egl_display(disp);
|
||||
struct droid_egl_surface *dsurf = droid_egl_surface(surf);
|
||||
|
||||
(void) drv;
|
||||
|
||||
if (!_eglPutSurface(surf))
|
||||
return EGL_TRUE;
|
||||
|
||||
(*ddpy->core->destroyDrawable)(dsurf->dri_drawable);
|
||||
|
||||
droid_enqueue_buffer(dsurf);
|
||||
dsurf->window->common.decRef(&dsurf->window->common);
|
||||
|
||||
free(surf);
|
||||
|
||||
return EGL_TRUE;
|
||||
}
|
||||
|
||||
static EGLBoolean
|
||||
droid_make_current(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *dsurf,
|
||||
_EGLSurface *rsurf, _EGLContext *ctx)
|
||||
{
|
||||
struct droid_egl_driver *ddrv = droid_egl_driver(drv);
|
||||
struct droid_egl_display *ddpy = droid_egl_display(disp);
|
||||
struct droid_egl_surface *droid_dsurf = droid_egl_surface(dsurf);
|
||||
struct droid_egl_surface *droid_rsurf = droid_egl_surface(rsurf);
|
||||
struct droid_egl_context *dctx = droid_egl_context(ctx);
|
||||
_EGLContext *old_ctx;
|
||||
_EGLSurface *old_dsurf, *old_rsurf;
|
||||
__DRIdrawable *ddraw, *rdraw;
|
||||
__DRIcontext *cctx;
|
||||
|
||||
/* make new bindings */
|
||||
if (!_eglBindContext(ctx, dsurf, rsurf, &old_ctx, &old_dsurf, &old_rsurf))
|
||||
return EGL_FALSE;
|
||||
|
||||
/* flush before context switch */
|
||||
if (old_ctx && ddrv->glFlush)
|
||||
ddrv->glFlush();
|
||||
|
||||
ddraw = (droid_dsurf) ? droid_dsurf->dri_drawable : NULL;
|
||||
rdraw = (droid_rsurf) ? droid_rsurf->dri_drawable : NULL;
|
||||
cctx = (dctx) ? dctx->dri_context : NULL;
|
||||
|
||||
if ((cctx == NULL && ddraw == NULL && rdraw == NULL) ||
|
||||
ddpy->core->bindContext(cctx, ddraw, rdraw)) {
|
||||
droid_destroy_surface(drv, disp, old_dsurf);
|
||||
droid_destroy_surface(drv, disp, old_rsurf);
|
||||
if (old_ctx) {
|
||||
/* unbind the old context only when there is no new context bound */
|
||||
if (!ctx) {
|
||||
__DRIcontext *old_cctx = droid_egl_context(old_ctx)->dri_context;
|
||||
ddpy->core->unbindContext(old_cctx);
|
||||
}
|
||||
/* no destroy? */
|
||||
_eglPutContext(old_ctx);
|
||||
}
|
||||
|
||||
return EGL_TRUE;
|
||||
} else {
|
||||
/* undo the previous _eglBindContext */
|
||||
_eglBindContext(old_ctx, old_dsurf, old_rsurf, &ctx, &dsurf, &rsurf);
|
||||
assert(&dctx->base == ctx &&
|
||||
&droid_dsurf->base == dsurf &&
|
||||
&droid_rsurf->base == rsurf);
|
||||
|
||||
_eglPutSurface(dsurf);
|
||||
_eglPutSurface(rsurf);
|
||||
_eglPutContext(ctx);
|
||||
|
||||
_eglPutSurface(old_dsurf);
|
||||
_eglPutSurface(old_rsurf);
|
||||
_eglPutContext(old_ctx);
|
||||
|
||||
return EGL_FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
static EGLBoolean
|
||||
droid_swap_buffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw)
|
||||
{
|
||||
struct droid_egl_driver *ddrv = droid_egl_driver(drv);
|
||||
struct droid_egl_display *ddpy = droid_egl_display(disp);
|
||||
struct droid_egl_surface *dsurf = droid_egl_surface(draw);
|
||||
_EGLContext *ctx;
|
||||
|
||||
if (ddrv->glFlush) {
|
||||
ctx = _eglGetCurrentContext();
|
||||
if (ctx && ctx->DrawSurface == &dsurf->base)
|
||||
ddrv->glFlush();
|
||||
}
|
||||
|
||||
(*ddpy->flush->flush)(dsurf->dri_drawable);
|
||||
|
||||
if (dsurf->buffer)
|
||||
droid_enqueue_buffer(dsurf);
|
||||
|
||||
(*ddpy->flush->invalidate)(dsurf->dri_drawable);
|
||||
|
||||
return EGL_TRUE;
|
||||
}
|
||||
|
||||
static EGLBoolean
|
||||
droid_wait_client(_EGLDriver *drv, _EGLDisplay *disp, _EGLContext *ctx)
|
||||
{
|
||||
struct droid_egl_driver *ddrv = droid_egl_driver(drv);
|
||||
struct droid_egl_display *ddpy = droid_egl_display(disp);
|
||||
struct droid_egl_surface *dsurf = droid_egl_surface(ctx->DrawSurface);
|
||||
|
||||
if (ddrv->glFinish)
|
||||
ddrv->glFinish();
|
||||
|
||||
if (dsurf)
|
||||
(*ddpy->flush->flush)(dsurf->dri_drawable);
|
||||
|
||||
return EGL_TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
droid_init_core_functions(_EGLDriver *drv)
|
||||
{
|
||||
struct droid_egl_driver *ddrv = droid_egl_driver(drv);
|
||||
|
||||
ddrv->base.API.CreateContext = droid_create_context;
|
||||
ddrv->base.API.CreateWindowSurface = droid_create_window_surface;
|
||||
ddrv->base.API.CreatePixmapSurface = droid_create_pixmap_surface;
|
||||
ddrv->base.API.CreatePbufferSurface = droid_create_pbuffer_surface;
|
||||
ddrv->base.API.DestroySurface = droid_destroy_surface;
|
||||
ddrv->base.API.MakeCurrent = droid_make_current;
|
||||
ddrv->base.API.SwapBuffers = droid_swap_buffers;
|
||||
ddrv->base.API.WaitClient = droid_wait_client;
|
||||
}
|
134
src/egl/drivers/android/droid_image.c
Normal file
134
src/egl/drivers/android/droid_image.c
Normal file
@@ -0,0 +1,134 @@
|
||||
/*
|
||||
* Copyright © 2010 Intel Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* Authors:
|
||||
* Kristian Høgsberg <krh@bitplanet.net>
|
||||
*/
|
||||
|
||||
#include "droid.h"
|
||||
|
||||
static _EGLImage *
|
||||
droid_create_image_android_native_buffer(_EGLDisplay *disp,
|
||||
EGLClientBuffer buffer)
|
||||
{
|
||||
struct droid_egl_display *ddpy = droid_egl_display(disp);
|
||||
struct android_native_buffer_t *buf =
|
||||
(struct android_native_buffer_t *) buffer;
|
||||
struct droid_egl_image *dimg;
|
||||
EGLint format, name;
|
||||
|
||||
if (!buf || buf->common.magic != ANDROID_NATIVE_BUFFER_MAGIC ||
|
||||
buf->common.version != sizeof(*buf)) {
|
||||
_eglError(EGL_BAD_PARAMETER, "eglCreateEGLImageKHR");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
name = get_native_buffer_name(buf);
|
||||
if (!name) {
|
||||
_eglError(EGL_BAD_PARAMETER, "eglCreateEGLImageKHR");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
switch (buf->format) {
|
||||
case HAL_PIXEL_FORMAT_BGRA_8888:
|
||||
format = __DRI_IMAGE_FORMAT_ARGB8888;
|
||||
break;
|
||||
case HAL_PIXEL_FORMAT_RGB_565:
|
||||
format = __DRI_IMAGE_FORMAT_RGB565;
|
||||
break;
|
||||
case HAL_PIXEL_FORMAT_RGBA_8888:
|
||||
format = __DRI_IMAGE_FORMAT_RGBA8888_REV;
|
||||
break;
|
||||
case HAL_PIXEL_FORMAT_RGBX_8888:
|
||||
case HAL_PIXEL_FORMAT_RGB_888:
|
||||
case HAL_PIXEL_FORMAT_RGBA_5551:
|
||||
case HAL_PIXEL_FORMAT_RGBA_4444:
|
||||
/* unsupported */
|
||||
default:
|
||||
_eglLog(_EGL_WARNING, "unsupported native buffer format 0x%x", buf->format);
|
||||
return NULL;
|
||||
break;
|
||||
}
|
||||
|
||||
dimg = calloc(1, sizeof(*dimg));
|
||||
if (!dimg) {
|
||||
_eglError(EGL_BAD_ALLOC, "droid_create_image_mesa_drm");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!_eglInitImage(&dimg->base, disp)) {
|
||||
free(dimg);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
dimg->dri_image =
|
||||
ddpy->image->createImageFromName(ddpy->dri_screen,
|
||||
buf->width,
|
||||
buf->height,
|
||||
format,
|
||||
name,
|
||||
buf->stride,
|
||||
dimg);
|
||||
if (!dimg->dri_image) {
|
||||
free(dimg);
|
||||
_eglError(EGL_BAD_ALLOC, "droid_create_image_mesa_drm");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return &dimg->base;
|
||||
}
|
||||
|
||||
static _EGLImage *
|
||||
droid_create_image_khr(_EGLDriver *drv, _EGLDisplay *disp,
|
||||
_EGLContext *ctx, EGLenum target,
|
||||
EGLClientBuffer buffer, const EGLint *attr_list)
|
||||
{
|
||||
switch (target) {
|
||||
case EGL_NATIVE_BUFFER_ANDROID:
|
||||
return droid_create_image_android_native_buffer(disp, buffer);
|
||||
default:
|
||||
_eglError(EGL_BAD_PARAMETER, "droid_create_image_khr");
|
||||
return EGL_NO_IMAGE_KHR;
|
||||
}
|
||||
}
|
||||
|
||||
static EGLBoolean
|
||||
droid_destroy_image_khr(_EGLDriver *drv, _EGLDisplay *disp, _EGLImage *image)
|
||||
{
|
||||
struct droid_egl_display *ddpy = droid_egl_display(disp);
|
||||
struct droid_egl_image *dimg = droid_egl_image(image);
|
||||
|
||||
ddpy->image->destroyImage(dimg->dri_image);
|
||||
free(dimg);
|
||||
|
||||
return EGL_TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
droid_init_image_functions(_EGLDriver *drv)
|
||||
{
|
||||
struct droid_egl_driver *ddrv = droid_egl_driver(drv);
|
||||
|
||||
ddrv->base.API.CreateImageKHR = droid_create_image_khr;
|
||||
ddrv->base.API.DestroyImageKHR = droid_destroy_image_khr;
|
||||
}
|
42
src/egl/drivers/android/egl_android.c
Normal file
42
src/egl/drivers/android/egl_android.c
Normal file
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* Copyright © 2010 Intel Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* Authors:
|
||||
* Kristian Høgsberg <krh@bitplanet.net>
|
||||
*/
|
||||
|
||||
#include "droid.h"
|
||||
|
||||
_EGLDriver *
|
||||
_eglMain(const char *args)
|
||||
{
|
||||
_EGLDriver *drv;
|
||||
|
||||
drv = droid_create_driver();
|
||||
if (drv) {
|
||||
droid_init_core_functions(drv);
|
||||
droid_init_image_functions(drv);
|
||||
}
|
||||
|
||||
return drv;
|
||||
}
|
@@ -916,6 +916,12 @@ eglGetProcAddress(const char *procname)
|
||||
#ifdef EGL_MESA_drm_image
|
||||
{ "eglCreateDRMImageMESA", (_EGLProc) eglCreateDRMImageMESA },
|
||||
{ "eglExportDRMImageMESA", (_EGLProc) eglExportDRMImageMESA },
|
||||
#endif
|
||||
#ifdef EGL_ANDROID_swap_rectangle
|
||||
{ "eglSetSwapRectangleANDROID", (_EGLProc) eglSetSwapRectangleANDROID },
|
||||
#endif
|
||||
#ifdef EGL_ANDROID_get_render_buffer
|
||||
{ "eglGetRenderBufferANDROID", (_EGLProc) eglGetRenderBufferANDROID },
|
||||
#endif
|
||||
{ NULL, NULL }
|
||||
};
|
||||
@@ -1494,3 +1500,49 @@ eglExportDRMImageMESA(EGLDisplay dpy, EGLImageKHR image,
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef EGL_ANDROID_swap_rectangle
|
||||
|
||||
EGLBoolean EGLAPIENTRY
|
||||
eglSetSwapRectangleANDROID(EGLDisplay dpy, EGLSurface draw,
|
||||
EGLint left, EGLint top,
|
||||
EGLint width, EGLint height)
|
||||
{
|
||||
_EGLDisplay *disp = _eglLockDisplay(dpy);
|
||||
_EGLSurface *surf = _eglLookupSurface(draw, disp);
|
||||
_EGLDriver *drv;
|
||||
EGLBoolean ret;
|
||||
|
||||
_EGL_CHECK_SURFACE(disp, surf, EGL_FALSE, drv);
|
||||
|
||||
if (!disp->Extensions.ANDROID_swap_rectangle)
|
||||
RETURN_EGL_EVAL(disp, EGL_FALSE);
|
||||
|
||||
ret = drv->API.SetSwapRectangleANDROID(drv, disp, surf, left, top, width, height);
|
||||
|
||||
RETURN_EGL_EVAL(disp, ret);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef EGL_ANDROID_get_render_buffer
|
||||
|
||||
EGLClientBuffer EGLAPIENTRY
|
||||
eglGetRenderBufferANDROID(EGLDisplay dpy, EGLSurface draw)
|
||||
{
|
||||
_EGLDisplay *disp = _eglLockDisplay(dpy);
|
||||
_EGLSurface *surf = _eglLookupSurface(draw, disp);
|
||||
_EGLDriver *drv;
|
||||
EGLClientBuffer ret;
|
||||
|
||||
_EGL_CHECK_SURFACE(disp, surf, NULL, drv);
|
||||
|
||||
if (!disp->Extensions.ANDROID_get_render_buffer)
|
||||
RETURN_EGL_EVAL(disp, NULL);
|
||||
|
||||
ret = drv->API.GetRenderBufferANDROID(drv, disp, surf);
|
||||
|
||||
RETURN_EGL_EVAL(disp, ret);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@@ -95,6 +95,14 @@ typedef _EGLImage *(*CreateDRMImageMESA_t)(_EGLDriver *drv, _EGLDisplay *disp, c
|
||||
typedef EGLBoolean (*ExportDRMImageMESA_t)(_EGLDriver *drv, _EGLDisplay *disp, _EGLImage *img, EGLint *name, EGLint *handle, EGLint *stride);
|
||||
#endif
|
||||
|
||||
#ifdef EGL_ANDROID_swap_rectangle
|
||||
typedef EGLBoolean (*SetSwapRectangleANDROID_t)(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw, EGLint left, EGLint top, EGLint width, EGLint height);
|
||||
#endif
|
||||
|
||||
#ifdef EGL_ANDROID_get_render_buffer
|
||||
typedef EGLClientBuffer (*GetRenderBufferANDROID_t)(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* The API dispatcher jumps through these functions
|
||||
*/
|
||||
@@ -169,6 +177,13 @@ struct _egl_api
|
||||
CreateDRMImageMESA_t CreateDRMImageMESA;
|
||||
ExportDRMImageMESA_t ExportDRMImageMESA;
|
||||
#endif
|
||||
|
||||
#ifdef EGL_ANDROID_swap_rectangle
|
||||
SetSwapRectangleANDROID_t SetSwapRectangleANDROID;
|
||||
#endif
|
||||
#ifdef EGL_ANDROID_get_render_buffer
|
||||
GetRenderBufferANDROID_t GetRenderBufferANDROID;
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif /* EGLAPI_INCLUDED */
|
||||
|
@@ -28,7 +28,8 @@ _eglGetNativePlatformFromEnv(void)
|
||||
{ _EGL_PLATFORM_WINDOWS, "gdi" },
|
||||
{ _EGL_PLATFORM_X11, "x11" },
|
||||
{ _EGL_PLATFORM_DRM, "drm" },
|
||||
{ _EGL_PLATFORM_FBDEV, "fbdev" }
|
||||
{ _EGL_PLATFORM_FBDEV, "fbdev" },
|
||||
{ _EGL_PLATFORM_ANDROID, "android" }
|
||||
};
|
||||
_EGLPlatformType plat = _EGL_INVALID_PLATFORM;
|
||||
const char *plat_name;
|
||||
|
@@ -13,6 +13,7 @@ enum _egl_platform_type {
|
||||
_EGL_PLATFORM_X11,
|
||||
_EGL_PLATFORM_DRM,
|
||||
_EGL_PLATFORM_FBDEV,
|
||||
_EGL_PLATFORM_ANDROID,
|
||||
|
||||
_EGL_NUM_PLATFORMS,
|
||||
_EGL_INVALID_PLATFORM = -1
|
||||
@@ -75,6 +76,10 @@ struct _egl_extensions
|
||||
EGLBoolean NOK_swap_region;
|
||||
EGLBoolean NOK_texture_from_pixmap;
|
||||
|
||||
EGLBoolean ANDROID_image_native_buffer;
|
||||
EGLBoolean ANDROID_swap_rectangle;
|
||||
EGLBoolean ANDROID_get_render_buffer;
|
||||
|
||||
char String[_EGL_MAX_EXTENSIONS_LEN];
|
||||
};
|
||||
|
||||
|
@@ -86,6 +86,30 @@ library_suffix(void)
|
||||
}
|
||||
|
||||
|
||||
#else /* _EGL_PLATFORM_NO_OS */
|
||||
|
||||
|
||||
typedef void *lib_handle;
|
||||
|
||||
static INLINE void *
|
||||
open_library(const char *filename)
|
||||
{
|
||||
return (void *) filename;
|
||||
}
|
||||
|
||||
static INLINE void
|
||||
close_library(void *lib)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
static const char *
|
||||
library_suffix(void)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -123,6 +147,8 @@ _eglOpenLibrary(const char *driverPath, lib_handle *handle)
|
||||
else {
|
||||
error = dlerror();
|
||||
}
|
||||
#else /* _EGL_PLATFORM_NO_OS */
|
||||
mainFunc = (_EGLMain_t) _eglMain;
|
||||
#endif
|
||||
|
||||
if (!lib) {
|
||||
@@ -501,6 +527,10 @@ _eglAddDefaultDrivers(void)
|
||||
"egl_dri2",
|
||||
"egl_glx"
|
||||
};
|
||||
#else /* _EGL_PLATFORM_NO_OS */
|
||||
const char *DefaultDriverNames[] = {
|
||||
"<builtin>"
|
||||
};
|
||||
#endif
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(DefaultDriverNames); i++) {
|
||||
|
@@ -107,6 +107,10 @@ _eglUpdateExtensionsString(_EGLDisplay *dpy)
|
||||
|
||||
_EGL_CHECK_EXTENSION(NOK_swap_region);
|
||||
_EGL_CHECK_EXTENSION(NOK_texture_from_pixmap);
|
||||
|
||||
_EGL_CHECK_EXTENSION(ANDROID_image_native_buffer);
|
||||
_EGL_CHECK_EXTENSION(ANDROID_swap_rectangle);
|
||||
_EGL_CHECK_EXTENSION(ANDROID_get_render_buffer);
|
||||
#undef _EGL_CHECK_EXTENSION
|
||||
}
|
||||
|
||||
|
3
src/gallium/Android.mk
Normal file
3
src/gallium/Android.mk
Normal file
@@ -0,0 +1,3 @@
|
||||
ifeq ($(strip $(MESA_BUILD_GALLIUM)),true)
|
||||
include $(call all-subdir-makefiles)
|
||||
endif
|
213
src/gallium/auxiliary/Android.mk
Normal file
213
src/gallium/auxiliary/Android.mk
Normal file
@@ -0,0 +1,213 @@
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
# from Makefile
|
||||
C_SOURCES = \
|
||||
cso_cache/cso_cache.c \
|
||||
cso_cache/cso_context.c \
|
||||
cso_cache/cso_hash.c \
|
||||
draw/draw_context.c \
|
||||
draw/draw_fs.c \
|
||||
draw/draw_gs.c \
|
||||
draw/draw_pipe.c \
|
||||
draw/draw_pipe_aaline.c \
|
||||
draw/draw_pipe_aapoint.c \
|
||||
draw/draw_pipe_clip.c \
|
||||
draw/draw_pipe_cull.c \
|
||||
draw/draw_pipe_flatshade.c \
|
||||
draw/draw_pipe_offset.c \
|
||||
draw/draw_pipe_pstipple.c \
|
||||
draw/draw_pipe_stipple.c \
|
||||
draw/draw_pipe_twoside.c \
|
||||
draw/draw_pipe_unfilled.c \
|
||||
draw/draw_pipe_util.c \
|
||||
draw/draw_pipe_validate.c \
|
||||
draw/draw_pipe_vbuf.c \
|
||||
draw/draw_pipe_wide_line.c \
|
||||
draw/draw_pipe_wide_point.c \
|
||||
draw/draw_pt.c \
|
||||
draw/draw_pt_emit.c \
|
||||
draw/draw_pt_fetch.c \
|
||||
draw/draw_pt_fetch_emit.c \
|
||||
draw/draw_pt_fetch_shade_emit.c \
|
||||
draw/draw_pt_fetch_shade_pipeline.c \
|
||||
draw/draw_pt_post_vs.c \
|
||||
draw/draw_pt_so_emit.c \
|
||||
draw/draw_pt_util.c \
|
||||
draw/draw_pt_vsplit.c \
|
||||
draw/draw_vertex.c \
|
||||
draw/draw_vs.c \
|
||||
draw/draw_vs_aos.c \
|
||||
draw/draw_vs_aos_io.c \
|
||||
draw/draw_vs_aos_machine.c \
|
||||
draw/draw_vs_exec.c \
|
||||
draw/draw_vs_ppc.c \
|
||||
draw/draw_vs_sse.c \
|
||||
draw/draw_vs_varient.c \
|
||||
indices/u_indices_gen.c \
|
||||
indices/u_unfilled_gen.c \
|
||||
os/os_misc.c \
|
||||
os/os_stream.c \
|
||||
os/os_stream_log.c \
|
||||
os/os_stream_null.c \
|
||||
os/os_stream_stdc.c \
|
||||
os/os_stream_str.c \
|
||||
os/os_time.c \
|
||||
pipebuffer/pb_buffer_fenced.c \
|
||||
pipebuffer/pb_buffer_malloc.c \
|
||||
pipebuffer/pb_bufmgr_alt.c \
|
||||
pipebuffer/pb_bufmgr_cache.c \
|
||||
pipebuffer/pb_bufmgr_debug.c \
|
||||
pipebuffer/pb_bufmgr_mm.c \
|
||||
pipebuffer/pb_bufmgr_ondemand.c \
|
||||
pipebuffer/pb_bufmgr_pool.c \
|
||||
pipebuffer/pb_bufmgr_slab.c \
|
||||
pipebuffer/pb_validate.c \
|
||||
rbug/rbug_connection.c \
|
||||
rbug/rbug_context.c \
|
||||
rbug/rbug_core.c \
|
||||
rbug/rbug_demarshal.c \
|
||||
rbug/rbug_texture.c \
|
||||
rbug/rbug_shader.c \
|
||||
rtasm/rtasm_cpu.c \
|
||||
rtasm/rtasm_execmem.c \
|
||||
rtasm/rtasm_ppc.c \
|
||||
rtasm/rtasm_ppc_spe.c \
|
||||
rtasm/rtasm_x86sse.c \
|
||||
tgsi/tgsi_build.c \
|
||||
tgsi/tgsi_dump.c \
|
||||
tgsi/tgsi_exec.c \
|
||||
tgsi/tgsi_info.c \
|
||||
tgsi/tgsi_iterate.c \
|
||||
tgsi/tgsi_parse.c \
|
||||
tgsi/tgsi_ppc.c \
|
||||
tgsi/tgsi_sanity.c \
|
||||
tgsi/tgsi_scan.c \
|
||||
tgsi/tgsi_sse2.c \
|
||||
tgsi/tgsi_text.c \
|
||||
tgsi/tgsi_transform.c \
|
||||
tgsi/tgsi_ureg.c \
|
||||
tgsi/tgsi_util.c \
|
||||
translate/translate.c \
|
||||
translate/translate_cache.c \
|
||||
translate/translate_generic.c \
|
||||
translate/translate_sse.c \
|
||||
util/u_debug.c \
|
||||
util/u_debug_describe.c \
|
||||
util/u_debug_refcnt.c \
|
||||
util/u_debug_stack.c \
|
||||
util/u_debug_symbol.c \
|
||||
util/u_dump_defines.c \
|
||||
util/u_dump_state.c \
|
||||
util/u_bitmask.c \
|
||||
util/u_blit.c \
|
||||
util/u_blitter.c \
|
||||
util/u_cache.c \
|
||||
util/u_caps.c \
|
||||
util/u_cpu_detect.c \
|
||||
util/u_dl.c \
|
||||
util/u_draw_quad.c \
|
||||
util/u_format.c \
|
||||
util/u_format_other.c \
|
||||
util/u_format_s3tc.c \
|
||||
util/u_format_srgb.c \
|
||||
util/u_format_table.c \
|
||||
util/u_format_tests.c \
|
||||
util/u_format_yuv.c \
|
||||
util/u_format_zs.c \
|
||||
util/u_framebuffer.c \
|
||||
util/u_gen_mipmap.c \
|
||||
util/u_half.c \
|
||||
util/u_handle_table.c \
|
||||
util/u_hash.c \
|
||||
util/u_hash_table.c \
|
||||
util/u_index_modify.c \
|
||||
util/u_keymap.c \
|
||||
util/u_linear.c \
|
||||
util/u_linkage.c \
|
||||
util/u_network.c \
|
||||
util/u_math.c \
|
||||
util/u_mm.c \
|
||||
util/u_rect.c \
|
||||
util/u_ringbuffer.c \
|
||||
util/u_sampler.c \
|
||||
util/u_simple_shaders.c \
|
||||
util/u_slab.c \
|
||||
util/u_snprintf.c \
|
||||
util/u_staging.c \
|
||||
util/u_surface.c \
|
||||
util/u_surfaces.c \
|
||||
util/u_texture.c \
|
||||
util/u_tile.c \
|
||||
util/u_transfer.c \
|
||||
util/u_resource.c \
|
||||
util/u_upload_mgr.c
|
||||
|
||||
GENERATED_SOURCES = \
|
||||
indices/u_indices_gen.c \
|
||||
indices/u_unfilled_gen.c \
|
||||
util/u_format_srgb.c \
|
||||
util/u_format_table.c \
|
||||
util/u_half.c
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_SRC_FILES := \
|
||||
$(filter-out $(GENERATED_SOURCES), $(C_SOURCES))
|
||||
|
||||
LOCAL_CFLAGS := \
|
||||
-fvisibility=hidden \
|
||||
-Wno-sign-compare
|
||||
|
||||
LOCAL_C_INCLUDES := \
|
||||
external/mesa/include \
|
||||
external/mesa/src/gallium/include \
|
||||
external/mesa/src/gallium/auxiliary \
|
||||
external/mesa/src/gallium/drivers \
|
||||
external/mesa/src/gallium/auxiliary/util
|
||||
|
||||
LOCAL_MODULE := libmesa_gallium
|
||||
LOCAL_MODULE_CLASS := STATIC_LIBRARIES
|
||||
|
||||
intermediates := $(call local-intermediates-dir)
|
||||
|
||||
GEN_SCRIPT := $(LOCAL_PATH)/indices/u_indices_gen.py
|
||||
GEN := $(intermediates)/indices/u_indices_gen.c
|
||||
$(GEN): PRIVATE_CUSTOM_TOOL = python $< > $@
|
||||
$(GEN): $(GEN_SCRIPT)
|
||||
$(transform-generated-source)
|
||||
|
||||
LOCAL_GENERATED_SOURCES += $(GEN)
|
||||
|
||||
GEN_SCRIPT := $(LOCAL_PATH)/indices/u_unfilled_gen.py
|
||||
GEN := $(intermediates)/indices/u_unfilled_gen.c
|
||||
$(GEN): PRIVATE_CUSTOM_TOOL = python $< > $@
|
||||
$(GEN): $(GEN_SCRIPT)
|
||||
$(transform-generated-source)
|
||||
|
||||
LOCAL_GENERATED_SOURCES += $(GEN)
|
||||
|
||||
GEN_SCRIPT := $(LOCAL_PATH)/util/u_format_srgb.py
|
||||
GEN := $(intermediates)/util/u_format_srgb.c
|
||||
$(GEN): PRIVATE_CUSTOM_TOOL = python $< > $@
|
||||
$(GEN): $(GEN_SCRIPT)
|
||||
$(transform-generated-source)
|
||||
|
||||
LOCAL_GENERATED_SOURCES += $(GEN)
|
||||
|
||||
GEN_SCRIPT := $(LOCAL_PATH)/util/u_format_table.py
|
||||
GEN := $(intermediates)/util/u_format_table.c
|
||||
$(GEN): PRIVATE_CUSTOM_TOOL := python $(GEN_SCRIPT) $(LOCAL_PATH)/util/u_format.csv > $(GEN)
|
||||
$(GEN): $(GEN_SCRIPT) $(LOCAL_PATH)/util/u_format.csv
|
||||
$(transform-generated-source)
|
||||
|
||||
LOCAL_GENERATED_SOURCES += $(GEN)
|
||||
|
||||
GEN_SCRIPT := $(LOCAL_PATH)/util/u_half.py
|
||||
GEN := $(intermediates)/util/u_half.c
|
||||
$(GEN): PRIVATE_CUSTOM_TOOL = python $< > $@
|
||||
$(GEN): $(GEN_SCRIPT)
|
||||
$(transform-generated-source)
|
||||
|
||||
LOCAL_GENERATED_SOURCES += $(GEN)
|
||||
|
||||
include $(BUILD_STATIC_LIBRARY)
|
@@ -306,7 +306,7 @@ typedef int64_t pipe_condvar;
|
||||
* pipe_barrier
|
||||
*/
|
||||
|
||||
#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_HAIKU) || defined(PIPE_OS_EMBEDDED)
|
||||
#if (defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_HAIKU) || defined(PIPE_OS_EMBEDDED)) && !defined(PIPE_OS_ANDROID)
|
||||
|
||||
typedef pthread_barrier_t pipe_barrier;
|
||||
|
||||
|
@@ -187,6 +187,16 @@ static INLINE double log2( double x )
|
||||
#endif /* _MSC_VER */
|
||||
|
||||
|
||||
#ifdef PIPE_OS_ANDROID
|
||||
|
||||
static INLINE
|
||||
double log2(double d)
|
||||
{
|
||||
return log(d) / M_LN2;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
1
src/gallium/drivers/Android.mk
Normal file
1
src/gallium/drivers/Android.mk
Normal file
@@ -0,0 +1 @@
|
||||
include $(call all-subdir-makefiles)
|
48
src/gallium/drivers/i915/Android.mk
Normal file
48
src/gallium/drivers/i915/Android.mk
Normal file
@@ -0,0 +1,48 @@
|
||||
ifeq ($(strip $(MESA_BUILD_I915G)),true)
|
||||
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
# from Makefile
|
||||
C_SOURCES = \
|
||||
i915_blit.c \
|
||||
i915_clear.c \
|
||||
i915_flush.c \
|
||||
i915_context.c \
|
||||
i915_debug.c \
|
||||
i915_debug_fp.c \
|
||||
i915_state.c \
|
||||
i915_state_immediate.c \
|
||||
i915_state_dynamic.c \
|
||||
i915_state_derived.c \
|
||||
i915_state_emit.c \
|
||||
i915_state_fpc.c \
|
||||
i915_state_sampler.c \
|
||||
i915_state_static.c \
|
||||
i915_screen.c \
|
||||
i915_prim_emit.c \
|
||||
i915_prim_vbuf.c \
|
||||
i915_resource.c \
|
||||
i915_resource_texture.c \
|
||||
i915_resource_buffer.c \
|
||||
i915_fpc_emit.c \
|
||||
i915_fpc_translate.c \
|
||||
i915_surface.c
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_SRC_FILES := \
|
||||
$(C_SOURCES)
|
||||
|
||||
LOCAL_CFLAGS := \
|
||||
-fvisibility=hidden \
|
||||
-Wno-sign-compare
|
||||
|
||||
LOCAL_C_INCLUDES := \
|
||||
external/mesa/src/gallium/include \
|
||||
external/mesa/src/gallium/auxiliary
|
||||
|
||||
LOCAL_MODULE := libmesa_pipe_i915
|
||||
|
||||
include $(BUILD_STATIC_LIBRARY)
|
||||
|
||||
endif # MESA_BUILD_I915G
|
@@ -55,7 +55,7 @@ i915_buffer_destroy(struct pipe_screen *screen,
|
||||
{
|
||||
struct i915_buffer *buffer = i915_buffer(resource);
|
||||
if (buffer->free_on_destroy)
|
||||
align_free(buffer->data);
|
||||
FREE(buffer->data);
|
||||
FREE(buffer);
|
||||
}
|
||||
|
||||
|
52
src/gallium/drivers/softpipe/Android.mk
Normal file
52
src/gallium/drivers/softpipe/Android.mk
Normal file
@@ -0,0 +1,52 @@
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
# from Makefile
|
||||
C_SOURCES = \
|
||||
sp_fs_exec.c \
|
||||
sp_fs_sse.c \
|
||||
sp_clear.c \
|
||||
sp_fence.c \
|
||||
sp_flush.c \
|
||||
sp_query.c \
|
||||
sp_context.c \
|
||||
sp_draw_arrays.c \
|
||||
sp_prim_vbuf.c \
|
||||
sp_quad_pipe.c \
|
||||
sp_quad_stipple.c \
|
||||
sp_quad_depth_test.c \
|
||||
sp_quad_fs.c \
|
||||
sp_quad_blend.c \
|
||||
sp_screen.c \
|
||||
sp_setup.c \
|
||||
sp_state_blend.c \
|
||||
sp_state_clip.c \
|
||||
sp_state_derived.c \
|
||||
sp_state_sampler.c \
|
||||
sp_state_shader.c \
|
||||
sp_state_so.c \
|
||||
sp_state_rasterizer.c \
|
||||
sp_state_surface.c \
|
||||
sp_state_vertex.c \
|
||||
sp_texture.c \
|
||||
sp_tex_sample.c \
|
||||
sp_tex_tile_cache.c \
|
||||
sp_tile_cache.c \
|
||||
sp_surface.c
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_SRC_FILES := \
|
||||
$(C_SOURCES)
|
||||
|
||||
LOCAL_CFLAGS := \
|
||||
-fvisibility=hidden \
|
||||
-Wno-sign-compare
|
||||
|
||||
LOCAL_C_INCLUDES := \
|
||||
external/mesa/include \
|
||||
external/mesa/src/gallium/include \
|
||||
external/mesa/src/gallium/auxiliary
|
||||
|
||||
LOCAL_MODULE := libmesa_pipe_softpipe
|
||||
|
||||
include $(BUILD_STATIC_LIBRARY)
|
@@ -50,7 +50,7 @@ softpipe_flush( struct pipe_context *pipe,
|
||||
|
||||
draw_flush(softpipe->draw);
|
||||
|
||||
if (flags & PIPE_FLUSH_TEXTURE_CACHE) {
|
||||
if (1 || (flags & PIPE_FLUSH_TEXTURE_CACHE)) {
|
||||
for (i = 0; i < softpipe->num_sampler_views; i++) {
|
||||
sp_flush_tex_tile_cache(softpipe->tex_cache[i]);
|
||||
}
|
||||
|
73
src/gallium/drivers/svga/Android.mk
Normal file
73
src/gallium/drivers/svga/Android.mk
Normal file
@@ -0,0 +1,73 @@
|
||||
ifeq ($(strip $(MESA_BUILD_VMWGFX)),true)
|
||||
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
# from Makefile
|
||||
C_SOURCES = \
|
||||
svgadump/svga_shader_dump.c \
|
||||
svgadump/svga_shader_op.c \
|
||||
svgadump/svga_dump.c \
|
||||
svga_cmd.c \
|
||||
svga_context.c \
|
||||
svga_draw.c \
|
||||
svga_draw_arrays.c \
|
||||
svga_draw_elements.c \
|
||||
svga_pipe_blend.c \
|
||||
svga_pipe_blit.c \
|
||||
svga_pipe_clear.c \
|
||||
svga_pipe_constants.c \
|
||||
svga_pipe_depthstencil.c \
|
||||
svga_pipe_draw.c \
|
||||
svga_pipe_flush.c \
|
||||
svga_pipe_fs.c \
|
||||
svga_pipe_misc.c \
|
||||
svga_pipe_query.c \
|
||||
svga_pipe_rasterizer.c \
|
||||
svga_pipe_sampler.c \
|
||||
svga_pipe_vertex.c \
|
||||
svga_pipe_vs.c \
|
||||
svga_screen.c \
|
||||
svga_screen_cache.c \
|
||||
svga_state.c \
|
||||
svga_state_need_swtnl.c \
|
||||
svga_state_constants.c \
|
||||
svga_state_framebuffer.c \
|
||||
svga_state_rss.c \
|
||||
svga_state_tss.c \
|
||||
svga_state_vdecl.c \
|
||||
svga_state_fs.c \
|
||||
svga_state_vs.c \
|
||||
svga_swtnl_backend.c \
|
||||
svga_swtnl_draw.c \
|
||||
svga_swtnl_state.c \
|
||||
svga_tgsi.c \
|
||||
svga_tgsi_decl_sm20.c \
|
||||
svga_tgsi_decl_sm30.c \
|
||||
svga_tgsi_insn.c \
|
||||
svga_sampler_view.c \
|
||||
svga_surface.c \
|
||||
svga_resource.c \
|
||||
svga_resource_texture.c \
|
||||
svga_resource_buffer.c \
|
||||
svga_resource_buffer_upload.c
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_SRC_FILES := \
|
||||
$(C_SOURCES)
|
||||
|
||||
LOCAL_CFLAGS := \
|
||||
-fvisibility=hidden \
|
||||
-Wno-sign-compare
|
||||
|
||||
LOCAL_C_INCLUDES := \
|
||||
external/mesa/include \
|
||||
external/mesa/src/gallium/include \
|
||||
external/mesa/src/gallium/auxiliary \
|
||||
external/mesa/src/gallium/drivers/svga/include
|
||||
|
||||
LOCAL_MODULE := libmesa_pipe_svga
|
||||
|
||||
include $(BUILD_STATIC_LIBRARY)
|
||||
|
||||
endif # MESA_BUILD_VMWGFX
|
@@ -67,7 +67,9 @@ extern "C" {
|
||||
|
||||
|
||||
#if !defined(__HAIKU__) && !defined(__USE_MISC)
|
||||
#if !defined(PIPE_OS_ANDROID)
|
||||
typedef unsigned int uint;
|
||||
#endif
|
||||
typedef unsigned short ushort;
|
||||
#endif
|
||||
typedef unsigned char ubyte;
|
||||
|
@@ -133,6 +133,14 @@
|
||||
#define PIPE_OS_UNIX
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Android defines __linux__ so PIPE_OS_LINUX and PIPE_OS_UNIX will also be
|
||||
* defined.
|
||||
*/
|
||||
#if defined(ANDROID)
|
||||
#define PIPE_OS_ANDROID
|
||||
#endif
|
||||
|
||||
#if defined(__FreeBSD__)
|
||||
#define PIPE_OS_FREEBSD
|
||||
#define PIPE_OS_BSD
|
||||
|
38
src/gallium/state_trackers/Android.mk
Normal file
38
src/gallium/state_trackers/Android.mk
Normal file
@@ -0,0 +1,38 @@
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
common_SOURCES := \
|
||||
egl/common/egl_g3d.c \
|
||||
egl/common/egl_g3d_api.c \
|
||||
egl/common/egl_g3d_image.c \
|
||||
egl/common/egl_g3d_st.c \
|
||||
egl/common/egl_g3d_sync.c \
|
||||
egl/common/native_helper.c
|
||||
|
||||
android_SOURCES := \
|
||||
egl/android/native_android.cpp
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_SRC_FILES := \
|
||||
$(common_SOURCES) \
|
||||
$(android_SOURCES)
|
||||
|
||||
LOCAL_CFLAGS := \
|
||||
-DHAVE_ANDROID_BACKEND \
|
||||
-fvisibility=hidden \
|
||||
-Wno-sign-compare
|
||||
|
||||
LOCAL_C_INCLUDES := \
|
||||
external/mesa/include \
|
||||
external/mesa/src/gallium/include \
|
||||
external/mesa/src/gallium/auxiliary \
|
||||
external/mesa/src/egl/main \
|
||||
external/mesa/src/gallium/state_trackers/egl \
|
||||
external/mesa/src/gallium/winsys/sw \
|
||||
external/mesa/src/gralloc \
|
||||
external/drm \
|
||||
external/drm/include/drm
|
||||
|
||||
LOCAL_MODULE := libmesa_st_egl
|
||||
|
||||
include $(BUILD_STATIC_LIBRARY)
|
679
src/gallium/state_trackers/egl/android/native_android.cpp
Normal file
679
src/gallium/state_trackers/egl/android/native_android.cpp
Normal file
@@ -0,0 +1,679 @@
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 7.9
|
||||
*
|
||||
* Copyright (C) 2010 LunarG Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* Authors:
|
||||
* Chia-I Wu <olv@lunarg.com>
|
||||
*/
|
||||
|
||||
#define LOG_TAG "MESA-EGL"
|
||||
#include <cutils/log.h>
|
||||
#include <cutils/properties.h>
|
||||
#include <ui/PixelFormat.h>
|
||||
#include <ui/android_native_buffer.h>
|
||||
|
||||
extern "C" {
|
||||
#include "egllog.h"
|
||||
}
|
||||
#include "util/u_memory.h"
|
||||
#include "util/u_inlines.h"
|
||||
#include "util/u_format.h"
|
||||
#include "common/native.h"
|
||||
#include "common/native_helper.h"
|
||||
#include "android/android_sw_winsys.h"
|
||||
#include "state_tracker/drm_driver.h"
|
||||
|
||||
struct android_config;
|
||||
|
||||
struct android_display {
|
||||
struct native_display base;
|
||||
|
||||
boolean use_drm;
|
||||
struct native_event_handler *event_handler;
|
||||
struct android_config *configs;
|
||||
int num_configs;
|
||||
};
|
||||
|
||||
struct android_surface {
|
||||
struct native_surface base;
|
||||
|
||||
struct android_display *adpy;
|
||||
android_native_window_t *win;
|
||||
|
||||
uint stamp;
|
||||
android_native_buffer_t *buf;
|
||||
struct pipe_resource *res;
|
||||
|
||||
/* cache the current front and back resources */
|
||||
void *cache_handles[2];
|
||||
struct pipe_resource *cache_resources[2];
|
||||
};
|
||||
|
||||
struct android_config {
|
||||
struct native_config base;
|
||||
};
|
||||
|
||||
static INLINE struct android_display *
|
||||
android_display(const struct native_display *ndpy)
|
||||
{
|
||||
return (struct android_display *) ndpy;
|
||||
}
|
||||
|
||||
static INLINE struct android_surface *
|
||||
android_surface(const struct native_surface *nsurf)
|
||||
{
|
||||
return (struct android_surface *) nsurf;
|
||||
}
|
||||
|
||||
static INLINE struct android_config *
|
||||
android_config(const struct native_config *nconf)
|
||||
{
|
||||
return (struct android_config *) nconf;
|
||||
}
|
||||
|
||||
namespace android {
|
||||
|
||||
static enum pipe_format
|
||||
get_pipe_format(int native)
|
||||
{
|
||||
enum pipe_format fmt;
|
||||
|
||||
/* see libpixelflinger/format.cpp */
|
||||
switch (native) {
|
||||
case PIXEL_FORMAT_RGBA_8888:
|
||||
fmt = PIPE_FORMAT_R8G8B8A8_UNORM;
|
||||
break;
|
||||
case PIXEL_FORMAT_RGBX_8888:
|
||||
fmt = PIPE_FORMAT_R8G8B8X8_UNORM;
|
||||
break;
|
||||
case PIXEL_FORMAT_RGB_888:
|
||||
fmt = PIPE_FORMAT_R8G8B8_UNORM;
|
||||
break;
|
||||
case PIXEL_FORMAT_RGB_565:
|
||||
fmt = PIPE_FORMAT_B5G6R5_UNORM;
|
||||
break;
|
||||
case PIXEL_FORMAT_BGRA_8888:
|
||||
fmt = PIPE_FORMAT_B8G8R8A8_UNORM;
|
||||
break;
|
||||
case PIXEL_FORMAT_A_8:
|
||||
fmt = PIPE_FORMAT_A8_UNORM;
|
||||
break;
|
||||
case PIXEL_FORMAT_L_8:
|
||||
fmt = PIPE_FORMAT_L8_UNORM;
|
||||
break;
|
||||
case PIXEL_FORMAT_LA_88:
|
||||
fmt = PIPE_FORMAT_L8A8_UNORM;
|
||||
break;
|
||||
case PIXEL_FORMAT_NONE:
|
||||
case PIXEL_FORMAT_RGBA_5551:
|
||||
case PIXEL_FORMAT_RGBA_4444:
|
||||
case PIXEL_FORMAT_RGB_332:
|
||||
default:
|
||||
LOGE("unsupported native format 0x%x", native);
|
||||
fmt = PIPE_FORMAT_NONE;
|
||||
break;
|
||||
}
|
||||
|
||||
return fmt;
|
||||
}
|
||||
|
||||
#include <gralloc_gem.h>
|
||||
static int
|
||||
get_handle_name(buffer_handle_t handle)
|
||||
{
|
||||
struct drm_bo_t *bo;
|
||||
|
||||
bo = drm_gem_get(handle);
|
||||
|
||||
return (bo) ? bo->name : 0;
|
||||
}
|
||||
|
||||
static struct pipe_resource *
|
||||
import_buffer(struct android_display *adpy, const struct pipe_resource *templ,
|
||||
struct android_native_buffer_t *abuf)
|
||||
{
|
||||
struct pipe_screen *screen = adpy->base.screen;
|
||||
struct pipe_resource *res;
|
||||
|
||||
if (templ->bind & PIPE_BIND_RENDER_TARGET) {
|
||||
if (!screen->is_format_supported(screen, templ->format,
|
||||
templ->target, 0, PIPE_BIND_RENDER_TARGET, 0))
|
||||
LOGW("importing unsupported buffer as render target");
|
||||
}
|
||||
if (templ->bind & PIPE_BIND_SAMPLER_VIEW) {
|
||||
if (!screen->is_format_supported(screen, templ->format,
|
||||
templ->target, 0, PIPE_BIND_SAMPLER_VIEW, 0))
|
||||
LOGW("importing unsupported buffer as sampler view");
|
||||
}
|
||||
|
||||
if (adpy->use_drm) {
|
||||
struct winsys_handle handle;
|
||||
|
||||
memset(&handle, 0, sizeof(handle));
|
||||
handle.type = DRM_API_HANDLE_TYPE_SHARED;
|
||||
handle.handle = get_handle_name(abuf->handle);
|
||||
if (!handle.handle) {
|
||||
LOGE("unable to import invalid buffer %p", abuf);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
handle.stride =
|
||||
abuf->stride * util_format_get_blocksize(templ->format);
|
||||
|
||||
res = screen->resource_from_handle(screen, templ, &handle);
|
||||
}
|
||||
else {
|
||||
struct android_winsys_handle handle;
|
||||
|
||||
memset(&handle, 0, sizeof(handle));
|
||||
handle.handle = abuf->handle;
|
||||
handle.stride =
|
||||
abuf->stride * util_format_get_blocksize(templ->format);
|
||||
|
||||
res = screen->resource_from_handle(screen,
|
||||
templ, (struct winsys_handle *) &handle);
|
||||
}
|
||||
|
||||
if (!res)
|
||||
LOGE("failed to import buffer %p", abuf);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
static boolean
|
||||
android_surface_dequeue_buffer(struct native_surface *nsurf)
|
||||
{
|
||||
struct android_surface *asurf = android_surface(nsurf);
|
||||
void *handle;
|
||||
int idx;
|
||||
|
||||
if (asurf->win->dequeueBuffer(asurf->win, &asurf->buf) != NO_ERROR) {
|
||||
LOGE("failed to dequeue window %p", asurf->win);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
asurf->buf->common.incRef(&asurf->buf->common);
|
||||
asurf->win->lockBuffer(asurf->win, asurf->buf);
|
||||
|
||||
if (asurf->adpy->use_drm)
|
||||
handle = (void *) get_handle_name(asurf->buf->handle);
|
||||
else
|
||||
handle = (void *) asurf->buf->handle;
|
||||
/* NULL is invalid */
|
||||
if (!handle) {
|
||||
LOGE("window %p returned an invalid buffer", asurf->win);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* find the slot to use */
|
||||
for (idx = 0; idx < Elements(asurf->cache_handles); idx++) {
|
||||
if (asurf->cache_handles[idx] == handle || !asurf->cache_handles[idx])
|
||||
break;
|
||||
}
|
||||
if (idx == Elements(asurf->cache_handles)) {
|
||||
/* buffer reallocated; clear the cache */
|
||||
for (idx = 0; idx < Elements(asurf->cache_handles); idx++) {
|
||||
asurf->cache_handles[idx] = 0;
|
||||
pipe_resource_reference(&asurf->cache_resources[idx], NULL);
|
||||
}
|
||||
idx = 0;
|
||||
}
|
||||
|
||||
/* update the cache */
|
||||
if (!asurf->cache_handles[idx]) {
|
||||
struct pipe_resource templ;
|
||||
|
||||
assert(!asurf->cache_resources[idx]);
|
||||
|
||||
memset(&templ, 0, sizeof(templ));
|
||||
templ.target = PIPE_TEXTURE_2D;
|
||||
templ.last_level = 0;
|
||||
templ.width0 = asurf->buf->width;
|
||||
templ.height0 = asurf->buf->height;
|
||||
templ.depth0 = 1;
|
||||
templ.bind = PIPE_BIND_RENDER_TARGET;
|
||||
if (!asurf->adpy->use_drm) {
|
||||
templ.bind |= PIPE_BIND_TRANSFER_WRITE |
|
||||
PIPE_BIND_TRANSFER_READ;
|
||||
}
|
||||
|
||||
templ.format = get_pipe_format(asurf->buf->format);
|
||||
if (templ.format != PIPE_FORMAT_NONE) {
|
||||
asurf->cache_resources[idx] =
|
||||
import_buffer(asurf->adpy, &templ, asurf->buf);
|
||||
}
|
||||
else {
|
||||
asurf->cache_resources[idx] = NULL;
|
||||
}
|
||||
|
||||
asurf->cache_handles[idx] = handle;
|
||||
}
|
||||
|
||||
pipe_resource_reference(&asurf->res, asurf->cache_resources[idx]);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
android_surface_enqueue_buffer(struct native_surface *nsurf)
|
||||
{
|
||||
struct android_surface *asurf = android_surface(nsurf);
|
||||
|
||||
pipe_resource_reference(&asurf->res, NULL);
|
||||
|
||||
asurf->win->queueBuffer(asurf->win, asurf->buf);
|
||||
|
||||
asurf->buf->common.decRef(&asurf->buf->common);
|
||||
asurf->buf = NULL;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
android_surface_swap_buffers(struct native_surface *nsurf)
|
||||
{
|
||||
struct android_surface *asurf = android_surface(nsurf);
|
||||
struct android_display *adpy = asurf->adpy;
|
||||
|
||||
if (!asurf->buf)
|
||||
return FALSE;
|
||||
|
||||
android_surface_enqueue_buffer(&asurf->base);
|
||||
|
||||
asurf->stamp++;
|
||||
adpy->event_handler->invalid_surface(&adpy->base,
|
||||
&asurf->base, asurf->stamp);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
android_surface_present(struct native_surface *nsurf,
|
||||
enum native_attachment natt,
|
||||
boolean preserve,
|
||||
uint swap_interval)
|
||||
{
|
||||
boolean ret;
|
||||
|
||||
if (swap_interval || natt != NATIVE_ATTACHMENT_BACK_LEFT)
|
||||
return FALSE;
|
||||
|
||||
return android_surface_swap_buffers(nsurf);
|
||||
}
|
||||
|
||||
static boolean
|
||||
android_surface_validate(struct native_surface *nsurf, uint attachment_mask,
|
||||
unsigned int *seq_num, struct pipe_resource **textures,
|
||||
int *width, int *height)
|
||||
{
|
||||
struct android_surface *asurf = android_surface(nsurf);
|
||||
struct winsys_handle handle;
|
||||
|
||||
if (!asurf->buf) {
|
||||
if (!android_surface_dequeue_buffer(&asurf->base))
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (textures) {
|
||||
const enum native_attachment att = NATIVE_ATTACHMENT_BACK_LEFT;
|
||||
|
||||
if (native_attachment_mask_test(attachment_mask, att)) {
|
||||
textures[att] = NULL;
|
||||
pipe_resource_reference(&textures[att], asurf->res);
|
||||
}
|
||||
}
|
||||
|
||||
if (seq_num)
|
||||
*seq_num = asurf->stamp;
|
||||
if (width)
|
||||
*width = asurf->buf->width;
|
||||
if (height)
|
||||
*height = asurf->buf->height;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
android_surface_wait(struct native_surface *nsurf)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
android_surface_destroy(struct native_surface *nsurf)
|
||||
{
|
||||
struct android_surface *asurf = android_surface(nsurf);
|
||||
int i;
|
||||
|
||||
if (asurf->buf)
|
||||
android_surface_enqueue_buffer(&asurf->base);
|
||||
|
||||
for (i = 0; i < Elements(asurf->cache_handles); i++)
|
||||
pipe_resource_reference(&asurf->cache_resources[i], NULL);
|
||||
|
||||
asurf->win->common.decRef(&asurf->win->common);
|
||||
|
||||
FREE(asurf);
|
||||
}
|
||||
|
||||
static struct native_surface *
|
||||
android_display_create_window_surface(struct native_display *ndpy,
|
||||
EGLNativeWindowType win,
|
||||
const struct native_config *nconf)
|
||||
{
|
||||
struct android_display *adpy = android_display(ndpy);
|
||||
struct android_config *aconf = android_config(nconf);
|
||||
struct android_surface *asurf;
|
||||
enum pipe_format format;
|
||||
int val;
|
||||
|
||||
if (win->common.magic != ANDROID_NATIVE_WINDOW_MAGIC) {
|
||||
LOGE("invalid native window with magic 0x%x", win->common.magic);
|
||||
return NULL;
|
||||
}
|
||||
if (win->query(win, NATIVE_WINDOW_FORMAT, &val)) {
|
||||
LOGE("failed to query native window format");
|
||||
return NULL;
|
||||
}
|
||||
format = get_pipe_format(val);
|
||||
if (format != nconf->color_format) {
|
||||
LOGW("native window format 0x%x != config format 0x%x",
|
||||
format, nconf->color_format);
|
||||
if (!adpy->base.screen->is_format_supported(adpy->base.screen,
|
||||
format, PIPE_TEXTURE_2D, 0, PIPE_BIND_RENDER_TARGET, 0)) {
|
||||
LOGE("and the native window cannot be used as a render target");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
asurf = CALLOC_STRUCT(android_surface);
|
||||
if (!asurf)
|
||||
return NULL;
|
||||
|
||||
asurf->adpy = adpy;
|
||||
asurf->win = win;
|
||||
|
||||
asurf->win->common.incRef(&asurf->win->common);
|
||||
if (!adpy->use_drm) {
|
||||
native_window_set_usage(asurf->win,
|
||||
GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_SW_WRITE_OFTEN);
|
||||
}
|
||||
|
||||
asurf->base.destroy = android_surface_destroy;
|
||||
asurf->base.present = android_surface_present;
|
||||
asurf->base.validate = android_surface_validate;
|
||||
asurf->base.wait = android_surface_wait;
|
||||
|
||||
return &asurf->base;
|
||||
}
|
||||
|
||||
static boolean
|
||||
android_display_init_configs(struct native_display *ndpy)
|
||||
{
|
||||
struct android_display *adpy = android_display(ndpy);
|
||||
const int native_formats[] = {
|
||||
PIXEL_FORMAT_RGBA_8888,
|
||||
PIXEL_FORMAT_RGBX_8888,
|
||||
PIXEL_FORMAT_RGB_888,
|
||||
PIXEL_FORMAT_RGB_565,
|
||||
PIXEL_FORMAT_BGRA_8888,
|
||||
PIXEL_FORMAT_A_8
|
||||
};
|
||||
int i;
|
||||
|
||||
adpy->configs = (struct android_config *)
|
||||
CALLOC(Elements(native_formats), sizeof(*adpy->configs));
|
||||
if (!adpy->configs)
|
||||
return FALSE;
|
||||
|
||||
for (i = 0; i < Elements(native_formats); i++) {
|
||||
enum pipe_format color_format;
|
||||
struct android_config *aconf;
|
||||
|
||||
color_format = get_pipe_format(native_formats[i]);
|
||||
if (color_format == PIPE_FORMAT_NONE ||
|
||||
!adpy->base.screen->is_format_supported(adpy->base.screen,
|
||||
color_format, PIPE_TEXTURE_2D, 0, PIPE_BIND_RENDER_TARGET, 0)) {
|
||||
LOGI("skip unsupported native format 0x%x", native_formats[i]);
|
||||
continue;
|
||||
}
|
||||
|
||||
aconf = &adpy->configs[adpy->num_configs++];
|
||||
aconf->base.buffer_mask = 1 << NATIVE_ATTACHMENT_BACK_LEFT;
|
||||
aconf->base.color_format = color_format;
|
||||
aconf->base.window_bit = TRUE;
|
||||
if (!adpy->use_drm)
|
||||
aconf->base.slow_config = TRUE;
|
||||
|
||||
aconf->base.native_visual_type = native_formats[i];
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
android_display_init(struct native_display *ndpy)
|
||||
{
|
||||
struct android_display *adpy = android_display(ndpy);
|
||||
const hw_module_t *mod;
|
||||
int fd, err;
|
||||
boolean force_sw;
|
||||
char value[PROPERTY_VALUE_MAX];
|
||||
|
||||
if (property_get("debug.mesa.software", value, NULL))
|
||||
force_sw = (atoi(value) != 0);
|
||||
else
|
||||
force_sw = debug_get_bool_option("EGL_SOFTWARE", FALSE);
|
||||
|
||||
/* try DRM first */
|
||||
if (!force_sw) {
|
||||
err = hw_get_module(GRALLOC_HARDWARE_MODULE_ID, &mod);
|
||||
if (!err) {
|
||||
const gralloc_module_t *gr = (gralloc_module_t *) mod;
|
||||
|
||||
err = -EINVAL;
|
||||
if (gr->perform)
|
||||
err = gr->perform(gr, GRALLOC_MODULE_PERFORM_GET_DRM_FD, &fd);
|
||||
}
|
||||
if (!err && fd >= 0) {
|
||||
adpy->base.screen =
|
||||
adpy->event_handler->new_drm_screen(&adpy->base, "i915", fd);
|
||||
if (adpy->base.screen)
|
||||
adpy->use_drm = TRUE;
|
||||
}
|
||||
|
||||
if (adpy->base.screen)
|
||||
LOGI("using DRM screen");
|
||||
else
|
||||
LOGE("failed to create DRM screen");
|
||||
}
|
||||
|
||||
/* try SW screen */
|
||||
if (!adpy->base.screen) {
|
||||
struct sw_winsys *ws = android_create_sw_winsys();
|
||||
|
||||
if (ws) {
|
||||
adpy->base.screen =
|
||||
adpy->event_handler->new_sw_screen(&adpy->base, ws);
|
||||
}
|
||||
|
||||
if (adpy->base.screen)
|
||||
LOGI("using SW screen");
|
||||
else
|
||||
LOGE("failed to create SW screen");
|
||||
}
|
||||
|
||||
if (adpy->base.screen) {
|
||||
if (!android_display_init_configs(&adpy->base)) {
|
||||
adpy->base.screen->destroy(adpy->base.screen);
|
||||
adpy->base.screen = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
return (adpy->base.screen != NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
android_display_destroy(struct native_display *ndpy)
|
||||
{
|
||||
struct android_display *adpy = android_display(ndpy);
|
||||
|
||||
FREE(adpy->configs);
|
||||
adpy->base.screen->destroy(adpy->base.screen);
|
||||
FREE(adpy);
|
||||
}
|
||||
|
||||
static const struct native_config **
|
||||
android_display_get_configs(struct native_display *ndpy, int *num_configs)
|
||||
{
|
||||
struct android_display *adpy = android_display(ndpy);
|
||||
const struct native_config **configs;
|
||||
int i;
|
||||
|
||||
configs = (const struct native_config **)
|
||||
MALLOC(adpy->num_configs * sizeof(*configs));
|
||||
if (configs) {
|
||||
for (i = 0; i < adpy->num_configs; i++)
|
||||
configs[i] = (const struct native_config *) &adpy->configs[i];
|
||||
if (num_configs)
|
||||
*num_configs = adpy->num_configs;
|
||||
}
|
||||
|
||||
return configs;
|
||||
}
|
||||
|
||||
static int
|
||||
android_display_get_param(struct native_display *ndpy,
|
||||
enum native_param_type param)
|
||||
{
|
||||
int val;
|
||||
|
||||
switch (param) {
|
||||
default:
|
||||
val = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
static struct pipe_resource *
|
||||
android_display_import_buffer(struct native_display *ndpy,
|
||||
const struct pipe_resource *templ,
|
||||
void *buf)
|
||||
{
|
||||
struct android_display *adpy = android_display(ndpy);
|
||||
struct android_native_buffer_t *abuf =
|
||||
(struct android_native_buffer_t *) buf;
|
||||
|
||||
return import_buffer(adpy, templ, abuf);
|
||||
}
|
||||
|
||||
static boolean
|
||||
android_display_export_buffer(struct native_display *ndpy,
|
||||
struct pipe_resource *res,
|
||||
void *buf)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static struct native_display_buffer android_display_buffer = {
|
||||
android_display_import_buffer,
|
||||
android_display_export_buffer
|
||||
};
|
||||
|
||||
static struct android_display *
|
||||
android_display_create(struct native_event_handler *event_handler,
|
||||
void *user_data)
|
||||
{
|
||||
struct android_display *adpy;
|
||||
|
||||
adpy = CALLOC_STRUCT(android_display);
|
||||
if (!adpy)
|
||||
return NULL;
|
||||
|
||||
adpy->event_handler = event_handler;
|
||||
adpy->base.user_data = user_data;
|
||||
|
||||
if (!android_display_init(&adpy->base)) {
|
||||
FREE(adpy);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
adpy->base.destroy = android_display_destroy;
|
||||
adpy->base.get_param = android_display_get_param;
|
||||
adpy->base.get_configs = android_display_get_configs;
|
||||
adpy->base.create_window_surface = android_display_create_window_surface;
|
||||
|
||||
adpy->base.buffer = &android_display_buffer;
|
||||
|
||||
return adpy;
|
||||
}
|
||||
|
||||
static struct native_display *
|
||||
native_create_display(void *dpy, struct native_event_handler *event_handler,
|
||||
void *user_data)
|
||||
{
|
||||
struct android_display *adpy;
|
||||
|
||||
adpy = android_display_create(event_handler, user_data);
|
||||
|
||||
return (adpy) ? &adpy->base : NULL;
|
||||
}
|
||||
|
||||
static const struct native_platform android_platform = {
|
||||
"Android", /* name */
|
||||
native_create_display
|
||||
};
|
||||
|
||||
}; /* namespace android */
|
||||
|
||||
using namespace android;
|
||||
|
||||
static void
|
||||
android_log(EGLint level, const char *msg)
|
||||
{
|
||||
switch (level) {
|
||||
case _EGL_DEBUG:
|
||||
LOGD(msg);
|
||||
break;
|
||||
case _EGL_INFO:
|
||||
LOGI(msg);
|
||||
break;
|
||||
case _EGL_WARNING:
|
||||
LOGW(msg);
|
||||
break;
|
||||
case _EGL_FATAL:
|
||||
LOG_FATAL(msg);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
const struct native_platform *
|
||||
native_get_android_platform(void)
|
||||
{
|
||||
_eglSetLogProc(android_log);
|
||||
|
||||
return &android_platform;
|
||||
}
|
@@ -73,6 +73,12 @@ egl_g3d_get_platform(_EGLDriver *drv, _EGLPlatformType plat)
|
||||
plat_name = "FBDEV";
|
||||
#ifdef HAVE_FBDEV_BACKEND
|
||||
nplat = native_get_fbdev_platform();
|
||||
#endif
|
||||
break;
|
||||
case _EGL_PLATFORM_ANDROID:
|
||||
plat_name = "Android";
|
||||
#ifdef HAVE_ANDROID_BACKEND
|
||||
nplat = native_get_android_platform();
|
||||
#endif
|
||||
break;
|
||||
default:
|
||||
@@ -557,6 +563,11 @@ egl_g3d_initialize(_EGLDriver *drv, _EGLDisplay *dpy,
|
||||
dpy->Extensions.MESA_drm_image = EGL_TRUE;
|
||||
}
|
||||
|
||||
#ifdef EGL_ANDROID_image_native_buffer
|
||||
if (dpy->Platform == _EGL_PLATFORM_ANDROID && gdpy->native->buffer)
|
||||
dpy->Extensions.ANDROID_image_native_buffer = EGL_TRUE;
|
||||
#endif
|
||||
|
||||
if (egl_g3d_add_configs(drv, dpy, 1) == 1) {
|
||||
_eglError(EGL_NOT_INITIALIZED, "eglInitialize(unable to add configs)");
|
||||
goto fail;
|
||||
|
@@ -94,6 +94,9 @@ struct egl_g3d_image {
|
||||
struct pipe_resource *texture;
|
||||
unsigned level;
|
||||
unsigned layer;
|
||||
|
||||
EGLenum target;
|
||||
EGLClientBuffer buffer;
|
||||
};
|
||||
|
||||
/* standard typecasts */
|
||||
|
@@ -41,6 +41,11 @@
|
||||
/* for struct winsys_handle */
|
||||
#include "state_tracker/drm_driver.h"
|
||||
|
||||
#ifdef EGL_ANDROID_image_native_buffer
|
||||
#include <ui/android_native_buffer.h>
|
||||
#include "android/android_sw_winsys.h"
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Reference and return the front left buffer of the native pixmap.
|
||||
*/
|
||||
@@ -185,6 +190,67 @@ egl_g3d_reference_drm_buffer(_EGLDisplay *dpy, EGLint name,
|
||||
|
||||
#endif /* EGL_MESA_drm_image */
|
||||
|
||||
#ifdef EGL_ANDROID_image_native_buffer
|
||||
|
||||
static struct pipe_resource *
|
||||
egl_g3d_reference_android_native_buffer(_EGLDisplay *dpy,
|
||||
struct android_native_buffer_t *buf)
|
||||
{
|
||||
struct egl_g3d_display *gdpy = egl_g3d_display(dpy);
|
||||
struct pipe_screen *screen = gdpy->native->screen;
|
||||
enum pipe_format format;
|
||||
struct pipe_resource templ, *res;
|
||||
struct android_winsys_handle handle;
|
||||
|
||||
if (!buf || buf->common.magic != ANDROID_NATIVE_BUFFER_MAGIC ||
|
||||
buf->common.version != sizeof(*buf)) {
|
||||
_eglError(EGL_BAD_PARAMETER, "eglCreateEGLImageKHR");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
switch (buf->format) {
|
||||
case HAL_PIXEL_FORMAT_RGBA_8888:
|
||||
format = PIPE_FORMAT_R8G8B8A8_UNORM;
|
||||
break;
|
||||
case HAL_PIXEL_FORMAT_RGBX_8888:
|
||||
format = PIPE_FORMAT_R8G8B8X8_UNORM;
|
||||
break;
|
||||
case HAL_PIXEL_FORMAT_RGB_888:
|
||||
format = PIPE_FORMAT_R8G8B8_UNORM;
|
||||
break;
|
||||
case HAL_PIXEL_FORMAT_RGB_565:
|
||||
format = PIPE_FORMAT_B5G6R5_UNORM;
|
||||
break;
|
||||
case HAL_PIXEL_FORMAT_BGRA_8888:
|
||||
format = PIPE_FORMAT_B8G8R8A8_UNORM;
|
||||
break;
|
||||
case HAL_PIXEL_FORMAT_RGBA_5551:
|
||||
case HAL_PIXEL_FORMAT_RGBA_4444:
|
||||
/* unsupported */
|
||||
default:
|
||||
_eglLog(_EGL_WARNING, "unsupported native format 0x%x", buf->format);
|
||||
return NULL;
|
||||
break;
|
||||
}
|
||||
|
||||
memset(&templ, 0, sizeof(templ));
|
||||
templ.target = PIPE_TEXTURE_2D;
|
||||
templ.format = format;
|
||||
templ.bind = PIPE_BIND_RENDER_TARGET | PIPE_BIND_SAMPLER_VIEW;
|
||||
templ.width0 = buf->width;
|
||||
templ.height0 = buf->height;
|
||||
templ.depth0 = 1;
|
||||
|
||||
res = gdpy->native->buffer->import_buffer(gdpy->native,
|
||||
&templ, (void *) buf);
|
||||
if (res)
|
||||
buf->common.incRef(&buf->common);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
#endif /* EGL_ANDROID_image_native_buffer */
|
||||
|
||||
_EGLImage *
|
||||
egl_g3d_create_image(_EGLDriver *drv, _EGLDisplay *dpy, _EGLContext *ctx,
|
||||
EGLenum target, EGLClientBuffer buffer,
|
||||
@@ -205,6 +271,8 @@ egl_g3d_create_image(_EGLDriver *drv, _EGLDisplay *dpy, _EGLContext *ctx,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
gimg->target = target;
|
||||
|
||||
switch (target) {
|
||||
case EGL_NATIVE_PIXMAP_KHR:
|
||||
ptex = egl_g3d_reference_native_pixmap(dpy,
|
||||
@@ -215,6 +283,13 @@ egl_g3d_create_image(_EGLDriver *drv, _EGLDisplay *dpy, _EGLContext *ctx,
|
||||
ptex = egl_g3d_reference_drm_buffer(dpy,
|
||||
(EGLint) buffer, &gimg->base, attribs);
|
||||
break;
|
||||
#endif
|
||||
#ifdef EGL_ANDROID_image_native_buffer
|
||||
case EGL_NATIVE_BUFFER_ANDROID:
|
||||
gimg->buffer = buffer;
|
||||
ptex = egl_g3d_reference_android_native_buffer(dpy,
|
||||
(struct android_native_buffer_t *) buffer);
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
ptex = NULL;
|
||||
@@ -252,6 +327,14 @@ egl_g3d_destroy_image(_EGLDriver *drv, _EGLDisplay *dpy, _EGLImage *img)
|
||||
{
|
||||
struct egl_g3d_image *gimg = egl_g3d_image(img);
|
||||
|
||||
#ifdef EGL_ANDROID_image_native_buffer
|
||||
if (gimg->target == EGL_NATIVE_BUFFER_ANDROID) {
|
||||
struct android_native_buffer_t * buf =
|
||||
(struct android_native_buffer_t *) gimg->buffer;
|
||||
buf->common.decRef(&buf->common);
|
||||
}
|
||||
#endif
|
||||
|
||||
pipe_resource_reference(&gimg->texture, NULL);
|
||||
FREE(gimg);
|
||||
|
||||
|
@@ -243,6 +243,9 @@ native_get_drm_platform(void);
|
||||
const struct native_platform *
|
||||
native_get_fbdev_platform(void);
|
||||
|
||||
const struct native_platform *
|
||||
native_get_android_platform(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
157
src/gallium/targets/Android.mk
Normal file
157
src/gallium/targets/Android.mk
Normal file
@@ -0,0 +1,157 @@
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
gles_SRC_FILES := \
|
||||
egl-gdi/egl-static.c
|
||||
|
||||
gles_CFLAGS := \
|
||||
-DFEATURE_ES1=1 \
|
||||
-DFEATURE_ES2=1 \
|
||||
-DGALLIUM_SOFTPIPE \
|
||||
-fvisibility=hidden \
|
||||
-Wno-sign-compare
|
||||
|
||||
gles_C_INCLUDES := \
|
||||
external/mesa/include \
|
||||
external/mesa/src/gallium/include \
|
||||
external/mesa/src/gallium/auxiliary \
|
||||
external/mesa/src/gallium/drivers \
|
||||
external/mesa/src/gallium/winsys \
|
||||
external/mesa/src/gallium/state_trackers/vega \
|
||||
external/mesa/src/gallium/state_trackers/egl \
|
||||
external/mesa/src/egl/main \
|
||||
external/mesa/src/mesa
|
||||
|
||||
gles_STATIC_LIBRARIES := \
|
||||
libmesa_st_egl \
|
||||
libmesa_winsys_sw \
|
||||
libmesa_pipe_softpipe \
|
||||
libmesa_st_mesa \
|
||||
libmesa_glsl \
|
||||
libmesa_st_mesa \
|
||||
libmesa_talloc \
|
||||
libmesa_gallium
|
||||
|
||||
gles_WHOLE_STATIC_LIBRARIES := \
|
||||
libmesa_egl \
|
||||
libmesa_glapi
|
||||
|
||||
gles_SHARED_LIBRARIES := \
|
||||
libdl \
|
||||
libhardware \
|
||||
liblog \
|
||||
libcutils
|
||||
|
||||
gralloc_SRC_FILES :=
|
||||
|
||||
gralloc_CFLAGS := \
|
||||
-fvisibility=hidden \
|
||||
-Wno-sign-compare
|
||||
|
||||
gralloc_C_INCLUDES := \
|
||||
external/mesa/src/gallium/include \
|
||||
external/mesa/src/gallium/auxiliary \
|
||||
external/mesa/src/gallium/drivers \
|
||||
external/mesa/src/gallium/winsys
|
||||
|
||||
gralloc_STATIC_LIBRARIES := \
|
||||
libmesa_gallium
|
||||
|
||||
gralloc_WHOLE_STATIC_LIBRARIES := \
|
||||
libmesa_st_gralloc
|
||||
|
||||
gralloc_SHARED_LIBRARIES := \
|
||||
libdl \
|
||||
liblog \
|
||||
libcutils \
|
||||
libdrm \
|
||||
libEGL
|
||||
|
||||
ifeq ($(strip $(MESA_BUILD_SWRAST)),true)
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_SRC_FILES := \
|
||||
$(gles_SRC_FILES)
|
||||
|
||||
LOCAL_CFLAGS := \
|
||||
$(gles_CFLAGS)
|
||||
|
||||
LOCAL_C_INCLUDES := \
|
||||
$(gles_C_INCLUDES)
|
||||
|
||||
LOCAL_STATIC_LIBRARIES := \
|
||||
$(gles_STATIC_LIBRARIES)
|
||||
|
||||
LOCAL_WHOLE_STATIC_LIBRARIES := \
|
||||
$(gles_WHOLE_STATIC_LIBRARIES)
|
||||
|
||||
LOCAL_SHARED_LIBRARIES := \
|
||||
$(gles_SHARED_LIBRARIES)
|
||||
|
||||
LOCAL_MODULE := libGLES_swrast
|
||||
LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/egl
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
endif # MESA_BUILD_SWRAST
|
||||
|
||||
ifeq ($(strip $(MESA_BUILD_I915G)),true)
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_SRC_FILES := \
|
||||
$(gles_SRC_FILES) \
|
||||
egl/pipe_i915.c
|
||||
|
||||
LOCAL_CFLAGS := \
|
||||
$(gles_CFLAGS) \
|
||||
-DFEATURE_DRM=1
|
||||
|
||||
LOCAL_C_INCLUDES := \
|
||||
$(gles_C_INCLUDES)
|
||||
|
||||
LOCAL_STATIC_LIBRARIES := \
|
||||
libmesa_winsys_i915 \
|
||||
libmesa_pipe_i915 \
|
||||
$(gles_STATIC_LIBRARIES)
|
||||
|
||||
LOCAL_WHOLE_STATIC_LIBRARIES := \
|
||||
$(gles_WHOLE_STATIC_LIBRARIES)
|
||||
|
||||
LOCAL_SHARED_LIBRARIES := \
|
||||
$(gles_SHARED_LIBRARIES) \
|
||||
libdrm \
|
||||
libdrm_intel
|
||||
|
||||
LOCAL_MODULE := libGLES_i915g
|
||||
LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/egl
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
endif # MESA_BUILD_I915G
|
||||
|
||||
ifeq ($(strip $(MESA_BUILD_VMWGFX)),true)
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_SRC_FILES := \
|
||||
egl/pipe_vmwgfx.c \
|
||||
$(gralloc_SRC_FILES)
|
||||
|
||||
LOCAL_CFLAGS := \
|
||||
$(gralloc_CFLAGS)
|
||||
|
||||
LOCAL_C_INCLUDES := \
|
||||
$(gralloc_C_INCLUDES)
|
||||
|
||||
LOCAL_STATIC_LIBRARIES := \
|
||||
libmesa_pipe_svga \
|
||||
libmesa_winsys_svga \
|
||||
$(gralloc_STATIC_LIBRARIES)
|
||||
|
||||
LOCAL_WHOLE_STATIC_LIBRARIES := \
|
||||
$(gralloc_WHOLE_STATIC_LIBRARIES)
|
||||
|
||||
LOCAL_SHARED_LIBRARIES := \
|
||||
$(gralloc_SHARED_LIBRARIES)
|
||||
|
||||
LOCAL_MODULE := gralloc.vmwgfx
|
||||
LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
endif # MESA_BUILD_VMWGFX
|
@@ -28,6 +28,7 @@
|
||||
|
||||
#include "common/egl_g3d_loader.h"
|
||||
#include "state_tracker/st_gl_api.h"
|
||||
#include "state_tracker/drm_driver.h"
|
||||
#include "vg_api.h"
|
||||
#include "target-helpers/inline_sw_helper.h"
|
||||
#include "target-helpers/inline_debug_helper.h"
|
||||
@@ -73,7 +74,11 @@ guess_gl_api(enum st_profile_type profile)
|
||||
static struct pipe_screen *
|
||||
create_drm_screen(const char *name, int fd)
|
||||
{
|
||||
#if FEATURE_DRM
|
||||
return driver_descriptor.create_screen(fd);
|
||||
#else
|
||||
return NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
static struct pipe_screen *
|
||||
|
1
src/gallium/winsys/Android.mk
Normal file
1
src/gallium/winsys/Android.mk
Normal file
@@ -0,0 +1 @@
|
||||
include $(call all-subdir-makefiles)
|
33
src/gallium/winsys/i915/Android.mk
Normal file
33
src/gallium/winsys/i915/Android.mk
Normal file
@@ -0,0 +1,33 @@
|
||||
ifeq ($(strip $(MESA_BUILD_I915G)),true)
|
||||
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
# from drm/Makefile
|
||||
C_SOURCES = \
|
||||
i915_drm_batchbuffer.c \
|
||||
i915_drm_buffer.c \
|
||||
i915_drm_fence.c \
|
||||
i915_drm_winsys.c
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_SRC_FILES := \
|
||||
$(addprefix drm/, $(C_SOURCES))
|
||||
|
||||
LOCAL_CFLAGS := \
|
||||
-fvisibility=hidden \
|
||||
-Wno-sign-compare
|
||||
|
||||
LOCAL_C_INCLUDES := \
|
||||
external/mesa/src/gallium/include \
|
||||
external/mesa/src/gallium/auxiliary \
|
||||
external/mesa/src/gallium/drivers \
|
||||
external/drm \
|
||||
external/drm/include/drm \
|
||||
external/drm/intel
|
||||
|
||||
LOCAL_MODULE := libmesa_winsys_i915
|
||||
|
||||
include $(BUILD_STATIC_LIBRARY)
|
||||
|
||||
endif # MESA_BUILD_I915G
|
39
src/gallium/winsys/svga/Android.mk
Normal file
39
src/gallium/winsys/svga/Android.mk
Normal file
@@ -0,0 +1,39 @@
|
||||
ifeq ($(strip $(MESA_BUILD_VMWGFX)),true)
|
||||
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
# from drm/Makefile
|
||||
C_SOURCES = \
|
||||
vmw_buffer.c \
|
||||
vmw_context.c \
|
||||
vmw_fence.c \
|
||||
vmw_screen.c \
|
||||
vmw_screen_dri.c \
|
||||
vmw_screen_ioctl.c \
|
||||
vmw_screen_pools.c \
|
||||
vmw_screen_svga.c \
|
||||
vmw_surface.c
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_SRC_FILES := \
|
||||
$(addprefix drm/, $(C_SOURCES))
|
||||
|
||||
LOCAL_CFLAGS := \
|
||||
-fvisibility=hidden \
|
||||
-Wno-sign-compare
|
||||
|
||||
LOCAL_C_INCLUDES := \
|
||||
external/mesa/include \
|
||||
external/mesa/src/gallium/include \
|
||||
external/mesa/src/gallium/auxiliary \
|
||||
external/mesa/src/gallium/drivers/svga \
|
||||
external/mesa/src/gallium/drivers/svga/include \
|
||||
external/drm \
|
||||
external/drm/include/drm
|
||||
|
||||
LOCAL_MODULE := libmesa_winsys_svga
|
||||
|
||||
include $(BUILD_STATIC_LIBRARY)
|
||||
|
||||
endif # MESA_BUILD_VMWGFX
|
@@ -46,6 +46,24 @@
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#ifdef PIPE_OS_ANDROID
|
||||
extern void* __mmap2(void*, size_t, int, int, int, size_t);
|
||||
|
||||
#define MMAP2_SHIFT 12
|
||||
static INLINE void* vmw_mmap(void *addr, size_t size, int prot, int flags, int fd, unsigned long long offset)
|
||||
{
|
||||
if ( offset & ((1UL << MMAP2_SHIFT)-1) ) {
|
||||
errno = EINVAL;
|
||||
return MAP_FAILED;
|
||||
}
|
||||
|
||||
return __mmap2(addr, size, prot, flags, fd, (size_t)(offset >> MMAP2_SHIFT));
|
||||
}
|
||||
|
||||
#else
|
||||
#define vmw_mmap(addr, size, prot, flags, fd, offset) mmap(addr, size, prot, flags, fd, offset)
|
||||
#endif
|
||||
|
||||
struct vmw_region
|
||||
{
|
||||
SVGAGuestPtr ptr;
|
||||
@@ -106,7 +124,7 @@ vmw_ioctl_fifo_map(struct vmw_winsys_screen *vws,
|
||||
|
||||
VMW_FUNC;
|
||||
|
||||
map = mmap(NULL, getpagesize(), PROT_READ, MAP_SHARED,
|
||||
map = vmw_mmap(NULL, getpagesize(), PROT_READ, MAP_SHARED,
|
||||
vws->ioctl.drm_fd, fifo_offset);
|
||||
|
||||
if (map == MAP_FAILED) {
|
||||
@@ -388,7 +406,7 @@ vmw_ioctl_region_map(struct vmw_region *region)
|
||||
region->ptr.gmrId, region->ptr.offset);
|
||||
|
||||
if (region->data == NULL) {
|
||||
map = mmap(NULL, region->size, PROT_READ | PROT_WRITE, MAP_SHARED,
|
||||
map = vmw_mmap(NULL, region->size, PROT_READ | PROT_WRITE, MAP_SHARED,
|
||||
region->drm_fd, region->map_handle);
|
||||
if (map == MAP_FAILED) {
|
||||
debug_printf("%s: Map failed.\n", __FUNCTION__);
|
||||
|
19
src/gallium/winsys/sw/Android.mk
Normal file
19
src/gallium/winsys/sw/Android.mk
Normal file
@@ -0,0 +1,19 @@
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_SRC_FILES := \
|
||||
android/android_sw_winsys.cpp
|
||||
|
||||
LOCAL_CFLAGS := \
|
||||
-fvisibility=hidden \
|
||||
-Wno-sign-compare
|
||||
|
||||
LOCAL_C_INCLUDES := \
|
||||
external/mesa/include \
|
||||
external/mesa/src/gallium/include \
|
||||
external/mesa/src/gallium/auxiliary
|
||||
|
||||
LOCAL_MODULE := libmesa_winsys_sw
|
||||
|
||||
include $(BUILD_STATIC_LIBRARY)
|
269
src/gallium/winsys/sw/android/android_sw_winsys.cpp
Normal file
269
src/gallium/winsys/sw/android/android_sw_winsys.cpp
Normal file
@@ -0,0 +1,269 @@
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 7.9
|
||||
*
|
||||
* Copyright (C) 2010 LunarG Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* Authors:
|
||||
* Chia-I Wu <olv@lunarg.com>
|
||||
*/
|
||||
|
||||
#include "pipe/p_compiler.h"
|
||||
#include "pipe/p_state.h"
|
||||
#include "util/u_memory.h"
|
||||
#include "util/u_format.h"
|
||||
#include "state_tracker/sw_winsys.h"
|
||||
|
||||
#include <ui/PixelFormat.h>
|
||||
#include <private/ui/sw_gralloc_handle.h>
|
||||
#include <hardware/gralloc.h>
|
||||
|
||||
#include "android_sw_winsys.h"
|
||||
|
||||
struct android_sw_winsys
|
||||
{
|
||||
struct sw_winsys base;
|
||||
|
||||
const gralloc_module_t *grmod;
|
||||
};
|
||||
|
||||
struct android_sw_displaytarget
|
||||
{
|
||||
buffer_handle_t handle;
|
||||
int stride;
|
||||
int width, height, usage;
|
||||
|
||||
void *mapped;
|
||||
};
|
||||
|
||||
static INLINE struct android_sw_winsys *
|
||||
android_sw_winsys(struct sw_winsys *ws)
|
||||
{
|
||||
return (struct android_sw_winsys *) ws;
|
||||
}
|
||||
|
||||
static INLINE struct android_sw_displaytarget *
|
||||
android_sw_displaytarget(struct sw_displaytarget *dt)
|
||||
{
|
||||
return (struct android_sw_displaytarget *) dt;
|
||||
}
|
||||
|
||||
namespace android {
|
||||
|
||||
static void
|
||||
android_displaytarget_display(struct sw_winsys *ws,
|
||||
struct sw_displaytarget *dt,
|
||||
void *context_private)
|
||||
{
|
||||
}
|
||||
|
||||
static struct sw_displaytarget *
|
||||
android_displaytarget_create(struct sw_winsys *ws,
|
||||
unsigned tex_usage,
|
||||
enum pipe_format format,
|
||||
unsigned width, unsigned height,
|
||||
unsigned alignment,
|
||||
unsigned *stride)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
android_displaytarget_destroy(struct sw_winsys *ws,
|
||||
struct sw_displaytarget *dt)
|
||||
{
|
||||
struct android_sw_displaytarget *adt = android_sw_displaytarget(dt);
|
||||
|
||||
assert(!adt->mapped);
|
||||
FREE(adt);
|
||||
}
|
||||
|
||||
static void
|
||||
android_displaytarget_unmap(struct sw_winsys *ws,
|
||||
struct sw_displaytarget *dt)
|
||||
{
|
||||
struct android_sw_winsys *droid = android_sw_winsys(ws);
|
||||
struct android_sw_displaytarget *adt = android_sw_displaytarget(dt);
|
||||
|
||||
if (adt->mapped) {
|
||||
if (sw_gralloc_handle_t::validate(adt->handle) >= 0) {
|
||||
adt->mapped = NULL;
|
||||
}
|
||||
else {
|
||||
droid->grmod->unlock(droid->grmod, adt->handle);
|
||||
adt->mapped = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void *
|
||||
android_displaytarget_map(struct sw_winsys *ws,
|
||||
struct sw_displaytarget *dt,
|
||||
unsigned flags)
|
||||
{
|
||||
struct android_sw_winsys *droid = android_sw_winsys(ws);
|
||||
struct android_sw_displaytarget *adt = android_sw_displaytarget(dt);
|
||||
|
||||
if (!adt->mapped) {
|
||||
if (sw_gralloc_handle_t::validate(adt->handle) >= 0) {
|
||||
const sw_gralloc_handle_t *swhandle =
|
||||
reinterpret_cast<const sw_gralloc_handle_t *>(adt->handle);
|
||||
adt->mapped = reinterpret_cast<void *>(swhandle->base);
|
||||
}
|
||||
else {
|
||||
droid->grmod->lock(droid->grmod, adt->handle,
|
||||
adt->usage, 0, 0, adt->width, adt->height, &adt->mapped);
|
||||
}
|
||||
}
|
||||
|
||||
return adt->mapped;
|
||||
}
|
||||
|
||||
static struct sw_displaytarget *
|
||||
android_displaytarget_from_handle(struct sw_winsys *ws,
|
||||
const struct pipe_resource *templ,
|
||||
struct winsys_handle *whandle,
|
||||
unsigned *stride)
|
||||
{
|
||||
struct android_winsys_handle *ahandle =
|
||||
(struct android_winsys_handle *) whandle;
|
||||
struct android_sw_displaytarget *adt;
|
||||
|
||||
adt = CALLOC_STRUCT(android_sw_displaytarget);
|
||||
if (!adt)
|
||||
return NULL;
|
||||
|
||||
adt->handle = ahandle->handle;
|
||||
adt->stride = ahandle->stride;
|
||||
adt->width = templ->width0;
|
||||
adt->height = templ->height0;
|
||||
|
||||
if (templ->usage & PIPE_BIND_RENDER_TARGET)
|
||||
adt->usage |= GRALLOC_USAGE_HW_RENDER;
|
||||
if (templ->usage & PIPE_BIND_SAMPLER_VIEW)
|
||||
adt->usage |= GRALLOC_USAGE_HW_TEXTURE;
|
||||
if (templ->usage & PIPE_BIND_SCANOUT)
|
||||
adt->usage |= GRALLOC_USAGE_HW_FB;
|
||||
|
||||
if (templ->usage & PIPE_BIND_TRANSFER_READ)
|
||||
adt->usage |= GRALLOC_USAGE_SW_READ_OFTEN;
|
||||
if (templ->usage & PIPE_BIND_TRANSFER_WRITE)
|
||||
adt->usage |= GRALLOC_USAGE_SW_WRITE_OFTEN;
|
||||
|
||||
if (stride)
|
||||
*stride = adt->stride;
|
||||
|
||||
return reinterpret_cast<struct sw_displaytarget *>(adt);
|
||||
}
|
||||
|
||||
static boolean
|
||||
android_displaytarget_get_handle(struct sw_winsys *ws,
|
||||
struct sw_displaytarget *dt,
|
||||
struct winsys_handle *whandle)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static boolean
|
||||
android_is_displaytarget_format_supported(struct sw_winsys *ws,
|
||||
unsigned tex_usage,
|
||||
enum pipe_format format)
|
||||
{
|
||||
struct android_sw_winsys *droid = android_sw_winsys(ws);
|
||||
int fmt;
|
||||
|
||||
switch (format) {
|
||||
case PIPE_FORMAT_R8G8B8A8_UNORM:
|
||||
fmt = PIXEL_FORMAT_RGBA_8888;
|
||||
break;
|
||||
case PIPE_FORMAT_R8G8B8X8_UNORM:
|
||||
fmt = PIXEL_FORMAT_RGBX_8888;
|
||||
break;
|
||||
case PIPE_FORMAT_R8G8B8_UNORM:
|
||||
fmt = PIXEL_FORMAT_RGB_888;
|
||||
break;
|
||||
case PIPE_FORMAT_B5G6R5_UNORM:
|
||||
fmt = PIXEL_FORMAT_RGB_565;
|
||||
break;
|
||||
case PIPE_FORMAT_B8G8R8A8_UNORM:
|
||||
fmt = PIXEL_FORMAT_BGRA_8888;
|
||||
break;
|
||||
case PIPE_FORMAT_A8_UNORM:
|
||||
fmt = PIXEL_FORMAT_A_8;
|
||||
break;
|
||||
case PIPE_FORMAT_L8_UNORM:
|
||||
fmt = PIXEL_FORMAT_L_8;
|
||||
break;
|
||||
case PIPE_FORMAT_L8A8_UNORM:
|
||||
fmt = PIXEL_FORMAT_LA_88;
|
||||
break;
|
||||
default:
|
||||
fmt = PIXEL_FORMAT_NONE;
|
||||
break;
|
||||
}
|
||||
|
||||
return (fmt != PIXEL_FORMAT_NONE);
|
||||
}
|
||||
|
||||
static void
|
||||
android_destroy(struct sw_winsys *ws)
|
||||
{
|
||||
struct android_sw_winsys *droid = android_sw_winsys(ws);
|
||||
|
||||
FREE(droid);
|
||||
}
|
||||
|
||||
}; /* namespace android */
|
||||
|
||||
using namespace android;
|
||||
|
||||
struct sw_winsys *
|
||||
android_create_sw_winsys(void)
|
||||
{
|
||||
struct android_sw_winsys *droid;
|
||||
const hw_module_t *mod;
|
||||
|
||||
droid = CALLOC_STRUCT(android_sw_winsys);
|
||||
if (!droid)
|
||||
return NULL;
|
||||
|
||||
if (hw_get_module(GRALLOC_HARDWARE_MODULE_ID, &mod)) {
|
||||
FREE(droid);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
droid->grmod = (const gralloc_module_t *) mod;
|
||||
|
||||
droid->base.destroy = android_destroy;
|
||||
droid->base.is_displaytarget_format_supported =
|
||||
android_is_displaytarget_format_supported;
|
||||
|
||||
droid->base.displaytarget_create = android_displaytarget_create;
|
||||
droid->base.displaytarget_destroy = android_displaytarget_destroy;
|
||||
droid->base.displaytarget_from_handle = android_displaytarget_from_handle;
|
||||
droid->base.displaytarget_get_handle = android_displaytarget_get_handle;
|
||||
|
||||
droid->base.displaytarget_map = android_displaytarget_map;
|
||||
droid->base.displaytarget_unmap = android_displaytarget_unmap;
|
||||
droid->base.displaytarget_display = android_displaytarget_display;
|
||||
|
||||
return &droid->base;
|
||||
}
|
49
src/gallium/winsys/sw/android/android_sw_winsys.h
Normal file
49
src/gallium/winsys/sw/android/android_sw_winsys.h
Normal file
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 7.9
|
||||
*
|
||||
* Copyright (C) 2010 LunarG Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* Authors:
|
||||
* Chia-I Wu <olv@lunarg.com>
|
||||
*/
|
||||
|
||||
#ifndef ANDROID_SW_WINSYS
|
||||
#define ANDROID_SW_WINSYS
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#include <hardware/gralloc.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
struct sw_winsys;
|
||||
|
||||
struct android_winsys_handle {
|
||||
buffer_handle_t handle;
|
||||
int stride;
|
||||
};
|
||||
|
||||
struct sw_winsys *
|
||||
android_create_sw_winsys(void);
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* ANDROID_SW_WINSYS */
|
96
src/glsl/Android.mk
Normal file
96
src/glsl/Android.mk
Normal file
@@ -0,0 +1,96 @@
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
# from Makefile
|
||||
LIBGLCPP_SOURCES = \
|
||||
glcpp/glcpp-lex.c \
|
||||
glcpp/glcpp-parse.c \
|
||||
glcpp/pp.c
|
||||
|
||||
C_SOURCES = \
|
||||
$(LIBGLCPP_SOURCES)
|
||||
|
||||
CXX_SOURCES = \
|
||||
ast_expr.cpp \
|
||||
ast_function.cpp \
|
||||
ast_to_hir.cpp \
|
||||
ast_type.cpp \
|
||||
builtin_function.cpp \
|
||||
glsl_lexer.cpp \
|
||||
glsl_parser.cpp \
|
||||
glsl_parser_extras.cpp \
|
||||
glsl_types.cpp \
|
||||
glsl_symbol_table.cpp \
|
||||
hir_field_selection.cpp \
|
||||
ir_basic_block.cpp \
|
||||
ir_clone.cpp \
|
||||
ir_constant_expression.cpp \
|
||||
ir.cpp \
|
||||
ir_expression_flattening.cpp \
|
||||
ir_function_can_inline.cpp \
|
||||
ir_function.cpp \
|
||||
ir_hierarchical_visitor.cpp \
|
||||
ir_hv_accept.cpp \
|
||||
ir_import_prototypes.cpp \
|
||||
ir_print_visitor.cpp \
|
||||
ir_reader.cpp \
|
||||
ir_rvalue_visitor.cpp \
|
||||
ir_set_program_inouts.cpp \
|
||||
ir_validate.cpp \
|
||||
ir_variable.cpp \
|
||||
ir_variable_refcount.cpp \
|
||||
linker.cpp \
|
||||
link_functions.cpp \
|
||||
loop_analysis.cpp \
|
||||
loop_controls.cpp \
|
||||
loop_unroll.cpp \
|
||||
lower_discard.cpp \
|
||||
lower_if_to_cond_assign.cpp \
|
||||
lower_instructions.cpp \
|
||||
lower_jumps.cpp \
|
||||
lower_mat_op_to_vec.cpp \
|
||||
lower_noise.cpp \
|
||||
lower_texture_projection.cpp \
|
||||
lower_variable_index_to_cond_assign.cpp \
|
||||
lower_vec_index_to_cond_assign.cpp \
|
||||
lower_vec_index_to_swizzle.cpp \
|
||||
lower_vector.cpp \
|
||||
opt_algebraic.cpp \
|
||||
opt_constant_folding.cpp \
|
||||
opt_constant_propagation.cpp \
|
||||
opt_constant_variable.cpp \
|
||||
opt_copy_propagation.cpp \
|
||||
opt_dead_code.cpp \
|
||||
opt_dead_code_local.cpp \
|
||||
opt_dead_functions.cpp \
|
||||
opt_discard_simplification.cpp \
|
||||
opt_function_inlining.cpp \
|
||||
opt_if_simplification.cpp \
|
||||
opt_noop_swizzle.cpp \
|
||||
opt_redundant_jumps.cpp \
|
||||
opt_structure_splitting.cpp \
|
||||
opt_swizzle_swizzle.cpp \
|
||||
opt_tree_grafting.cpp \
|
||||
s_expression.cpp
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_SRC_FILES := \
|
||||
$(C_SOURCES) \
|
||||
$(CXX_SOURCES)
|
||||
|
||||
LOCAL_CFLAGS := \
|
||||
-DPTHREADS \
|
||||
-fvisibility=hidden \
|
||||
-Wno-sign-compare \
|
||||
-Wno-error=non-virtual-dtor \
|
||||
-Wno-non-virtual-dtor
|
||||
|
||||
LOCAL_C_INCLUDES := \
|
||||
external/mesa/include \
|
||||
external/mesa/src/mapi \
|
||||
external/mesa/src/talloc \
|
||||
external/mesa/src/mesa
|
||||
|
||||
LOCAL_MODULE := libmesa_glsl
|
||||
|
||||
include $(BUILD_STATIC_LIBRARY)
|
@@ -129,6 +129,7 @@ protected:
|
||||
* be created.
|
||||
*/
|
||||
ast_node(void);
|
||||
virtual ~ast_node() {}
|
||||
};
|
||||
|
||||
|
||||
|
@@ -131,6 +131,7 @@ protected:
|
||||
ir_type = ir_type_unset;
|
||||
type = NULL;
|
||||
}
|
||||
virtual ~ir_instruction() {}
|
||||
};
|
||||
|
||||
|
||||
|
@@ -77,6 +77,7 @@ enum ir_visitor_status {
|
||||
class ir_hierarchical_visitor {
|
||||
public:
|
||||
ir_hierarchical_visitor();
|
||||
virtual ~ir_hierarchical_visitor() {}
|
||||
|
||||
/**
|
||||
* \name Visit methods for leaf-node classes
|
||||
|
@@ -21,9 +21,9 @@
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <cstdarg>
|
||||
|
||||
extern "C" {
|
||||
#include <stdarg.h>
|
||||
#include <talloc.h>
|
||||
}
|
||||
|
||||
|
@@ -23,9 +23,9 @@
|
||||
|
||||
#include <cstdlib>
|
||||
#include <cstdio>
|
||||
#include <cstdarg>
|
||||
|
||||
extern "C" {
|
||||
#include <stdarg.h>
|
||||
#include <talloc.h>
|
||||
}
|
||||
|
||||
|
@@ -65,10 +65,10 @@
|
||||
*/
|
||||
#include <cstdlib>
|
||||
#include <cstdio>
|
||||
#include <cstdarg>
|
||||
#include <climits>
|
||||
|
||||
extern "C" {
|
||||
#include <stdarg.h>
|
||||
#include <talloc.h>
|
||||
}
|
||||
|
||||
|
54
src/gralloc/Android.mk
Normal file
54
src/gralloc/Android.mk
Normal file
@@ -0,0 +1,54 @@
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
common_SRC_FILES := \
|
||||
gralloc_gem.c \
|
||||
gralloc_kms.c \
|
||||
gralloc_mod.c
|
||||
|
||||
common_C_INCLUDES := \
|
||||
external/drm \
|
||||
external/drm/include/drm
|
||||
|
||||
common_SHARED_LIBRARIES := \
|
||||
libdrm \
|
||||
liblog \
|
||||
libcutils
|
||||
|
||||
ifeq ($(strip $(MESA_BUILD_I915)),true)
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_SRC_FILES := \
|
||||
$(common_SRC_FILES) \
|
||||
gralloc_gem_i915.c
|
||||
|
||||
LOCAL_C_INCLUDES := \
|
||||
$(common_C_INCLUDES) \
|
||||
external/drm/intel
|
||||
|
||||
LOCAL_SHARED_LIBRARIES := \
|
||||
$(common_SHARED_LIBRARIES) \
|
||||
libdrm_intel \
|
||||
libEGL
|
||||
|
||||
LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw
|
||||
LOCAL_MODULE := gralloc.i915
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
endif # MESA_BUILD_I915
|
||||
|
||||
ifeq ($(strip $(MESA_BUILD_GALLIUM)),true)
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_SRC_FILES := \
|
||||
$(common_SRC_FILES) \
|
||||
gralloc_gem_pipe.c
|
||||
|
||||
LOCAL_C_INCLUDES := \
|
||||
$(common_C_INCLUDES) \
|
||||
external/mesa/src/gallium/include \
|
||||
external/mesa/src/gallium/auxiliary
|
||||
|
||||
LOCAL_MODULE := libmesa_st_gralloc
|
||||
|
||||
include $(BUILD_STATIC_LIBRARY)
|
||||
endif # MESA_BUILD_GALLIUM
|
119
src/gralloc/gralloc_gem.c
Normal file
119
src/gralloc/gralloc_gem.c
Normal file
@@ -0,0 +1,119 @@
|
||||
#define LOG_TAG "GRALLOC-GEM"
|
||||
|
||||
#include <cutils/log.h>
|
||||
#include <cutils/atomic.h>
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#include "gralloc_mod.h"
|
||||
#include "gralloc_gem.h"
|
||||
|
||||
#define unlikely(x) __builtin_expect(!!(x), 0)
|
||||
|
||||
#define DRM_PATH "/dev/dri/card0"
|
||||
|
||||
static int32_t drm_gem_pid = 0;
|
||||
|
||||
static int
|
||||
drm_gem_get_pid(void)
|
||||
{
|
||||
if (unlikely(!drm_gem_pid))
|
||||
android_atomic_write((int32_t) getpid(), &drm_gem_pid);
|
||||
return drm_gem_pid;
|
||||
}
|
||||
|
||||
static int
|
||||
drm_gem_init_locked(struct drm_module_t *drm)
|
||||
{
|
||||
int ret;
|
||||
|
||||
if (drm->fd >= 0)
|
||||
return 0;
|
||||
|
||||
drm->fd = open(DRM_PATH, O_RDWR);
|
||||
if (drm->fd < 0) {
|
||||
LOGE("failed to open %s", DRM_PATH);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
drm_gem_init(struct drm_module_t *drm)
|
||||
{
|
||||
int ret;
|
||||
|
||||
pthread_mutex_lock(&drm->mutex);
|
||||
ret = drm_gem_init_locked(drm);
|
||||
pthread_mutex_unlock(&drm->mutex);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
drm_gem_get_magic(struct drm_module_t *drm, int32_t *magic)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = drm_gem_init(drm);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
return drmGetMagic(drm->fd, (drm_magic_t *) magic);
|
||||
}
|
||||
|
||||
int
|
||||
drm_gem_auth_magic(struct drm_module_t *drm, int32_t magic)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = drm_gem_init(drm);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
return drmAuthMagic(drm->fd, (drm_magic_t) magic);
|
||||
}
|
||||
|
||||
struct drm_bo_t *
|
||||
drm_gem_create_bo(int width, int height, int format, int usage)
|
||||
{
|
||||
struct drm_bo_t *bo;
|
||||
|
||||
bo = calloc(1, sizeof(*bo));
|
||||
if (!bo)
|
||||
return NULL;
|
||||
|
||||
bo->base.version = sizeof(bo->base);
|
||||
bo->base.numInts = DRM_HANDLE_NUM_INTS;
|
||||
bo->base.numFds = DRM_HANDLE_NUM_FDS;
|
||||
|
||||
bo->magic = DRM_HANDLE_MAGIC;
|
||||
|
||||
bo->width = width;
|
||||
bo->height = height;
|
||||
bo->format = format;
|
||||
bo->usage = usage;
|
||||
|
||||
bo->pid = drm_gem_get_pid();
|
||||
|
||||
return bo;
|
||||
}
|
||||
|
||||
struct drm_bo_t *
|
||||
drm_gem_validate(buffer_handle_t handle)
|
||||
{
|
||||
struct drm_bo_t *bo = drm_gem_get(handle);
|
||||
|
||||
if (bo && unlikely(bo->pid != drm_gem_pid)) {
|
||||
bo->pid = drm_gem_get_pid();
|
||||
bo->fb_handle = 0;
|
||||
bo->fb_id = 0;
|
||||
bo->data = 0;
|
||||
}
|
||||
|
||||
return bo;
|
||||
}
|
77
src/gralloc/gralloc_gem.h
Normal file
77
src/gralloc/gralloc_gem.h
Normal file
@@ -0,0 +1,77 @@
|
||||
#ifndef _GRALLOC_GEM_H_
|
||||
#define _GRALLOC_GEM_H_
|
||||
|
||||
#include <cutils/native_handle.h>
|
||||
#include "gralloc_mod.h"
|
||||
|
||||
struct drm_bo_t {
|
||||
native_handle_t base;
|
||||
|
||||
#define DRM_HANDLE_MAGIC 0x12345678
|
||||
#define DRM_HANDLE_NUM_INTS 11
|
||||
#define DRM_HANDLE_NUM_FDS 0
|
||||
int magic;
|
||||
|
||||
int width;
|
||||
int height;
|
||||
int format;
|
||||
int usage;
|
||||
|
||||
int name;
|
||||
int stride;
|
||||
|
||||
/* these fields are undefined until validated */
|
||||
int pid;
|
||||
int fb_handle;
|
||||
int fb_id;
|
||||
int data; /* pointer as int? 32-bit only! */
|
||||
};
|
||||
|
||||
int
|
||||
drm_gem_init(struct drm_module_t *drm);
|
||||
|
||||
int
|
||||
drm_gem_get_magic(struct drm_module_t *drm, int32_t *magic);
|
||||
|
||||
int
|
||||
drm_gem_auth_magic(struct drm_module_t *drm, int32_t magic);
|
||||
|
||||
static inline struct drm_bo_t *
|
||||
drm_gem_get(buffer_handle_t handle)
|
||||
{
|
||||
struct drm_bo_t *bo = (struct drm_bo_t *) handle;
|
||||
|
||||
if (bo->base.version != sizeof(bo->base) ||
|
||||
bo->base.numInts != DRM_HANDLE_NUM_INTS ||
|
||||
bo->base.numFds != DRM_HANDLE_NUM_FDS ||
|
||||
bo->magic != DRM_HANDLE_MAGIC)
|
||||
bo = NULL;
|
||||
|
||||
return bo;
|
||||
}
|
||||
|
||||
struct drm_bo_t *
|
||||
drm_gem_validate(buffer_handle_t handle);
|
||||
|
||||
struct drm_bo_t *
|
||||
drm_gem_create_bo(int width, int height, int format, int usage);
|
||||
|
||||
|
||||
int
|
||||
drm_gem_drv_init(struct drm_module_t *drm);
|
||||
|
||||
struct drm_bo_t *
|
||||
drm_gem_drv_alloc(struct drm_module_t *drm, int width, int height,
|
||||
int format, int usage, int *stride);
|
||||
|
||||
void
|
||||
drm_gem_drv_free(struct drm_module_t *drm, struct drm_bo_t *bo);
|
||||
|
||||
int
|
||||
drm_gem_drv_map(struct drm_module_t *drm, struct drm_bo_t *bo,
|
||||
int x, int y, int w, int h, int enable_write, void **addr);
|
||||
|
||||
void
|
||||
drm_gem_drv_unmap(struct drm_module_t *drm, struct drm_bo_t *bo);
|
||||
|
||||
#endif /* _GRALLOC_GEM_H_ */
|
211
src/gralloc/gralloc_gem_i915.c
Normal file
211
src/gralloc/gralloc_gem_i915.c
Normal file
@@ -0,0 +1,211 @@
|
||||
#define LOG_TAG "GRALLOC-I915"
|
||||
|
||||
#include <cutils/log.h>
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
#include <drm.h>
|
||||
#include <intel_bufmgr.h>
|
||||
#include <i915_drm.h>
|
||||
|
||||
#include "gralloc_mod.h"
|
||||
#include "gralloc_gem.h"
|
||||
|
||||
static void
|
||||
drm_gem_drv_init_features_locked(struct drm_module_t *drm)
|
||||
{
|
||||
struct drm_i915_getparam gp;
|
||||
|
||||
drm_intel_bufmgr *bufmgr = (drm_intel_bufmgr *) drm->gem;
|
||||
|
||||
drm->mode_dirty_fb = 0;
|
||||
|
||||
memset(&gp, 0, sizeof(gp));
|
||||
gp.param = I915_PARAM_HAS_PAGEFLIPPING;
|
||||
gp.value = &drm->mode_page_flip;
|
||||
if (!drmCommandWriteRead(drm->fd, DRM_I915_GETPARAM, &gp, sizeof(gp)))
|
||||
drm->mode_page_flip = *gp.value;
|
||||
else
|
||||
drm->mode_page_flip = 0;
|
||||
|
||||
if (drm->resources) {
|
||||
int pipe;
|
||||
|
||||
pipe = drm_intel_get_pipe_from_crtc_id(bufmgr, drm->crtc_id);
|
||||
drm->swap_interval = (pipe >= 0) ? 1 : 0;
|
||||
drm->vblank_secondary = (pipe > 0);
|
||||
}
|
||||
else {
|
||||
drm->swap_interval = 0;
|
||||
}
|
||||
|
||||
/* XXX there is a bug in the kernel module */
|
||||
drm->mode_page_flip = 0;
|
||||
|
||||
}
|
||||
|
||||
static int
|
||||
drm_gem_drv_init_locked(struct drm_module_t *drm)
|
||||
{
|
||||
if (drm->gem)
|
||||
return 0;
|
||||
|
||||
drm->gem = (void *) drm_intel_bufmgr_gem_init(drm->fd, 16 * 1024);
|
||||
if (!drm->gem) {
|
||||
LOGE("failed to create buffer manager");
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
drm_gem_drv_init_features_locked(drm);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
drm_gem_drv_init(struct drm_module_t *drm)
|
||||
{
|
||||
int ret;
|
||||
|
||||
pthread_mutex_lock(&drm->mutex);
|
||||
ret = drm_gem_drv_init_locked(drm);
|
||||
pthread_mutex_unlock(&drm->mutex);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static uint32_t
|
||||
drm_gem_get_tiling(struct drm_bo_t *bo)
|
||||
{
|
||||
uint32_t tiling = I915_TILING_NONE;
|
||||
|
||||
if (bo->usage & GRALLOC_USAGE_SW_READ_OFTEN)
|
||||
return tiling;
|
||||
|
||||
if (bo->usage & GRALLOC_USAGE_HW_FB ||
|
||||
bo->usage & GRALLOC_USAGE_HW_TEXTURE) {
|
||||
if (bo->width >= 64)
|
||||
tiling = I915_TILING_X;
|
||||
}
|
||||
|
||||
return tiling;
|
||||
}
|
||||
|
||||
struct drm_bo_t *
|
||||
drm_gem_drv_alloc(struct drm_module_t *drm, int width, int height,
|
||||
int format, int usage, int *stride)
|
||||
{
|
||||
drm_intel_bufmgr *bufmgr = (drm_intel_bufmgr *) drm->gem;
|
||||
struct drm_bo_t *bo;
|
||||
drm_intel_bo *ibo;
|
||||
int aligned_width, aligned_height, cpp;
|
||||
unsigned long pitch, flags;
|
||||
uint32_t tiling;
|
||||
const char *name;
|
||||
|
||||
bo = drm_gem_create_bo(width, height, format, usage);
|
||||
if (!bo)
|
||||
return NULL;
|
||||
|
||||
cpp = drm_mod_get_bpp(format);
|
||||
if (!cpp) {
|
||||
LOGE("unrecognized format 0x%x", format);
|
||||
free(bo);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (usage & GRALLOC_USAGE_HW_FB) {
|
||||
name = "gralloc-fb";
|
||||
aligned_width = (width + 63) & ~63;
|
||||
}
|
||||
if (usage & GRALLOC_USAGE_HW_TEXTURE) {
|
||||
name = "gralloc-texture";
|
||||
aligned_width = (width + 3) & ~3;
|
||||
aligned_height = (height + 1) & ~1;
|
||||
}
|
||||
else {
|
||||
name = "gralloc-buf";
|
||||
aligned_width = width;
|
||||
aligned_height = height;
|
||||
}
|
||||
|
||||
tiling = drm_gem_get_tiling(bo);
|
||||
|
||||
flags = 0x0;
|
||||
if (bo->usage & (GRALLOC_USAGE_HW_RENDER | GRALLOC_USAGE_HW_FB))
|
||||
flags |= BO_ALLOC_FOR_RENDER;
|
||||
|
||||
ibo = drm_intel_bo_alloc_tiled(bufmgr, name,
|
||||
aligned_width, aligned_height, cpp, &tiling, &pitch, flags);
|
||||
if (!ibo) {
|
||||
LOGE("failed to allocate ibo %dx%dx%d", width, height, cpp);
|
||||
free(bo);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (bo->usage & GRALLOC_USAGE_HW_FB) {
|
||||
drm_intel_bo_disable_reuse(ibo);
|
||||
bo->stride = pitch;
|
||||
bo->fb_handle = ibo->handle;
|
||||
}
|
||||
|
||||
if (drm_intel_bo_flink(ibo, (uint32_t *) &bo->name)) {
|
||||
LOGE("failed to flink ibo");
|
||||
drm_intel_bo_unreference(ibo);
|
||||
free(bo);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bo->data = (int) ibo;
|
||||
|
||||
*stride = pitch;
|
||||
|
||||
return bo;
|
||||
}
|
||||
|
||||
void
|
||||
drm_gem_drv_free(struct drm_module_t *drm, struct drm_bo_t *bo)
|
||||
{
|
||||
drm_intel_bo_unreference((drm_intel_bo *) bo->data);
|
||||
free(bo);
|
||||
}
|
||||
|
||||
int
|
||||
drm_gem_drv_map(struct drm_module_t *drm, struct drm_bo_t *bo,
|
||||
int x, int y, int w, int h, int enable_write, void **addr)
|
||||
{
|
||||
drm_intel_bo *ibo = (drm_intel_bo *) bo->data;
|
||||
int err;
|
||||
|
||||
if (!ibo) {
|
||||
drm_intel_bufmgr *bufmgr = (drm_intel_bufmgr *) drm->gem;
|
||||
|
||||
ibo = drm_intel_bo_gem_create_from_name(bufmgr, "gralloc-r", bo->name);
|
||||
if (!ibo) {
|
||||
LOGE("failed to create ibo from name %u", bo->name);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
bo->data = (int) ibo;
|
||||
}
|
||||
|
||||
if ((bo->usage & GRALLOC_USAGE_HW_FB) ||
|
||||
drm_gem_get_tiling(bo) != I915_TILING_NONE)
|
||||
err = drm_intel_gem_bo_map_gtt(ibo);
|
||||
else
|
||||
err = drm_intel_bo_map(ibo, enable_write);
|
||||
if (!err)
|
||||
*addr = ibo->virtual;
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
void
|
||||
drm_gem_drv_unmap(struct drm_module_t *drm, struct drm_bo_t *bo)
|
||||
{
|
||||
drm_intel_bo *ibo = (drm_intel_bo *) bo->data;
|
||||
|
||||
if ((bo->usage & GRALLOC_USAGE_HW_FB) ||
|
||||
drm_gem_get_tiling(bo) != I915_TILING_NONE)
|
||||
drm_intel_gem_bo_unmap_gtt(ibo);
|
||||
else
|
||||
drm_intel_bo_unmap(ibo);
|
||||
}
|
333
src/gralloc/gralloc_gem_pipe.c
Normal file
333
src/gralloc/gralloc_gem_pipe.c
Normal file
@@ -0,0 +1,333 @@
|
||||
#define LOG_TAG "GRALLOC-PIPE"
|
||||
|
||||
#include <cutils/log.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "pipe/p_screen.h"
|
||||
#include "pipe/p_context.h"
|
||||
#include "state_tracker/drm_driver.h"
|
||||
#include "util/u_inlines.h"
|
||||
#include "util/u_memory.h"
|
||||
|
||||
#include "gralloc_mod.h"
|
||||
#include "gralloc_gem.h"
|
||||
|
||||
struct drm_pipe_manager {
|
||||
pthread_mutex_t mutex;
|
||||
struct pipe_screen *screen;
|
||||
struct pipe_context *context;
|
||||
};
|
||||
|
||||
struct drm_pipe_buffer {
|
||||
struct winsys_handle winsys;
|
||||
uint32_t fb_handle;
|
||||
struct pipe_resource *resource;
|
||||
struct pipe_transfer *transfer;
|
||||
};
|
||||
|
||||
static void
|
||||
drm_gem_drv_init_features_locked(struct drm_module_t *drm)
|
||||
{
|
||||
drm->mode_dirty_fb = 0;
|
||||
drm->mode_page_flip = 0;
|
||||
|
||||
if (strcmp(driver_descriptor.driver_name, "vmwgfx") == 0)
|
||||
drm->mode_dirty_fb = 1;
|
||||
|
||||
drm->swap_interval = 0;
|
||||
}
|
||||
|
||||
static int
|
||||
drm_gem_drv_init_locked(struct drm_module_t *drm)
|
||||
{
|
||||
struct drm_pipe_manager *pm;
|
||||
|
||||
if (drm->gem)
|
||||
return 0;
|
||||
|
||||
pm = CALLOC(1, sizeof(*pm));
|
||||
if (!pm)
|
||||
return -ENOMEM;
|
||||
|
||||
pthread_mutex_init(&pm->mutex, NULL);
|
||||
|
||||
pm->screen = driver_descriptor.create_screen(drm->fd);
|
||||
if (!pm->screen) {
|
||||
LOGE("failed to create pipe screen");
|
||||
FREE(pm);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
drm->gem = (void *) pm;
|
||||
|
||||
drm_gem_drv_init_features_locked(drm);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
drm_gem_drv_init(struct drm_module_t *drm)
|
||||
{
|
||||
int ret;
|
||||
|
||||
pthread_mutex_lock(&drm->mutex);
|
||||
ret = drm_gem_drv_init_locked(drm);
|
||||
pthread_mutex_unlock(&drm->mutex);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static enum pipe_format
|
||||
get_pipe_format(int format)
|
||||
{
|
||||
enum pipe_format fmt;
|
||||
|
||||
switch (format) {
|
||||
case HAL_PIXEL_FORMAT_RGBA_8888:
|
||||
fmt = PIPE_FORMAT_R8G8B8A8_UNORM;
|
||||
break;
|
||||
case HAL_PIXEL_FORMAT_RGBX_8888:
|
||||
fmt = PIPE_FORMAT_R8G8B8X8_UNORM;
|
||||
break;
|
||||
case HAL_PIXEL_FORMAT_RGB_888:
|
||||
fmt = PIPE_FORMAT_R8G8B8_UNORM;
|
||||
break;
|
||||
case HAL_PIXEL_FORMAT_RGB_565:
|
||||
fmt = PIPE_FORMAT_B5G6R5_UNORM;
|
||||
break;
|
||||
case HAL_PIXEL_FORMAT_BGRA_8888:
|
||||
fmt = PIPE_FORMAT_B8G8R8A8_UNORM;
|
||||
break;
|
||||
case HAL_PIXEL_FORMAT_RGBA_5551:
|
||||
case HAL_PIXEL_FORMAT_RGBA_4444:
|
||||
default:
|
||||
fmt = PIPE_FORMAT_NONE;
|
||||
break;
|
||||
}
|
||||
|
||||
return fmt;
|
||||
}
|
||||
|
||||
static unsigned
|
||||
get_pipe_bind(int usage)
|
||||
{
|
||||
unsigned bind = PIPE_BIND_SHARED;
|
||||
|
||||
if (usage & GRALLOC_USAGE_SW_READ_MASK)
|
||||
bind |= PIPE_BIND_TRANSFER_READ;
|
||||
if (usage & GRALLOC_USAGE_SW_WRITE_MASK)
|
||||
bind |= PIPE_BIND_TRANSFER_WRITE;
|
||||
|
||||
if (usage & GRALLOC_USAGE_HW_TEXTURE)
|
||||
bind |= PIPE_BIND_SAMPLER_VIEW;
|
||||
if (usage & GRALLOC_USAGE_HW_RENDER)
|
||||
bind |= PIPE_BIND_RENDER_TARGET;
|
||||
if (usage & GRALLOC_USAGE_HW_FB) {
|
||||
bind |= PIPE_BIND_RENDER_TARGET;
|
||||
bind |= PIPE_BIND_SCANOUT;
|
||||
}
|
||||
|
||||
return bind;
|
||||
}
|
||||
|
||||
static struct drm_pipe_buffer *
|
||||
get_pipe_buffer(struct drm_pipe_manager *pm, int width, int height,
|
||||
int format, int usage, struct winsys_handle *winsys)
|
||||
{
|
||||
struct drm_pipe_buffer *buf;
|
||||
struct pipe_resource templ;
|
||||
|
||||
memset(&templ, 0, sizeof(templ));
|
||||
templ.format = get_pipe_format(format);
|
||||
templ.bind = get_pipe_bind(usage);
|
||||
templ.target = PIPE_TEXTURE_2D;
|
||||
|
||||
if (templ.format == PIPE_FORMAT_NONE ||
|
||||
!pm->screen->is_format_supported(pm->screen, templ.format,
|
||||
templ.target, 0, templ.bind, 0)) {
|
||||
LOGE("unsupported format 0x%x", format);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
buf = CALLOC(1, sizeof(*buf));
|
||||
if (!buf)
|
||||
return NULL;
|
||||
|
||||
templ.width0 = width;
|
||||
templ.height0 = height;
|
||||
templ.depth0 = 1;
|
||||
|
||||
if (winsys) {
|
||||
buf->resource = pm->screen->resource_from_handle(pm->screen,
|
||||
&templ, winsys);
|
||||
if (!buf->resource)
|
||||
goto fail;
|
||||
|
||||
buf->winsys = *winsys;
|
||||
}
|
||||
else {
|
||||
buf->resource = pm->screen->resource_create(pm->screen, &templ);
|
||||
if (!buf->resource)
|
||||
goto fail;
|
||||
|
||||
buf->winsys.type = DRM_API_HANDLE_TYPE_SHARED;
|
||||
if (!pm->screen->resource_get_handle(pm->screen, buf->resource, &buf->winsys))
|
||||
goto fail;
|
||||
}
|
||||
|
||||
/* need the gem handle for fb */
|
||||
if (usage & GRALLOC_USAGE_HW_FB) {
|
||||
struct winsys_handle tmp;
|
||||
|
||||
memset(&tmp, 0, sizeof(tmp));
|
||||
tmp.type = DRM_API_HANDLE_TYPE_KMS;
|
||||
if (!pm->screen->resource_get_handle(pm->screen, buf->resource, &tmp))
|
||||
goto fail;
|
||||
|
||||
buf->fb_handle = tmp.handle;
|
||||
}
|
||||
|
||||
return buf;
|
||||
|
||||
fail:
|
||||
LOGE("failed to allocate pipe buffer");
|
||||
if (buf->resource)
|
||||
pipe_resource_reference(&buf->resource, NULL);
|
||||
FREE(buf);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
struct drm_bo_t *
|
||||
drm_gem_drv_alloc(struct drm_module_t *drm, int width, int height,
|
||||
int format, int usage, int *stride)
|
||||
{
|
||||
struct drm_pipe_manager *pm = (struct drm_pipe_manager *) drm->gem;
|
||||
struct drm_pipe_buffer *buf;
|
||||
struct drm_bo_t *bo;
|
||||
struct pipe_resource templ;
|
||||
|
||||
bo = drm_gem_create_bo(width, height, format, usage);
|
||||
if (!bo)
|
||||
return NULL;
|
||||
|
||||
pthread_mutex_lock(&pm->mutex);
|
||||
buf = get_pipe_buffer(pm, width, height, format, usage, NULL);
|
||||
pthread_mutex_unlock(&pm->mutex);
|
||||
|
||||
if (buf) {
|
||||
bo->name = (int) buf->winsys.handle;
|
||||
bo->stride = (int) buf->winsys.stride;
|
||||
|
||||
bo->fb_handle = buf->fb_handle;
|
||||
bo->data = (int) buf;
|
||||
|
||||
*stride = bo->stride;
|
||||
}
|
||||
else {
|
||||
free(bo);
|
||||
bo = NULL;
|
||||
}
|
||||
|
||||
return bo;
|
||||
}
|
||||
|
||||
void
|
||||
drm_gem_drv_free(struct drm_module_t *drm, struct drm_bo_t *bo)
|
||||
{
|
||||
struct drm_pipe_manager *pm = (struct drm_pipe_manager *) drm->gem;
|
||||
struct drm_pipe_buffer *buf = (struct drm_pipe_buffer *) bo->data;
|
||||
|
||||
pthread_mutex_lock(&pm->mutex);
|
||||
|
||||
if (buf->transfer)
|
||||
pipe_transfer_destroy(pm->context, buf->transfer);
|
||||
pipe_resource_reference(&buf->resource, NULL);
|
||||
|
||||
pthread_mutex_unlock(&pm->mutex);
|
||||
|
||||
FREE(buf);
|
||||
free(bo);
|
||||
}
|
||||
|
||||
int
|
||||
drm_gem_drv_map(struct drm_module_t *drm, struct drm_bo_t *bo,
|
||||
int x, int y, int w, int h, int enable_write, void **addr)
|
||||
{
|
||||
struct drm_pipe_manager *pm = (struct drm_pipe_manager *) drm->gem;
|
||||
struct drm_pipe_buffer *buf = (struct drm_pipe_buffer *) bo->data;
|
||||
enum pipe_transfer_usage usage = 0;
|
||||
int ret = 0;
|
||||
|
||||
pthread_mutex_lock(&pm->mutex);
|
||||
|
||||
/* need a context to get transfer */
|
||||
if (!pm->context) {
|
||||
pm->context = pm->screen->context_create(pm->screen, NULL);
|
||||
if (!pm->context) {
|
||||
LOGE("failed to create pipe context");
|
||||
ret = -ENOMEM;
|
||||
}
|
||||
}
|
||||
|
||||
/* the bo was allocated by another process */
|
||||
if (!buf && !ret) {
|
||||
struct winsys_handle winsys;
|
||||
|
||||
memset(&winsys, 0, sizeof(winsys));
|
||||
winsys.type = DRM_API_HANDLE_TYPE_SHARED;
|
||||
winsys.handle = bo->name;
|
||||
winsys.stride = bo->stride;
|
||||
|
||||
buf = get_pipe_buffer(pm, bo->width, bo->height,
|
||||
bo->format, bo->usage, &winsys);
|
||||
if (!buf) {
|
||||
LOGE("failed to create pipe buffer from name %u", bo->name);
|
||||
ret = -ENOMEM;
|
||||
}
|
||||
|
||||
bo->data = (int) buf;
|
||||
}
|
||||
|
||||
if (buf) {
|
||||
usage = PIPE_TRANSFER_READ;
|
||||
if (enable_write)
|
||||
usage |= PIPE_TRANSFER_WRITE;
|
||||
|
||||
assert(!buf->transfer);
|
||||
|
||||
/*
|
||||
* ignore x, y, w and h so that returned addr points at the start of the
|
||||
* buffer
|
||||
*/
|
||||
buf->transfer = pipe_get_transfer(pm->context, buf->resource,
|
||||
0, 0, usage, 0, 0, bo->width, bo->height);
|
||||
if (buf->transfer)
|
||||
*addr = pipe_transfer_map(pm->context, buf->transfer);
|
||||
else
|
||||
ret = -ENOMEM;
|
||||
}
|
||||
|
||||
pthread_mutex_unlock(&pm->mutex);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void
|
||||
drm_gem_drv_unmap(struct drm_module_t *drm, struct drm_bo_t *bo)
|
||||
{
|
||||
struct drm_pipe_manager *pm = (struct drm_pipe_manager *) drm->gem;
|
||||
struct drm_pipe_buffer *buf = (struct drm_pipe_buffer *) bo->data;
|
||||
|
||||
pthread_mutex_lock(&pm->mutex);
|
||||
|
||||
assert(buf && buf->transfer);
|
||||
|
||||
pipe_transfer_unmap(pm->context, buf->transfer);
|
||||
pipe_transfer_destroy(pm->context, buf->transfer);
|
||||
buf->transfer = NULL;
|
||||
|
||||
pm->context->flush(pm->context, PIPE_FLUSH_RENDER_CACHE, NULL);
|
||||
|
||||
pthread_mutex_unlock(&pm->mutex);
|
||||
}
|
241
src/gralloc/gralloc_kms.c
Normal file
241
src/gralloc/gralloc_kms.c
Normal file
@@ -0,0 +1,241 @@
|
||||
#define LOG_TAG "GRALLOC-KMS"
|
||||
|
||||
#include <cutils/log.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include "gralloc_kms.h"
|
||||
|
||||
int
|
||||
drm_kms_add_fb(struct drm_module_t *drm, struct drm_bo_t *bo)
|
||||
{
|
||||
uint8_t bpp;
|
||||
|
||||
bpp = drm_mod_get_bpp(bo->format) * 8;
|
||||
|
||||
return drmModeAddFB(drm->fd, bo->width, bo->height, bpp, bpp,
|
||||
bo->stride, bo->fb_handle, (uint32_t *) &bo->fb_id);
|
||||
}
|
||||
|
||||
void
|
||||
drm_kms_rm_fb(struct drm_module_t *drm, struct drm_bo_t *bo)
|
||||
{
|
||||
drmModeRmFB(drm->fd, bo->fb_id);
|
||||
bo->fb_id = 0;
|
||||
}
|
||||
|
||||
static void
|
||||
drm_kms_wait_vblank(struct drm_module_t *drm, int num)
|
||||
{
|
||||
drmVBlank vbl;
|
||||
int ret;
|
||||
|
||||
memset(&vbl, 0, sizeof(vbl));
|
||||
vbl.request.type = DRM_VBLANK_RELATIVE;
|
||||
if (drm->vblank_secondary)
|
||||
vbl.request.type |= DRM_VBLANK_SECONDARY;
|
||||
vbl.request.sequence = num;
|
||||
|
||||
ret = drmWaitVBlank(drm->fd, &vbl);
|
||||
if (ret)
|
||||
LOGW("failed to wait vblank");
|
||||
}
|
||||
|
||||
static int
|
||||
drm_kms_set_crtc(struct drm_module_t *drm, struct drm_bo_t *bo)
|
||||
{
|
||||
int ret;
|
||||
|
||||
if (drm->swap_interval)
|
||||
drm_kms_wait_vblank(drm, drm->swap_interval);
|
||||
|
||||
ret = drmModeSetCrtc(drm->fd, drm->crtc_id, bo->fb_id,
|
||||
0, 0, &drm->connector_id, 1, &drm->mode);
|
||||
if (ret) {
|
||||
LOGE("failed to set crtc");
|
||||
return ret;
|
||||
}
|
||||
|
||||
#ifdef DRM_MODE_FEATURE_DIRTYFB
|
||||
if (drm->mode_dirty_fb)
|
||||
ret = drmModeDirtyFB(drm->fd, bo->fb_id, &drm->clip, 1);
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int
|
||||
drm_kms_page_flip(struct drm_module_t *drm, struct drm_bo_t *bo)
|
||||
{
|
||||
int waits = 3, ret;
|
||||
|
||||
if (drm->swap_interval > 1)
|
||||
drm_kms_wait_vblank(drm, drm->swap_interval - 1);
|
||||
|
||||
while (waits) {
|
||||
ret = drmModePageFlip(drm->fd, drm->crtc_id, bo->fb_id, 0x0, NULL);
|
||||
if (ret && errno == -EBUSY) {
|
||||
if (drm->swap_interval)
|
||||
drm_kms_wait_vblank(drm, 1);
|
||||
else
|
||||
usleep(5000);
|
||||
waits--;
|
||||
}
|
||||
else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (ret)
|
||||
LOGE("failed to perform page flip");
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
drm_kms_post(struct drm_module_t *drm, struct drm_bo_t *bo)
|
||||
{
|
||||
int ret;
|
||||
|
||||
if (!bo->fb_id) {
|
||||
LOGE("unable to post bo %p without fb", bo);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* TODO spawn a thread to avoid waiting */
|
||||
|
||||
if (drm->first_post) {
|
||||
pthread_mutex_lock(&drm->mutex);
|
||||
if (drm->first_post) {
|
||||
ret = drm_kms_set_crtc(drm, bo);
|
||||
if (!ret)
|
||||
drm->first_post = 0;
|
||||
pthread_mutex_unlock(&drm->mutex);
|
||||
|
||||
return ret;
|
||||
}
|
||||
pthread_mutex_unlock(&drm->mutex);
|
||||
}
|
||||
|
||||
if (drm->mode_page_flip && drm->swap_interval)
|
||||
ret = drm_kms_page_flip(drm, bo);
|
||||
else
|
||||
ret = drm_kms_set_crtc(drm, bo);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int
|
||||
drm_kms_init_with_connector_locked(struct drm_module_t *drm,
|
||||
drmModeConnectorPtr connector)
|
||||
{
|
||||
drmModeEncoderPtr encoder;
|
||||
drmModeModeInfoPtr mode;
|
||||
int i;
|
||||
|
||||
if (!connector->count_modes)
|
||||
return -EINVAL;
|
||||
|
||||
encoder = drmModeGetEncoder(drm->fd, connector->encoders[0]);
|
||||
if (!encoder)
|
||||
return -EINVAL;
|
||||
|
||||
for (i = 0; i < drm->resources->count_crtcs; i++) {
|
||||
if (encoder->possible_crtcs & (1 << i))
|
||||
break;
|
||||
}
|
||||
drmModeFreeEncoder(encoder);
|
||||
if (i == drm->resources->count_crtcs)
|
||||
return -EINVAL;
|
||||
|
||||
drm->crtc_id = drm->resources->crtcs[i];
|
||||
drm->connector_id = connector->connector_id;
|
||||
|
||||
/* find the first preferred mode */
|
||||
mode = NULL;
|
||||
for (i = 0; i < connector->count_modes; i++) {
|
||||
drmModeModeInfoPtr m = &connector->modes[i];
|
||||
if (m->type & DRM_MODE_TYPE_PREFERRED) {
|
||||
mode = m;
|
||||
break;
|
||||
}
|
||||
}
|
||||
/* no preference; use the first */
|
||||
if (!mode)
|
||||
mode = &connector->modes[0];
|
||||
|
||||
drm->mode = *mode;
|
||||
|
||||
if (connector->mmWidth && connector->mmHeight) {
|
||||
drm->xdpi = (drm->mode.hdisplay * 25.4 / connector->mmWidth);
|
||||
drm->ydpi = (drm->mode.vdisplay * 25.4 / connector->mmHeight);
|
||||
}
|
||||
else {
|
||||
drm->xdpi = 75;
|
||||
drm->ydpi = 75;
|
||||
}
|
||||
|
||||
/* select between 32/16 bits */
|
||||
#if 1
|
||||
drm->format = HAL_PIXEL_FORMAT_BGRA_8888;
|
||||
#else
|
||||
drm->format = HAL_PIXEL_FORMAT_RGB_565;
|
||||
#endif
|
||||
|
||||
#ifdef DRM_MODE_FEATURE_DIRTYFB
|
||||
drm->clip.x1 = 0;
|
||||
drm->clip.y1 = 0;
|
||||
drm->clip.x2 = drm->mode.hdisplay;
|
||||
drm->clip.y2 = drm->mode.vdisplay;
|
||||
#endif
|
||||
|
||||
drm->first_post = 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
drm_kms_init_locked(struct drm_module_t *drm)
|
||||
{
|
||||
int i, ret;
|
||||
|
||||
if (drm->resources)
|
||||
return 0;
|
||||
|
||||
drm->resources = drmModeGetResources(drm->fd);
|
||||
if (!drm->resources)
|
||||
return -EINVAL;
|
||||
|
||||
for (i = 0; i < drm->resources->count_connectors; i++) {
|
||||
drmModeConnectorPtr connector;
|
||||
|
||||
connector = drmModeGetConnector(drm->fd, drm->resources->connectors[i]);
|
||||
if (connector) {
|
||||
if (connector->connection == DRM_MODE_CONNECTED) {
|
||||
if (!drm_kms_init_with_connector_locked(drm, connector))
|
||||
break;
|
||||
}
|
||||
|
||||
drmModeFreeConnector(connector);
|
||||
}
|
||||
}
|
||||
if (i == drm->resources->count_connectors) {
|
||||
drmModeFreeResources(drm->resources);
|
||||
drm->resources = NULL;
|
||||
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
drm_kms_init(struct drm_module_t *drm)
|
||||
{
|
||||
int ret;
|
||||
|
||||
pthread_mutex_lock(&drm->mutex);
|
||||
ret = drm_kms_init_locked(drm);
|
||||
pthread_mutex_unlock(&drm->mutex);
|
||||
|
||||
return ret;
|
||||
}
|
19
src/gralloc/gralloc_kms.h
Normal file
19
src/gralloc/gralloc_kms.h
Normal file
@@ -0,0 +1,19 @@
|
||||
#ifndef _DRM_KMS_H_
|
||||
#define _DRM_KMS_H_
|
||||
|
||||
#include "gralloc_mod.h"
|
||||
#include "gralloc_gem.h"
|
||||
|
||||
int
|
||||
drm_kms_init(struct drm_module_t *drm);
|
||||
|
||||
int
|
||||
drm_kms_add_fb(struct drm_module_t *drm, struct drm_bo_t *bo);
|
||||
|
||||
void
|
||||
drm_kms_rm_fb(struct drm_module_t *drm, struct drm_bo_t *bo);
|
||||
|
||||
int
|
||||
drm_kms_post(struct drm_module_t *drm, struct drm_bo_t *bo);
|
||||
|
||||
#endif /* _DRM_KMS_H_ */
|
328
src/gralloc/gralloc_mod.c
Normal file
328
src/gralloc/gralloc_mod.c
Normal file
@@ -0,0 +1,328 @@
|
||||
#define LOG_TAG "GRALLOC-MOD"
|
||||
|
||||
#include <cutils/log.h>
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "gralloc_mod.h"
|
||||
#include "gralloc_gem.h"
|
||||
#include "gralloc_kms.h"
|
||||
|
||||
static int
|
||||
drm_mod_perform(const struct gralloc_module_t *mod, int op, ...)
|
||||
{
|
||||
struct drm_module_t *drm = (struct drm_module_t *) mod;
|
||||
va_list args;
|
||||
int ret;
|
||||
|
||||
va_start(args, op);
|
||||
switch (op) {
|
||||
case GRALLOC_MODULE_PERFORM_GET_DRM_FD:
|
||||
{
|
||||
int *fd = va_arg(args, int *);
|
||||
|
||||
ret = drm_gem_init(drm);
|
||||
if (!ret)
|
||||
*fd = drm->fd;
|
||||
}
|
||||
break;
|
||||
case GRALLOC_MODULE_PERFORM_GET_DRM_MAGIC:
|
||||
{
|
||||
int32_t *magic = va_arg(args, int32_t *);
|
||||
|
||||
ret = drm_gem_init(drm);
|
||||
if (!ret)
|
||||
ret = drm_gem_get_magic(drm, magic);
|
||||
}
|
||||
break;
|
||||
case GRALLOC_MODULE_PERFORM_AUTH_DRM_MAGIC:
|
||||
{
|
||||
int32_t magic = va_arg(args, int32_t);
|
||||
|
||||
ret = drm_gem_init(drm);
|
||||
if (!ret)
|
||||
ret = drm_gem_auth_magic(drm, magic);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
ret = -EINVAL;
|
||||
break;
|
||||
}
|
||||
va_end(args);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int
|
||||
drm_mod_register_buffer(const gralloc_module_t *mod, buffer_handle_t handle)
|
||||
{
|
||||
return (drm_gem_get(handle)) ? 0 : -EINVAL;
|
||||
}
|
||||
|
||||
static int
|
||||
drm_mod_unregister_buffer(const gralloc_module_t *mod, buffer_handle_t handle)
|
||||
{
|
||||
return (drm_gem_get(handle)) ? 0 : -EINVAL;
|
||||
}
|
||||
|
||||
static int
|
||||
drm_mod_lock(const gralloc_module_t *mod, buffer_handle_t handle,
|
||||
int usage, int x, int y, int w, int h, void **ptr)
|
||||
{
|
||||
struct drm_module_t *drm = (struct drm_module_t *) mod;
|
||||
struct drm_bo_t *bo;
|
||||
int ret;
|
||||
|
||||
ret = drm_gem_init(drm);
|
||||
if (!ret)
|
||||
ret = drm_gem_drv_init(drm);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
bo = drm_gem_validate(handle);
|
||||
if (!bo)
|
||||
return -EINVAL;
|
||||
|
||||
return drm_gem_drv_map(drm, bo, x, y, w, h, 1, ptr);
|
||||
}
|
||||
|
||||
static int
|
||||
drm_mod_unlock(const gralloc_module_t *mod, buffer_handle_t handle)
|
||||
{
|
||||
struct drm_module_t *drm = (struct drm_module_t *) mod;
|
||||
struct drm_bo_t *bo;
|
||||
|
||||
bo = drm_gem_validate(handle);
|
||||
if (!bo)
|
||||
return -EINVAL;
|
||||
|
||||
drm_gem_drv_unmap(drm, bo);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
drm_mod_close_gpu0(struct hw_device_t *dev)
|
||||
{
|
||||
struct alloc_device_t *alloc = (struct alloc_device_t *) dev;
|
||||
|
||||
free(alloc);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
drm_mod_free_gpu0(alloc_device_t *dev, buffer_handle_t handle)
|
||||
{
|
||||
struct drm_module_t *drm = (struct drm_module_t *) dev->common.module;
|
||||
struct drm_bo_t *bo;
|
||||
|
||||
bo = drm_gem_validate(handle);
|
||||
if (!bo)
|
||||
return -EINVAL;
|
||||
|
||||
if (bo->usage & GRALLOC_USAGE_HW_FB)
|
||||
drm_kms_rm_fb(drm, bo);
|
||||
|
||||
drm_gem_drv_free(drm, bo);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
drm_mod_alloc_gpu0(alloc_device_t *dev, int w, int h, int format, int usage,
|
||||
buffer_handle_t *handle, int *stride)
|
||||
{
|
||||
struct drm_module_t *drm = (struct drm_module_t *) dev->common.module;
|
||||
struct drm_bo_t *bo;
|
||||
int size, bpp, ret;
|
||||
|
||||
ret = drm_gem_drv_init(drm);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
bpp = drm_mod_get_bpp(format);
|
||||
if (!bpp)
|
||||
return -EINVAL;
|
||||
|
||||
bo = drm_gem_drv_alloc(drm, w, h, format, usage, stride);
|
||||
if (!bo)
|
||||
return -EINVAL;
|
||||
if (bo->usage & GRALLOC_USAGE_HW_FB) {
|
||||
ret = drm_kms_add_fb(drm, bo);
|
||||
if (ret) {
|
||||
LOGE("failed to add fb");
|
||||
drm_gem_drv_free(drm, bo);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
*stride /= bpp;
|
||||
*handle = &bo->base;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
drm_mod_open_gpu0(struct drm_module_t *drm, hw_device_t **dev)
|
||||
{
|
||||
struct alloc_device_t *alloc;
|
||||
int ret;
|
||||
|
||||
ret = drm_gem_init(drm);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
alloc = calloc(1, sizeof(*alloc));
|
||||
if (!alloc)
|
||||
return -EINVAL;
|
||||
|
||||
alloc->common.tag = HARDWARE_DEVICE_TAG;
|
||||
alloc->common.version = 0;
|
||||
alloc->common.module = (hw_module_t *) drm;
|
||||
alloc->common.close = drm_mod_close_gpu0;
|
||||
|
||||
alloc->alloc = drm_mod_alloc_gpu0;
|
||||
alloc->free = drm_mod_free_gpu0;
|
||||
|
||||
*dev = &alloc->common;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
drm_mod_close_fb0(struct hw_device_t *dev)
|
||||
{
|
||||
struct framebuffer_device_t *fb = (struct framebuffer_device_t *) dev;
|
||||
|
||||
free(fb);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
drm_mod_set_swap_interval_fb0(struct framebuffer_device_t *fb, int interval)
|
||||
{
|
||||
if (interval < fb->minSwapInterval || interval > fb->maxSwapInterval)
|
||||
return -EINVAL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
drm_mod_post_fb0(struct framebuffer_device_t *fb, buffer_handle_t handle)
|
||||
{
|
||||
struct drm_module_t *drm = (struct drm_module_t *) fb->common.module;
|
||||
struct drm_bo_t *bo;
|
||||
|
||||
bo = drm_gem_validate(handle);
|
||||
if (!bo)
|
||||
return -EINVAL;
|
||||
|
||||
return drm_kms_post(drm, bo);
|
||||
}
|
||||
|
||||
#include <EGL/egl.h>
|
||||
static int
|
||||
drm_mod_composition_complete_fb0(struct framebuffer_device_t *fb)
|
||||
{
|
||||
eglWaitClient();
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
drm_mod_open_fb0(struct drm_module_t *drm, struct hw_device_t **dev)
|
||||
{
|
||||
struct framebuffer_device_t *fb;
|
||||
int ret;
|
||||
|
||||
fb = calloc(1, sizeof(*fb));
|
||||
if (!fb)
|
||||
return -ENOMEM;
|
||||
|
||||
ret = drm_gem_init(drm);
|
||||
if (!ret)
|
||||
ret = drm_kms_init(drm);
|
||||
if (ret) {
|
||||
free(fb);
|
||||
return ret;
|
||||
}
|
||||
|
||||
fb->common.tag = HARDWARE_DEVICE_TAG;
|
||||
fb->common.version = 0;
|
||||
fb->common.module = (hw_module_t *) drm;
|
||||
fb->common.close = drm_mod_close_fb0;
|
||||
|
||||
fb->setSwapInterval = drm_mod_set_swap_interval_fb0;
|
||||
fb->post = drm_mod_post_fb0;
|
||||
fb->compositionComplete = drm_mod_composition_complete_fb0;
|
||||
|
||||
*((uint32_t *) &fb->flags) = 0x0;
|
||||
*((uint32_t *) &fb->width) = drm->mode.hdisplay;
|
||||
*((uint32_t *) &fb->height) = drm->mode.vdisplay;
|
||||
*((int *) &fb->stride) = drm->mode.hdisplay;
|
||||
*((float *) &fb->fps) = drm->mode.vrefresh;
|
||||
|
||||
*((int *) &fb->format) = drm->format;
|
||||
*((float *) &fb->xdpi) = drm->xdpi;
|
||||
*((float *) &fb->ydpi) = drm->ydpi;
|
||||
*((int *) &fb->minSwapInterval) = drm->swap_interval;
|
||||
*((int *) &fb->maxSwapInterval) = drm->swap_interval;
|
||||
|
||||
*dev = &fb->common;
|
||||
|
||||
LOGI("mode.hdisplay %d\n"
|
||||
"mode.vdisplay %d\n"
|
||||
"mode.vrefresh %d\n"
|
||||
"format 0x%x\n"
|
||||
"xdpi %d\n"
|
||||
"ydpi %d\n",
|
||||
drm->mode.hdisplay,
|
||||
drm->mode.vdisplay,
|
||||
drm->mode.vrefresh,
|
||||
drm->format,
|
||||
drm->xdpi, drm->ydpi);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
drm_mod_open(const struct hw_module_t *mod, const char *name, struct hw_device_t **dev)
|
||||
{
|
||||
struct drm_module_t *drm = (struct drm_module_t *) mod;
|
||||
int ret;
|
||||
|
||||
if (strcmp(name, GRALLOC_HARDWARE_GPU0) == 0)
|
||||
ret = drm_mod_open_gpu0(drm, dev);
|
||||
else if (strcmp(name, GRALLOC_HARDWARE_FB0) == 0)
|
||||
ret = drm_mod_open_fb0(drm, dev);
|
||||
else
|
||||
ret = -EINVAL;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static struct hw_module_methods_t drm_mod_methods = {
|
||||
.open = drm_mod_open
|
||||
};
|
||||
|
||||
struct drm_module_t HAL_MODULE_INFO_SYM = {
|
||||
.base = {
|
||||
.common = {
|
||||
.tag = HARDWARE_MODULE_TAG,
|
||||
.version_major = 1,
|
||||
.version_minor = 0,
|
||||
.id = GRALLOC_HARDWARE_MODULE_ID,
|
||||
.name = "DRM Memory Allocator",
|
||||
.author = "Chia-I Wu",
|
||||
.methods = &drm_mod_methods
|
||||
},
|
||||
.registerBuffer = drm_mod_register_buffer,
|
||||
.unregisterBuffer = drm_mod_unregister_buffer,
|
||||
.lock = drm_mod_lock,
|
||||
.unlock = drm_mod_unlock,
|
||||
.perform = drm_mod_perform
|
||||
},
|
||||
.mutex = PTHREAD_MUTEX_INITIALIZER,
|
||||
.fd = -1
|
||||
};
|
65
src/gralloc/gralloc_mod.h
Normal file
65
src/gralloc/gralloc_mod.h
Normal file
@@ -0,0 +1,65 @@
|
||||
#ifndef _GRALLOC_DRM_H
|
||||
#define _GRALLOC_DRM_H
|
||||
|
||||
#include <hardware/gralloc.h>
|
||||
#include <xf86drm.h>
|
||||
#include <xf86drmMode.h>
|
||||
#include <pthread.h>
|
||||
|
||||
struct drm_module_t {
|
||||
gralloc_module_t base;
|
||||
|
||||
pthread_mutex_t mutex;
|
||||
|
||||
/* initialized by drm_gem_init */
|
||||
int fd;
|
||||
|
||||
/* initialized by drm_kms_init */
|
||||
drmModeResPtr resources;
|
||||
uint32_t crtc_id;
|
||||
uint32_t connector_id;
|
||||
drmModeModeInfo mode;
|
||||
int xdpi, ydpi;
|
||||
int format;
|
||||
#ifdef DRM_MODE_FEATURE_DIRTYFB
|
||||
drmModeClip clip;
|
||||
#endif
|
||||
|
||||
/* initialized by drm_gem_drv_init */
|
||||
void *gem;
|
||||
int mode_dirty_fb;
|
||||
int mode_page_flip;
|
||||
int swap_interval;
|
||||
int vblank_secondary;
|
||||
|
||||
int first_post;
|
||||
};
|
||||
|
||||
static inline int
|
||||
drm_mod_get_bpp(int format)
|
||||
{
|
||||
int bpp;
|
||||
|
||||
switch (format) {
|
||||
case HAL_PIXEL_FORMAT_RGBA_8888:
|
||||
case HAL_PIXEL_FORMAT_RGBX_8888:
|
||||
case HAL_PIXEL_FORMAT_BGRA_8888:
|
||||
bpp = 4;
|
||||
break;
|
||||
case HAL_PIXEL_FORMAT_RGB_888:
|
||||
bpp = 3;
|
||||
break;
|
||||
case HAL_PIXEL_FORMAT_RGB_565:
|
||||
case HAL_PIXEL_FORMAT_RGBA_5551:
|
||||
case HAL_PIXEL_FORMAT_RGBA_4444:
|
||||
bpp = 2;
|
||||
break;
|
||||
default:
|
||||
bpp = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
return bpp;
|
||||
}
|
||||
|
||||
#endif /* _GRALLOC_DRM_H */
|
46
src/mapi/Android.mk
Normal file
46
src/mapi/Android.mk
Normal file
@@ -0,0 +1,46 @@
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
include $(LOCAL_PATH)/glapi/sources.mak
|
||||
include $(LOCAL_PATH)/mapi/sources.mak
|
||||
glapi_SOURCES := \
|
||||
$(addprefix glapi/, $(GLAPI_SOURCES)) \
|
||||
$(addprefix mapi/, $(MAPI_GLAPI_SOURCES))
|
||||
|
||||
glapi_CFLAGS := \
|
||||
-DPTHREADS \
|
||||
-DMAPI_GLAPI_CURRENT \
|
||||
-fvisibility=hidden \
|
||||
-Wno-sign-compare
|
||||
|
||||
glapi_C_INCLUDES := \
|
||||
external/mesa/include \
|
||||
external/mesa/src/mapi
|
||||
|
||||
# use x86 assembly to generate ES2 entries on the fly
|
||||
glapi_SOURCES += \
|
||||
$(addprefix es1api/glapi/, $(X86_API))
|
||||
glapi_CFLAGS += \
|
||||
-DUSE_X86_ASM
|
||||
glapi_C_INCLUDES += \
|
||||
external/mesa/src/mesa
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_MODULE := libmesa_glapi
|
||||
|
||||
LOCAL_SRC_FILES := $(glapi_SOURCES)
|
||||
LOCAL_CFLAGS := $(glapi_CFLAGS)
|
||||
|
||||
## generate glapi headers
|
||||
#intermediates := $(call local-intermediates-dir)
|
||||
#glapi_OUT := $(intermediates)/es1api
|
||||
#glapi_XML := $(LOCAL_PATH)/glapi/gen-es/es1_API.xml
|
||||
#include $(LOCAL_PATH)/generate_glapi.mk
|
||||
#
|
||||
## depend on the generated headers
|
||||
#$(intermediates)/%.o: $(LOCAL_GENERATED_SOURCES)
|
||||
glapi_OUT := external/mesa/src/mapi/es1api
|
||||
|
||||
LOCAL_C_INCLUDES := $(glapi_OUT) $(glapi_C_INCLUDES)
|
||||
|
||||
include $(BUILD_STATIC_LIBRARY)
|
1080
src/mapi/es1api/glapi/glapi_sparc.S
Normal file
1080
src/mapi/es1api/glapi/glapi_sparc.S
Normal file
File diff suppressed because it is too large
Load Diff
19246
src/mapi/es1api/glapi/glapi_x86-64.S
Normal file
19246
src/mapi/es1api/glapi/glapi_x86-64.S
Normal file
File diff suppressed because it is too large
Load Diff
1043
src/mapi/es1api/glapi/glapi_x86.S
Normal file
1043
src/mapi/es1api/glapi/glapi_x86.S
Normal file
File diff suppressed because it is too large
Load Diff
551
src/mapi/es1api/glapi/glapitable.h
Normal file
551
src/mapi/es1api/glapi/glapitable.h
Normal file
@@ -0,0 +1,551 @@
|
||||
/* DO NOT EDIT - This file generated automatically by gl_table.py (from Mesa) script */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
|
||||
* (C) Copyright IBM Corporation 2004
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sub license,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
|
||||
* BRIAN PAUL, IBM,
|
||||
* AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
|
||||
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
#if !defined( _GLAPI_TABLE_H_ )
|
||||
# define _GLAPI_TABLE_H_
|
||||
|
||||
#ifndef GLAPIENTRYP
|
||||
# ifndef GLAPIENTRY
|
||||
# define GLAPIENTRY
|
||||
# endif
|
||||
|
||||
# define GLAPIENTRYP GLAPIENTRY *
|
||||
#endif
|
||||
|
||||
|
||||
struct _glapi_table
|
||||
{
|
||||
void (GLAPIENTRYP NewList)(GLuint list, GLenum mode); /* 0 */
|
||||
void (GLAPIENTRYP EndList)(void); /* 1 */
|
||||
void (GLAPIENTRYP CallList)(GLuint list); /* 2 */
|
||||
void (GLAPIENTRYP CallLists)(GLsizei n, GLenum type, const GLvoid * lists); /* 3 */
|
||||
void (GLAPIENTRYP DeleteLists)(GLuint list, GLsizei range); /* 4 */
|
||||
GLuint (GLAPIENTRYP GenLists)(GLsizei range); /* 5 */
|
||||
void (GLAPIENTRYP ListBase)(GLuint base); /* 6 */
|
||||
void (GLAPIENTRYP Begin)(GLenum mode); /* 7 */
|
||||
void (GLAPIENTRYP Bitmap)(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte * bitmap); /* 8 */
|
||||
void (GLAPIENTRYP Color3b)(GLbyte red, GLbyte green, GLbyte blue); /* 9 */
|
||||
void (GLAPIENTRYP Color3bv)(const GLbyte * v); /* 10 */
|
||||
void (GLAPIENTRYP Color3d)(GLdouble red, GLdouble green, GLdouble blue); /* 11 */
|
||||
void (GLAPIENTRYP Color3dv)(const GLdouble * v); /* 12 */
|
||||
void (GLAPIENTRYP Color3f)(GLfloat red, GLfloat green, GLfloat blue); /* 13 */
|
||||
void (GLAPIENTRYP Color3fv)(const GLfloat * v); /* 14 */
|
||||
void (GLAPIENTRYP Color3i)(GLint red, GLint green, GLint blue); /* 15 */
|
||||
void (GLAPIENTRYP Color3iv)(const GLint * v); /* 16 */
|
||||
void (GLAPIENTRYP Color3s)(GLshort red, GLshort green, GLshort blue); /* 17 */
|
||||
void (GLAPIENTRYP Color3sv)(const GLshort * v); /* 18 */
|
||||
void (GLAPIENTRYP Color3ub)(GLubyte red, GLubyte green, GLubyte blue); /* 19 */
|
||||
void (GLAPIENTRYP Color3ubv)(const GLubyte * v); /* 20 */
|
||||
void (GLAPIENTRYP Color3ui)(GLuint red, GLuint green, GLuint blue); /* 21 */
|
||||
void (GLAPIENTRYP Color3uiv)(const GLuint * v); /* 22 */
|
||||
void (GLAPIENTRYP Color3us)(GLushort red, GLushort green, GLushort blue); /* 23 */
|
||||
void (GLAPIENTRYP Color3usv)(const GLushort * v); /* 24 */
|
||||
void (GLAPIENTRYP Color4b)(GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha); /* 25 */
|
||||
void (GLAPIENTRYP Color4bv)(const GLbyte * v); /* 26 */
|
||||
void (GLAPIENTRYP Color4d)(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha); /* 27 */
|
||||
void (GLAPIENTRYP Color4dv)(const GLdouble * v); /* 28 */
|
||||
void (GLAPIENTRYP Color4f)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); /* 29 */
|
||||
void (GLAPIENTRYP Color4fv)(const GLfloat * v); /* 30 */
|
||||
void (GLAPIENTRYP Color4i)(GLint red, GLint green, GLint blue, GLint alpha); /* 31 */
|
||||
void (GLAPIENTRYP Color4iv)(const GLint * v); /* 32 */
|
||||
void (GLAPIENTRYP Color4s)(GLshort red, GLshort green, GLshort blue, GLshort alpha); /* 33 */
|
||||
void (GLAPIENTRYP Color4sv)(const GLshort * v); /* 34 */
|
||||
void (GLAPIENTRYP Color4ub)(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha); /* 35 */
|
||||
void (GLAPIENTRYP Color4ubv)(const GLubyte * v); /* 36 */
|
||||
void (GLAPIENTRYP Color4ui)(GLuint red, GLuint green, GLuint blue, GLuint alpha); /* 37 */
|
||||
void (GLAPIENTRYP Color4uiv)(const GLuint * v); /* 38 */
|
||||
void (GLAPIENTRYP Color4us)(GLushort red, GLushort green, GLushort blue, GLushort alpha); /* 39 */
|
||||
void (GLAPIENTRYP Color4usv)(const GLushort * v); /* 40 */
|
||||
void (GLAPIENTRYP EdgeFlag)(GLboolean flag); /* 41 */
|
||||
void (GLAPIENTRYP EdgeFlagv)(const GLboolean * flag); /* 42 */
|
||||
void (GLAPIENTRYP End)(void); /* 43 */
|
||||
void (GLAPIENTRYP Indexd)(GLdouble c); /* 44 */
|
||||
void (GLAPIENTRYP Indexdv)(const GLdouble * c); /* 45 */
|
||||
void (GLAPIENTRYP Indexf)(GLfloat c); /* 46 */
|
||||
void (GLAPIENTRYP Indexfv)(const GLfloat * c); /* 47 */
|
||||
void (GLAPIENTRYP Indexi)(GLint c); /* 48 */
|
||||
void (GLAPIENTRYP Indexiv)(const GLint * c); /* 49 */
|
||||
void (GLAPIENTRYP Indexs)(GLshort c); /* 50 */
|
||||
void (GLAPIENTRYP Indexsv)(const GLshort * c); /* 51 */
|
||||
void (GLAPIENTRYP Normal3b)(GLbyte nx, GLbyte ny, GLbyte nz); /* 52 */
|
||||
void (GLAPIENTRYP Normal3bv)(const GLbyte * v); /* 53 */
|
||||
void (GLAPIENTRYP Normal3d)(GLdouble nx, GLdouble ny, GLdouble nz); /* 54 */
|
||||
void (GLAPIENTRYP Normal3dv)(const GLdouble * v); /* 55 */
|
||||
void (GLAPIENTRYP Normal3f)(GLfloat nx, GLfloat ny, GLfloat nz); /* 56 */
|
||||
void (GLAPIENTRYP Normal3fv)(const GLfloat * v); /* 57 */
|
||||
void (GLAPIENTRYP Normal3i)(GLint nx, GLint ny, GLint nz); /* 58 */
|
||||
void (GLAPIENTRYP Normal3iv)(const GLint * v); /* 59 */
|
||||
void (GLAPIENTRYP Normal3s)(GLshort nx, GLshort ny, GLshort nz); /* 60 */
|
||||
void (GLAPIENTRYP Normal3sv)(const GLshort * v); /* 61 */
|
||||
void (GLAPIENTRYP RasterPos2d)(GLdouble x, GLdouble y); /* 62 */
|
||||
void (GLAPIENTRYP RasterPos2dv)(const GLdouble * v); /* 63 */
|
||||
void (GLAPIENTRYP RasterPos2f)(GLfloat x, GLfloat y); /* 64 */
|
||||
void (GLAPIENTRYP RasterPos2fv)(const GLfloat * v); /* 65 */
|
||||
void (GLAPIENTRYP RasterPos2i)(GLint x, GLint y); /* 66 */
|
||||
void (GLAPIENTRYP RasterPos2iv)(const GLint * v); /* 67 */
|
||||
void (GLAPIENTRYP RasterPos2s)(GLshort x, GLshort y); /* 68 */
|
||||
void (GLAPIENTRYP RasterPos2sv)(const GLshort * v); /* 69 */
|
||||
void (GLAPIENTRYP RasterPos3d)(GLdouble x, GLdouble y, GLdouble z); /* 70 */
|
||||
void (GLAPIENTRYP RasterPos3dv)(const GLdouble * v); /* 71 */
|
||||
void (GLAPIENTRYP RasterPos3f)(GLfloat x, GLfloat y, GLfloat z); /* 72 */
|
||||
void (GLAPIENTRYP RasterPos3fv)(const GLfloat * v); /* 73 */
|
||||
void (GLAPIENTRYP RasterPos3i)(GLint x, GLint y, GLint z); /* 74 */
|
||||
void (GLAPIENTRYP RasterPos3iv)(const GLint * v); /* 75 */
|
||||
void (GLAPIENTRYP RasterPos3s)(GLshort x, GLshort y, GLshort z); /* 76 */
|
||||
void (GLAPIENTRYP RasterPos3sv)(const GLshort * v); /* 77 */
|
||||
void (GLAPIENTRYP RasterPos4d)(GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 78 */
|
||||
void (GLAPIENTRYP RasterPos4dv)(const GLdouble * v); /* 79 */
|
||||
void (GLAPIENTRYP RasterPos4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 80 */
|
||||
void (GLAPIENTRYP RasterPos4fv)(const GLfloat * v); /* 81 */
|
||||
void (GLAPIENTRYP RasterPos4i)(GLint x, GLint y, GLint z, GLint w); /* 82 */
|
||||
void (GLAPIENTRYP RasterPos4iv)(const GLint * v); /* 83 */
|
||||
void (GLAPIENTRYP RasterPos4s)(GLshort x, GLshort y, GLshort z, GLshort w); /* 84 */
|
||||
void (GLAPIENTRYP RasterPos4sv)(const GLshort * v); /* 85 */
|
||||
void (GLAPIENTRYP Rectd)(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2); /* 86 */
|
||||
void (GLAPIENTRYP Rectdv)(const GLdouble * v1, const GLdouble * v2); /* 87 */
|
||||
void (GLAPIENTRYP Rectf)(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2); /* 88 */
|
||||
void (GLAPIENTRYP Rectfv)(const GLfloat * v1, const GLfloat * v2); /* 89 */
|
||||
void (GLAPIENTRYP Recti)(GLint x1, GLint y1, GLint x2, GLint y2); /* 90 */
|
||||
void (GLAPIENTRYP Rectiv)(const GLint * v1, const GLint * v2); /* 91 */
|
||||
void (GLAPIENTRYP Rects)(GLshort x1, GLshort y1, GLshort x2, GLshort y2); /* 92 */
|
||||
void (GLAPIENTRYP Rectsv)(const GLshort * v1, const GLshort * v2); /* 93 */
|
||||
void (GLAPIENTRYP TexCoord1d)(GLdouble s); /* 94 */
|
||||
void (GLAPIENTRYP TexCoord1dv)(const GLdouble * v); /* 95 */
|
||||
void (GLAPIENTRYP TexCoord1f)(GLfloat s); /* 96 */
|
||||
void (GLAPIENTRYP TexCoord1fv)(const GLfloat * v); /* 97 */
|
||||
void (GLAPIENTRYP TexCoord1i)(GLint s); /* 98 */
|
||||
void (GLAPIENTRYP TexCoord1iv)(const GLint * v); /* 99 */
|
||||
void (GLAPIENTRYP TexCoord1s)(GLshort s); /* 100 */
|
||||
void (GLAPIENTRYP TexCoord1sv)(const GLshort * v); /* 101 */
|
||||
void (GLAPIENTRYP TexCoord2d)(GLdouble s, GLdouble t); /* 102 */
|
||||
void (GLAPIENTRYP TexCoord2dv)(const GLdouble * v); /* 103 */
|
||||
void (GLAPIENTRYP TexCoord2f)(GLfloat s, GLfloat t); /* 104 */
|
||||
void (GLAPIENTRYP TexCoord2fv)(const GLfloat * v); /* 105 */
|
||||
void (GLAPIENTRYP TexCoord2i)(GLint s, GLint t); /* 106 */
|
||||
void (GLAPIENTRYP TexCoord2iv)(const GLint * v); /* 107 */
|
||||
void (GLAPIENTRYP TexCoord2s)(GLshort s, GLshort t); /* 108 */
|
||||
void (GLAPIENTRYP TexCoord2sv)(const GLshort * v); /* 109 */
|
||||
void (GLAPIENTRYP TexCoord3d)(GLdouble s, GLdouble t, GLdouble r); /* 110 */
|
||||
void (GLAPIENTRYP TexCoord3dv)(const GLdouble * v); /* 111 */
|
||||
void (GLAPIENTRYP TexCoord3f)(GLfloat s, GLfloat t, GLfloat r); /* 112 */
|
||||
void (GLAPIENTRYP TexCoord3fv)(const GLfloat * v); /* 113 */
|
||||
void (GLAPIENTRYP TexCoord3i)(GLint s, GLint t, GLint r); /* 114 */
|
||||
void (GLAPIENTRYP TexCoord3iv)(const GLint * v); /* 115 */
|
||||
void (GLAPIENTRYP TexCoord3s)(GLshort s, GLshort t, GLshort r); /* 116 */
|
||||
void (GLAPIENTRYP TexCoord3sv)(const GLshort * v); /* 117 */
|
||||
void (GLAPIENTRYP TexCoord4d)(GLdouble s, GLdouble t, GLdouble r, GLdouble q); /* 118 */
|
||||
void (GLAPIENTRYP TexCoord4dv)(const GLdouble * v); /* 119 */
|
||||
void (GLAPIENTRYP TexCoord4f)(GLfloat s, GLfloat t, GLfloat r, GLfloat q); /* 120 */
|
||||
void (GLAPIENTRYP TexCoord4fv)(const GLfloat * v); /* 121 */
|
||||
void (GLAPIENTRYP TexCoord4i)(GLint s, GLint t, GLint r, GLint q); /* 122 */
|
||||
void (GLAPIENTRYP TexCoord4iv)(const GLint * v); /* 123 */
|
||||
void (GLAPIENTRYP TexCoord4s)(GLshort s, GLshort t, GLshort r, GLshort q); /* 124 */
|
||||
void (GLAPIENTRYP TexCoord4sv)(const GLshort * v); /* 125 */
|
||||
void (GLAPIENTRYP Vertex2d)(GLdouble x, GLdouble y); /* 126 */
|
||||
void (GLAPIENTRYP Vertex2dv)(const GLdouble * v); /* 127 */
|
||||
void (GLAPIENTRYP Vertex2f)(GLfloat x, GLfloat y); /* 128 */
|
||||
void (GLAPIENTRYP Vertex2fv)(const GLfloat * v); /* 129 */
|
||||
void (GLAPIENTRYP Vertex2i)(GLint x, GLint y); /* 130 */
|
||||
void (GLAPIENTRYP Vertex2iv)(const GLint * v); /* 131 */
|
||||
void (GLAPIENTRYP Vertex2s)(GLshort x, GLshort y); /* 132 */
|
||||
void (GLAPIENTRYP Vertex2sv)(const GLshort * v); /* 133 */
|
||||
void (GLAPIENTRYP Vertex3d)(GLdouble x, GLdouble y, GLdouble z); /* 134 */
|
||||
void (GLAPIENTRYP Vertex3dv)(const GLdouble * v); /* 135 */
|
||||
void (GLAPIENTRYP Vertex3f)(GLfloat x, GLfloat y, GLfloat z); /* 136 */
|
||||
void (GLAPIENTRYP Vertex3fv)(const GLfloat * v); /* 137 */
|
||||
void (GLAPIENTRYP Vertex3i)(GLint x, GLint y, GLint z); /* 138 */
|
||||
void (GLAPIENTRYP Vertex3iv)(const GLint * v); /* 139 */
|
||||
void (GLAPIENTRYP Vertex3s)(GLshort x, GLshort y, GLshort z); /* 140 */
|
||||
void (GLAPIENTRYP Vertex3sv)(const GLshort * v); /* 141 */
|
||||
void (GLAPIENTRYP Vertex4d)(GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 142 */
|
||||
void (GLAPIENTRYP Vertex4dv)(const GLdouble * v); /* 143 */
|
||||
void (GLAPIENTRYP Vertex4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 144 */
|
||||
void (GLAPIENTRYP Vertex4fv)(const GLfloat * v); /* 145 */
|
||||
void (GLAPIENTRYP Vertex4i)(GLint x, GLint y, GLint z, GLint w); /* 146 */
|
||||
void (GLAPIENTRYP Vertex4iv)(const GLint * v); /* 147 */
|
||||
void (GLAPIENTRYP Vertex4s)(GLshort x, GLshort y, GLshort z, GLshort w); /* 148 */
|
||||
void (GLAPIENTRYP Vertex4sv)(const GLshort * v); /* 149 */
|
||||
void (GLAPIENTRYP ClipPlane)(GLenum plane, const GLdouble * equation); /* 150 */
|
||||
void (GLAPIENTRYP ColorMaterial)(GLenum face, GLenum mode); /* 151 */
|
||||
void (GLAPIENTRYP CullFace)(GLenum mode); /* 152 */
|
||||
void (GLAPIENTRYP Fogf)(GLenum pname, GLfloat param); /* 153 */
|
||||
void (GLAPIENTRYP Fogfv)(GLenum pname, const GLfloat * params); /* 154 */
|
||||
void (GLAPIENTRYP Fogi)(GLenum pname, GLint param); /* 155 */
|
||||
void (GLAPIENTRYP Fogiv)(GLenum pname, const GLint * params); /* 156 */
|
||||
void (GLAPIENTRYP FrontFace)(GLenum mode); /* 157 */
|
||||
void (GLAPIENTRYP Hint)(GLenum target, GLenum mode); /* 158 */
|
||||
void (GLAPIENTRYP Lightf)(GLenum light, GLenum pname, GLfloat param); /* 159 */
|
||||
void (GLAPIENTRYP Lightfv)(GLenum light, GLenum pname, const GLfloat * params); /* 160 */
|
||||
void (GLAPIENTRYP Lighti)(GLenum light, GLenum pname, GLint param); /* 161 */
|
||||
void (GLAPIENTRYP Lightiv)(GLenum light, GLenum pname, const GLint * params); /* 162 */
|
||||
void (GLAPIENTRYP LightModelf)(GLenum pname, GLfloat param); /* 163 */
|
||||
void (GLAPIENTRYP LightModelfv)(GLenum pname, const GLfloat * params); /* 164 */
|
||||
void (GLAPIENTRYP LightModeli)(GLenum pname, GLint param); /* 165 */
|
||||
void (GLAPIENTRYP LightModeliv)(GLenum pname, const GLint * params); /* 166 */
|
||||
void (GLAPIENTRYP LineStipple)(GLint factor, GLushort pattern); /* 167 */
|
||||
void (GLAPIENTRYP LineWidth)(GLfloat width); /* 168 */
|
||||
void (GLAPIENTRYP Materialf)(GLenum face, GLenum pname, GLfloat param); /* 169 */
|
||||
void (GLAPIENTRYP Materialfv)(GLenum face, GLenum pname, const GLfloat * params); /* 170 */
|
||||
void (GLAPIENTRYP Materiali)(GLenum face, GLenum pname, GLint param); /* 171 */
|
||||
void (GLAPIENTRYP Materialiv)(GLenum face, GLenum pname, const GLint * params); /* 172 */
|
||||
void (GLAPIENTRYP PointSize)(GLfloat size); /* 173 */
|
||||
void (GLAPIENTRYP PolygonMode)(GLenum face, GLenum mode); /* 174 */
|
||||
void (GLAPIENTRYP PolygonStipple)(const GLubyte * mask); /* 175 */
|
||||
void (GLAPIENTRYP Scissor)(GLint x, GLint y, GLsizei width, GLsizei height); /* 176 */
|
||||
void (GLAPIENTRYP ShadeModel)(GLenum mode); /* 177 */
|
||||
void (GLAPIENTRYP TexParameterf)(GLenum target, GLenum pname, GLfloat param); /* 178 */
|
||||
void (GLAPIENTRYP TexParameterfv)(GLenum target, GLenum pname, const GLfloat * params); /* 179 */
|
||||
void (GLAPIENTRYP TexParameteri)(GLenum target, GLenum pname, GLint param); /* 180 */
|
||||
void (GLAPIENTRYP TexParameteriv)(GLenum target, GLenum pname, const GLint * params); /* 181 */
|
||||
void (GLAPIENTRYP TexImage1D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid * pixels); /* 182 */
|
||||
void (GLAPIENTRYP TexImage2D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid * pixels); /* 183 */
|
||||
void (GLAPIENTRYP TexEnvf)(GLenum target, GLenum pname, GLfloat param); /* 184 */
|
||||
void (GLAPIENTRYP TexEnvfv)(GLenum target, GLenum pname, const GLfloat * params); /* 185 */
|
||||
void (GLAPIENTRYP TexEnvi)(GLenum target, GLenum pname, GLint param); /* 186 */
|
||||
void (GLAPIENTRYP TexEnviv)(GLenum target, GLenum pname, const GLint * params); /* 187 */
|
||||
void (GLAPIENTRYP TexGend)(GLenum coord, GLenum pname, GLdouble param); /* 188 */
|
||||
void (GLAPIENTRYP TexGendv)(GLenum coord, GLenum pname, const GLdouble * params); /* 189 */
|
||||
void (GLAPIENTRYP TexGenfOES)(GLenum coord, GLenum pname, GLfloat param); /* 190 */
|
||||
void (GLAPIENTRYP TexGenfvOES)(GLenum coord, GLenum pname, const GLfloat * params); /* 191 */
|
||||
void (GLAPIENTRYP TexGeniOES)(GLenum coord, GLenum pname, GLint param); /* 192 */
|
||||
void (GLAPIENTRYP TexGenivOES)(GLenum coord, GLenum pname, const GLint * params); /* 193 */
|
||||
void (GLAPIENTRYP FeedbackBuffer)(GLsizei size, GLenum type, GLfloat * buffer); /* 194 */
|
||||
void (GLAPIENTRYP SelectBuffer)(GLsizei size, GLuint * buffer); /* 195 */
|
||||
GLint (GLAPIENTRYP RenderMode)(GLenum mode); /* 196 */
|
||||
void (GLAPIENTRYP InitNames)(void); /* 197 */
|
||||
void (GLAPIENTRYP LoadName)(GLuint name); /* 198 */
|
||||
void (GLAPIENTRYP PassThrough)(GLfloat token); /* 199 */
|
||||
void (GLAPIENTRYP PopName)(void); /* 200 */
|
||||
void (GLAPIENTRYP PushName)(GLuint name); /* 201 */
|
||||
void (GLAPIENTRYP DrawBuffer)(GLenum mode); /* 202 */
|
||||
void (GLAPIENTRYP Clear)(GLbitfield mask); /* 203 */
|
||||
void (GLAPIENTRYP ClearAccum)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); /* 204 */
|
||||
void (GLAPIENTRYP ClearIndex)(GLfloat c); /* 205 */
|
||||
void (GLAPIENTRYP ClearColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); /* 206 */
|
||||
void (GLAPIENTRYP ClearStencil)(GLint s); /* 207 */
|
||||
void (GLAPIENTRYP ClearDepth)(GLclampd depth); /* 208 */
|
||||
void (GLAPIENTRYP StencilMask)(GLuint mask); /* 209 */
|
||||
void (GLAPIENTRYP ColorMask)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); /* 210 */
|
||||
void (GLAPIENTRYP DepthMask)(GLboolean flag); /* 211 */
|
||||
void (GLAPIENTRYP IndexMask)(GLuint mask); /* 212 */
|
||||
void (GLAPIENTRYP Accum)(GLenum op, GLfloat value); /* 213 */
|
||||
void (GLAPIENTRYP Disable)(GLenum cap); /* 214 */
|
||||
void (GLAPIENTRYP Enable)(GLenum cap); /* 215 */
|
||||
void (GLAPIENTRYP Finish)(void); /* 216 */
|
||||
void (GLAPIENTRYP Flush)(void); /* 217 */
|
||||
void (GLAPIENTRYP PopAttrib)(void); /* 218 */
|
||||
void (GLAPIENTRYP PushAttrib)(GLbitfield mask); /* 219 */
|
||||
void (GLAPIENTRYP Map1d)(GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble * points); /* 220 */
|
||||
void (GLAPIENTRYP Map1f)(GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat * points); /* 221 */
|
||||
void (GLAPIENTRYP Map2d)(GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble * points); /* 222 */
|
||||
void (GLAPIENTRYP Map2f)(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat * points); /* 223 */
|
||||
void (GLAPIENTRYP MapGrid1d)(GLint un, GLdouble u1, GLdouble u2); /* 224 */
|
||||
void (GLAPIENTRYP MapGrid1f)(GLint un, GLfloat u1, GLfloat u2); /* 225 */
|
||||
void (GLAPIENTRYP MapGrid2d)(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2); /* 226 */
|
||||
void (GLAPIENTRYP MapGrid2f)(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2); /* 227 */
|
||||
void (GLAPIENTRYP EvalCoord1d)(GLdouble u); /* 228 */
|
||||
void (GLAPIENTRYP EvalCoord1dv)(const GLdouble * u); /* 229 */
|
||||
void (GLAPIENTRYP EvalCoord1f)(GLfloat u); /* 230 */
|
||||
void (GLAPIENTRYP EvalCoord1fv)(const GLfloat * u); /* 231 */
|
||||
void (GLAPIENTRYP EvalCoord2d)(GLdouble u, GLdouble v); /* 232 */
|
||||
void (GLAPIENTRYP EvalCoord2dv)(const GLdouble * u); /* 233 */
|
||||
void (GLAPIENTRYP EvalCoord2f)(GLfloat u, GLfloat v); /* 234 */
|
||||
void (GLAPIENTRYP EvalCoord2fv)(const GLfloat * u); /* 235 */
|
||||
void (GLAPIENTRYP EvalMesh1)(GLenum mode, GLint i1, GLint i2); /* 236 */
|
||||
void (GLAPIENTRYP EvalPoint1)(GLint i); /* 237 */
|
||||
void (GLAPIENTRYP EvalMesh2)(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2); /* 238 */
|
||||
void (GLAPIENTRYP EvalPoint2)(GLint i, GLint j); /* 239 */
|
||||
void (GLAPIENTRYP AlphaFunc)(GLenum func, GLclampf ref); /* 240 */
|
||||
void (GLAPIENTRYP BlendFunc)(GLenum sfactor, GLenum dfactor); /* 241 */
|
||||
void (GLAPIENTRYP LogicOp)(GLenum opcode); /* 242 */
|
||||
void (GLAPIENTRYP StencilFunc)(GLenum func, GLint ref, GLuint mask); /* 243 */
|
||||
void (GLAPIENTRYP StencilOp)(GLenum fail, GLenum zfail, GLenum zpass); /* 244 */
|
||||
void (GLAPIENTRYP DepthFunc)(GLenum func); /* 245 */
|
||||
void (GLAPIENTRYP PixelZoom)(GLfloat xfactor, GLfloat yfactor); /* 246 */
|
||||
void (GLAPIENTRYP PixelTransferf)(GLenum pname, GLfloat param); /* 247 */
|
||||
void (GLAPIENTRYP PixelTransferi)(GLenum pname, GLint param); /* 248 */
|
||||
void (GLAPIENTRYP PixelStoref)(GLenum pname, GLfloat param); /* 249 */
|
||||
void (GLAPIENTRYP PixelStorei)(GLenum pname, GLint param); /* 250 */
|
||||
void (GLAPIENTRYP PixelMapfv)(GLenum map, GLsizei mapsize, const GLfloat * values); /* 251 */
|
||||
void (GLAPIENTRYP PixelMapuiv)(GLenum map, GLsizei mapsize, const GLuint * values); /* 252 */
|
||||
void (GLAPIENTRYP PixelMapusv)(GLenum map, GLsizei mapsize, const GLushort * values); /* 253 */
|
||||
void (GLAPIENTRYP ReadBuffer)(GLenum mode); /* 254 */
|
||||
void (GLAPIENTRYP CopyPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type); /* 255 */
|
||||
void (GLAPIENTRYP ReadPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid * pixels); /* 256 */
|
||||
void (GLAPIENTRYP DrawPixels)(GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels); /* 257 */
|
||||
void (GLAPIENTRYP GetBooleanv)(GLenum pname, GLboolean * params); /* 258 */
|
||||
void (GLAPIENTRYP GetClipPlane)(GLenum plane, GLdouble * equation); /* 259 */
|
||||
void (GLAPIENTRYP GetDoublev)(GLenum pname, GLdouble * params); /* 260 */
|
||||
GLenum (GLAPIENTRYP GetError)(void); /* 261 */
|
||||
void (GLAPIENTRYP GetFloatv)(GLenum pname, GLfloat * params); /* 262 */
|
||||
void (GLAPIENTRYP GetIntegerv)(GLenum pname, GLint * params); /* 263 */
|
||||
void (GLAPIENTRYP GetLightfv)(GLenum light, GLenum pname, GLfloat * params); /* 264 */
|
||||
void (GLAPIENTRYP GetLightiv)(GLenum light, GLenum pname, GLint * params); /* 265 */
|
||||
void (GLAPIENTRYP GetMapdv)(GLenum target, GLenum query, GLdouble * v); /* 266 */
|
||||
void (GLAPIENTRYP GetMapfv)(GLenum target, GLenum query, GLfloat * v); /* 267 */
|
||||
void (GLAPIENTRYP GetMapiv)(GLenum target, GLenum query, GLint * v); /* 268 */
|
||||
void (GLAPIENTRYP GetMaterialfv)(GLenum face, GLenum pname, GLfloat * params); /* 269 */
|
||||
void (GLAPIENTRYP GetMaterialiv)(GLenum face, GLenum pname, GLint * params); /* 270 */
|
||||
void (GLAPIENTRYP GetPixelMapfv)(GLenum map, GLfloat * values); /* 271 */
|
||||
void (GLAPIENTRYP GetPixelMapuiv)(GLenum map, GLuint * values); /* 272 */
|
||||
void (GLAPIENTRYP GetPixelMapusv)(GLenum map, GLushort * values); /* 273 */
|
||||
void (GLAPIENTRYP GetPolygonStipple)(GLubyte * mask); /* 274 */
|
||||
const GLubyte * (GLAPIENTRYP GetString)(GLenum name); /* 275 */
|
||||
void (GLAPIENTRYP GetTexEnvfv)(GLenum target, GLenum pname, GLfloat * params); /* 276 */
|
||||
void (GLAPIENTRYP GetTexEnviv)(GLenum target, GLenum pname, GLint * params); /* 277 */
|
||||
void (GLAPIENTRYP GetTexGendv)(GLenum coord, GLenum pname, GLdouble * params); /* 278 */
|
||||
void (GLAPIENTRYP GetTexGenfvOES)(GLenum coord, GLenum pname, GLfloat * params); /* 279 */
|
||||
void (GLAPIENTRYP GetTexGenivOES)(GLenum coord, GLenum pname, GLint * params); /* 280 */
|
||||
void (GLAPIENTRYP GetTexImage)(GLenum target, GLint level, GLenum format, GLenum type, GLvoid * pixels); /* 281 */
|
||||
void (GLAPIENTRYP GetTexParameterfv)(GLenum target, GLenum pname, GLfloat * params); /* 282 */
|
||||
void (GLAPIENTRYP GetTexParameteriv)(GLenum target, GLenum pname, GLint * params); /* 283 */
|
||||
void (GLAPIENTRYP GetTexLevelParameterfv)(GLenum target, GLint level, GLenum pname, GLfloat * params); /* 284 */
|
||||
void (GLAPIENTRYP GetTexLevelParameteriv)(GLenum target, GLint level, GLenum pname, GLint * params); /* 285 */
|
||||
GLboolean (GLAPIENTRYP IsEnabled)(GLenum cap); /* 286 */
|
||||
GLboolean (GLAPIENTRYP IsList)(GLuint list); /* 287 */
|
||||
void (GLAPIENTRYP DepthRange)(GLclampd zNear, GLclampd zFar); /* 288 */
|
||||
void (GLAPIENTRYP Frustum)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); /* 289 */
|
||||
void (GLAPIENTRYP LoadIdentity)(void); /* 290 */
|
||||
void (GLAPIENTRYP LoadMatrixf)(const GLfloat * m); /* 291 */
|
||||
void (GLAPIENTRYP LoadMatrixd)(const GLdouble * m); /* 292 */
|
||||
void (GLAPIENTRYP MatrixMode)(GLenum mode); /* 293 */
|
||||
void (GLAPIENTRYP MultMatrixf)(const GLfloat * m); /* 294 */
|
||||
void (GLAPIENTRYP MultMatrixd)(const GLdouble * m); /* 295 */
|
||||
void (GLAPIENTRYP Ortho)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); /* 296 */
|
||||
void (GLAPIENTRYP PopMatrix)(void); /* 297 */
|
||||
void (GLAPIENTRYP PushMatrix)(void); /* 298 */
|
||||
void (GLAPIENTRYP Rotated)(GLdouble angle, GLdouble x, GLdouble y, GLdouble z); /* 299 */
|
||||
void (GLAPIENTRYP Rotatef)(GLfloat angle, GLfloat x, GLfloat y, GLfloat z); /* 300 */
|
||||
void (GLAPIENTRYP Scaled)(GLdouble x, GLdouble y, GLdouble z); /* 301 */
|
||||
void (GLAPIENTRYP Scalef)(GLfloat x, GLfloat y, GLfloat z); /* 302 */
|
||||
void (GLAPIENTRYP Translated)(GLdouble x, GLdouble y, GLdouble z); /* 303 */
|
||||
void (GLAPIENTRYP Translatef)(GLfloat x, GLfloat y, GLfloat z); /* 304 */
|
||||
void (GLAPIENTRYP Viewport)(GLint x, GLint y, GLsizei width, GLsizei height); /* 305 */
|
||||
void (GLAPIENTRYP ArrayElement)(GLint i); /* 306 */
|
||||
void (GLAPIENTRYP BindTexture)(GLenum target, GLuint texture); /* 307 */
|
||||
void (GLAPIENTRYP ColorPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 308 */
|
||||
void (GLAPIENTRYP DisableClientState)(GLenum array); /* 309 */
|
||||
void (GLAPIENTRYP DrawArrays)(GLenum mode, GLint first, GLsizei count); /* 310 */
|
||||
void (GLAPIENTRYP DrawElements)(GLenum mode, GLsizei count, GLenum type, const GLvoid * indices); /* 311 */
|
||||
void (GLAPIENTRYP EdgeFlagPointer)(GLsizei stride, const GLvoid * pointer); /* 312 */
|
||||
void (GLAPIENTRYP EnableClientState)(GLenum array); /* 313 */
|
||||
void (GLAPIENTRYP IndexPointer)(GLenum type, GLsizei stride, const GLvoid * pointer); /* 314 */
|
||||
void (GLAPIENTRYP Indexub)(GLubyte c); /* 315 */
|
||||
void (GLAPIENTRYP Indexubv)(const GLubyte * c); /* 316 */
|
||||
void (GLAPIENTRYP InterleavedArrays)(GLenum format, GLsizei stride, const GLvoid * pointer); /* 317 */
|
||||
void (GLAPIENTRYP NormalPointer)(GLenum type, GLsizei stride, const GLvoid * pointer); /* 318 */
|
||||
void (GLAPIENTRYP PolygonOffset)(GLfloat factor, GLfloat units); /* 319 */
|
||||
void (GLAPIENTRYP TexCoordPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 320 */
|
||||
void (GLAPIENTRYP VertexPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 321 */
|
||||
GLboolean (GLAPIENTRYP AreTexturesResident)(GLsizei n, const GLuint * textures, GLboolean * residences); /* 322 */
|
||||
void (GLAPIENTRYP CopyTexImage1D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); /* 323 */
|
||||
void (GLAPIENTRYP CopyTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); /* 324 */
|
||||
void (GLAPIENTRYP CopyTexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); /* 325 */
|
||||
void (GLAPIENTRYP CopyTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); /* 326 */
|
||||
void (GLAPIENTRYP DeleteTextures)(GLsizei n, const GLuint * textures); /* 327 */
|
||||
void (GLAPIENTRYP GenTextures)(GLsizei n, GLuint * textures); /* 328 */
|
||||
void (GLAPIENTRYP GetPointerv)(GLenum pname, GLvoid ** params); /* 329 */
|
||||
GLboolean (GLAPIENTRYP IsTexture)(GLuint texture); /* 330 */
|
||||
void (GLAPIENTRYP PrioritizeTextures)(GLsizei n, const GLuint * textures, const GLclampf * priorities); /* 331 */
|
||||
void (GLAPIENTRYP TexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid * pixels); /* 332 */
|
||||
void (GLAPIENTRYP TexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels); /* 333 */
|
||||
void (GLAPIENTRYP PopClientAttrib)(void); /* 334 */
|
||||
void (GLAPIENTRYP PushClientAttrib)(GLbitfield mask); /* 335 */
|
||||
void (GLAPIENTRYP BlendColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); /* 336 */
|
||||
void (GLAPIENTRYP BlendEquationOES)(GLenum mode); /* 337 */
|
||||
void (GLAPIENTRYP DrawRangeElements)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid * indices); /* 338 */
|
||||
void (GLAPIENTRYP ColorTable)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * table); /* 339 */
|
||||
void (GLAPIENTRYP ColorTableParameterfv)(GLenum target, GLenum pname, const GLfloat * params); /* 340 */
|
||||
void (GLAPIENTRYP ColorTableParameteriv)(GLenum target, GLenum pname, const GLint * params); /* 341 */
|
||||
void (GLAPIENTRYP CopyColorTable)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); /* 342 */
|
||||
void (GLAPIENTRYP GetColorTable)(GLenum target, GLenum format, GLenum type, GLvoid * table); /* 343 */
|
||||
void (GLAPIENTRYP GetColorTableParameterfv)(GLenum target, GLenum pname, GLfloat * params); /* 344 */
|
||||
void (GLAPIENTRYP GetColorTableParameteriv)(GLenum target, GLenum pname, GLint * params); /* 345 */
|
||||
void (GLAPIENTRYP ColorSubTable)(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid * data); /* 346 */
|
||||
void (GLAPIENTRYP CopyColorSubTable)(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); /* 347 */
|
||||
void (GLAPIENTRYP ConvolutionFilter1D)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * image); /* 348 */
|
||||
void (GLAPIENTRYP ConvolutionFilter2D)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * image); /* 349 */
|
||||
void (GLAPIENTRYP ConvolutionParameterf)(GLenum target, GLenum pname, GLfloat params); /* 350 */
|
||||
void (GLAPIENTRYP ConvolutionParameterfv)(GLenum target, GLenum pname, const GLfloat * params); /* 351 */
|
||||
void (GLAPIENTRYP ConvolutionParameteri)(GLenum target, GLenum pname, GLint params); /* 352 */
|
||||
void (GLAPIENTRYP ConvolutionParameteriv)(GLenum target, GLenum pname, const GLint * params); /* 353 */
|
||||
void (GLAPIENTRYP CopyConvolutionFilter1D)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); /* 354 */
|
||||
void (GLAPIENTRYP CopyConvolutionFilter2D)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); /* 355 */
|
||||
void (GLAPIENTRYP GetConvolutionFilter)(GLenum target, GLenum format, GLenum type, GLvoid * image); /* 356 */
|
||||
void (GLAPIENTRYP GetConvolutionParameterfv)(GLenum target, GLenum pname, GLfloat * params); /* 357 */
|
||||
void (GLAPIENTRYP GetConvolutionParameteriv)(GLenum target, GLenum pname, GLint * params); /* 358 */
|
||||
void (GLAPIENTRYP GetSeparableFilter)(GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span); /* 359 */
|
||||
void (GLAPIENTRYP SeparableFilter2D)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * row, const GLvoid * column); /* 360 */
|
||||
void (GLAPIENTRYP GetHistogram)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values); /* 361 */
|
||||
void (GLAPIENTRYP GetHistogramParameterfv)(GLenum target, GLenum pname, GLfloat * params); /* 362 */
|
||||
void (GLAPIENTRYP GetHistogramParameteriv)(GLenum target, GLenum pname, GLint * params); /* 363 */
|
||||
void (GLAPIENTRYP GetMinmax)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values); /* 364 */
|
||||
void (GLAPIENTRYP GetMinmaxParameterfv)(GLenum target, GLenum pname, GLfloat * params); /* 365 */
|
||||
void (GLAPIENTRYP GetMinmaxParameteriv)(GLenum target, GLenum pname, GLint * params); /* 366 */
|
||||
void (GLAPIENTRYP Histogram)(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); /* 367 */
|
||||
void (GLAPIENTRYP Minmax)(GLenum target, GLenum internalformat, GLboolean sink); /* 368 */
|
||||
void (GLAPIENTRYP ResetHistogram)(GLenum target); /* 369 */
|
||||
void (GLAPIENTRYP ResetMinmax)(GLenum target); /* 370 */
|
||||
void (GLAPIENTRYP TexImage3D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid * pixels); /* 371 */
|
||||
void (GLAPIENTRYP TexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid * pixels); /* 372 */
|
||||
void (GLAPIENTRYP CopyTexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); /* 373 */
|
||||
void (GLAPIENTRYP ActiveTexture)(GLenum texture); /* 374 */
|
||||
void (GLAPIENTRYP ClientActiveTexture)(GLenum texture); /* 375 */
|
||||
void (GLAPIENTRYP MultiTexCoord1dARB)(GLenum target, GLdouble s); /* 376 */
|
||||
void (GLAPIENTRYP MultiTexCoord1dvARB)(GLenum target, const GLdouble * v); /* 377 */
|
||||
void (GLAPIENTRYP MultiTexCoord1fARB)(GLenum target, GLfloat s); /* 378 */
|
||||
void (GLAPIENTRYP MultiTexCoord1fvARB)(GLenum target, const GLfloat * v); /* 379 */
|
||||
void (GLAPIENTRYP MultiTexCoord1iARB)(GLenum target, GLint s); /* 380 */
|
||||
void (GLAPIENTRYP MultiTexCoord1ivARB)(GLenum target, const GLint * v); /* 381 */
|
||||
void (GLAPIENTRYP MultiTexCoord1sARB)(GLenum target, GLshort s); /* 382 */
|
||||
void (GLAPIENTRYP MultiTexCoord1svARB)(GLenum target, const GLshort * v); /* 383 */
|
||||
void (GLAPIENTRYP MultiTexCoord2dARB)(GLenum target, GLdouble s, GLdouble t); /* 384 */
|
||||
void (GLAPIENTRYP MultiTexCoord2dvARB)(GLenum target, const GLdouble * v); /* 385 */
|
||||
void (GLAPIENTRYP MultiTexCoord2fARB)(GLenum target, GLfloat s, GLfloat t); /* 386 */
|
||||
void (GLAPIENTRYP MultiTexCoord2fvARB)(GLenum target, const GLfloat * v); /* 387 */
|
||||
void (GLAPIENTRYP MultiTexCoord2iARB)(GLenum target, GLint s, GLint t); /* 388 */
|
||||
void (GLAPIENTRYP MultiTexCoord2ivARB)(GLenum target, const GLint * v); /* 389 */
|
||||
void (GLAPIENTRYP MultiTexCoord2sARB)(GLenum target, GLshort s, GLshort t); /* 390 */
|
||||
void (GLAPIENTRYP MultiTexCoord2svARB)(GLenum target, const GLshort * v); /* 391 */
|
||||
void (GLAPIENTRYP MultiTexCoord3dARB)(GLenum target, GLdouble s, GLdouble t, GLdouble r); /* 392 */
|
||||
void (GLAPIENTRYP MultiTexCoord3dvARB)(GLenum target, const GLdouble * v); /* 393 */
|
||||
void (GLAPIENTRYP MultiTexCoord3fARB)(GLenum target, GLfloat s, GLfloat t, GLfloat r); /* 394 */
|
||||
void (GLAPIENTRYP MultiTexCoord3fvARB)(GLenum target, const GLfloat * v); /* 395 */
|
||||
void (GLAPIENTRYP MultiTexCoord3iARB)(GLenum target, GLint s, GLint t, GLint r); /* 396 */
|
||||
void (GLAPIENTRYP MultiTexCoord3ivARB)(GLenum target, const GLint * v); /* 397 */
|
||||
void (GLAPIENTRYP MultiTexCoord3sARB)(GLenum target, GLshort s, GLshort t, GLshort r); /* 398 */
|
||||
void (GLAPIENTRYP MultiTexCoord3svARB)(GLenum target, const GLshort * v); /* 399 */
|
||||
void (GLAPIENTRYP MultiTexCoord4dARB)(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); /* 400 */
|
||||
void (GLAPIENTRYP MultiTexCoord4dvARB)(GLenum target, const GLdouble * v); /* 401 */
|
||||
void (GLAPIENTRYP MultiTexCoord4f)(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); /* 402 */
|
||||
void (GLAPIENTRYP MultiTexCoord4fvARB)(GLenum target, const GLfloat * v); /* 403 */
|
||||
void (GLAPIENTRYP MultiTexCoord4iARB)(GLenum target, GLint s, GLint t, GLint r, GLint q); /* 404 */
|
||||
void (GLAPIENTRYP MultiTexCoord4ivARB)(GLenum target, const GLint * v); /* 405 */
|
||||
void (GLAPIENTRYP MultiTexCoord4sARB)(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); /* 406 */
|
||||
void (GLAPIENTRYP MultiTexCoord4svARB)(GLenum target, const GLshort * v); /* 407 */
|
||||
void (GLAPIENTRYP BlendEquationSeparateOES)(GLenum modeRGB, GLenum modeA); /* 408 */
|
||||
void (GLAPIENTRYP BlendFuncSeparateOES)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); /* 409 */
|
||||
void (GLAPIENTRYP DrawTexfOES)(GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height); /* 410 */
|
||||
void (GLAPIENTRYP DrawTexfvOES)(const GLfloat * coords); /* 411 */
|
||||
void (GLAPIENTRYP DrawTexiOES)(GLint x, GLint y, GLint z, GLint width, GLint height); /* 412 */
|
||||
void (GLAPIENTRYP DrawTexivOES)(const GLint * coords); /* 413 */
|
||||
void (GLAPIENTRYP DrawTexsOES)(GLshort x, GLshort y, GLshort z, GLshort width, GLshort height); /* 414 */
|
||||
void (GLAPIENTRYP DrawTexsvOES)(const GLshort * coords); /* 415 */
|
||||
void (GLAPIENTRYP DrawTexxOES)(GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height); /* 416 */
|
||||
void (GLAPIENTRYP DrawTexxvOES)(const GLfixed * coords); /* 417 */
|
||||
void (GLAPIENTRYP BindFramebufferOES)(GLenum target, GLuint framebuffer); /* 418 */
|
||||
void (GLAPIENTRYP BindRenderbufferOES)(GLenum target, GLuint renderbuffer); /* 419 */
|
||||
GLenum (GLAPIENTRYP CheckFramebufferStatusOES)(GLenum target); /* 420 */
|
||||
void (GLAPIENTRYP DeleteFramebuffersOES)(GLsizei n, const GLuint * framebuffers); /* 421 */
|
||||
void (GLAPIENTRYP DeleteRenderbuffersOES)(GLsizei n, const GLuint * renderbuffers); /* 422 */
|
||||
void (GLAPIENTRYP FramebufferRenderbufferOES)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); /* 423 */
|
||||
void (GLAPIENTRYP FramebufferTexture2DOES)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); /* 424 */
|
||||
void (GLAPIENTRYP GenFramebuffersOES)(GLsizei n, GLuint * framebuffers); /* 425 */
|
||||
void (GLAPIENTRYP GenRenderbuffersOES)(GLsizei n, GLuint * renderbuffers); /* 426 */
|
||||
void (GLAPIENTRYP GenerateMipmapOES)(GLenum target); /* 427 */
|
||||
void (GLAPIENTRYP GetFramebufferAttachmentParameterivOES)(GLenum target, GLenum attachment, GLenum pname, GLint * params); /* 428 */
|
||||
void (GLAPIENTRYP GetRenderbufferParameterivOES)(GLenum target, GLenum pname, GLint * params); /* 429 */
|
||||
GLboolean (GLAPIENTRYP IsFramebufferOES)(GLuint framebuffer); /* 430 */
|
||||
GLboolean (GLAPIENTRYP IsRenderbufferOES)(GLuint renderbuffer); /* 431 */
|
||||
void (GLAPIENTRYP RenderbufferStorageOES)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height); /* 432 */
|
||||
void (GLAPIENTRYP PointSizePointerOES)(GLenum type, GLsizei stride, const GLvoid * pointer); /* 433 */
|
||||
GLbitfield (GLAPIENTRYP QueryMatrixxOES)(GLfixed * mantissa, GLint * exponent); /* 434 */
|
||||
void (GLAPIENTRYP GetTexGenxvOES)(GLenum coord, GLenum pname, GLfixed * params); /* 435 */
|
||||
void (GLAPIENTRYP TexGenxOES)(GLenum coord, GLenum pname, GLint param); /* 436 */
|
||||
void (GLAPIENTRYP TexGenxvOES)(GLenum coord, GLenum pname, const GLfixed * params); /* 437 */
|
||||
void (GLAPIENTRYP GetBufferPointervOES)(GLenum target, GLenum pname, GLvoid ** params); /* 438 */
|
||||
GLvoid * (GLAPIENTRYP MapBufferOES)(GLenum target, GLenum access); /* 439 */
|
||||
GLboolean (GLAPIENTRYP UnmapBufferOES)(GLenum target); /* 440 */
|
||||
void (GLAPIENTRYP MultiDrawArraysEXT)(GLenum mode, const GLint * first, const GLsizei * count, GLsizei primcount); /* 441 */
|
||||
void (GLAPIENTRYP MultiDrawElementsEXT)(GLenum mode, const GLsizei * count, GLenum type, const GLvoid ** indices, GLsizei primcount); /* 442 */
|
||||
void (GLAPIENTRYP BindVertexArrayAPPLE)(GLuint array); /* 443 */
|
||||
void (GLAPIENTRYP DeleteVertexArraysAPPLE)(GLsizei n, const GLuint * arrays); /* 444 */
|
||||
void (GLAPIENTRYP GenVertexArraysAPPLE)(GLsizei n, GLuint * arrays); /* 445 */
|
||||
GLboolean (GLAPIENTRYP IsVertexArrayAPPLE)(GLuint array); /* 446 */
|
||||
void (GLAPIENTRYP EGLImageTargetRenderbufferStorageOES)(GLenum target, GLvoid * writeOffset); /* 447 */
|
||||
void (GLAPIENTRYP EGLImageTargetTexture2DOES)(GLenum target, GLvoid * writeOffset); /* 448 */
|
||||
void (GLAPIENTRYP CompressedTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid * data); /* 449 */
|
||||
void (GLAPIENTRYP CompressedTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid * data); /* 450 */
|
||||
void (GLAPIENTRYP SampleCoverage)(GLclampf value, GLboolean invert); /* 451 */
|
||||
void (GLAPIENTRYP BindBuffer)(GLenum target, GLuint buffer); /* 452 */
|
||||
void (GLAPIENTRYP BufferData)(GLenum target, GLsizeiptr size, const GLvoid * data, GLenum usage); /* 453 */
|
||||
void (GLAPIENTRYP BufferSubData)(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid * data); /* 454 */
|
||||
void (GLAPIENTRYP DeleteBuffers)(GLsizei n, const GLuint * buffer); /* 455 */
|
||||
void (GLAPIENTRYP GenBuffers)(GLsizei n, GLuint * buffer); /* 456 */
|
||||
void (GLAPIENTRYP GetBufferParameteriv)(GLenum target, GLenum pname, GLint * params); /* 457 */
|
||||
GLboolean (GLAPIENTRYP IsBuffer)(GLuint buffer); /* 458 */
|
||||
void (GLAPIENTRYP PointParameterf)(GLenum pname, GLfloat param); /* 459 */
|
||||
void (GLAPIENTRYP PointParameterfv)(GLenum pname, const GLfloat * params); /* 460 */
|
||||
void (GLAPIENTRYP AlphaFuncx)(GLenum func, GLclampx ref); /* 461 */
|
||||
void (GLAPIENTRYP ClearColorx)(GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha); /* 462 */
|
||||
void (GLAPIENTRYP ClearDepthf)(GLclampf depth); /* 463 */
|
||||
void (GLAPIENTRYP ClearDepthx)(GLclampx depth); /* 464 */
|
||||
void (GLAPIENTRYP Color4x)(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); /* 465 */
|
||||
void (GLAPIENTRYP DepthRangef)(GLclampf zNear, GLclampf zFar); /* 466 */
|
||||
void (GLAPIENTRYP DepthRangex)(GLclampx zNear, GLclampx zFar); /* 467 */
|
||||
void (GLAPIENTRYP Fogx)(GLenum pname, GLfixed param); /* 468 */
|
||||
void (GLAPIENTRYP Fogxv)(GLenum pname, const GLfixed * params); /* 469 */
|
||||
void (GLAPIENTRYP Frustumf)(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar); /* 470 */
|
||||
void (GLAPIENTRYP Frustumx)(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar); /* 471 */
|
||||
void (GLAPIENTRYP LightModelx)(GLenum pname, GLfixed param); /* 472 */
|
||||
void (GLAPIENTRYP LightModelxv)(GLenum pname, const GLfixed * params); /* 473 */
|
||||
void (GLAPIENTRYP Lightx)(GLenum light, GLenum pname, GLfixed param); /* 474 */
|
||||
void (GLAPIENTRYP Lightxv)(GLenum light, GLenum pname, const GLfixed * params); /* 475 */
|
||||
void (GLAPIENTRYP LineWidthx)(GLfixed width); /* 476 */
|
||||
void (GLAPIENTRYP LoadMatrixx)(const GLfixed * m); /* 477 */
|
||||
void (GLAPIENTRYP Materialx)(GLenum face, GLenum pname, GLfixed param); /* 478 */
|
||||
void (GLAPIENTRYP Materialxv)(GLenum face, GLenum pname, const GLfixed * params); /* 479 */
|
||||
void (GLAPIENTRYP MultMatrixx)(const GLfixed * m); /* 480 */
|
||||
void (GLAPIENTRYP MultiTexCoord4x)(GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q); /* 481 */
|
||||
void (GLAPIENTRYP Normal3x)(GLfixed nx, GLfixed ny, GLfixed nz); /* 482 */
|
||||
void (GLAPIENTRYP Orthof)(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar); /* 483 */
|
||||
void (GLAPIENTRYP Orthox)(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar); /* 484 */
|
||||
void (GLAPIENTRYP PointSizex)(GLfixed size); /* 485 */
|
||||
void (GLAPIENTRYP PolygonOffsetx)(GLfixed factor, GLfixed units); /* 486 */
|
||||
void (GLAPIENTRYP Rotatex)(GLfixed angle, GLfixed x, GLfixed y, GLfixed z); /* 487 */
|
||||
void (GLAPIENTRYP SampleCoveragex)(GLclampx value, GLboolean invert); /* 488 */
|
||||
void (GLAPIENTRYP Scalex)(GLfixed x, GLfixed y, GLfixed z); /* 489 */
|
||||
void (GLAPIENTRYP TexEnvx)(GLenum target, GLenum pname, GLfixed param); /* 490 */
|
||||
void (GLAPIENTRYP TexEnvxv)(GLenum target, GLenum pname, const GLfixed * params); /* 491 */
|
||||
void (GLAPIENTRYP TexParameterx)(GLenum target, GLenum pname, GLfixed param); /* 492 */
|
||||
void (GLAPIENTRYP Translatex)(GLfixed x, GLfixed y, GLfixed z); /* 493 */
|
||||
void (GLAPIENTRYP ClipPlanef)(GLenum plane, const GLfloat * equation); /* 494 */
|
||||
void (GLAPIENTRYP ClipPlanex)(GLenum plane, const GLfixed * equation); /* 495 */
|
||||
void (GLAPIENTRYP GetClipPlanef)(GLenum plane, GLfloat * equation); /* 496 */
|
||||
void (GLAPIENTRYP GetClipPlanex)(GLenum plane, GLfixed * equation); /* 497 */
|
||||
void (GLAPIENTRYP GetFixedv)(GLenum pname, GLfixed * params); /* 498 */
|
||||
void (GLAPIENTRYP GetLightxv)(GLenum light, GLenum pname, GLfixed * params); /* 499 */
|
||||
void (GLAPIENTRYP GetMaterialxv)(GLenum face, GLenum pname, GLfixed * params); /* 500 */
|
||||
void (GLAPIENTRYP GetTexEnvxv)(GLenum target, GLenum pname, GLfixed * params); /* 501 */
|
||||
void (GLAPIENTRYP GetTexParameterxv)(GLenum target, GLenum pname, GLfixed * params); /* 502 */
|
||||
void (GLAPIENTRYP PointParameterx)(GLenum pname, GLfixed param); /* 503 */
|
||||
void (GLAPIENTRYP PointParameterxv)(GLenum pname, const GLfixed * params); /* 504 */
|
||||
void (GLAPIENTRYP TexParameterxv)(GLenum target, GLenum pname, const GLfixed * params); /* 505 */
|
||||
};
|
||||
|
||||
#endif /* !defined( _GLAPI_TABLE_H_ ) */
|
4528
src/mapi/es1api/glapi/glapitemp.h
Normal file
4528
src/mapi/es1api/glapi/glapitemp.h
Normal file
File diff suppressed because it is too large
Load Diff
1977
src/mapi/es1api/glapi/glprocs.h
Normal file
1977
src/mapi/es1api/glapi/glprocs.h
Normal file
File diff suppressed because it is too large
Load Diff
2524
src/mapi/es1api/main/glapidispatch.h
Normal file
2524
src/mapi/es1api/main/glapidispatch.h
Normal file
File diff suppressed because it is too large
Load Diff
2335
src/mapi/es1api/main/remap_helper.h
Normal file
2335
src/mapi/es1api/main/remap_helper.h
Normal file
File diff suppressed because it is too large
Load Diff
1084
src/mapi/es2api/glapi/glapi_sparc.S
Normal file
1084
src/mapi/es2api/glapi/glapi_sparc.S
Normal file
File diff suppressed because it is too large
Load Diff
19796
src/mapi/es2api/glapi/glapi_x86-64.S
Normal file
19796
src/mapi/es2api/glapi/glapi_x86-64.S
Normal file
File diff suppressed because it is too large
Load Diff
1053
src/mapi/es2api/glapi/glapi_x86.S
Normal file
1053
src/mapi/es2api/glapi/glapi_x86.S
Normal file
File diff suppressed because it is too large
Load Diff
563
src/mapi/es2api/glapi/glapitable.h
Normal file
563
src/mapi/es2api/glapi/glapitable.h
Normal file
@@ -0,0 +1,563 @@
|
||||
/* DO NOT EDIT - This file generated automatically by gl_table.py (from Mesa) script */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
|
||||
* (C) Copyright IBM Corporation 2004
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sub license,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
|
||||
* BRIAN PAUL, IBM,
|
||||
* AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
|
||||
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
#if !defined( _GLAPI_TABLE_H_ )
|
||||
# define _GLAPI_TABLE_H_
|
||||
|
||||
#ifndef GLAPIENTRYP
|
||||
# ifndef GLAPIENTRY
|
||||
# define GLAPIENTRY
|
||||
# endif
|
||||
|
||||
# define GLAPIENTRYP GLAPIENTRY *
|
||||
#endif
|
||||
|
||||
|
||||
struct _glapi_table
|
||||
{
|
||||
void (GLAPIENTRYP NewList)(GLuint list, GLenum mode); /* 0 */
|
||||
void (GLAPIENTRYP EndList)(void); /* 1 */
|
||||
void (GLAPIENTRYP CallList)(GLuint list); /* 2 */
|
||||
void (GLAPIENTRYP CallLists)(GLsizei n, GLenum type, const GLvoid * lists); /* 3 */
|
||||
void (GLAPIENTRYP DeleteLists)(GLuint list, GLsizei range); /* 4 */
|
||||
GLuint (GLAPIENTRYP GenLists)(GLsizei range); /* 5 */
|
||||
void (GLAPIENTRYP ListBase)(GLuint base); /* 6 */
|
||||
void (GLAPIENTRYP Begin)(GLenum mode); /* 7 */
|
||||
void (GLAPIENTRYP Bitmap)(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte * bitmap); /* 8 */
|
||||
void (GLAPIENTRYP Color3b)(GLbyte red, GLbyte green, GLbyte blue); /* 9 */
|
||||
void (GLAPIENTRYP Color3bv)(const GLbyte * v); /* 10 */
|
||||
void (GLAPIENTRYP Color3d)(GLdouble red, GLdouble green, GLdouble blue); /* 11 */
|
||||
void (GLAPIENTRYP Color3dv)(const GLdouble * v); /* 12 */
|
||||
void (GLAPIENTRYP Color3f)(GLfloat red, GLfloat green, GLfloat blue); /* 13 */
|
||||
void (GLAPIENTRYP Color3fv)(const GLfloat * v); /* 14 */
|
||||
void (GLAPIENTRYP Color3i)(GLint red, GLint green, GLint blue); /* 15 */
|
||||
void (GLAPIENTRYP Color3iv)(const GLint * v); /* 16 */
|
||||
void (GLAPIENTRYP Color3s)(GLshort red, GLshort green, GLshort blue); /* 17 */
|
||||
void (GLAPIENTRYP Color3sv)(const GLshort * v); /* 18 */
|
||||
void (GLAPIENTRYP Color3ub)(GLubyte red, GLubyte green, GLubyte blue); /* 19 */
|
||||
void (GLAPIENTRYP Color3ubv)(const GLubyte * v); /* 20 */
|
||||
void (GLAPIENTRYP Color3ui)(GLuint red, GLuint green, GLuint blue); /* 21 */
|
||||
void (GLAPIENTRYP Color3uiv)(const GLuint * v); /* 22 */
|
||||
void (GLAPIENTRYP Color3us)(GLushort red, GLushort green, GLushort blue); /* 23 */
|
||||
void (GLAPIENTRYP Color3usv)(const GLushort * v); /* 24 */
|
||||
void (GLAPIENTRYP Color4b)(GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha); /* 25 */
|
||||
void (GLAPIENTRYP Color4bv)(const GLbyte * v); /* 26 */
|
||||
void (GLAPIENTRYP Color4d)(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha); /* 27 */
|
||||
void (GLAPIENTRYP Color4dv)(const GLdouble * v); /* 28 */
|
||||
void (GLAPIENTRYP Color4f)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); /* 29 */
|
||||
void (GLAPIENTRYP Color4fv)(const GLfloat * v); /* 30 */
|
||||
void (GLAPIENTRYP Color4i)(GLint red, GLint green, GLint blue, GLint alpha); /* 31 */
|
||||
void (GLAPIENTRYP Color4iv)(const GLint * v); /* 32 */
|
||||
void (GLAPIENTRYP Color4s)(GLshort red, GLshort green, GLshort blue, GLshort alpha); /* 33 */
|
||||
void (GLAPIENTRYP Color4sv)(const GLshort * v); /* 34 */
|
||||
void (GLAPIENTRYP Color4ub)(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha); /* 35 */
|
||||
void (GLAPIENTRYP Color4ubv)(const GLubyte * v); /* 36 */
|
||||
void (GLAPIENTRYP Color4ui)(GLuint red, GLuint green, GLuint blue, GLuint alpha); /* 37 */
|
||||
void (GLAPIENTRYP Color4uiv)(const GLuint * v); /* 38 */
|
||||
void (GLAPIENTRYP Color4us)(GLushort red, GLushort green, GLushort blue, GLushort alpha); /* 39 */
|
||||
void (GLAPIENTRYP Color4usv)(const GLushort * v); /* 40 */
|
||||
void (GLAPIENTRYP EdgeFlag)(GLboolean flag); /* 41 */
|
||||
void (GLAPIENTRYP EdgeFlagv)(const GLboolean * flag); /* 42 */
|
||||
void (GLAPIENTRYP End)(void); /* 43 */
|
||||
void (GLAPIENTRYP Indexd)(GLdouble c); /* 44 */
|
||||
void (GLAPIENTRYP Indexdv)(const GLdouble * c); /* 45 */
|
||||
void (GLAPIENTRYP Indexf)(GLfloat c); /* 46 */
|
||||
void (GLAPIENTRYP Indexfv)(const GLfloat * c); /* 47 */
|
||||
void (GLAPIENTRYP Indexi)(GLint c); /* 48 */
|
||||
void (GLAPIENTRYP Indexiv)(const GLint * c); /* 49 */
|
||||
void (GLAPIENTRYP Indexs)(GLshort c); /* 50 */
|
||||
void (GLAPIENTRYP Indexsv)(const GLshort * c); /* 51 */
|
||||
void (GLAPIENTRYP Normal3b)(GLbyte nx, GLbyte ny, GLbyte nz); /* 52 */
|
||||
void (GLAPIENTRYP Normal3bv)(const GLbyte * v); /* 53 */
|
||||
void (GLAPIENTRYP Normal3d)(GLdouble nx, GLdouble ny, GLdouble nz); /* 54 */
|
||||
void (GLAPIENTRYP Normal3dv)(const GLdouble * v); /* 55 */
|
||||
void (GLAPIENTRYP Normal3f)(GLfloat nx, GLfloat ny, GLfloat nz); /* 56 */
|
||||
void (GLAPIENTRYP Normal3fv)(const GLfloat * v); /* 57 */
|
||||
void (GLAPIENTRYP Normal3i)(GLint nx, GLint ny, GLint nz); /* 58 */
|
||||
void (GLAPIENTRYP Normal3iv)(const GLint * v); /* 59 */
|
||||
void (GLAPIENTRYP Normal3s)(GLshort nx, GLshort ny, GLshort nz); /* 60 */
|
||||
void (GLAPIENTRYP Normal3sv)(const GLshort * v); /* 61 */
|
||||
void (GLAPIENTRYP RasterPos2d)(GLdouble x, GLdouble y); /* 62 */
|
||||
void (GLAPIENTRYP RasterPos2dv)(const GLdouble * v); /* 63 */
|
||||
void (GLAPIENTRYP RasterPos2f)(GLfloat x, GLfloat y); /* 64 */
|
||||
void (GLAPIENTRYP RasterPos2fv)(const GLfloat * v); /* 65 */
|
||||
void (GLAPIENTRYP RasterPos2i)(GLint x, GLint y); /* 66 */
|
||||
void (GLAPIENTRYP RasterPos2iv)(const GLint * v); /* 67 */
|
||||
void (GLAPIENTRYP RasterPos2s)(GLshort x, GLshort y); /* 68 */
|
||||
void (GLAPIENTRYP RasterPos2sv)(const GLshort * v); /* 69 */
|
||||
void (GLAPIENTRYP RasterPos3d)(GLdouble x, GLdouble y, GLdouble z); /* 70 */
|
||||
void (GLAPIENTRYP RasterPos3dv)(const GLdouble * v); /* 71 */
|
||||
void (GLAPIENTRYP RasterPos3f)(GLfloat x, GLfloat y, GLfloat z); /* 72 */
|
||||
void (GLAPIENTRYP RasterPos3fv)(const GLfloat * v); /* 73 */
|
||||
void (GLAPIENTRYP RasterPos3i)(GLint x, GLint y, GLint z); /* 74 */
|
||||
void (GLAPIENTRYP RasterPos3iv)(const GLint * v); /* 75 */
|
||||
void (GLAPIENTRYP RasterPos3s)(GLshort x, GLshort y, GLshort z); /* 76 */
|
||||
void (GLAPIENTRYP RasterPos3sv)(const GLshort * v); /* 77 */
|
||||
void (GLAPIENTRYP RasterPos4d)(GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 78 */
|
||||
void (GLAPIENTRYP RasterPos4dv)(const GLdouble * v); /* 79 */
|
||||
void (GLAPIENTRYP RasterPos4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 80 */
|
||||
void (GLAPIENTRYP RasterPos4fv)(const GLfloat * v); /* 81 */
|
||||
void (GLAPIENTRYP RasterPos4i)(GLint x, GLint y, GLint z, GLint w); /* 82 */
|
||||
void (GLAPIENTRYP RasterPos4iv)(const GLint * v); /* 83 */
|
||||
void (GLAPIENTRYP RasterPos4s)(GLshort x, GLshort y, GLshort z, GLshort w); /* 84 */
|
||||
void (GLAPIENTRYP RasterPos4sv)(const GLshort * v); /* 85 */
|
||||
void (GLAPIENTRYP Rectd)(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2); /* 86 */
|
||||
void (GLAPIENTRYP Rectdv)(const GLdouble * v1, const GLdouble * v2); /* 87 */
|
||||
void (GLAPIENTRYP Rectf)(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2); /* 88 */
|
||||
void (GLAPIENTRYP Rectfv)(const GLfloat * v1, const GLfloat * v2); /* 89 */
|
||||
void (GLAPIENTRYP Recti)(GLint x1, GLint y1, GLint x2, GLint y2); /* 90 */
|
||||
void (GLAPIENTRYP Rectiv)(const GLint * v1, const GLint * v2); /* 91 */
|
||||
void (GLAPIENTRYP Rects)(GLshort x1, GLshort y1, GLshort x2, GLshort y2); /* 92 */
|
||||
void (GLAPIENTRYP Rectsv)(const GLshort * v1, const GLshort * v2); /* 93 */
|
||||
void (GLAPIENTRYP TexCoord1d)(GLdouble s); /* 94 */
|
||||
void (GLAPIENTRYP TexCoord1dv)(const GLdouble * v); /* 95 */
|
||||
void (GLAPIENTRYP TexCoord1f)(GLfloat s); /* 96 */
|
||||
void (GLAPIENTRYP TexCoord1fv)(const GLfloat * v); /* 97 */
|
||||
void (GLAPIENTRYP TexCoord1i)(GLint s); /* 98 */
|
||||
void (GLAPIENTRYP TexCoord1iv)(const GLint * v); /* 99 */
|
||||
void (GLAPIENTRYP TexCoord1s)(GLshort s); /* 100 */
|
||||
void (GLAPIENTRYP TexCoord1sv)(const GLshort * v); /* 101 */
|
||||
void (GLAPIENTRYP TexCoord2d)(GLdouble s, GLdouble t); /* 102 */
|
||||
void (GLAPIENTRYP TexCoord2dv)(const GLdouble * v); /* 103 */
|
||||
void (GLAPIENTRYP TexCoord2f)(GLfloat s, GLfloat t); /* 104 */
|
||||
void (GLAPIENTRYP TexCoord2fv)(const GLfloat * v); /* 105 */
|
||||
void (GLAPIENTRYP TexCoord2i)(GLint s, GLint t); /* 106 */
|
||||
void (GLAPIENTRYP TexCoord2iv)(const GLint * v); /* 107 */
|
||||
void (GLAPIENTRYP TexCoord2s)(GLshort s, GLshort t); /* 108 */
|
||||
void (GLAPIENTRYP TexCoord2sv)(const GLshort * v); /* 109 */
|
||||
void (GLAPIENTRYP TexCoord3d)(GLdouble s, GLdouble t, GLdouble r); /* 110 */
|
||||
void (GLAPIENTRYP TexCoord3dv)(const GLdouble * v); /* 111 */
|
||||
void (GLAPIENTRYP TexCoord3f)(GLfloat s, GLfloat t, GLfloat r); /* 112 */
|
||||
void (GLAPIENTRYP TexCoord3fv)(const GLfloat * v); /* 113 */
|
||||
void (GLAPIENTRYP TexCoord3i)(GLint s, GLint t, GLint r); /* 114 */
|
||||
void (GLAPIENTRYP TexCoord3iv)(const GLint * v); /* 115 */
|
||||
void (GLAPIENTRYP TexCoord3s)(GLshort s, GLshort t, GLshort r); /* 116 */
|
||||
void (GLAPIENTRYP TexCoord3sv)(const GLshort * v); /* 117 */
|
||||
void (GLAPIENTRYP TexCoord4d)(GLdouble s, GLdouble t, GLdouble r, GLdouble q); /* 118 */
|
||||
void (GLAPIENTRYP TexCoord4dv)(const GLdouble * v); /* 119 */
|
||||
void (GLAPIENTRYP TexCoord4f)(GLfloat s, GLfloat t, GLfloat r, GLfloat q); /* 120 */
|
||||
void (GLAPIENTRYP TexCoord4fv)(const GLfloat * v); /* 121 */
|
||||
void (GLAPIENTRYP TexCoord4i)(GLint s, GLint t, GLint r, GLint q); /* 122 */
|
||||
void (GLAPIENTRYP TexCoord4iv)(const GLint * v); /* 123 */
|
||||
void (GLAPIENTRYP TexCoord4s)(GLshort s, GLshort t, GLshort r, GLshort q); /* 124 */
|
||||
void (GLAPIENTRYP TexCoord4sv)(const GLshort * v); /* 125 */
|
||||
void (GLAPIENTRYP Vertex2d)(GLdouble x, GLdouble y); /* 126 */
|
||||
void (GLAPIENTRYP Vertex2dv)(const GLdouble * v); /* 127 */
|
||||
void (GLAPIENTRYP Vertex2f)(GLfloat x, GLfloat y); /* 128 */
|
||||
void (GLAPIENTRYP Vertex2fv)(const GLfloat * v); /* 129 */
|
||||
void (GLAPIENTRYP Vertex2i)(GLint x, GLint y); /* 130 */
|
||||
void (GLAPIENTRYP Vertex2iv)(const GLint * v); /* 131 */
|
||||
void (GLAPIENTRYP Vertex2s)(GLshort x, GLshort y); /* 132 */
|
||||
void (GLAPIENTRYP Vertex2sv)(const GLshort * v); /* 133 */
|
||||
void (GLAPIENTRYP Vertex3d)(GLdouble x, GLdouble y, GLdouble z); /* 134 */
|
||||
void (GLAPIENTRYP Vertex3dv)(const GLdouble * v); /* 135 */
|
||||
void (GLAPIENTRYP Vertex3f)(GLfloat x, GLfloat y, GLfloat z); /* 136 */
|
||||
void (GLAPIENTRYP Vertex3fv)(const GLfloat * v); /* 137 */
|
||||
void (GLAPIENTRYP Vertex3i)(GLint x, GLint y, GLint z); /* 138 */
|
||||
void (GLAPIENTRYP Vertex3iv)(const GLint * v); /* 139 */
|
||||
void (GLAPIENTRYP Vertex3s)(GLshort x, GLshort y, GLshort z); /* 140 */
|
||||
void (GLAPIENTRYP Vertex3sv)(const GLshort * v); /* 141 */
|
||||
void (GLAPIENTRYP Vertex4d)(GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 142 */
|
||||
void (GLAPIENTRYP Vertex4dv)(const GLdouble * v); /* 143 */
|
||||
void (GLAPIENTRYP Vertex4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 144 */
|
||||
void (GLAPIENTRYP Vertex4fv)(const GLfloat * v); /* 145 */
|
||||
void (GLAPIENTRYP Vertex4i)(GLint x, GLint y, GLint z, GLint w); /* 146 */
|
||||
void (GLAPIENTRYP Vertex4iv)(const GLint * v); /* 147 */
|
||||
void (GLAPIENTRYP Vertex4s)(GLshort x, GLshort y, GLshort z, GLshort w); /* 148 */
|
||||
void (GLAPIENTRYP Vertex4sv)(const GLshort * v); /* 149 */
|
||||
void (GLAPIENTRYP ClipPlane)(GLenum plane, const GLdouble * equation); /* 150 */
|
||||
void (GLAPIENTRYP ColorMaterial)(GLenum face, GLenum mode); /* 151 */
|
||||
void (GLAPIENTRYP CullFace)(GLenum mode); /* 152 */
|
||||
void (GLAPIENTRYP Fogf)(GLenum pname, GLfloat param); /* 153 */
|
||||
void (GLAPIENTRYP Fogfv)(GLenum pname, const GLfloat * params); /* 154 */
|
||||
void (GLAPIENTRYP Fogi)(GLenum pname, GLint param); /* 155 */
|
||||
void (GLAPIENTRYP Fogiv)(GLenum pname, const GLint * params); /* 156 */
|
||||
void (GLAPIENTRYP FrontFace)(GLenum mode); /* 157 */
|
||||
void (GLAPIENTRYP Hint)(GLenum target, GLenum mode); /* 158 */
|
||||
void (GLAPIENTRYP Lightf)(GLenum light, GLenum pname, GLfloat param); /* 159 */
|
||||
void (GLAPIENTRYP Lightfv)(GLenum light, GLenum pname, const GLfloat * params); /* 160 */
|
||||
void (GLAPIENTRYP Lighti)(GLenum light, GLenum pname, GLint param); /* 161 */
|
||||
void (GLAPIENTRYP Lightiv)(GLenum light, GLenum pname, const GLint * params); /* 162 */
|
||||
void (GLAPIENTRYP LightModelf)(GLenum pname, GLfloat param); /* 163 */
|
||||
void (GLAPIENTRYP LightModelfv)(GLenum pname, const GLfloat * params); /* 164 */
|
||||
void (GLAPIENTRYP LightModeli)(GLenum pname, GLint param); /* 165 */
|
||||
void (GLAPIENTRYP LightModeliv)(GLenum pname, const GLint * params); /* 166 */
|
||||
void (GLAPIENTRYP LineStipple)(GLint factor, GLushort pattern); /* 167 */
|
||||
void (GLAPIENTRYP LineWidth)(GLfloat width); /* 168 */
|
||||
void (GLAPIENTRYP Materialf)(GLenum face, GLenum pname, GLfloat param); /* 169 */
|
||||
void (GLAPIENTRYP Materialfv)(GLenum face, GLenum pname, const GLfloat * params); /* 170 */
|
||||
void (GLAPIENTRYP Materiali)(GLenum face, GLenum pname, GLint param); /* 171 */
|
||||
void (GLAPIENTRYP Materialiv)(GLenum face, GLenum pname, const GLint * params); /* 172 */
|
||||
void (GLAPIENTRYP PointSize)(GLfloat size); /* 173 */
|
||||
void (GLAPIENTRYP PolygonMode)(GLenum face, GLenum mode); /* 174 */
|
||||
void (GLAPIENTRYP PolygonStipple)(const GLubyte * mask); /* 175 */
|
||||
void (GLAPIENTRYP Scissor)(GLint x, GLint y, GLsizei width, GLsizei height); /* 176 */
|
||||
void (GLAPIENTRYP ShadeModel)(GLenum mode); /* 177 */
|
||||
void (GLAPIENTRYP TexParameterf)(GLenum target, GLenum pname, GLfloat param); /* 178 */
|
||||
void (GLAPIENTRYP TexParameterfv)(GLenum target, GLenum pname, const GLfloat * params); /* 179 */
|
||||
void (GLAPIENTRYP TexParameteri)(GLenum target, GLenum pname, GLint param); /* 180 */
|
||||
void (GLAPIENTRYP TexParameteriv)(GLenum target, GLenum pname, const GLint * params); /* 181 */
|
||||
void (GLAPIENTRYP TexImage1D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid * pixels); /* 182 */
|
||||
void (GLAPIENTRYP TexImage2D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid * pixels); /* 183 */
|
||||
void (GLAPIENTRYP TexEnvf)(GLenum target, GLenum pname, GLfloat param); /* 184 */
|
||||
void (GLAPIENTRYP TexEnvfv)(GLenum target, GLenum pname, const GLfloat * params); /* 185 */
|
||||
void (GLAPIENTRYP TexEnvi)(GLenum target, GLenum pname, GLint param); /* 186 */
|
||||
void (GLAPIENTRYP TexEnviv)(GLenum target, GLenum pname, const GLint * params); /* 187 */
|
||||
void (GLAPIENTRYP TexGend)(GLenum coord, GLenum pname, GLdouble param); /* 188 */
|
||||
void (GLAPIENTRYP TexGendv)(GLenum coord, GLenum pname, const GLdouble * params); /* 189 */
|
||||
void (GLAPIENTRYP TexGenf)(GLenum coord, GLenum pname, GLfloat param); /* 190 */
|
||||
void (GLAPIENTRYP TexGenfv)(GLenum coord, GLenum pname, const GLfloat * params); /* 191 */
|
||||
void (GLAPIENTRYP TexGeni)(GLenum coord, GLenum pname, GLint param); /* 192 */
|
||||
void (GLAPIENTRYP TexGeniv)(GLenum coord, GLenum pname, const GLint * params); /* 193 */
|
||||
void (GLAPIENTRYP FeedbackBuffer)(GLsizei size, GLenum type, GLfloat * buffer); /* 194 */
|
||||
void (GLAPIENTRYP SelectBuffer)(GLsizei size, GLuint * buffer); /* 195 */
|
||||
GLint (GLAPIENTRYP RenderMode)(GLenum mode); /* 196 */
|
||||
void (GLAPIENTRYP InitNames)(void); /* 197 */
|
||||
void (GLAPIENTRYP LoadName)(GLuint name); /* 198 */
|
||||
void (GLAPIENTRYP PassThrough)(GLfloat token); /* 199 */
|
||||
void (GLAPIENTRYP PopName)(void); /* 200 */
|
||||
void (GLAPIENTRYP PushName)(GLuint name); /* 201 */
|
||||
void (GLAPIENTRYP DrawBuffer)(GLenum mode); /* 202 */
|
||||
void (GLAPIENTRYP Clear)(GLbitfield mask); /* 203 */
|
||||
void (GLAPIENTRYP ClearAccum)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); /* 204 */
|
||||
void (GLAPIENTRYP ClearIndex)(GLfloat c); /* 205 */
|
||||
void (GLAPIENTRYP ClearColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); /* 206 */
|
||||
void (GLAPIENTRYP ClearStencil)(GLint s); /* 207 */
|
||||
void (GLAPIENTRYP ClearDepth)(GLclampd depth); /* 208 */
|
||||
void (GLAPIENTRYP StencilMask)(GLuint mask); /* 209 */
|
||||
void (GLAPIENTRYP ColorMask)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); /* 210 */
|
||||
void (GLAPIENTRYP DepthMask)(GLboolean flag); /* 211 */
|
||||
void (GLAPIENTRYP IndexMask)(GLuint mask); /* 212 */
|
||||
void (GLAPIENTRYP Accum)(GLenum op, GLfloat value); /* 213 */
|
||||
void (GLAPIENTRYP Disable)(GLenum cap); /* 214 */
|
||||
void (GLAPIENTRYP Enable)(GLenum cap); /* 215 */
|
||||
void (GLAPIENTRYP Finish)(void); /* 216 */
|
||||
void (GLAPIENTRYP Flush)(void); /* 217 */
|
||||
void (GLAPIENTRYP PopAttrib)(void); /* 218 */
|
||||
void (GLAPIENTRYP PushAttrib)(GLbitfield mask); /* 219 */
|
||||
void (GLAPIENTRYP Map1d)(GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble * points); /* 220 */
|
||||
void (GLAPIENTRYP Map1f)(GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat * points); /* 221 */
|
||||
void (GLAPIENTRYP Map2d)(GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble * points); /* 222 */
|
||||
void (GLAPIENTRYP Map2f)(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat * points); /* 223 */
|
||||
void (GLAPIENTRYP MapGrid1d)(GLint un, GLdouble u1, GLdouble u2); /* 224 */
|
||||
void (GLAPIENTRYP MapGrid1f)(GLint un, GLfloat u1, GLfloat u2); /* 225 */
|
||||
void (GLAPIENTRYP MapGrid2d)(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2); /* 226 */
|
||||
void (GLAPIENTRYP MapGrid2f)(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2); /* 227 */
|
||||
void (GLAPIENTRYP EvalCoord1d)(GLdouble u); /* 228 */
|
||||
void (GLAPIENTRYP EvalCoord1dv)(const GLdouble * u); /* 229 */
|
||||
void (GLAPIENTRYP EvalCoord1f)(GLfloat u); /* 230 */
|
||||
void (GLAPIENTRYP EvalCoord1fv)(const GLfloat * u); /* 231 */
|
||||
void (GLAPIENTRYP EvalCoord2d)(GLdouble u, GLdouble v); /* 232 */
|
||||
void (GLAPIENTRYP EvalCoord2dv)(const GLdouble * u); /* 233 */
|
||||
void (GLAPIENTRYP EvalCoord2f)(GLfloat u, GLfloat v); /* 234 */
|
||||
void (GLAPIENTRYP EvalCoord2fv)(const GLfloat * u); /* 235 */
|
||||
void (GLAPIENTRYP EvalMesh1)(GLenum mode, GLint i1, GLint i2); /* 236 */
|
||||
void (GLAPIENTRYP EvalPoint1)(GLint i); /* 237 */
|
||||
void (GLAPIENTRYP EvalMesh2)(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2); /* 238 */
|
||||
void (GLAPIENTRYP EvalPoint2)(GLint i, GLint j); /* 239 */
|
||||
void (GLAPIENTRYP AlphaFunc)(GLenum func, GLclampf ref); /* 240 */
|
||||
void (GLAPIENTRYP BlendFunc)(GLenum sfactor, GLenum dfactor); /* 241 */
|
||||
void (GLAPIENTRYP LogicOp)(GLenum opcode); /* 242 */
|
||||
void (GLAPIENTRYP StencilFunc)(GLenum func, GLint ref, GLuint mask); /* 243 */
|
||||
void (GLAPIENTRYP StencilOp)(GLenum fail, GLenum zfail, GLenum zpass); /* 244 */
|
||||
void (GLAPIENTRYP DepthFunc)(GLenum func); /* 245 */
|
||||
void (GLAPIENTRYP PixelZoom)(GLfloat xfactor, GLfloat yfactor); /* 246 */
|
||||
void (GLAPIENTRYP PixelTransferf)(GLenum pname, GLfloat param); /* 247 */
|
||||
void (GLAPIENTRYP PixelTransferi)(GLenum pname, GLint param); /* 248 */
|
||||
void (GLAPIENTRYP PixelStoref)(GLenum pname, GLfloat param); /* 249 */
|
||||
void (GLAPIENTRYP PixelStorei)(GLenum pname, GLint param); /* 250 */
|
||||
void (GLAPIENTRYP PixelMapfv)(GLenum map, GLsizei mapsize, const GLfloat * values); /* 251 */
|
||||
void (GLAPIENTRYP PixelMapuiv)(GLenum map, GLsizei mapsize, const GLuint * values); /* 252 */
|
||||
void (GLAPIENTRYP PixelMapusv)(GLenum map, GLsizei mapsize, const GLushort * values); /* 253 */
|
||||
void (GLAPIENTRYP ReadBuffer)(GLenum mode); /* 254 */
|
||||
void (GLAPIENTRYP CopyPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type); /* 255 */
|
||||
void (GLAPIENTRYP ReadPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid * pixels); /* 256 */
|
||||
void (GLAPIENTRYP DrawPixels)(GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels); /* 257 */
|
||||
void (GLAPIENTRYP GetBooleanv)(GLenum pname, GLboolean * params); /* 258 */
|
||||
void (GLAPIENTRYP GetClipPlane)(GLenum plane, GLdouble * equation); /* 259 */
|
||||
void (GLAPIENTRYP GetDoublev)(GLenum pname, GLdouble * params); /* 260 */
|
||||
GLenum (GLAPIENTRYP GetError)(void); /* 261 */
|
||||
void (GLAPIENTRYP GetFloatv)(GLenum pname, GLfloat * params); /* 262 */
|
||||
void (GLAPIENTRYP GetIntegerv)(GLenum pname, GLint * params); /* 263 */
|
||||
void (GLAPIENTRYP GetLightfv)(GLenum light, GLenum pname, GLfloat * params); /* 264 */
|
||||
void (GLAPIENTRYP GetLightiv)(GLenum light, GLenum pname, GLint * params); /* 265 */
|
||||
void (GLAPIENTRYP GetMapdv)(GLenum target, GLenum query, GLdouble * v); /* 266 */
|
||||
void (GLAPIENTRYP GetMapfv)(GLenum target, GLenum query, GLfloat * v); /* 267 */
|
||||
void (GLAPIENTRYP GetMapiv)(GLenum target, GLenum query, GLint * v); /* 268 */
|
||||
void (GLAPIENTRYP GetMaterialfv)(GLenum face, GLenum pname, GLfloat * params); /* 269 */
|
||||
void (GLAPIENTRYP GetMaterialiv)(GLenum face, GLenum pname, GLint * params); /* 270 */
|
||||
void (GLAPIENTRYP GetPixelMapfv)(GLenum map, GLfloat * values); /* 271 */
|
||||
void (GLAPIENTRYP GetPixelMapuiv)(GLenum map, GLuint * values); /* 272 */
|
||||
void (GLAPIENTRYP GetPixelMapusv)(GLenum map, GLushort * values); /* 273 */
|
||||
void (GLAPIENTRYP GetPolygonStipple)(GLubyte * mask); /* 274 */
|
||||
const GLubyte * (GLAPIENTRYP GetString)(GLenum name); /* 275 */
|
||||
void (GLAPIENTRYP GetTexEnvfv)(GLenum target, GLenum pname, GLfloat * params); /* 276 */
|
||||
void (GLAPIENTRYP GetTexEnviv)(GLenum target, GLenum pname, GLint * params); /* 277 */
|
||||
void (GLAPIENTRYP GetTexGendv)(GLenum coord, GLenum pname, GLdouble * params); /* 278 */
|
||||
void (GLAPIENTRYP GetTexGenfv)(GLenum coord, GLenum pname, GLfloat * params); /* 279 */
|
||||
void (GLAPIENTRYP GetTexGeniv)(GLenum coord, GLenum pname, GLint * params); /* 280 */
|
||||
void (GLAPIENTRYP GetTexImage)(GLenum target, GLint level, GLenum format, GLenum type, GLvoid * pixels); /* 281 */
|
||||
void (GLAPIENTRYP GetTexParameterfv)(GLenum target, GLenum pname, GLfloat * params); /* 282 */
|
||||
void (GLAPIENTRYP GetTexParameteriv)(GLenum target, GLenum pname, GLint * params); /* 283 */
|
||||
void (GLAPIENTRYP GetTexLevelParameterfv)(GLenum target, GLint level, GLenum pname, GLfloat * params); /* 284 */
|
||||
void (GLAPIENTRYP GetTexLevelParameteriv)(GLenum target, GLint level, GLenum pname, GLint * params); /* 285 */
|
||||
GLboolean (GLAPIENTRYP IsEnabled)(GLenum cap); /* 286 */
|
||||
GLboolean (GLAPIENTRYP IsList)(GLuint list); /* 287 */
|
||||
void (GLAPIENTRYP DepthRange)(GLclampd zNear, GLclampd zFar); /* 288 */
|
||||
void (GLAPIENTRYP Frustum)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); /* 289 */
|
||||
void (GLAPIENTRYP LoadIdentity)(void); /* 290 */
|
||||
void (GLAPIENTRYP LoadMatrixf)(const GLfloat * m); /* 291 */
|
||||
void (GLAPIENTRYP LoadMatrixd)(const GLdouble * m); /* 292 */
|
||||
void (GLAPIENTRYP MatrixMode)(GLenum mode); /* 293 */
|
||||
void (GLAPIENTRYP MultMatrixf)(const GLfloat * m); /* 294 */
|
||||
void (GLAPIENTRYP MultMatrixd)(const GLdouble * m); /* 295 */
|
||||
void (GLAPIENTRYP Ortho)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); /* 296 */
|
||||
void (GLAPIENTRYP PopMatrix)(void); /* 297 */
|
||||
void (GLAPIENTRYP PushMatrix)(void); /* 298 */
|
||||
void (GLAPIENTRYP Rotated)(GLdouble angle, GLdouble x, GLdouble y, GLdouble z); /* 299 */
|
||||
void (GLAPIENTRYP Rotatef)(GLfloat angle, GLfloat x, GLfloat y, GLfloat z); /* 300 */
|
||||
void (GLAPIENTRYP Scaled)(GLdouble x, GLdouble y, GLdouble z); /* 301 */
|
||||
void (GLAPIENTRYP Scalef)(GLfloat x, GLfloat y, GLfloat z); /* 302 */
|
||||
void (GLAPIENTRYP Translated)(GLdouble x, GLdouble y, GLdouble z); /* 303 */
|
||||
void (GLAPIENTRYP Translatef)(GLfloat x, GLfloat y, GLfloat z); /* 304 */
|
||||
void (GLAPIENTRYP Viewport)(GLint x, GLint y, GLsizei width, GLsizei height); /* 305 */
|
||||
void (GLAPIENTRYP ArrayElement)(GLint i); /* 306 */
|
||||
void (GLAPIENTRYP BindTexture)(GLenum target, GLuint texture); /* 307 */
|
||||
void (GLAPIENTRYP ColorPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 308 */
|
||||
void (GLAPIENTRYP DisableClientState)(GLenum array); /* 309 */
|
||||
void (GLAPIENTRYP DrawArrays)(GLenum mode, GLint first, GLsizei count); /* 310 */
|
||||
void (GLAPIENTRYP DrawElements)(GLenum mode, GLsizei count, GLenum type, const GLvoid * indices); /* 311 */
|
||||
void (GLAPIENTRYP EdgeFlagPointer)(GLsizei stride, const GLvoid * pointer); /* 312 */
|
||||
void (GLAPIENTRYP EnableClientState)(GLenum array); /* 313 */
|
||||
void (GLAPIENTRYP IndexPointer)(GLenum type, GLsizei stride, const GLvoid * pointer); /* 314 */
|
||||
void (GLAPIENTRYP Indexub)(GLubyte c); /* 315 */
|
||||
void (GLAPIENTRYP Indexubv)(const GLubyte * c); /* 316 */
|
||||
void (GLAPIENTRYP InterleavedArrays)(GLenum format, GLsizei stride, const GLvoid * pointer); /* 317 */
|
||||
void (GLAPIENTRYP NormalPointer)(GLenum type, GLsizei stride, const GLvoid * pointer); /* 318 */
|
||||
void (GLAPIENTRYP PolygonOffset)(GLfloat factor, GLfloat units); /* 319 */
|
||||
void (GLAPIENTRYP TexCoordPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 320 */
|
||||
void (GLAPIENTRYP VertexPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 321 */
|
||||
GLboolean (GLAPIENTRYP AreTexturesResident)(GLsizei n, const GLuint * textures, GLboolean * residences); /* 322 */
|
||||
void (GLAPIENTRYP CopyTexImage1D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); /* 323 */
|
||||
void (GLAPIENTRYP CopyTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); /* 324 */
|
||||
void (GLAPIENTRYP CopyTexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); /* 325 */
|
||||
void (GLAPIENTRYP CopyTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); /* 326 */
|
||||
void (GLAPIENTRYP DeleteTextures)(GLsizei n, const GLuint * textures); /* 327 */
|
||||
void (GLAPIENTRYP GenTextures)(GLsizei n, GLuint * textures); /* 328 */
|
||||
void (GLAPIENTRYP GetPointerv)(GLenum pname, GLvoid ** params); /* 329 */
|
||||
GLboolean (GLAPIENTRYP IsTexture)(GLuint texture); /* 330 */
|
||||
void (GLAPIENTRYP PrioritizeTextures)(GLsizei n, const GLuint * textures, const GLclampf * priorities); /* 331 */
|
||||
void (GLAPIENTRYP TexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid * pixels); /* 332 */
|
||||
void (GLAPIENTRYP TexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels); /* 333 */
|
||||
void (GLAPIENTRYP PopClientAttrib)(void); /* 334 */
|
||||
void (GLAPIENTRYP PushClientAttrib)(GLbitfield mask); /* 335 */
|
||||
void (GLAPIENTRYP BlendColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); /* 336 */
|
||||
void (GLAPIENTRYP BlendEquation)(GLenum mode); /* 337 */
|
||||
void (GLAPIENTRYP DrawRangeElements)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid * indices); /* 338 */
|
||||
void (GLAPIENTRYP ColorTable)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * table); /* 339 */
|
||||
void (GLAPIENTRYP ColorTableParameterfv)(GLenum target, GLenum pname, const GLfloat * params); /* 340 */
|
||||
void (GLAPIENTRYP ColorTableParameteriv)(GLenum target, GLenum pname, const GLint * params); /* 341 */
|
||||
void (GLAPIENTRYP CopyColorTable)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); /* 342 */
|
||||
void (GLAPIENTRYP GetColorTable)(GLenum target, GLenum format, GLenum type, GLvoid * table); /* 343 */
|
||||
void (GLAPIENTRYP GetColorTableParameterfv)(GLenum target, GLenum pname, GLfloat * params); /* 344 */
|
||||
void (GLAPIENTRYP GetColorTableParameteriv)(GLenum target, GLenum pname, GLint * params); /* 345 */
|
||||
void (GLAPIENTRYP ColorSubTable)(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid * data); /* 346 */
|
||||
void (GLAPIENTRYP CopyColorSubTable)(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); /* 347 */
|
||||
void (GLAPIENTRYP ConvolutionFilter1D)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * image); /* 348 */
|
||||
void (GLAPIENTRYP ConvolutionFilter2D)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * image); /* 349 */
|
||||
void (GLAPIENTRYP ConvolutionParameterf)(GLenum target, GLenum pname, GLfloat params); /* 350 */
|
||||
void (GLAPIENTRYP ConvolutionParameterfv)(GLenum target, GLenum pname, const GLfloat * params); /* 351 */
|
||||
void (GLAPIENTRYP ConvolutionParameteri)(GLenum target, GLenum pname, GLint params); /* 352 */
|
||||
void (GLAPIENTRYP ConvolutionParameteriv)(GLenum target, GLenum pname, const GLint * params); /* 353 */
|
||||
void (GLAPIENTRYP CopyConvolutionFilter1D)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); /* 354 */
|
||||
void (GLAPIENTRYP CopyConvolutionFilter2D)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); /* 355 */
|
||||
void (GLAPIENTRYP GetConvolutionFilter)(GLenum target, GLenum format, GLenum type, GLvoid * image); /* 356 */
|
||||
void (GLAPIENTRYP GetConvolutionParameterfv)(GLenum target, GLenum pname, GLfloat * params); /* 357 */
|
||||
void (GLAPIENTRYP GetConvolutionParameteriv)(GLenum target, GLenum pname, GLint * params); /* 358 */
|
||||
void (GLAPIENTRYP GetSeparableFilter)(GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span); /* 359 */
|
||||
void (GLAPIENTRYP SeparableFilter2D)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * row, const GLvoid * column); /* 360 */
|
||||
void (GLAPIENTRYP GetHistogram)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values); /* 361 */
|
||||
void (GLAPIENTRYP GetHistogramParameterfv)(GLenum target, GLenum pname, GLfloat * params); /* 362 */
|
||||
void (GLAPIENTRYP GetHistogramParameteriv)(GLenum target, GLenum pname, GLint * params); /* 363 */
|
||||
void (GLAPIENTRYP GetMinmax)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values); /* 364 */
|
||||
void (GLAPIENTRYP GetMinmaxParameterfv)(GLenum target, GLenum pname, GLfloat * params); /* 365 */
|
||||
void (GLAPIENTRYP GetMinmaxParameteriv)(GLenum target, GLenum pname, GLint * params); /* 366 */
|
||||
void (GLAPIENTRYP Histogram)(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); /* 367 */
|
||||
void (GLAPIENTRYP Minmax)(GLenum target, GLenum internalformat, GLboolean sink); /* 368 */
|
||||
void (GLAPIENTRYP ResetHistogram)(GLenum target); /* 369 */
|
||||
void (GLAPIENTRYP ResetMinmax)(GLenum target); /* 370 */
|
||||
void (GLAPIENTRYP TexImage3DOES)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid * pixels); /* 371 */
|
||||
void (GLAPIENTRYP TexSubImage3DOES)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid * pixels); /* 372 */
|
||||
void (GLAPIENTRYP CopyTexSubImage3DOES)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); /* 373 */
|
||||
void (GLAPIENTRYP ActiveTexture)(GLenum texture); /* 374 */
|
||||
void (GLAPIENTRYP ClientActiveTextureARB)(GLenum texture); /* 375 */
|
||||
void (GLAPIENTRYP MultiTexCoord1dARB)(GLenum target, GLdouble s); /* 376 */
|
||||
void (GLAPIENTRYP MultiTexCoord1dvARB)(GLenum target, const GLdouble * v); /* 377 */
|
||||
void (GLAPIENTRYP MultiTexCoord1fARB)(GLenum target, GLfloat s); /* 378 */
|
||||
void (GLAPIENTRYP MultiTexCoord1fvARB)(GLenum target, const GLfloat * v); /* 379 */
|
||||
void (GLAPIENTRYP MultiTexCoord1iARB)(GLenum target, GLint s); /* 380 */
|
||||
void (GLAPIENTRYP MultiTexCoord1ivARB)(GLenum target, const GLint * v); /* 381 */
|
||||
void (GLAPIENTRYP MultiTexCoord1sARB)(GLenum target, GLshort s); /* 382 */
|
||||
void (GLAPIENTRYP MultiTexCoord1svARB)(GLenum target, const GLshort * v); /* 383 */
|
||||
void (GLAPIENTRYP MultiTexCoord2dARB)(GLenum target, GLdouble s, GLdouble t); /* 384 */
|
||||
void (GLAPIENTRYP MultiTexCoord2dvARB)(GLenum target, const GLdouble * v); /* 385 */
|
||||
void (GLAPIENTRYP MultiTexCoord2fARB)(GLenum target, GLfloat s, GLfloat t); /* 386 */
|
||||
void (GLAPIENTRYP MultiTexCoord2fvARB)(GLenum target, const GLfloat * v); /* 387 */
|
||||
void (GLAPIENTRYP MultiTexCoord2iARB)(GLenum target, GLint s, GLint t); /* 388 */
|
||||
void (GLAPIENTRYP MultiTexCoord2ivARB)(GLenum target, const GLint * v); /* 389 */
|
||||
void (GLAPIENTRYP MultiTexCoord2sARB)(GLenum target, GLshort s, GLshort t); /* 390 */
|
||||
void (GLAPIENTRYP MultiTexCoord2svARB)(GLenum target, const GLshort * v); /* 391 */
|
||||
void (GLAPIENTRYP MultiTexCoord3dARB)(GLenum target, GLdouble s, GLdouble t, GLdouble r); /* 392 */
|
||||
void (GLAPIENTRYP MultiTexCoord3dvARB)(GLenum target, const GLdouble * v); /* 393 */
|
||||
void (GLAPIENTRYP MultiTexCoord3fARB)(GLenum target, GLfloat s, GLfloat t, GLfloat r); /* 394 */
|
||||
void (GLAPIENTRYP MultiTexCoord3fvARB)(GLenum target, const GLfloat * v); /* 395 */
|
||||
void (GLAPIENTRYP MultiTexCoord3iARB)(GLenum target, GLint s, GLint t, GLint r); /* 396 */
|
||||
void (GLAPIENTRYP MultiTexCoord3ivARB)(GLenum target, const GLint * v); /* 397 */
|
||||
void (GLAPIENTRYP MultiTexCoord3sARB)(GLenum target, GLshort s, GLshort t, GLshort r); /* 398 */
|
||||
void (GLAPIENTRYP MultiTexCoord3svARB)(GLenum target, const GLshort * v); /* 399 */
|
||||
void (GLAPIENTRYP MultiTexCoord4dARB)(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); /* 400 */
|
||||
void (GLAPIENTRYP MultiTexCoord4dvARB)(GLenum target, const GLdouble * v); /* 401 */
|
||||
void (GLAPIENTRYP MultiTexCoord4fARB)(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); /* 402 */
|
||||
void (GLAPIENTRYP MultiTexCoord4fvARB)(GLenum target, const GLfloat * v); /* 403 */
|
||||
void (GLAPIENTRYP MultiTexCoord4iARB)(GLenum target, GLint s, GLint t, GLint r, GLint q); /* 404 */
|
||||
void (GLAPIENTRYP MultiTexCoord4ivARB)(GLenum target, const GLint * v); /* 405 */
|
||||
void (GLAPIENTRYP MultiTexCoord4sARB)(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); /* 406 */
|
||||
void (GLAPIENTRYP MultiTexCoord4svARB)(GLenum target, const GLshort * v); /* 407 */
|
||||
void (GLAPIENTRYP GetBufferPointervOES)(GLenum target, GLenum pname, GLvoid ** params); /* 408 */
|
||||
GLvoid * (GLAPIENTRYP MapBufferOES)(GLenum target, GLenum access); /* 409 */
|
||||
GLboolean (GLAPIENTRYP UnmapBufferOES)(GLenum target); /* 410 */
|
||||
void (GLAPIENTRYP CompressedTexImage3DOES)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid * data); /* 411 */
|
||||
void (GLAPIENTRYP CompressedTexSubImage3DOES)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid * data); /* 412 */
|
||||
void (GLAPIENTRYP FramebufferTexture3DOES)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); /* 413 */
|
||||
void (GLAPIENTRYP GetProgramBinaryOES)(GLuint program, GLsizei bufSize, GLsizei * length, GLenum * binaryFormat, GLvoid * binary); /* 414 */
|
||||
void (GLAPIENTRYP ProgramBinaryOES)(GLuint program, GLenum binaryFormat, const GLvoid * binary, GLint length); /* 415 */
|
||||
void (GLAPIENTRYP MultiDrawArraysEXT)(GLenum mode, const GLint * first, const GLsizei * count, GLsizei primcount); /* 416 */
|
||||
void (GLAPIENTRYP MultiDrawElementsEXT)(GLenum mode, const GLsizei * count, GLenum type, const GLvoid ** indices, GLsizei primcount); /* 417 */
|
||||
void (GLAPIENTRYP BindVertexArrayAPPLE)(GLuint array); /* 418 */
|
||||
void (GLAPIENTRYP DeleteVertexArraysAPPLE)(GLsizei n, const GLuint * arrays); /* 419 */
|
||||
void (GLAPIENTRYP GenVertexArraysAPPLE)(GLsizei n, GLuint * arrays); /* 420 */
|
||||
GLboolean (GLAPIENTRYP IsVertexArrayAPPLE)(GLuint array); /* 421 */
|
||||
void (GLAPIENTRYP EGLImageTargetRenderbufferStorageOES)(GLenum target, GLvoid * writeOffset); /* 422 */
|
||||
void (GLAPIENTRYP EGLImageTargetTexture2DOES)(GLenum target, GLvoid * writeOffset); /* 423 */
|
||||
void (GLAPIENTRYP CompressedTexImage2D)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid * data); /* 424 */
|
||||
void (GLAPIENTRYP CompressedTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid * data); /* 425 */
|
||||
void (GLAPIENTRYP SampleCoverage)(GLclampf value, GLboolean invert); /* 426 */
|
||||
void (GLAPIENTRYP BindBuffer)(GLenum target, GLuint buffer); /* 427 */
|
||||
void (GLAPIENTRYP BufferData)(GLenum target, GLsizeiptr size, const GLvoid * data, GLenum usage); /* 428 */
|
||||
void (GLAPIENTRYP BufferSubData)(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid * data); /* 429 */
|
||||
void (GLAPIENTRYP DeleteBuffers)(GLsizei n, const GLuint * buffer); /* 430 */
|
||||
void (GLAPIENTRYP GenBuffers)(GLsizei n, GLuint * buffer); /* 431 */
|
||||
void (GLAPIENTRYP GetBufferParameteriv)(GLenum target, GLenum pname, GLint * params); /* 432 */
|
||||
GLboolean (GLAPIENTRYP IsBuffer)(GLuint buffer); /* 433 */
|
||||
void (GLAPIENTRYP AttachShader)(GLuint program, GLuint shader); /* 434 */
|
||||
void (GLAPIENTRYP BindAttribLocation)(GLuint program, GLuint index, const GLchar * name); /* 435 */
|
||||
void (GLAPIENTRYP BlendEquationSeparate)(GLenum modeRGB, GLenum modeA); /* 436 */
|
||||
void (GLAPIENTRYP CompileShader)(GLuint shader); /* 437 */
|
||||
GLuint (GLAPIENTRYP CreateProgram)(void); /* 438 */
|
||||
GLuint (GLAPIENTRYP CreateShader)(GLenum type); /* 439 */
|
||||
void (GLAPIENTRYP DeleteProgram)(GLuint program); /* 440 */
|
||||
void (GLAPIENTRYP DeleteShader)(GLuint program); /* 441 */
|
||||
void (GLAPIENTRYP DetachShader)(GLuint program, GLuint shader); /* 442 */
|
||||
void (GLAPIENTRYP DisableVertexAttribArray)(GLuint index); /* 443 */
|
||||
void (GLAPIENTRYP EnableVertexAttribArray)(GLuint index); /* 444 */
|
||||
void (GLAPIENTRYP GetActiveAttrib)(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLchar * name); /* 445 */
|
||||
void (GLAPIENTRYP GetActiveUniform)(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLchar * name); /* 446 */
|
||||
void (GLAPIENTRYP GetAttachedShaders)(GLuint program, GLsizei maxCount, GLsizei * count, GLuint * obj); /* 447 */
|
||||
GLint (GLAPIENTRYP GetAttribLocation)(GLuint program, const GLchar * name); /* 448 */
|
||||
void (GLAPIENTRYP GetProgramInfoLog)(GLuint program, GLsizei bufSize, GLsizei * length, GLchar * infoLog); /* 449 */
|
||||
void (GLAPIENTRYP GetProgramiv)(GLuint program, GLenum pname, GLint * params); /* 450 */
|
||||
void (GLAPIENTRYP GetShaderInfoLog)(GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * infoLog); /* 451 */
|
||||
void (GLAPIENTRYP GetShaderSource)(GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * source); /* 452 */
|
||||
void (GLAPIENTRYP GetShaderiv)(GLuint shader, GLenum pname, GLint * params); /* 453 */
|
||||
GLint (GLAPIENTRYP GetUniformLocation)(GLuint program, const GLchar * name); /* 454 */
|
||||
void (GLAPIENTRYP GetUniformfv)(GLuint program, GLint location, GLfloat * params); /* 455 */
|
||||
void (GLAPIENTRYP GetUniformiv)(GLuint program, GLint location, GLint * params); /* 456 */
|
||||
void (GLAPIENTRYP GetVertexAttribPointerv)(GLuint index, GLenum pname, GLvoid ** pointer); /* 457 */
|
||||
void (GLAPIENTRYP GetVertexAttribfv)(GLuint index, GLenum pname, GLfloat * params); /* 458 */
|
||||
void (GLAPIENTRYP GetVertexAttribiv)(GLuint index, GLenum pname, GLint * params); /* 459 */
|
||||
GLboolean (GLAPIENTRYP IsProgram)(GLuint program); /* 460 */
|
||||
GLboolean (GLAPIENTRYP IsShader)(GLuint shader); /* 461 */
|
||||
void (GLAPIENTRYP LinkProgram)(GLuint program); /* 462 */
|
||||
void (GLAPIENTRYP ShaderSource)(GLuint shader, GLsizei count, const GLchar ** string, const GLint * length); /* 463 */
|
||||
void (GLAPIENTRYP StencilFuncSeparate)(GLenum face, GLenum func, GLint ref, GLuint mask); /* 464 */
|
||||
void (GLAPIENTRYP StencilMaskSeparate)(GLenum face, GLuint mask); /* 465 */
|
||||
void (GLAPIENTRYP StencilOpSeparate)(GLenum face, GLenum sfail, GLenum zfail, GLenum zpass); /* 466 */
|
||||
void (GLAPIENTRYP Uniform1f)(GLint location, GLfloat v0); /* 467 */
|
||||
void (GLAPIENTRYP Uniform1fv)(GLint location, GLsizei count, const GLfloat * value); /* 468 */
|
||||
void (GLAPIENTRYP Uniform1i)(GLint location, GLint v0); /* 469 */
|
||||
void (GLAPIENTRYP Uniform1iv)(GLint location, GLsizei count, const GLint * value); /* 470 */
|
||||
void (GLAPIENTRYP Uniform2f)(GLint location, GLfloat v0, GLfloat v1); /* 471 */
|
||||
void (GLAPIENTRYP Uniform2fv)(GLint location, GLsizei count, const GLfloat * value); /* 472 */
|
||||
void (GLAPIENTRYP Uniform2i)(GLint location, GLint v0, GLint v1); /* 473 */
|
||||
void (GLAPIENTRYP Uniform2iv)(GLint location, GLsizei count, const GLint * value); /* 474 */
|
||||
void (GLAPIENTRYP Uniform3f)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2); /* 475 */
|
||||
void (GLAPIENTRYP Uniform3fv)(GLint location, GLsizei count, const GLfloat * value); /* 476 */
|
||||
void (GLAPIENTRYP Uniform3i)(GLint location, GLint v0, GLint v1, GLint v2); /* 477 */
|
||||
void (GLAPIENTRYP Uniform3iv)(GLint location, GLsizei count, const GLint * value); /* 478 */
|
||||
void (GLAPIENTRYP Uniform4f)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); /* 479 */
|
||||
void (GLAPIENTRYP Uniform4fv)(GLint location, GLsizei count, const GLfloat * value); /* 480 */
|
||||
void (GLAPIENTRYP Uniform4i)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3); /* 481 */
|
||||
void (GLAPIENTRYP Uniform4iv)(GLint location, GLsizei count, const GLint * value); /* 482 */
|
||||
void (GLAPIENTRYP UniformMatrix2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 483 */
|
||||
void (GLAPIENTRYP UniformMatrix3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 484 */
|
||||
void (GLAPIENTRYP UniformMatrix4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 485 */
|
||||
void (GLAPIENTRYP UseProgram)(GLuint program); /* 486 */
|
||||
void (GLAPIENTRYP ValidateProgram)(GLuint program); /* 487 */
|
||||
void (GLAPIENTRYP VertexAttrib1f)(GLuint index, GLfloat x); /* 488 */
|
||||
void (GLAPIENTRYP VertexAttrib1fv)(GLuint index, const GLfloat * v); /* 489 */
|
||||
void (GLAPIENTRYP VertexAttrib2f)(GLuint index, GLfloat x, GLfloat y); /* 490 */
|
||||
void (GLAPIENTRYP VertexAttrib2fv)(GLuint index, const GLfloat * v); /* 491 */
|
||||
void (GLAPIENTRYP VertexAttrib3f)(GLuint index, GLfloat x, GLfloat y, GLfloat z); /* 492 */
|
||||
void (GLAPIENTRYP VertexAttrib3fv)(GLuint index, const GLfloat * v); /* 493 */
|
||||
void (GLAPIENTRYP VertexAttrib4f)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 494 */
|
||||
void (GLAPIENTRYP VertexAttrib4fv)(GLuint index, const GLfloat * v); /* 495 */
|
||||
void (GLAPIENTRYP VertexAttribPointer)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid * pointer); /* 496 */
|
||||
void (GLAPIENTRYP BlendFuncSeparate)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); /* 497 */
|
||||
void (GLAPIENTRYP BindFramebuffer)(GLenum target, GLuint framebuffer); /* 498 */
|
||||
void (GLAPIENTRYP BindRenderbuffer)(GLenum target, GLuint renderbuffer); /* 499 */
|
||||
GLenum (GLAPIENTRYP CheckFramebufferStatus)(GLenum target); /* 500 */
|
||||
void (GLAPIENTRYP ClearDepthf)(GLclampf depth); /* 501 */
|
||||
void (GLAPIENTRYP DeleteFramebuffers)(GLsizei n, const GLuint * framebuffers); /* 502 */
|
||||
void (GLAPIENTRYP DeleteRenderbuffers)(GLsizei n, const GLuint * renderbuffers); /* 503 */
|
||||
void (GLAPIENTRYP DepthRangef)(GLclampf zNear, GLclampf zFar); /* 504 */
|
||||
void (GLAPIENTRYP FramebufferRenderbuffer)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); /* 505 */
|
||||
void (GLAPIENTRYP FramebufferTexture2D)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); /* 506 */
|
||||
void (GLAPIENTRYP GenFramebuffers)(GLsizei n, GLuint * framebuffers); /* 507 */
|
||||
void (GLAPIENTRYP GenRenderbuffers)(GLsizei n, GLuint * renderbuffers); /* 508 */
|
||||
void (GLAPIENTRYP GenerateMipmap)(GLenum target); /* 509 */
|
||||
void (GLAPIENTRYP GetFramebufferAttachmentParameteriv)(GLenum target, GLenum attachment, GLenum pname, GLint * params); /* 510 */
|
||||
void (GLAPIENTRYP GetRenderbufferParameteriv)(GLenum target, GLenum pname, GLint * params); /* 511 */
|
||||
void (GLAPIENTRYP GetShaderPrecisionFormat)(GLenum shadertype, GLenum precisiontype, GLint * range, GLint * precision); /* 512 */
|
||||
GLboolean (GLAPIENTRYP IsFramebuffer)(GLuint framebuffer); /* 513 */
|
||||
GLboolean (GLAPIENTRYP IsRenderbuffer)(GLuint renderbuffer); /* 514 */
|
||||
void (GLAPIENTRYP ReleaseShaderCompiler)(void); /* 515 */
|
||||
void (GLAPIENTRYP RenderbufferStorage)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height); /* 516 */
|
||||
void (GLAPIENTRYP ShaderBinary)(GLsizei n, const GLuint * shaders, GLenum binaryformat, const GLvoid * binary, GLsizei length); /* 517 */
|
||||
};
|
||||
|
||||
#endif /* !defined( _GLAPI_TABLE_H_ ) */
|
4170
src/mapi/es2api/glapi/glapitemp.h
Normal file
4170
src/mapi/es2api/glapi/glapitemp.h
Normal file
File diff suppressed because it is too large
Load Diff
1877
src/mapi/es2api/glapi/glprocs.h
Normal file
1877
src/mapi/es2api/glapi/glprocs.h
Normal file
File diff suppressed because it is too large
Load Diff
2392
src/mapi/es2api/main/glapidispatch.h
Normal file
2392
src/mapi/es2api/main/glapidispatch.h
Normal file
File diff suppressed because it is too large
Load Diff
2269
src/mapi/es2api/main/remap_helper.h
Normal file
2269
src/mapi/es2api/main/remap_helper.h
Normal file
File diff suppressed because it is too large
Load Diff
43
src/mapi/generate_glapi.mk
Normal file
43
src/mapi/generate_glapi.mk
Normal file
@@ -0,0 +1,43 @@
|
||||
GLAPI := $(LOCAL_PATH)/glapi/gen
|
||||
|
||||
GEN := $(glapi_OUT)/glapi/glapidispatch.h
|
||||
$(GEN): PRIVATE_CUSTOM_TOOL := python $(GLAPI)/gl_table.py -f $(glapi_XML) -c -m remap_table > $(GEN)
|
||||
$(GEN): $(glapi_XML)
|
||||
$(transform-generated-source)
|
||||
|
||||
LOCAL_GENERATED_SOURCES += $(GEN)
|
||||
|
||||
GEN := $(glapi_OUT)/glapi/glapioffsets.h
|
||||
$(GEN): PRIVATE_CUSTOM_TOOL := python $(GLAPI)/gl_offsets.py -f $(glapi_XML) -c > $(GEN)
|
||||
$(GEN): $(glapi_XML)
|
||||
$(transform-generated-source)
|
||||
|
||||
LOCAL_GENERATED_SOURCES += $(GEN)
|
||||
|
||||
GEN := $(glapi_OUT)/glapi/glapitable.h
|
||||
$(GEN): PRIVATE_CUSTOM_TOOL := python $(GLAPI)/gl_table.py -f $(glapi_XML) -c > $(GEN)
|
||||
$(GEN): $(glapi_XML)
|
||||
$(transform-generated-source)
|
||||
|
||||
LOCAL_GENERATED_SOURCES += $(GEN)
|
||||
|
||||
GEN := $(glapi_OUT)/glapi/glapitemp.h
|
||||
$(GEN): PRIVATE_CUSTOM_TOOL := python $(GLAPI)/gl_apitemp.py -f $(glapi_XML) -c > $(GEN)
|
||||
$(GEN): $(glapi_XML)
|
||||
$(transform-generated-source)
|
||||
|
||||
LOCAL_GENERATED_SOURCES += $(GEN)
|
||||
|
||||
GEN := $(glapi_OUT)/glapi/glprocs.h
|
||||
$(GEN): PRIVATE_CUSTOM_TOOL := python $(GLAPI)/gl_procs.py -f $(glapi_XML) -c > $(GEN)
|
||||
$(GEN): $(glapi_XML)
|
||||
$(transform-generated-source)
|
||||
|
||||
LOCAL_GENERATED_SOURCES += $(GEN)
|
||||
|
||||
GEN := $(glapi_OUT)/main/remap_helper.h
|
||||
$(GEN): PRIVATE_CUSTOM_TOOL := python $(GLAPI)/remap_helper.py -f $(glapi_XML) > $(GEN)
|
||||
$(GEN): $(glapi_XML)
|
||||
$(transform-generated-source)
|
||||
|
||||
LOCAL_GENERATED_SOURCES += $(GEN)
|
80
src/mesa/Android.mk
Normal file
80
src/mesa/Android.mk
Normal file
@@ -0,0 +1,80 @@
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
include $(LOCAL_PATH)/sources.mak
|
||||
|
||||
common_CFLAGS := \
|
||||
-DPTHREADS \
|
||||
-DFEATURE_ES1=1 \
|
||||
-DFEATURE_ES2=1 \
|
||||
-fvisibility=hidden \
|
||||
-Wno-sign-compare
|
||||
|
||||
common_C_INCLUDES := \
|
||||
external/mesa/include \
|
||||
external/mesa/src/mapi \
|
||||
external/mesa/src/glsl \
|
||||
external/mesa/src/talloc
|
||||
|
||||
ifeq ($(strip $(MESA_BUILD_GALLIUM)),true)
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_SRC_FILES := \
|
||||
$(filter-out $(MAIN_ES_SOURCES), $(MESA_GALLIUM_SOURCES)) \
|
||||
$(MESA_GALLIUM_CXX_SOURCES)
|
||||
|
||||
LOCAL_CFLAGS := \
|
||||
$(common_CFLAGS)
|
||||
|
||||
LOCAL_C_INCLUDES := \
|
||||
$(common_C_INCLUDES) \
|
||||
external/mesa/src/gallium/include \
|
||||
external/mesa/src/gallium/auxiliary
|
||||
|
||||
LOCAL_MODULE := libmesa_st_mesa
|
||||
LOCAL_MODULE_CLASS := STATIC_LIBRARIES
|
||||
|
||||
#GEN_SCRIPT := python $(LOCAL_PATH)/main/es_generator.py
|
||||
#intermediates := $(call local-intermediates-dir)
|
||||
#
|
||||
#GEN := $(intermediates)/main/api_exec_es1.c
|
||||
#$(GEN): PRIVATE_CUSTOM_TOOL = $(GEN_SCRIPT) -S $< -V GLES1.1 > $@
|
||||
#$(GEN): $(LOCAL_PATH)/main/APIspec.xml
|
||||
# $(transform-generated-source)
|
||||
#
|
||||
#LOCAL_GENERATED_SOURCES += $(GEN)
|
||||
#
|
||||
#GEN := $(intermediates)/main/api_exec_es2.c
|
||||
#$(GEN): PRIVATE_CUSTOM_TOOL = $(GEN_SCRIPT) -S $< -V GLES2.0 > $@
|
||||
#$(GEN): $(LOCAL_PATH)/main/APIspec.xml
|
||||
# $(transform-generated-source)
|
||||
#
|
||||
#LOCAL_GENERATED_SOURCES += $(GEN)
|
||||
#
|
||||
#LOCAL_C_INCLUDES += \
|
||||
# $(call intermediates-dir-for,SHARED_LIBRARIES,libGLESv1_CM_mesa) \
|
||||
# $(call intermediates-dir-for,SHARED_LIBRARIES,libGLESv2_mesa)
|
||||
LOCAL_SRC_FILES += $(MAIN_ES_SOURCES)
|
||||
|
||||
include $(BUILD_STATIC_LIBRARY)
|
||||
endif # MESA_BUILD_GALLIUM
|
||||
|
||||
ifeq ($(strip $(MESA_BUILD_CLASSIC)),true)
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_SRC_FILES := \
|
||||
$(MESA_SOURCES) \
|
||||
$(MESA_CXX_SOURCES)
|
||||
|
||||
LOCAL_CFLAGS := \
|
||||
$(common_CFLAGS) \
|
||||
-DFEATURE_GL=1
|
||||
|
||||
LOCAL_C_INCLUDES := \
|
||||
$(common_C_INCLUDES)
|
||||
|
||||
LOCAL_MODULE := libmesa_classic_mesa
|
||||
|
||||
include $(BUILD_STATIC_LIBRARY)
|
||||
|
||||
include $(call all-makefiles-under,$(LOCAL_PATH))
|
||||
endif # MESA_BUILD_CLASSIC
|
266
src/mesa/drivers/Android.mk
Normal file
266
src/mesa/drivers/Android.mk
Normal file
@@ -0,0 +1,266 @@
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
# from dri/Makefile.template
|
||||
COMMON_SOURCES = \
|
||||
dri/common/utils.c \
|
||||
dri/common/vblank.c \
|
||||
dri/common/dri_util.c \
|
||||
dri/common/xmlconfig.c \
|
||||
dri/common/texmem.c \
|
||||
dri/common/drirenderbuffer.c \
|
||||
dri/common/dri_metaops.c \
|
||||
common/driverfuncs.c
|
||||
|
||||
# from dri/i915/Makefile
|
||||
i915_DRIVER_SOURCES = \
|
||||
i830_context.c \
|
||||
i830_state.c \
|
||||
i830_texblend.c \
|
||||
i830_texstate.c \
|
||||
i830_vtbl.c \
|
||||
intel_render.c \
|
||||
intel_regions.c \
|
||||
intel_buffer_objects.c \
|
||||
intel_batchbuffer.c \
|
||||
intel_clear.c \
|
||||
intel_extensions.c \
|
||||
intel_extensions_es2.c \
|
||||
intel_mipmap_tree.c \
|
||||
intel_tex_layout.c \
|
||||
intel_tex_image.c \
|
||||
intel_tex_subimage.c \
|
||||
intel_tex_copy.c \
|
||||
intel_tex_validate.c \
|
||||
intel_tex_format.c \
|
||||
intel_tex.c \
|
||||
intel_pixel.c \
|
||||
intel_pixel_bitmap.c \
|
||||
intel_pixel_copy.c \
|
||||
intel_pixel_draw.c \
|
||||
intel_pixel_read.c \
|
||||
intel_buffers.c \
|
||||
intel_blit.c \
|
||||
i915_tex_layout.c \
|
||||
i915_texstate.c \
|
||||
i915_context.c \
|
||||
i915_debug.c \
|
||||
i915_debug_fp.c \
|
||||
i915_fragprog.c \
|
||||
i915_program.c \
|
||||
i915_state.c \
|
||||
i915_vtbl.c \
|
||||
intel_context.c \
|
||||
intel_decode.c \
|
||||
intel_screen.c \
|
||||
intel_span.c \
|
||||
intel_state.c \
|
||||
intel_syncobj.c \
|
||||
intel_tris.c \
|
||||
intel_fbo.c
|
||||
i915_DRIVER_SOURCES := $(addprefix dri/i915/, $(i915_DRIVER_SOURCES))
|
||||
|
||||
i965_DRIVER_SOURCES = \
|
||||
intel_batchbuffer.c \
|
||||
intel_blit.c \
|
||||
intel_buffer_objects.c \
|
||||
intel_buffers.c \
|
||||
intel_clear.c \
|
||||
intel_context.c \
|
||||
intel_decode.c \
|
||||
intel_extensions.c \
|
||||
intel_extensions_es2.c \
|
||||
intel_fbo.c \
|
||||
intel_mipmap_tree.c \
|
||||
intel_regions.c \
|
||||
intel_screen.c \
|
||||
intel_span.c \
|
||||
intel_pixel.c \
|
||||
intel_pixel_bitmap.c \
|
||||
intel_pixel_copy.c \
|
||||
intel_pixel_draw.c \
|
||||
intel_pixel_read.c \
|
||||
intel_state.c \
|
||||
intel_syncobj.c \
|
||||
intel_tex.c \
|
||||
intel_tex_copy.c \
|
||||
intel_tex_format.c \
|
||||
intel_tex_image.c \
|
||||
intel_tex_layout.c \
|
||||
intel_tex_subimage.c \
|
||||
intel_tex_validate.c \
|
||||
brw_cc.c \
|
||||
brw_clip.c \
|
||||
brw_clip_line.c \
|
||||
brw_clip_point.c \
|
||||
brw_clip_state.c \
|
||||
brw_clip_tri.c \
|
||||
brw_clip_unfilled.c \
|
||||
brw_clip_util.c \
|
||||
brw_context.c \
|
||||
brw_curbe.c \
|
||||
brw_disasm.c \
|
||||
brw_draw.c \
|
||||
brw_draw_upload.c \
|
||||
brw_eu.c \
|
||||
brw_eu_debug.c \
|
||||
brw_eu_emit.c \
|
||||
brw_eu_util.c \
|
||||
brw_fallback.c \
|
||||
brw_gs.c \
|
||||
brw_gs_emit.c \
|
||||
brw_gs_state.c \
|
||||
brw_misc_state.c \
|
||||
brw_optimize.c \
|
||||
brw_program.c \
|
||||
brw_queryobj.c \
|
||||
brw_sf.c \
|
||||
brw_sf_emit.c \
|
||||
brw_sf_state.c \
|
||||
brw_state.c \
|
||||
brw_state_batch.c \
|
||||
brw_state_cache.c \
|
||||
brw_state_dump.c \
|
||||
brw_state_upload.c \
|
||||
brw_tex.c \
|
||||
brw_tex_layout.c \
|
||||
brw_urb.c \
|
||||
brw_util.c \
|
||||
brw_vs.c \
|
||||
brw_vs_constval.c \
|
||||
brw_vs_emit.c \
|
||||
brw_vs_state.c \
|
||||
brw_vs_surface_state.c \
|
||||
brw_vtbl.c \
|
||||
brw_wm.c \
|
||||
brw_wm_debug.c \
|
||||
brw_wm_emit.c \
|
||||
brw_wm_fp.c \
|
||||
brw_wm_iz.c \
|
||||
brw_wm_pass0.c \
|
||||
brw_wm_pass1.c \
|
||||
brw_wm_pass2.c \
|
||||
brw_wm_sampler_state.c \
|
||||
brw_wm_state.c \
|
||||
brw_wm_surface_state.c \
|
||||
gen6_cc.c \
|
||||
gen6_clip_state.c \
|
||||
gen6_depthstencil.c \
|
||||
gen6_gs_state.c \
|
||||
gen6_sampler_state.c \
|
||||
gen6_scissor_state.c \
|
||||
gen6_sf_state.c \
|
||||
gen6_urb.c \
|
||||
gen6_viewport_state.c \
|
||||
gen6_vs_state.c \
|
||||
gen6_wm_state.c
|
||||
i965_CXX_SOURCES = \
|
||||
brw_cubemap_normalize.cpp \
|
||||
brw_fs.cpp \
|
||||
brw_fs_channel_expressions.cpp \
|
||||
brw_fs_reg_allocate.cpp \
|
||||
brw_fs_vector_splitting.cpp
|
||||
i965_DRIVER_SOURCES := \
|
||||
$(addprefix dri/i965/, $(i965_DRIVER_SOURCES)) \
|
||||
$(addprefix dri/i965/, $(i965_CXX_SOURCES))
|
||||
|
||||
common_CFLAGS := \
|
||||
-DPTHREADS \
|
||||
-DFEATURE_GL=1 \
|
||||
-DFEATURE_ES1=1 \
|
||||
-DFEATURE_ES2=1 \
|
||||
-fvisibility=hidden \
|
||||
-Wno-sign-compare
|
||||
|
||||
common_C_INCLUDES := \
|
||||
external/mesa/include \
|
||||
external/mesa/src/mapi \
|
||||
external/mesa/src/glsl \
|
||||
external/mesa/src/talloc \
|
||||
external/mesa/src/mesa \
|
||||
external/mesa/src/mesa/drivers/dri/common \
|
||||
external/drm/ \
|
||||
external/drm/include/drm \
|
||||
external/expat/lib
|
||||
|
||||
common_STATIC_LIBRARIES := \
|
||||
libmesa_classic_mesa \
|
||||
libmesa_glsl \
|
||||
libmesa_classic_mesa \
|
||||
libmesa_talloc \
|
||||
libmesa_classic_egl
|
||||
|
||||
common_WHOLE_STATIC_LIBRARIES := \
|
||||
libmesa_egl \
|
||||
libmesa_glapi
|
||||
|
||||
common_SHARED_LIBRARIES := \
|
||||
libdl \
|
||||
libdrm \
|
||||
libexpat \
|
||||
libhardware \
|
||||
liblog \
|
||||
libcutils
|
||||
|
||||
ifeq ($(strip $(MESA_BUILD_I915C)),true)
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_SRC_FILES := \
|
||||
$(COMMON_SOURCES) \
|
||||
$(i915_DRIVER_SOURCES)
|
||||
|
||||
LOCAL_CFLAGS := \
|
||||
$(common_CFLAGS) \
|
||||
-DI915
|
||||
|
||||
LOCAL_C_INCLUDES := \
|
||||
$(common_C_INCLUDES) \
|
||||
external/mesa/src/mesa/drivers/dri/intel \
|
||||
external/drm/intel
|
||||
|
||||
LOCAL_STATIC_LIBRARIES := \
|
||||
$(common_STATIC_LIBRARIES)
|
||||
|
||||
LOCAL_WHOLE_STATIC_LIBRARIES := \
|
||||
$(common_WHOLE_STATIC_LIBRARIES)
|
||||
|
||||
LOCAL_SHARED_LIBRARIES := \
|
||||
$(common_SHARED_LIBRARIES) \
|
||||
libdrm_intel
|
||||
|
||||
LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/egl
|
||||
LOCAL_MODULE := libGLES_i915c
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
endif # MESA_BUILD_I915C
|
||||
|
||||
ifeq ($(strip $(MESA_BUILD_I965C)),true)
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_SRC_FILES := \
|
||||
$(COMMON_SOURCES) \
|
||||
$(i965_DRIVER_SOURCES)
|
||||
|
||||
LOCAL_CFLAGS := \
|
||||
$(common_CFLAGS) \
|
||||
-DI965
|
||||
|
||||
LOCAL_C_INCLUDES := \
|
||||
$(common_C_INCLUDES) \
|
||||
external/mesa/src/mesa/drivers/dri/intel \
|
||||
external/drm/intel
|
||||
|
||||
LOCAL_STATIC_LIBRARIES := \
|
||||
$(common_STATIC_LIBRARIES)
|
||||
|
||||
LOCAL_WHOLE_STATIC_LIBRARIES := \
|
||||
$(common_WHOLE_STATIC_LIBRARIES)
|
||||
|
||||
LOCAL_SHARED_LIBRARIES := \
|
||||
$(common_SHARED_LIBRARIES) \
|
||||
libdrm_intel
|
||||
|
||||
LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/egl
|
||||
LOCAL_MODULE := libGLES_i965c
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
endif # MESA_BUILD_I965C
|
@@ -267,6 +267,16 @@ struct gen_mipmap_state
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* State for glDrawTex()
|
||||
*/
|
||||
struct drawtex_state
|
||||
{
|
||||
GLuint ArrayObj;
|
||||
GLuint VBO;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* All per-context meta state.
|
||||
*/
|
||||
@@ -282,6 +292,7 @@ struct gl_meta_state
|
||||
struct drawpix_state DrawPix; /**< For _mesa_meta_DrawPixels() */
|
||||
struct bitmap_state Bitmap; /**< For _mesa_meta_Bitmap() */
|
||||
struct gen_mipmap_state Mipmap; /**< For _mesa_meta_GenerateMipmap() */
|
||||
struct drawtex_state DrawTex; /**< For _mesa_meta_DrawTex() */
|
||||
};
|
||||
|
||||
|
||||
@@ -2844,3 +2855,135 @@ _mesa_meta_CopyColorSubTable(struct gl_context *ctx,GLenum target, GLsizei start
|
||||
|
||||
free(buf);
|
||||
}
|
||||
|
||||
|
||||
#if FEATURE_OES_draw_texture
|
||||
|
||||
|
||||
/**
|
||||
* Meta implementation of ctx->Driver.DrawTex() in terms
|
||||
* of polygon rendering.
|
||||
*/
|
||||
void
|
||||
_mesa_meta_DrawTex(struct gl_context *ctx, GLfloat x, GLfloat y, GLfloat z,
|
||||
GLfloat width, GLfloat height)
|
||||
{
|
||||
struct drawtex_state *drawtex = &ctx->Meta->DrawTex;
|
||||
struct vertex {
|
||||
GLfloat x, y, z, st[MAX_TEXTURE_UNITS][2];
|
||||
};
|
||||
struct vertex verts[4];
|
||||
GLuint i;
|
||||
|
||||
_mesa_meta_begin(ctx, (META_RASTERIZATION |
|
||||
META_SHADER |
|
||||
META_TRANSFORM |
|
||||
META_VERTEX |
|
||||
META_VIEWPORT));
|
||||
|
||||
if (drawtex->ArrayObj == 0) {
|
||||
/* one-time setup */
|
||||
GLint active_texture;
|
||||
|
||||
/* create vertex array object */
|
||||
_mesa_GenVertexArrays(1, &drawtex->ArrayObj);
|
||||
_mesa_BindVertexArray(drawtex->ArrayObj);
|
||||
|
||||
/* create vertex array buffer */
|
||||
_mesa_GenBuffersARB(1, &drawtex->VBO);
|
||||
_mesa_BindBufferARB(GL_ARRAY_BUFFER_ARB, drawtex->VBO);
|
||||
_mesa_BufferDataARB(GL_ARRAY_BUFFER_ARB, sizeof(verts),
|
||||
NULL, GL_DYNAMIC_DRAW_ARB);
|
||||
|
||||
/* client active texture is not part of the array object */
|
||||
active_texture = ctx->Array.ActiveTexture;
|
||||
|
||||
/* setup vertex arrays */
|
||||
_mesa_VertexPointer(3, GL_FLOAT, sizeof(struct vertex), OFFSET(x));
|
||||
_mesa_EnableClientState(GL_VERTEX_ARRAY);
|
||||
for (i = 0; i < ctx->Const.MaxTextureUnits; i++) {
|
||||
_mesa_ClientActiveTextureARB(GL_TEXTURE0 + i);
|
||||
_mesa_TexCoordPointer(2, GL_FLOAT, sizeof(struct vertex), OFFSET(st[i]));
|
||||
_mesa_EnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
}
|
||||
|
||||
/* restore client active texture */
|
||||
_mesa_ClientActiveTextureARB(GL_TEXTURE0 + active_texture);
|
||||
}
|
||||
else {
|
||||
_mesa_BindVertexArray(drawtex->ArrayObj);
|
||||
_mesa_BindBufferARB(GL_ARRAY_BUFFER_ARB, drawtex->VBO);
|
||||
}
|
||||
|
||||
/* vertex positions, texcoords */
|
||||
{
|
||||
const GLfloat x1 = x + width;
|
||||
const GLfloat y1 = y + height;
|
||||
|
||||
z = CLAMP(z, 0.0, 1.0);
|
||||
z = invert_z(z);
|
||||
|
||||
verts[0].x = x;
|
||||
verts[0].y = y;
|
||||
verts[0].z = z;
|
||||
|
||||
verts[1].x = x1;
|
||||
verts[1].y = y;
|
||||
verts[1].z = z;
|
||||
|
||||
verts[2].x = x1;
|
||||
verts[2].y = y1;
|
||||
verts[2].z = z;
|
||||
|
||||
verts[3].x = x;
|
||||
verts[3].y = y1;
|
||||
verts[3].z = z;
|
||||
|
||||
for (i = 0; i < ctx->Const.MaxTextureUnits; i++) {
|
||||
const struct gl_texture_object *texObj;
|
||||
const struct gl_texture_image *texImage;
|
||||
GLfloat s, t, s1, t1;
|
||||
GLuint tw, th;
|
||||
|
||||
if (!ctx->Texture.Unit[i]._ReallyEnabled) {
|
||||
GLuint j;
|
||||
for (j = 0; j < 4; j++) {
|
||||
verts[j].st[i][0] = 0.0f;
|
||||
verts[j].st[i][1] = 0.0f;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
texObj = ctx->Texture.Unit[i]._Current;
|
||||
texImage = texObj->Image[0][texObj->BaseLevel];
|
||||
tw = texImage->Width2;
|
||||
th = texImage->Height2;
|
||||
|
||||
s = (GLfloat) texObj->CropRect[0] / tw;
|
||||
t = (GLfloat) texObj->CropRect[1] / th;
|
||||
s1 = (GLfloat) (texObj->CropRect[0] + texObj->CropRect[2]) / tw;
|
||||
t1 = (GLfloat) (texObj->CropRect[1] + texObj->CropRect[3]) / th;
|
||||
|
||||
verts[0].st[i][0] = s;
|
||||
verts[0].st[i][1] = t;
|
||||
|
||||
verts[1].st[i][0] = s1;
|
||||
verts[1].st[i][1] = t;
|
||||
|
||||
verts[2].st[i][0] = s1;
|
||||
verts[2].st[i][1] = t1;
|
||||
|
||||
verts[3].st[i][0] = s;
|
||||
verts[3].st[i][1] = t1;
|
||||
}
|
||||
|
||||
_mesa_BufferSubDataARB(GL_ARRAY_BUFFER_ARB, 0, sizeof(verts), verts);
|
||||
}
|
||||
|
||||
_mesa_DrawArrays(GL_TRIANGLE_FAN, 0, 4);
|
||||
|
||||
_mesa_meta_end(ctx);
|
||||
}
|
||||
|
||||
|
||||
#endif /* FEATURE_OES_draw_texture */
|
||||
|
@@ -114,5 +114,8 @@ _mesa_meta_CopyConvolutionFilter2D(struct gl_context *ctx, GLenum target,
|
||||
GLenum internalFormat, GLint x, GLint y,
|
||||
GLsizei width, GLsizei height);
|
||||
|
||||
extern void
|
||||
_mesa_meta_DrawTex(struct gl_context *ctx, GLfloat x, GLfloat y, GLfloat z,
|
||||
GLfloat width, GLfloat height);
|
||||
|
||||
#endif /* META_H */
|
||||
|
@@ -60,6 +60,8 @@ translate_texture_format(gl_format mesa_format, GLuint internal_format,
|
||||
return MAPSURF_32BIT | MT_32BIT_ARGB8888;
|
||||
case MESA_FORMAT_XRGB8888:
|
||||
return MAPSURF_32BIT | MT_32BIT_XRGB8888;
|
||||
case MESA_FORMAT_RGBA8888_REV:
|
||||
return MAPSURF_32BIT | MT_32BIT_ABGR8888;
|
||||
case MESA_FORMAT_YCBCR_REV:
|
||||
return (MAPSURF_422 | MT_422_YCRCB_NORMAL);
|
||||
case MESA_FORMAT_YCBCR:
|
||||
|
@@ -191,6 +191,7 @@ static GLuint get_surface_type( GLenum type, GLuint size,
|
||||
else {
|
||||
return ubyte_types_norm[size];
|
||||
}
|
||||
case GL_FIXED: return float_types[size]; /* was uploaded as floats */
|
||||
default: assert(0); return 0;
|
||||
}
|
||||
}
|
||||
@@ -206,6 +207,7 @@ static GLuint get_surface_type( GLenum type, GLuint size,
|
||||
case GL_UNSIGNED_INT: return uint_types_scale[size];
|
||||
case GL_UNSIGNED_SHORT: return ushort_types_scale[size];
|
||||
case GL_UNSIGNED_BYTE: return ubyte_types_scale[size];
|
||||
case GL_FIXED: return float_types[size]; /* was uploaded as floats */
|
||||
default: assert(0); return 0;
|
||||
}
|
||||
}
|
||||
@@ -224,6 +226,7 @@ static GLuint get_size( GLenum type )
|
||||
case GL_UNSIGNED_INT: return sizeof(GLuint);
|
||||
case GL_UNSIGNED_SHORT: return sizeof(GLushort);
|
||||
case GL_UNSIGNED_BYTE: return sizeof(GLubyte);
|
||||
case GL_FIXED: return sizeof(GLfloat); /* will be uploaded as floats */
|
||||
default: return 0;
|
||||
}
|
||||
}
|
||||
@@ -287,6 +290,49 @@ copy_array_to_vbo_array( struct brw_context *brw,
|
||||
element->stride = dst_stride;
|
||||
}
|
||||
|
||||
/* upload as floats */
|
||||
if (element->glarray->Type == GL_FIXED) {
|
||||
drm_intel_bo *src_bo = NULL;
|
||||
const char *src;
|
||||
char *dst;
|
||||
GLint i, j;
|
||||
|
||||
/* map source bo */
|
||||
if (_mesa_is_bufferobj(element->glarray->BufferObj)) {
|
||||
struct intel_buffer_object *intel_buffer =
|
||||
intel_buffer_object(element->glarray->BufferObj);
|
||||
|
||||
src_bo = intel_bufferobj_buffer(&brw->intel, intel_buffer, INTEL_READ);
|
||||
drm_intel_gem_bo_map_gtt(src_bo);
|
||||
|
||||
src = (const char *) element->bo->virtual +
|
||||
(unsigned long) element->glarray->Ptr;
|
||||
}
|
||||
else {
|
||||
src = (const char *) element->glarray->Ptr;
|
||||
}
|
||||
|
||||
drm_intel_gem_bo_map_gtt(element->bo);
|
||||
dst = (char *) element->bo->virtual + element->offset;
|
||||
|
||||
for (i = 0; i < element->count; i++) {
|
||||
const GLint *s = (GLint *) src;
|
||||
GLfloat *d = (GLfloat *) dst;
|
||||
|
||||
for (j = 0; j < element->glarray->Size; j++)
|
||||
d[j] = s[j] / 65536.0f;
|
||||
|
||||
src += element->glarray->StrideB;
|
||||
dst += dst_stride;
|
||||
}
|
||||
|
||||
drm_intel_gem_bo_unmap_gtt(element->bo);
|
||||
if (src_bo)
|
||||
drm_intel_gem_bo_unmap_gtt(src_bo);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (dst_stride == element->glarray->StrideB) {
|
||||
drm_intel_gem_bo_map_gtt(element->bo);
|
||||
memcpy((char *)element->bo->virtual + element->offset,
|
||||
@@ -356,7 +402,8 @@ static void brw_prepare_vertices(struct brw_context *brw)
|
||||
|
||||
input->element_size = get_size(input->glarray->Type) * input->glarray->Size;
|
||||
|
||||
if (_mesa_is_bufferobj(input->glarray->BufferObj)) {
|
||||
if (_mesa_is_bufferobj(input->glarray->BufferObj) &&
|
||||
input->glarray->Type != GL_FIXED) {
|
||||
struct intel_buffer_object *intel_buffer =
|
||||
intel_buffer_object(input->glarray->BufferObj);
|
||||
|
||||
|
@@ -85,7 +85,7 @@ static void init_registers( struct brw_wm_compile *c )
|
||||
prealloc_reg(c, &c->creg[j], i++);
|
||||
|
||||
if (intel->gen >= 6) {
|
||||
for (unsigned int j = 0; j < FRAG_ATTRIB_MAX; j++) {
|
||||
for (j = 0; j < FRAG_ATTRIB_MAX; j++) {
|
||||
if (brw->fragment_program->Base.InputsRead & BITFIELD64_BIT(j)) {
|
||||
nr_interp_regs++;
|
||||
prealloc_reg(c, &c->payload.input_interp[j], i++);
|
||||
|
@@ -420,6 +420,32 @@ intel_update_renderbuffers(__DRIcontext *context, __DRIdrawable *drawable)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef ANDROID
|
||||
depth_rb = intel_get_renderbuffer(fb, BUFFER_DEPTH);
|
||||
stencil_rb = intel_get_renderbuffer(fb, BUFFER_STENCIL);
|
||||
rb = NULL;
|
||||
if (depth_rb && !depth_rb->region)
|
||||
rb = depth_rb;
|
||||
else if (stencil_rb && !stencil_rb->region)
|
||||
rb = stencil_rb;
|
||||
if (rb) {
|
||||
uint32_t tiling = I915_TILING_NONE;
|
||||
|
||||
/* Gen6 requires depth must be tiling */
|
||||
if (intel->gen >= 6 && rb->Base.Format == MESA_FORMAT_S8_Z24)
|
||||
tiling = I915_TILING_Y;
|
||||
|
||||
region = intel_region_alloc(intel->intelScreen, tiling,
|
||||
_mesa_get_format_bytes(rb->Base.Format),
|
||||
drawable->w, drawable->h, GL_TRUE);
|
||||
intel_renderbuffer_set_region(intel, rb, region);
|
||||
intel_region_release(®ion);
|
||||
}
|
||||
|
||||
if (stencil_rb && !stencil_rb->region)
|
||||
intel_renderbuffer_set_region(intel, stencil_rb, depth_rb->region);
|
||||
#endif
|
||||
|
||||
driUpdateFramebufferSize(&intel->ctx, drawable);
|
||||
}
|
||||
|
||||
@@ -789,6 +815,7 @@ intelInitContext(struct intel_context *intel,
|
||||
intelInitExtensions(ctx);
|
||||
break;
|
||||
case API_OPENGLES:
|
||||
intelInitExtensionsES1(ctx);
|
||||
break;
|
||||
case API_OPENGLES2:
|
||||
intelInitExtensionsES2(ctx);
|
||||
|
@@ -32,6 +32,9 @@
|
||||
extern void
|
||||
intelInitExtensions(struct gl_context *ctx);
|
||||
|
||||
extern void
|
||||
intelInitExtensionsES1(struct gl_context *ctx);
|
||||
|
||||
extern void
|
||||
intelInitExtensionsES2(struct gl_context *ctx);
|
||||
|
||||
|
@@ -78,6 +78,25 @@ static const char *es2_extensions[] = {
|
||||
NULL,
|
||||
};
|
||||
|
||||
void
|
||||
intelInitExtensionsES1(struct gl_context *ctx)
|
||||
{
|
||||
int i;
|
||||
|
||||
/* Can't use driInitExtensions() since it uses extensions from
|
||||
* main/remap_helper.h when called the first time. */
|
||||
|
||||
for (i = 0; es2_extensions[i]; i++)
|
||||
_mesa_enable_extension(ctx, es2_extensions[i]);
|
||||
|
||||
_mesa_enable_extension(ctx, "GL_ARB_texture_env_add");
|
||||
_mesa_enable_extension(ctx, "GL_ARB_texture_env_combine");
|
||||
_mesa_enable_extension(ctx, "GL_ARB_texture_env_dot3");
|
||||
_mesa_enable_extension(ctx, "GL_ARB_point_parameters");
|
||||
|
||||
_mesa_enable_extension(ctx, "GL_OES_draw_texture");
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes potential list of extensions if ctx == NULL, or actually enables
|
||||
* extensions for a context.
|
||||
|
@@ -151,6 +151,11 @@ intel_create_image_from_name(__DRIscreen *screen,
|
||||
image->internal_format = GL_RGBA;
|
||||
image->data_type = GL_UNSIGNED_BYTE;
|
||||
break;
|
||||
case __DRI_IMAGE_FORMAT_RGBA8888_REV:
|
||||
image->format = MESA_FORMAT_RGBA8888_REV;
|
||||
image->internal_format = GL_RGBA;
|
||||
image->data_type = GL_UNSIGNED_BYTE;
|
||||
break;
|
||||
default:
|
||||
free(image);
|
||||
return NULL;
|
||||
@@ -237,6 +242,11 @@ intel_create_image(__DRIscreen *screen,
|
||||
image->internal_format = GL_RGBA;
|
||||
image->data_type = GL_UNSIGNED_BYTE;
|
||||
break;
|
||||
case __DRI_IMAGE_FORMAT_RGBA8888_REV:
|
||||
image->format = MESA_FORMAT_RGBA8888_REV;
|
||||
image->internal_format = GL_RGBA;
|
||||
image->data_type = GL_UNSIGNED_BYTE;
|
||||
break;
|
||||
default:
|
||||
free(image);
|
||||
return NULL;
|
||||
|
@@ -120,4 +120,6 @@ intelInitTextureFuncs(struct dd_function_table *functions)
|
||||
functions->NewTextureImage = intelNewTextureImage;
|
||||
functions->DeleteTexture = intelDeleteTextureObject;
|
||||
functions->FreeTexImageData = intelFreeTextureImageData;
|
||||
|
||||
functions->DrawTex = _mesa_meta_DrawTex;
|
||||
}
|
||||
|
2
src/mesa/main/.gitignore
vendored
2
src/mesa/main/.gitignore
vendored
@@ -1,4 +1,2 @@
|
||||
api_exec_es1.c
|
||||
api_exec_es2.c
|
||||
get_es1.c
|
||||
get_es2.c
|
||||
|
4860
src/mesa/main/api_exec_es1.c
Normal file
4860
src/mesa/main/api_exec_es1.c
Normal file
File diff suppressed because it is too large
Load Diff
2519
src/mesa/main/api_exec_es2.c
Normal file
2519
src/mesa/main/api_exec_es2.c
Normal file
File diff suppressed because it is too large
Load Diff
@@ -757,7 +757,7 @@ _mesa_strdup( const char *s )
|
||||
float
|
||||
_mesa_strtof( const char *s, char **end )
|
||||
{
|
||||
#if defined(_GNU_SOURCE) && !defined(__CYGWIN__) && !defined(__FreeBSD__)
|
||||
#if defined(_GNU_SOURCE) && !defined(__CYGWIN__) && !defined(__FreeBSD__) && !defined(ANDROID)
|
||||
static locale_t loc = NULL;
|
||||
if (!loc) {
|
||||
loc = newlocale(LC_CTYPE_MASK, "C", NULL);
|
||||
|
@@ -116,6 +116,7 @@ typedef union { GLfloat f; GLint i; } fi_type;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* \name Work-arounds for platforms that lack C99 math functions
|
||||
*/
|
||||
@@ -134,7 +135,13 @@ typedef union { GLfloat f; GLint i; } fi_type;
|
||||
#define exp2f(f) ((float) exp2(f))
|
||||
#define floorf(f) ((float) floor(f))
|
||||
#define logf(f) ((float) log(f))
|
||||
|
||||
#ifdef ANDROID
|
||||
#define log2f(f) ((float) (log(f) / M_LN2))
|
||||
#else
|
||||
#define log2f(f) ((float) log2(f))
|
||||
#endif
|
||||
|
||||
#define powf(x,y) ((float) pow(x,y))
|
||||
#define sinf(f) ((float) sin(f))
|
||||
#define sinhf(f) ((float) sinh(f))
|
||||
|
@@ -73,7 +73,8 @@ fpclassify(double x)
|
||||
#elif defined(__APPLE__) || defined(__CYGWIN__) || defined(__FreeBSD__) || \
|
||||
defined(__OpenBSD__) || defined(__NetBSD__) || defined(__DragonFly__) || \
|
||||
(defined(__sun) && defined(__C99FEATURES__)) || defined(__MINGW32__) || \
|
||||
(defined(__sun) && defined(__GNUC__))
|
||||
(defined(__sun) && defined(__GNUC__)) || \
|
||||
defined(ANDROID)
|
||||
|
||||
/* fpclassify is available. */
|
||||
|
||||
|
@@ -174,6 +174,16 @@ static void _tnl_import_array( struct gl_context *ctx,
|
||||
case GL_HALF_FLOAT:
|
||||
convert_half_to_float(input, ptr, fptr, count, sz);
|
||||
break;
|
||||
case GL_FIXED:
|
||||
{
|
||||
GLuint i, j;
|
||||
for (i = 0; i < count; i++) {
|
||||
const GLint *in = (GLint *) (ptr + i * input->StrideB);
|
||||
for (j = 0; j < sz; j++)
|
||||
*fptr++ = *in++ / 65536.0f;
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
assert(0);
|
||||
break;
|
||||
|
13
src/talloc/Android.mk
Normal file
13
src/talloc/Android.mk
Normal file
@@ -0,0 +1,13 @@
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_SRC_FILES := \
|
||||
talloc.c
|
||||
|
||||
LOCAL_CFLAGS := \
|
||||
-fvisibility=hidden
|
||||
|
||||
LOCAL_MODULE := libmesa_talloc
|
||||
|
||||
include $(BUILD_STATIC_LIBRARY)
|
@@ -56,7 +56,7 @@ static size_t strnlen (const char* s, size_t n)
|
||||
#endif
|
||||
|
||||
/* Visual C++ 2008 & Xcode/gcc4.0 compatibility */
|
||||
#if !defined(_cplusplus) && (defined(WIN32) || defined(__APPLE__))
|
||||
#if !defined(_cplusplus) && (defined(WIN32) || defined(__APPLE__) || defined(ANDROID))
|
||||
typedef int bool;
|
||||
#define false 0
|
||||
#define true 1
|
||||
|
Reference in New Issue
Block a user