RetroArch
Classes | Macros | Typedefs | Functions | Variables
gl2_renderchain.c File Reference
#include <stdio.h>
#include <stdint.h>
#include <math.h>
#include <string.h>
#include <retro_common_api.h>
#include <libretro.h>
#include <compat/strl.h>
#include <gfx/scaler/scaler.h>
#include <formats/image.h>
#include <retro_inline.h>
#include <retro_miscellaneous.h>
#include <retro_math.h>
#include <string/stdstring.h>
#include <gfx/gl_capabilities.h>
#include <gfx/video_frame.h>
#include <glsym/glsym.h>
#include "../video_driver.h"
#include "../video_shader_parse.h"
#include "../common/gl_common.h"
#include "../../driver.h"
#include "../../configuration.h"
#include "../../verbosity.h"
Include dependency graph for gl2_renderchain.c:

Classes

struct  gl2_renderchain
 

Macros

#define MAX_FENCES   4
 
#define HAVE_GL_SYNC
 
#define set_texture_coords(coords, xamt, yamt)
 
#define gl2_fb_texture_2d(a, b, c, d, e)   glFramebufferTexture2D(a, b, c, d, e)
 
#define gl2_check_fb_status(target)   glCheckFramebufferStatus(target)
 
#define gl2_gen_fb(n, ids)   glGenFramebuffers(n, ids)
 
#define gl2_delete_fb(n, fb)   glDeleteFramebuffers(n, fb)
 
#define gl2_bind_fb(id)   glBindFramebuffer(RARCH_GL_FRAMEBUFFER, id)
 
#define gl2_gen_rb   glGenRenderbuffers
 
#define gl2_bind_rb   glBindRenderbuffer
 
#define gl2_fb_rb   glFramebufferRenderbuffer
 
#define gl2_rb_storage   glRenderbufferStorage
 
#define gl2_delete_rb   glDeleteRenderbuffers
 
#define GL_SYNC_GPU_COMMANDS_COMPLETE   0x9117
 
#define GL_SYNC_FLUSH_COMMANDS_BIT   0x00000001
 

Typedefs

typedef struct gl2_renderchain gl2_renderchain_t
 

Functions

static void gl2_renderchain_bind_backbuffer (void *data, void *chain_data)
 
void context_bind_hw_render (void *data, bool enable)
 
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)
 
void gl_set_viewport (gl_t *gl, video_frame_info_t *video_info, unsigned viewport_width, unsigned viewport_height, bool force_full, bool allow_rotate)
 
static void gl2_renderchain_convert_geometry (struct video_fbo_rect *fbo_rect, struct gfx_fbo_scale *fbo_scale, unsigned last_width, unsigned last_max_width, unsigned last_height, unsigned last_max_height, unsigned vp_width, unsigned vp_height)
 
static bool gl_recreate_fbo (struct video_fbo_rect *fbo_rect, GLuint fbo, GLuint *texture)
 
static void gl_check_fbo_dimension (gl_t *gl, void *chain_data, unsigned i, bool update_feedback)
 
static void gl2_renderchain_check_fbo_dimensions (gl_t *gl, void *chain_data)
 
static void gl2_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)
 
static void gl2_renderchain_deinit_fbo (gl_t *gl, void *chain_data)
 
static void gl2_renderchain_deinit_hw_render (gl_t *gl, void *chain_data)
 
static void gl2_renderchain_free (gl_t *gl, void *chain_data)
 
static bool gl_create_fbo_targets (gl_t *gl, void *chain_data)
 
static void gl_create_fbo_texture (gl_t *gl, void *chain_data, unsigned i, GLuint texture)
 
static void gl_create_fbo_textures (gl_t *gl, gl2_renderchain_t *chain)
 
static void gl2_renderchain_recompute_pass_sizes (gl_t *gl, void *chain_data, unsigned width, unsigned height, unsigned vp_width, unsigned vp_height)
 
static void gl2_renderchain_start_render (gl_t *gl, void *chain_data, video_frame_info_t *video_info)
 
void gl2_renderchain_init (gl_t *gl, void *chain_data, unsigned fbo_width, unsigned fbo_height)
 
static bool gl2_renderchain_init_hw_render (gl_t *gl, void *chain_data, unsigned width, unsigned height)
 
static void gl2_renderchain_bind_prev_texture (gl_t *gl, void *chain_data, const struct video_tex_info *tex_info)
 
static bool gl2_renderchain_read_viewport (gl_t *gl, void *chain_data, uint8_t *buffer, bool is_idle)
 
void gl2_renderchain_free_internal (void *data, void *chain_data)
 
static voidgl2_renderchain_new (void)
 
static void gl2_renderchain_bind_vao (void *data, void *chain_data)
 
static void gl2_renderchain_unbind_vao (void *data, void *chain_data)
 
static void gl2_renderchain_new_vao (void *data, void *chain_data)
 
