RetroArch
gl_common.h
Go to the documentation of this file.
1 /* RetroArch - A frontend for libretro.
2  * Copyright (C) 2010-2014 - Hans-Kristian Arntzen
3  * copyright (c) 2011-2017 - Daniel De Matteis
4  *
5  * RetroArch is free software: you can redistribute it and/or modify it under the terms
6  * of the GNU General Public License as published by the Free Software Found-
7  * ation, either version 3 of the License, or (at your option) any later version.
8  *
9  * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
10  * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11  * PURPOSE. See the GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License along with RetroArch.
14  * If not, see <http://www.gnu.org/licenses/>.
15  */
16 
17 #ifndef __GL_COMMON_H
18 #define __GL_COMMON_H
19 
20 #include <boolean.h>
21 #include <string.h>
22 #include <libretro.h>
23 #include <retro_common_api.h>
24 
25 #ifdef HAVE_CONFIG_H
26 #include "../../config.h"
27 #endif
28 
29 #include <retro_inline.h>
30 #include <gfx/math/matrix_4x4.h>
31 #include <gfx/scaler/scaler.h>
32 #include <formats/image.h>
33 
34 #include "../../verbosity.h"
35 #include "../font_driver.h"
36 #include "../video_coord_array.h"
37 #include "../video_driver.h"
38 #include <glsym/glsym.h>
39 
41 
42 #if defined(HAVE_PSGL)
43 #define RARCH_GL_FRAMEBUFFER GL_FRAMEBUFFER_OES
44 #define RARCH_GL_FRAMEBUFFER_COMPLETE GL_FRAMEBUFFER_COMPLETE_OES
45 #define RARCH_GL_COLOR_ATTACHMENT0 GL_COLOR_ATTACHMENT0_EXT
46 #elif (defined(__MACH__) && (defined(__ppc__) || defined(__ppc64__)))
47 #define RARCH_GL_FRAMEBUFFER GL_FRAMEBUFFER_EXT
48 #define RARCH_GL_FRAMEBUFFER_COMPLETE GL_FRAMEBUFFER_COMPLETE_EXT
49 #define RARCH_GL_COLOR_ATTACHMENT0 GL_COLOR_ATTACHMENT0_EXT
50 #else
51 #define RARCH_GL_FRAMEBUFFER GL_FRAMEBUFFER
52 #define RARCH_GL_FRAMEBUFFER_COMPLETE GL_FRAMEBUFFER_COMPLETE
53 #define RARCH_GL_COLOR_ATTACHMENT0 GL_COLOR_ATTACHMENT0
54 #endif
55 
56 #if defined(HAVE_OPENGLES2) || defined(HAVE_OPENGLES3) || defined(HAVE_OPENGLES_3_1) || defined(HAVE_OPENGLES_3_2)
57 #define RARCH_GL_RENDERBUFFER GL_RENDERBUFFER
58 #if defined(HAVE_OPENGLES2)
59 #define RARCH_GL_DEPTH24_STENCIL8 GL_DEPTH24_STENCIL8_OES
60 #else
61 #define RARCH_GL_DEPTH24_STENCIL8 GL_DEPTH24_STENCIL8
62 #endif
63 #define RARCH_GL_DEPTH_ATTACHMENT GL_DEPTH_ATTACHMENT
64 #define RARCH_GL_STENCIL_ATTACHMENT GL_STENCIL_ATTACHMENT
65 #elif (defined(__MACH__) && (defined(__ppc__) || defined(__ppc64__)))
66 #define RARCH_GL_RENDERBUFFER GL_RENDERBUFFER_EXT
67 #define RARCH_GL_DEPTH24_STENCIL8 GL_DEPTH24_STENCIL8_EXT
68 #define RARCH_GL_DEPTH_ATTACHMENT GL_DEPTH_ATTACHMENT_EXT
69 #define RARCH_GL_STENCIL_ATTACHMENT GL_STENCIL_ATTACHMENT_EXT
70 #elif defined(HAVE_PSGL)
71 #define RARCH_GL_RENDERBUFFER GL_RENDERBUFFER_OES
72 #define RARCH_GL_DEPTH24_STENCIL8 GL_DEPTH24_STENCIL8_SCE
73 #define RARCH_GL_DEPTH_ATTACHMENT GL_DEPTH_ATTACHMENT_OES
74 #define RARCH_GL_STENCIL_ATTACHMENT GL_STENCIL_ATTACHMENT_OES
75 #else
76 #define RARCH_GL_RENDERBUFFER GL_RENDERBUFFER
77 #define RARCH_GL_DEPTH24_STENCIL8 GL_DEPTH24_STENCIL8
78 #define RARCH_GL_DEPTH_ATTACHMENT GL_DEPTH_ATTACHMENT
79 #define RARCH_GL_STENCIL_ATTACHMENT GL_STENCIL_ATTACHMENT
80 #endif
81 
82 #if (defined(__MACH__) && (defined(__ppc__) || defined(__ppc64__)))
83 #define RARCH_GL_MAX_RENDERBUFFER_SIZE GL_MAX_RENDERBUFFER_SIZE_EXT
84 #elif defined(HAVE_PSGL)
85 #define RARCH_GL_MAX_RENDERBUFFER_SIZE GL_MAX_RENDERBUFFER_SIZE_OES
86 #else
87 #define RARCH_GL_MAX_RENDERBUFFER_SIZE GL_MAX_RENDERBUFFER_SIZE
88 #endif
89 
90 #if defined(HAVE_PSGL)
91 #define glGenerateMipmap glGenerateMipmapOES
92 #endif
93 
94 #if defined(__APPLE__) || defined(HAVE_PSGL)
95 #define GL_RGBA32F GL_RGBA32F_ARB
96 #endif
97 
98 #if defined(HAVE_PSGL)
99 #define RARCH_GL_INTERNAL_FORMAT32 GL_ARGB_SCE
100 #define RARCH_GL_INTERNAL_FORMAT16 GL_RGB5 /* TODO: Verify if this is really 565 or just 555. */
101 #define RARCH_GL_TEXTURE_TYPE32 GL_BGRA
102 #define RARCH_GL_TEXTURE_TYPE16 GL_BGRA
103 #define RARCH_GL_FORMAT32 GL_UNSIGNED_INT_8_8_8_8_REV
104 #define RARCH_GL_FORMAT16 GL_RGB5
105 #elif defined(HAVE_OPENGLES)
106 /* Imgtec/SGX headers have this missing. */
107 #ifndef GL_BGRA_EXT
108 #define GL_BGRA_EXT 0x80E1
109 #endif
110 #ifndef GL_BGRA8_EXT
111 #define GL_BGRA8_EXT 0x93A1
112 #endif
113 #ifdef IOS
114 /* Stupid Apple */
115 #define RARCH_GL_INTERNAL_FORMAT32 GL_RGBA
116 #else
117 #define RARCH_GL_INTERNAL_FORMAT32 GL_BGRA_EXT
118 #endif
119 #define RARCH_GL_INTERNAL_FORMAT16 GL_RGB
120 #define RARCH_GL_TEXTURE_TYPE32 GL_BGRA_EXT
121 #define RARCH_GL_TEXTURE_TYPE16 GL_RGB
122 #define RARCH_GL_FORMAT32 GL_UNSIGNED_BYTE
123 #define RARCH_GL_FORMAT16 GL_UNSIGNED_SHORT_5_6_5
124 #else
125 /* On desktop, we always use 32-bit. */
126 #define RARCH_GL_INTERNAL_FORMAT32 GL_RGBA8
127 #define RARCH_GL_INTERNAL_FORMAT16 GL_RGBA8
128 #define RARCH_GL_TEXTURE_TYPE32 GL_BGRA
129 #define RARCH_GL_TEXTURE_TYPE16 GL_BGRA
130 #define RARCH_GL_FORMAT32 GL_UNSIGNED_INT_8_8_8_8_REV
131 #define RARCH_GL_FORMAT16 GL_UNSIGNED_INT_8_8_8_8_REV
132 
133 /* GL_RGB565 internal format isn't in desktop GL
134  * until 4.1 core (ARB_ES2_compatibility).
135  * Check for this. */
136 #ifndef GL_RGB565
137 #define GL_RGB565 0x8D62
138 #endif
139 #define RARCH_GL_INTERNAL_FORMAT16_565 GL_RGB565
140 #define RARCH_GL_TEXTURE_TYPE16_565 GL_RGB
141 #define RARCH_GL_FORMAT16_565 GL_UNSIGNED_SHORT_5_6_5
142 #endif
143 
144 #if defined(HAVE_OPENGLES2) /* TODO: Figure out exactly what. */
145 #define NO_GL_CLAMP_TO_BORDER
146 #endif
147 
148 #if defined(HAVE_OPENGLES)
149 #ifndef GL_UNPACK_ROW_LENGTH
150 #define GL_UNPACK_ROW_LENGTH 0x0CF2
151 #endif
152 
153 #ifndef GL_SRGB_ALPHA_EXT
154 #define GL_SRGB_ALPHA_EXT 0x8C42
155 #endif
156 #endif
157 
158 typedef struct gl gl_t;
160 
162 {
163  void (*set_coords)(void *handle_data,
164  void *chain_data,
165  void *shader_data, const struct video_coords *coords);
166  void (*set_mvp)(void *data,
167  void *chain_data,
168  void *shader_data,
169  const void *mat_data);
171  gl_t *gl, void *chain_data, unsigned i,
172  unsigned internal_fmt, unsigned texture_fmt,
173  unsigned texture_type);
174  void (*fence_iterate)(void *data, void *chain_data,
175  unsigned hard_sync_frames);
176  void (*fence_free)(void *data, void *chain_data);
178  void *chain_data,
179  unsigned alignment,
180  unsigned fmt, unsigned type,
181  void *src);
182  void (*init_pbo)(unsigned size, const void *data);
183  void (*bind_pbo)(unsigned idx);
184  void (*unbind_pbo)(void *data, void *chain_data);
186  gl_t *gl,
187  void *chain_data,
189  const void *frame,
190  unsigned width, unsigned height, unsigned pitch);
191  void (*restore_default_state)(gl_t *gl, void *chain_data);
192  void (*new_vao)(void *data, void *chain_data);
193  void (*free_vao)(void *data, void *chain_data);
194  void (*bind_vao)(void *data, void *chain_data);
195  void (*unbind_vao)(void *data, void *chain_data);
196  void (*disable_client_arrays)(void *data, void *chain_data);
197  void (*ff_vertex)(const void *data);
198  void (*ff_matrix)(const void *data);
199  void (*bind_backbuffer)(void *data, void *chain_data);
200  void (*deinit_fbo)(gl_t *gl, void *chain_data);
202  gl_t *gl, void *chain_data, uint8_t *buffer, bool is_idle);
204  gl_t *gl,
205  void *chain_data,
206  const struct video_tex_info *tex_info);
207  void (*chain_free)(void *data, void *chain_data);
208  void *(*chain_new)(void);
209  void (*init)(gl_t *gl, void *chain_data,
210  unsigned fbo_width, unsigned fbo_height);
211  bool (*init_hw_render)(gl_t *gl, void *chain_data,
212  unsigned width, unsigned height);
213  void (*free)(gl_t *gl, void *chain_data);
214  void (*deinit_hw_render)(gl_t *gl, void *chain_data);
215  void (*start_render)(gl_t *gl, void *chain_data,
217  void (*check_fbo_dimensions)(gl_t *gl, void *chain_data);
219  void *chain_data,
220  unsigned width, unsigned height,
221  unsigned vp_width, unsigned vp_height);
223  void *chain_data,
225  uint64_t frame_count,
226  const struct video_tex_info *tex_info,
227  const struct video_tex_info *feedback_info);
229  gl_t *gl,
230  void *chain_data,
231  const char *context_ident,
232  const video_info_t *video);
233  const char *ident;
234 };
235 
236 struct gl
237 {
239  GLenum texture_type; /* RGB565 or ARGB */
242 
243  bool vsync;
248  bool has_fbo;
251 
253  bool quitting;
260 
265  bool have_sync;
268 
271 
282 
283  unsigned tex_index; /* For use with PREV. */
284  unsigned textures;
286  unsigned rotation;
287  unsigned vp_out_width;
288  unsigned vp_out_height;
289  unsigned tex_w;
290  unsigned tex_h;
291  unsigned base_size; /* 2 or 4 */
292  unsigned overlays;
296 
298 
299  void *empty_buf;
300  void *conv_buffer;
302  const float *vertex_ptr;
303  const float *white_color_ptr;
307 
317 
320  void *ctx_data;
322 };
323 
324 static INLINE void gl_bind_texture(GLuint id, GLint wrap_mode, GLint mag_filter,
325  GLint min_filter)
326 {
332 }
333 
335 {
336  switch (type)
337  {
338 #ifndef HAVE_OPENGLES
339  case RARCH_WRAP_BORDER: /* GL_CLAMP_TO_BORDER: Available since GL 1.3 */
340  return GL_CLAMP_TO_BORDER;
341 #else
342  case RARCH_WRAP_BORDER:
343 #endif
344  case RARCH_WRAP_EDGE:
345  return GL_CLAMP_TO_EDGE;
346  case RARCH_WRAP_REPEAT:
347  return GL_REPEAT;
349  return GL_MIRRORED_REPEAT;
350  default:
351  break;
352  }
353 
354  return 0;
355 }
356 
358 
360  GLint level,
362  GLsizei width,
363  GLsizei height,
364  GLint border,
365  GLenum format,
366  GLenum type,
367  const GLvoid * data);
368 
370  uint32_t id_data,
371  enum gfx_wrap_type wrap_type,
372  enum texture_filter_type filter_type,
373  unsigned alignment,
374  unsigned width, unsigned height,
375  const void *frame, unsigned base_size);
376 
378 {
379  switch (type)
380  {
382  return GL_LINEAR;
384  return GL_NEAREST;
385  default:
386  break;
387  }
388 
389  return type;
390 }
391 
393 {
395  if (ctx_type != RETRO_HW_CONTEXT_OPENGL_CORE)
396  return false;
397 
401  flags.flags = 0;
403 
405 
406  return true;
407 }
408 
410 
411 #endif
void(* restore_default_state)(gl_t *gl, void *chain_data)
Definition: gl_common.h:191
void(* deinit_fbo)(gl_t *gl, void *chain_data)
Definition: gl_common.h:200
math_matrix_4x4 mvp
Definition: gl_common.h:311
struct video_tex_info tex_info
Definition: gl_common.h:308
Definition: video_coord_array.h:28
GLenum wrap_mode
Definition: gl_common.h:241
retro_hw_context_type
Definition: libretro.h:1935
bool quitting
Definition: gl_common.h:253
void(* unbind_pbo)(void *data, void *chain_data)
Definition: gl_common.h:184
#define GL_MIRRORED_REPEAT
Definition: glext.h:284
void(* ff_matrix)(const void *data)
Definition: gl_common.h:198
Definition: matrix_4x4.h:40
#define GL_LINEAR_MIPMAP_LINEAR
Definition: nx_gl.h:495
#define GL_NEAREST
Definition: nx_gl.h:503
#define glBindTexture
Definition: glsmsym.h:57
#define INLINE
Definition: retro_inline.h:35
static INLINE bool gl_set_core_context(enum retro_hw_context_type ctx_type)
Definition: gl_common.h:392
void(* init)(gl_t *gl, void *chain_data, unsigned fbo_width, unsigned fbo_height)
Definition: gl_common.h:209
#define RETRO_BEGIN_DECLS
Definition: retro_common_api.h:41
bool should_resize
Definition: gl_common.h:252
GLuint buffer
Definition: glext.h:6555
Definition: video_shader_parse.h:80
void(* set_mvp)(void *data, void *chain_data, void *shader_data, const void *mat_data)
Definition: gl_common.h:166
void(* start_render)(gl_t *gl, void *chain_data, video_frame_info_t *video_info)
Definition: gl_common.h:215
GLenum internalFormat
Definition: glext.h:9307
struct scaler_ctx scaler
Definition: gl_common.h:313
bool has_fbo
Definition: gl_common.h:248
Definition: ffmpeg_core.c:151
GLuint pbo_readback[4]
Definition: gl_common.h:279
static const unsigned hard_sync_frames
Definition: config.def.h:166
float * overlay_vertex_coord
Definition: gl_common.h:304
bool menu_texture_enable
Definition: gl_common.h:263
void(* copy_frame)(gl_t *gl, void *chain_data, video_frame_info_t *video_info, const void *frame, unsigned width, unsigned height, unsigned pitch)
Definition: gl_common.h:185
unsigned int GLuint
Definition: nx_gl.h:48
GLsizeiptr size
Definition: glext.h:6559
const float * vertex_ptr
Definition: gl_common.h:302
#define GL_TEXTURE_WRAP_T
Definition: nx_gl.h:472
#define GFX_MAX_TEXTURES
Definition: video_shader_parse.h:34
bool pbo_readback_enable
Definition: gl_common.h:267
Definition: video_driver.h:625
bool menu_texture_full_screen
Definition: gl_common.h:264
int GLsizei
Definition: nx_gl.h:49
bool hw_render_fbo_init
Definition: gl_common.h:247
typedef void(__stdcall *PFN_DESTRUCTION_CALLBACK)(void *pData)
unsigned pbo_readback_index
Definition: gl_common.h:293
unsigned vp_out_width
Definition: gl_common.h:287
struct video_tex_info prev_info[GFX_MAX_TEXTURES]
Definition: gl_common.h:315
void(* bind_pbo)(unsigned idx)
Definition: gl_common.h:183
struct scaler_ctx pbo_readback_scaler
Definition: gl_common.h:309
Definition: ibxm.h:9
bool(* read_viewport)(gl_t *gl, void *chain_data, uint8_t *buffer, bool is_idle)
Definition: gl_common.h:201
Definition: video_coord_array.h:48
unsigned tex_index
Definition: gl_common.h:283
void(* init_pbo)(unsigned size, const void *data)
Definition: gl_common.h:182
const gl_renderchain_driver_t * renderchain_driver
Definition: gl_common.h:318
bool core_context_in_use
Definition: gl_common.h:250
GLsizei GLsizei GLenum GLenum const GLvoid * data
Definition: glext.h:6303
unsigned last_width[GFX_MAX_TEXTURES]
Definition: gl_common.h:294
typedef bool(RETRO_CALLCONV *retro_replace_image_index_t)(unsigned index
GLuint * overlay_tex
Definition: gl_common.h:277
Definition: scaler.h:62
GLuint menu_texture
Definition: gl_common.h:278
bool(* init_hw_render)(gl_t *gl, void *chain_data, unsigned width, unsigned height)
Definition: gl_common.h:211
#define GL_CLAMP_TO_EDGE
Definition: glext.h:81
void(* renderchain_render)(gl_t *gl, void *chain_data, video_frame_info_t *video_info, uint64_t frame_count, const struct video_tex_info *tex_info, const struct video_tex_info *feedback_info)
Definition: gl_common.h:222
void(* unbind_vao)(void *data, void *chain_data)
Definition: gl_common.h:195
void(* fence_iterate)(void *data, void *chain_data, unsigned hard_sync_frames)
Definition: gl_common.h:174
GLuint coords
Definition: glext.h:8035
unsigned textures
Definition: gl_common.h:284
#define GL_TEXTURE_WRAP_S
Definition: nx_gl.h:471
bool fullscreen
Definition: gl_common.h:254
static INLINE void gl_bind_texture(GLuint id, GLint wrap_mode, GLint mag_filter, GLint min_filter)
Definition: gl_common.h:324
GLenum type
Definition: glext.h:6233
const char * ident
Definition: gl_common.h:233
Definition: video_driver.h:405
bool have_sync
Definition: gl_common.h:265
const float * white_color_ptr
Definition: gl_common.h:303
bool have_full_npot_support
Definition: gl_common.h:258
void(* bind_backbuffer)(void *data, void *chain_data)
Definition: gl_common.h:199
#define BIT32_SET(a, bit)
Definition: retro_miscellaneous.h:109
GLuint fbo_feedback_texture
Definition: gl_common.h:275
void(* new_vao)(void *data, void *chain_data)
Definition: gl_common.h:192
Definition: video_shader_parse.h:81
unsigned last_height[GFX_MAX_TEXTURES]
Definition: gl_common.h:295
unsigned overlays
Definition: gl_common.h:292
unsigned tex_h
Definition: gl_common.h:290
unsigned int GLenum
Definition: nx_gl.h:39
bool overlay_enable
Definition: gl_common.h:261
bool have_mipmap
Definition: gl_common.h:259
void(* free_vao)(void *data, void *chain_data)
Definition: gl_common.h:193
GLint level
Definition: glext.h:6293
bool video_context_driver_set_flags(gfx_ctx_flags_t *flags)
Definition: video_driver.c:3353
void(* free)(gl_t *gl, void *chain_data)
Definition: gl_common.h:213
void(* chain_free)(void *data, void *chain_data)
Definition: gl_common.h:207
const gfx_ctx_driver_t * ctx_driver
Definition: gl_common.h:321
bool vsync
Definition: gl_common.h:243
void(* disable_client_arrays)(void *data, void *chain_data)
Definition: gl_common.h:196
Definition: video_driver.h:513
#define GL_TEXTURE_2D
Definition: nx_gl.h:470
Definition: video_driver.h:332
texture_filter_type
Definition: video_defines.h:24
GLenum src
Definition: glext.h:6980
Definition: video_coord_array.h:56
bool support_unpack_row_length
Definition: gl_common.h:256
void * ctx_data
Definition: gl_common.h:320
GLenum texture_fmt
Definition: gl_common.h:240
bool overlay_full_screen
Definition: gl_common.h:262
bool gl_query_core_context_in_use(void)
Definition: gl_capabilities.c:36
bool keep_aspect
Definition: gl_common.h:255
#define GL_NEAREST_MIPMAP_NEAREST
Definition: nx_gl.h:492
GLuint fbo_feedback
Definition: gl_common.h:274
set set set set set set set macro pixldst1 abits if abits op else op endif endm macro pixldst2 abits if abits op else op endif endm macro pixldst4 abits if abits op else op endif endm macro pixldst0 idx
Definition: pixman-arm-neon-asm.h:96
#define GL_TEXTURE_MIN_FILTER
Definition: nx_gl.h:474
#define RETRO_END_DECLS
Definition: retro_common_api.h:42
GLint GLint GLsizei GLsizei GLsizei GLint border
Definition: glext.h:6293
Definition: libretro.h:1944
void GLvoid
Definition: nx_gl.h:42
bool tex_mipmap
Definition: gl_common.h:244
#define GL_CLAMP_TO_BORDER
Definition: glext.h:235
Definition: video_shader_parse.h:82
float * overlay_tex_coord
Definition: gl_common.h:305
void(* set_coords)(void *handle_data, void *chain_data, void *shader_data, const struct video_coords *coords)
Definition: gl_common.h:163
unsigned base_size
Definition: gl_common.h:291
GLuint tex_mag_filter
Definition: gl_common.h:272
void * readback_buffer_screenshot
Definition: gl_common.h:301
void * renderchain_data
Definition: gl_common.h:319
void(* recompute_pass_sizes)(gl_t *gl, void *chain_data, unsigned width, unsigned height, unsigned vp_width, unsigned vp_height)
Definition: gl_common.h:218
void(* bind_vao)(void *data, void *chain_data)
Definition: gl_common.h:194
GLenum texture_type
Definition: gl_common.h:239
Definition: video_driver.h:686
#define GL_LINEAR
Definition: nx_gl.h:269
void(* readback)(gl_t *gl, void *chain_data, unsigned alignment, unsigned fmt, unsigned type, void *src)
Definition: gl_common.h:177
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: glext.h:6293
static INLINE unsigned gl_wrap_type_to_enum(enum gfx_wrap_type type)
Definition: gl_common.h:334
Definition: gl_common.h:236
GLint GLint GLsizei width
Definition: glext.h:6293
void(* bind_prev_texture)(gl_t *gl, void *chain_data, const struct video_tex_info *tex_info)
Definition: gl_common.h:203
static INLINE GLenum gl_min_filter_to_mag(GLenum type)
Definition: gl_common.h:377
int version_major
Definition: gl_common.h:269
bool hw_render_use
Definition: gl_common.h:249
void(* deinit_hw_render)(gl_t *gl, void *chain_data)
Definition: gl_common.h:214
bool pbo_readback_valid[4]
Definition: gl_common.h:266
Definition: ffmpeg_fft.c:36
unsigned tex_w
Definition: gl_common.h:289
void(* ff_vertex)(const void *data)
Definition: gl_common.h:197
Definition: video_driver.h:116
GLuint pbo
Definition: gl_common.h:276
void * empty_buf
Definition: gl_common.h:299
gfx_wrap_type
Definition: video_shader_parse.h:75
void(* fence_free)(void *data, void *chain_data)
Definition: gl_common.h:176
RGLSYMGLTEXPARAMETERIPROC glTexParameteri
Definition: nx_glsym.h:656
GLuint hw_render_fbo[GFX_MAX_TEXTURES]
Definition: gl_common.h:281
void * conv_buffer
Definition: gl_common.h:300
bool fbo_inited
Definition: gl_common.h:245
#define GFX_MAX_SHADERS
Definition: video_shader_parse.h:30
Definition: metal_common.m:516
int version_minor
Definition: gl_common.h:270
void(* resolve_extensions)(gl_t *gl, void *chain_data, const char *context_ident, const video_info_t *video)
Definition: gl_common.h:228
struct video_viewport vp
Definition: gl_common.h:310
GLuint tex_min_filter
Definition: gl_common.h:273
unsigned vp_out_height
Definition: gl_common.h:288
GLenum internal_fmt
Definition: gl_common.h:238
bool have_es2_compat
Definition: gl_common.h:257
Definition: gl_common.h:161
video_info_t video_info
Definition: gl_common.h:314
void(* check_fbo_dimensions)(gl_t *gl, void *chain_data)
Definition: gl_common.h:217
void(* init_texture_reference)(gl_t *gl, void *chain_data, unsigned i, unsigned internal_fmt, unsigned texture_fmt, unsigned texture_type)
Definition: gl_common.h:170
GLbitfield flags
Definition: glext.h:7828
#define GL_TEXTURE_MAG_FILTER
Definition: nx_gl.h:473
float * overlay_color_coord
Definition: gl_common.h:306
unsigned fbo_feedback_pass
Definition: gl_common.h:285
math_matrix_4x4 mvp_no_rot
Definition: gl_common.h:311
void gl_load_texture_image(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *data)
Definition: gl_common.c:47
unsigned __int64 uint64_t
Definition: stdint.h:136
unsigned char uint8_t
Definition: stdint.h:124
unsigned int uint32_t
Definition: stdint.h:126
int GLint
Definition: nx_gl.h:45
float menu_texture_alpha
Definition: gl_common.h:297
Definition: video_shader_parse.h:77
GLint GLint GLsizei GLsizei height
Definition: glext.h:6293
void gl_load_texture_data(uint32_t id_data, enum gfx_wrap_type wrap_type, enum texture_filter_type filter_type, unsigned alignment, unsigned width, unsigned height, const void *frame, unsigned base_size)
Definition: gl.c:604
bool fbo_feedback_enable
Definition: gl_common.h:246
#define GL_REPEAT
Definition: nx_gl.h:504
struct video_fbo_rect fbo_rect[GFX_MAX_SHADERS]
Definition: gl_common.h:316
unsigned rotation
Definition: gl_common.h:286