screencopy: fix shm exports with 10-bit

fixes #4019
This commit is contained in:
Vaxry
2023-12-01 17:20:56 +00:00
parent 8440a30231
commit 9c09f2a847
7 changed files with 37 additions and 30 deletions

View File

@@ -781,4 +781,14 @@ uint32_t drmFormatToGL(uint32_t drm) {
}
UNREACHABLE();
return GL_RGBA;
}
uint32_t glFormatToType(uint32_t gl) {
return gl != GL_RGBA ?
#ifdef GLES2
GL_UNSIGNED_INT_2_10_10_10_REV_EXT :
#else
GL_UNSIGNED_INT_2_10_10_10_REV :
#endif
GL_UNSIGNED_BYTE;
}