r300: respect radeon common code fallbacks
[mesa.git] / src / gallium / state_trackers / egl / common / egl_st.h
1 /*
2 * Mesa 3-D graphics library
3 * Version: 7.8
4 *
5 * Copyright (C) 2009-2010 Chia-I Wu <olv@0xlab.org>
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a
8 * copy of this software and associated documentation files (the "Software"),
9 * to deal in the Software without restriction, including without limitation
10 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
11 * and/or sell copies of the Software, and to permit persons to whom the
12 * Software is furnished to do so, subject to the following conditions:
13 *
14 * The above copyright notice and this permission notice shall be included
15 * in all copies or substantial portions of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
21 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 */
24
25 #ifndef _EGL_ST_H_
26 #define _EGL_ST_H_
27
28 #include "GL/gl.h" /* for GL types */
29 #include "GL/internal/glcore.h" /* for __GLcontextModes */
30
31 #include "pipe/p_compiler.h"
32 #include "pipe/p_format.h"
33 #include "pipe/p_context.h"
34
35 /* avoid calling st functions directly */
36 #if 1
37
38 #define ST_SURFACE_FRONT_LEFT 0
39 #define ST_SURFACE_BACK_LEFT 1
40 #define ST_SURFACE_FRONT_RIGHT 2
41 #define ST_SURFACE_BACK_RIGHT 3
42
43 #define ST_TEXTURE_2D 0x2
44
45 struct st_context;
46 struct st_framebuffer;
47 typedef void (*st_proc)();
48
49 #else
50 #include "state_tracker/st_public.h"
51 #endif
52
53 /* remember to update egl_g3d_get_st() when update the enums */
54 enum egl_g3d_st_api {
55 EGL_G3D_ST_OPENGL_ES = 0,
56 EGL_G3D_ST_OPENVG,
57 EGL_G3D_ST_OPENGL_ES2,
58 EGL_G3D_ST_OPENGL,
59
60 NUM_EGL_G3D_STS
61 };
62
63 struct egl_g3d_st {
64 #define ST_PUBLIC(name, ret, ...) ret (*name)(__VA_ARGS__);
65 #include "st_public_tmp.h"
66 /* fields must be added here */
67 EGLint api_bit;
68 };
69
70 const struct egl_g3d_st *
71 egl_g3d_get_st(enum egl_g3d_st_api api);
72
73 #endif /* _EGL_ST_H_ */