mirror of
https://repo.dec05eba.com/gpu-screen-recorder
synced 2026-03-31 09:07:13 +09:00
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%.
This commit is contained in:
19
include/shader.h
Normal file
19
include/shader.h
Normal file
@@ -0,0 +1,19 @@
|
||||
#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 */
|
||||
Reference in New Issue
Block a user