aboutsummaryrefslogtreecommitdiff
path: root/src/encoder/video/vaapi.c
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2025-06-09 22:11:16 +0200
committerdec05eba <dec05eba@protonmail.com>2025-06-09 22:11:16 +0200
commit7f00ce22e7e86904e09f900422dfa591d045f447 (patch)
tree7ba28db730298c462b3a028348b4960977e751c2 /src/encoder/video/vaapi.c
parent3ba1dbda98fcf221eb92d241b753ccdef9eb2a08 (diff)
Revert "Fix screen and portal capture not working on some intel gpus"
This reverts commit 3ba1dbda98fcf221eb92d241b753ccdef9eb2a08.
Diffstat (limited to 'src/encoder/video/vaapi.c')
-rw-r--r--src/encoder/video/vaapi.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/encoder/video/vaapi.c b/src/encoder/video/vaapi.c
index 0daf4d8..c7ccd26 100644
--- a/src/encoder/video/vaapi.c
+++ b/src/encoder/video/vaapi.c
@@ -92,6 +92,10 @@ static bool gsr_video_encoder_vaapi_setup_textures(gsr_video_encoder_vaapi *self
if(self->prime.fourcc == VA_FOURCC_NV12 || self->prime.fourcc == VA_FOURCC_P010) {
const uint32_t *formats = self->prime.fourcc == VA_FOURCC_NV12 ? formats_nv12 : formats_p010;
const int div[2] = {1, 2}; // divide UV texture size by 2 because chroma is half size
+ const float border_colors[2][4] = {
+ {0.0f, 0.0f, 0.0f, 1.0f},
+ {0.5f, 0.5f, 0.0f, 1.0f}
+ };
self->params.egl->glGenTextures(2, self->target_textures);
for(int i = 0; i < 2; ++i) {
@@ -121,6 +125,9 @@ static bool gsr_video_encoder_vaapi_setup_textures(gsr_video_encoder_vaapi *self
}
self->params.egl->glBindTexture(GL_TEXTURE_2D, self->target_textures[i]);
+ self->params.egl->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER);
+ self->params.egl->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER);
+ self->params.egl->glTexParameterfv(GL_TEXTURE_2D, GL_TEXTURE_BORDER_COLOR, border_colors[i]);
self->params.egl->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
self->params.egl->glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);