static void gl2_renderchain_free_vao (void *data, void *chain_data)
 
static void gl2_renderchain_restore_default_state (gl_t *gl, void *chain_data)
 
static void gl2_renderchain_copy_frame (gl_t *gl, void *chain_data, video_frame_info_t *video_info, const void *frame, unsigned width, unsigned height, unsigned pitch)
 
static void gl2_renderchain_bind_pbo (unsigned idx)
 
static void gl2_renderchain_unbind_pbo (void *data, void *chain_data)
 
static void gl2_renderchain_init_pbo (unsigned size, const void *data)
 
static void gl2_renderchain_readback (gl_t *gl, void *chain_data, unsigned alignment, unsigned fmt, unsigned type, void *src)
 
static void gl2_renderchain_fence_iterate (void *data, void *chain_data, unsigned hard_sync_frames)
 
static void gl2_renderchain_fence_free (void *data, void *chain_data)
 
static void gl2_renderchain_init_textures_reference (gl_t *gl, void *chain_data, unsigned i, unsigned internal_fmt, unsigned texture_fmt, unsigned texture_type)
 
static void gl2_renderchain_resolve_extensions (gl_t *gl, void *chain_data, const char *context_ident, const video_info_t *video)
 

Variables

gl_renderchain_driver_t gl2_renderchain
 

Macro Definition Documentation

◆ gl2_bind_fb

#define gl2_bind_fb (   id)    glBindFramebuffer(RARCH_GL_FRAMEBUFFER, id)

◆ gl2_bind_rb

#define gl2_bind_rb   glBindRenderbuffer

◆ gl2_check_fb_status

#define gl2_check_fb_status (   target)    glCheckFramebufferStatus(target)

◆ gl2_delete_fb

#define gl2_delete_fb (   n,
  fb 
)    glDeleteFramebuffers(n, fb)

◆ gl2_delete_rb

#define gl2_delete_rb   glDeleteRenderbuffers

◆ gl2_fb_rb

#define gl2_fb_rb   glFramebufferRenderbuffer

◆ gl2_fb_texture_2d

#define gl2_fb_texture_2d (   a,
  b,
  c,
  d,
 
)    glFramebufferTexture2D(a, b, c, d, e)

◆ gl2_gen_fb

#define gl2_gen_fb (   n,
  ids 
)    glGenFramebuffers(n, ids)

◆ gl2_gen_rb

#define gl2_gen_rb   glGenRenderbuffers

◆ gl2_rb_storage

#define gl2_rb_storage   glRenderbufferStorage

◆ GL_SYNC_FLUSH_COMMANDS_BIT

#define GL_SYNC_FLUSH_COMMANDS_BIT   0x00000001

◆ GL_SYNC_GPU_COMMANDS_COMPLETE

#define GL_SYNC_GPU_COMMANDS_COMPLETE   0x9117

◆ HAVE_GL_SYNC

#define HAVE_GL_SYNC

◆ MAX_FENCES

#define MAX_FENCES   4

◆ set_texture_coords

#define set_texture_coords (   coords,
  xamt,
  yamt 
)
Value:
coords[2] = xamt; \
coords[6] = xamt; \
coords[5] = yamt; \
coords[7] = yamt
GLuint coords
Definition: glext.h:8035

Typedef Documentation

◆ gl2_renderchain_t

Function Documentation

◆ context_bind_hw_render()

void context_bind_hw_render ( void data,
bool  enable 
)
Here is the caller graph for this function:

◆ gl2_renderchain_bind_backbuffer()

static void gl2_renderchain_bind_backbuffer ( void data,
void chain_data 
)
static
Here is the caller graph for this function:

◆ gl2_renderchain_bind_pbo()

static void gl2_renderchain_bind_pbo ( unsigned  idx)
static

◆ gl2_renderchain_bind_prev_texture()

static void gl2_renderchain_bind_prev_texture ( gl_t gl,
void chain_data,
const struct video_tex_info tex_info 
)
static
Here is the call graph for this function:

◆ gl2_renderchain_bind_vao()

static void gl2_renderchain_bind_vao ( void data,
void chain_data 
)
static

◆ gl2_renderchain_check_fbo_dimensions()

static void gl2_renderchain_check_fbo_dimensions ( gl_t gl,
void chain_data 
)
static
Here is the call graph for this function:

◆ gl2_renderchain_convert_geometry()

static void gl2_renderchain_convert_geometry ( struct video_fbo_rect fbo_rect,
struct gfx_fbo_scale fbo_scale,
unsigned  last_width,
unsigned  last_max_width,
unsigned  last_height,
unsigned  last_max_height,
unsigned  vp_width,
unsigned  vp_height 
)
static
Here is the caller graph for this function:

◆ gl2_renderchain_copy_frame()

