rsdGL.h revision 4b3de47071d875faaa7d419d050a464b09538797
1/*
2 * Copyright (C) 2011 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef RSD_GL_H
18#define RSD_GL_H
19
20#include <rs_hal.h>
21
22
23
24typedef void (* InvokeFunc_t)(void);
25typedef void (*WorkerCallback_t)(void *usr, uint32_t idx);
26
27typedef struct RsdGLRec {
28    struct {
29        EGLint numConfigs;
30        EGLint majorVersion;
31        EGLint minorVersion;
32        EGLConfig config;
33        EGLContext context;
34        EGLSurface surface;
35        EGLSurface surfaceDefault;
36        EGLDisplay display;
37    } egl;
38
39    struct {
40        const uint8_t * vendor;
41        const uint8_t * renderer;
42        const uint8_t * version;
43        const uint8_t * extensions;
44
45        uint32_t majorVersion;
46        uint32_t minorVersion;
47
48        int32_t maxVaryingVectors;
49        int32_t maxTextureImageUnits;
50
51        int32_t maxFragmentTextureImageUnits;
52        int32_t maxFragmentUniformVectors;
53
54        int32_t maxVertexAttribs;
55        int32_t maxVertexUniformVectors;
56        int32_t maxVertexTextureUnits;
57
58        bool OES_texture_npot;
59        bool GL_IMG_texture_npot;
60        bool GL_NV_texture_npot_2D_mipmap;
61        float EXT_texture_max_aniso;
62    } gl;
63
64    ANativeWindow *wndSurface;
65    uint32_t width;
66    uint32_t height;
67} RsdGL;
68
69
70
71bool rsdGLInit(const android::renderscript::Context *rsc);
72void rsdGLShutdown(const android::renderscript::Context *rsc);
73bool rsdGLSetSurface(const android::renderscript::Context *rsc,
74                     uint32_t w, uint32_t h, ANativeWindow *sur);
75void rsdGLSwap(const android::renderscript::Context *rsc);
76
77#endif
78
79