gpu-screen-recorder/include/shader.h
dec05eba f6107a0c5d Fix AMD single monitor rotated display being rotated in recording
If there is only one monitor connected and it's rotated then
the drm buf will also be rotated. This only the case with AMD and
only when using one monitor!

To fix this, we perform color conversion with an opengl shader
which allows us to also rotate the texture.
VAAPI supports rotation but it's not implemented by AMD at least.

Performance seems to be the same as when using VAAPI, even when
GPU usage is 100%.
2023-04-15 19:06:08 +02:00

20 lines
552 B
C

#ifndef GSR_SHADER_H
#define GSR_SHADER_H
#include "egl.h"
typedef struct {
gsr_egl *egl;
unsigned int program_id;
} gsr_shader;
/* |vertex_shader| or |fragment_shader| may be NULL */
int gsr_shader_init(gsr_shader *self, gsr_egl *egl, const char *vertex_shader, const char *fragment_shader);
void gsr_shader_deinit(gsr_shader *self);
int gsr_shader_bind_attribute_location(gsr_shader *self, const char *attribute, int location);
void gsr_shader_use(gsr_shader *self);
void gsr_shader_use_none(gsr_shader *self);
#endif /* GSR_SHADER_H */