static void gl2_renderchain_copy_frame ( gl_t gl,
void chain_data,
video_frame_info_t video_info,
const void frame,
unsigned  width,
unsigned  height,
unsigned  pitch 
)
static
Here is the call graph for this function:

◆ gl2_renderchain_deinit_fbo()

static void gl2_renderchain_deinit_fbo ( gl_t gl,
void chain_data 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gl2_renderchain_deinit_hw_render()

static void gl2_renderchain_deinit_hw_render ( gl_t gl,
void chain_data 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gl2_renderchain_fence_free()

static void gl2_renderchain_fence_free ( void data,
void chain_data 
)
static

◆ gl2_renderchain_fence_iterate()

static void gl2_renderchain_fence_iterate ( void data,
void chain_data,
unsigned  hard_sync_frames 
)
static

◆ gl2_renderchain_free()

static void gl2_renderchain_free ( gl_t gl,
void chain_data 
)
static
Here is the call graph for this function:

◆ gl2_renderchain_free_internal()

void gl2_renderchain_free_internal ( void data,
void chain_data 
)
Here is the call graph for this function:

◆ gl2_renderchain_free_vao()

static void gl2_renderchain_free_vao ( void data,
void chain_data 
)
static

◆ gl2_renderchain_init()

void gl2_renderchain_init ( gl_t gl,
void chain_data,
unsigned  fbo_width,
unsigned  fbo_height 
)
Here is the call graph for this function:

◆ gl2_renderchain_init_hw_render()

static bool gl2_renderchain_init_hw_render ( gl_t gl,
void chain_data,
unsigned  width,
unsigned  height 
)
static
Here is the call graph for this function:

◆ gl2_renderchain_init_pbo()

static void gl2_renderchain_init_pbo ( unsigned  size,
const void data 
)
static

◆ gl2_renderchain_init_textures_reference()

static void gl2_renderchain_init_textures_reference ( gl_t gl,
void chain_data,
unsigned  i,
unsigned  internal_fmt,
unsigned  texture_fmt,
unsigned  texture_type 
)
static
Here is the call graph for this function:

◆ gl2_renderchain_new()

static void* gl2_renderchain_new ( void  )
static

◆ gl2_renderchain_new_vao()

static void gl2_renderchain_new_vao ( void data,
void chain_data 
)
static

◆ gl2_renderchain_read_viewport()

static bool gl2_renderchain_read_viewport ( gl_t gl,
void chain_data,
uint8_t buffer,
bool  is_idle 
)
static
Here is the call graph for this function:

◆ gl2_renderchain_readback()

static void gl2_renderchain_readback ( gl_t gl,
void chain_data,
unsigned  alignment,
unsigned  fmt,
unsigned  type,
void src 
)
static

◆ gl2_renderchain_recompute_pass_sizes()

static void gl2_renderchain_recompute_pass_sizes ( gl_t gl,
void chain_data,
unsigned  width,
unsigned  height,
unsigned  vp_width,
unsigned  vp_height 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gl2_renderchain_render()

static void gl2_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 
)
static
Here is the call graph for this function:

◆ gl2_renderchain_resolve_extensions()

static void gl2_renderchain_resolve_extensions ( gl_t gl,
void chain_data,
const char *  context_ident,
const video_info_t video 
)
static
Here is the call graph for this function:

◆ gl2_renderchain_restore_default_state()

static void gl2_renderchain_restore_default_state ( gl_t gl,
void chain_data 
)
static

◆ gl2_renderchain_start_render()

static void gl2_renderchain_start_render ( gl_t gl,
void chain_data,
video_frame_info_t video_info 
)
static
Here is the call graph for this function:

◆ gl2_renderchain_unbind_pbo()

static void gl2_renderchain_unbind_pbo ( void data,
void chain_data 
)
static

◆ gl2_renderchain_unbind_vao()

static void gl2_renderchain_unbind_vao ( void data,
void chain_data 
)
static

◆ gl_check_fbo_dimension()

static void gl_check_fbo_dimension ( gl_t gl,
void chain_data,
unsigned  i,
bool  update_feedback 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gl_create_fbo_targets()

static bool gl_create_fbo_targets ( gl_t gl,
void chain_data 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gl_create_fbo_texture()

static void gl_create_fbo_texture ( gl_t gl,
void chain_data,
unsigned  i,
GLuint  texture 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gl_create_fbo_textures()

static void gl_create_fbo_textures ( gl_t gl,
gl2_renderchain_t chain 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gl_load_texture_data()

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 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gl_recreate_fbo()

static bool gl_recreate_fbo ( struct video_fbo_rect fbo_rect,
GLuint  fbo,
GLuint texture 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gl_set_viewport()

void gl_set_viewport ( gl_t gl,
video_frame_info_t video_info,
unsigned  viewport_width,
unsigned  viewport_height,
bool  force_full,
bool  allow_rotate 
)
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ gl2_renderchain