1
0
mirror of https://github.com/mpv-player/mpv synced 2025-01-10 00:49:32 +00:00
mpv/video/out/opengl/ra_gl.h
wm4 333cae74ef vo_opengl: move shader handling to ra
Now all GL-specifics of shader compilation are abstracted through ra.
Of course we still have everything hardcoded to GLSL - that isn't going
to change.

Some things will probably change later - in particular, the way we pass
uniforms and textures to the shader. Currently, there is a confusing
mismatch between "primitive" uniforms like floats, and others like
textures.

Also, SSBOs are not abstracted yet.
2017-08-05 16:27:09 +02:00

49 lines
1.2 KiB
C

#pragma once
#include "common.h"
#include "ra.h"
#include "gl_utils.h"
// For ra.priv
struct ra_gl {
GL *gl;
};
// For ra_tex.priv
struct ra_tex_gl {
bool own_objects;
GLenum target;
GLuint texture; // 0 if no texture data associated
GLuint fbo; // 0 if no rendering requested, or it default framebuffer
// These 3 fields can be 0 if unknown.
GLint internal_format;
GLenum format;
GLenum type;
struct gl_pbo_upload pbo;
};
// For ra_mapped_buffer.priv
struct ra_mapped_buffer_gl {
GLuint pbo;
GLsync fence;
};
// For ra_renderpass.priv
struct ra_renderpass_gl {
GLuint program;
// 1 entry for each ra_renderpass_params.inputs[] entry
GLint *uniform_loc;
int num_uniform_loc; // == ra_renderpass_params.num_inputs
struct gl_vao vao;
bool first_run;
};
int ra_init_gl(struct ra *ra, GL *gl);
struct ra_tex *ra_create_wrapped_texture(struct ra *ra, GLuint gl_texture,
GLenum gl_target, GLint gl_iformat,
GLenum gl_format, GLenum gl_type,
int w, int h);
struct ra_tex *ra_create_wrapped_fb(struct ra *ra, GLuint gl_fbo, int w, int h);
GL *ra_gl_get(struct ra *ra);