High priority egl context if possible, use eglBindAPI(EGL_OPENGL_ES_API)
This commit is contained in:
parent
bee99a69e3
commit
4ad0118f35
3
TODO
3
TODO
@ -37,12 +37,9 @@ Window capture doesn't work properly in _control_ game after going from pause me
|
|||||||
|
|
||||||
Fix constant framerate not working properly on amd/intel because capture framerate gets locked to the same framerate as game framerate, which doesn't work well when you need to encode multiple duplicate frames. We can skip multiple encode if we duplicate frame once and then use that same frame data as the difference between frames will be exactly the same, but hevc complains about that. Is there a way to make hevc shut up?
|
Fix constant framerate not working properly on amd/intel because capture framerate gets locked to the same framerate as game framerate, which doesn't work well when you need to encode multiple duplicate frames. We can skip multiple encode if we duplicate frame once and then use that same frame data as the difference between frames will be exactly the same, but hevc complains about that. Is there a way to make hevc shut up?
|
||||||
|
|
||||||
JPEG color range on amd seems to produce too bright video with h264 but not hevc, why?
|
|
||||||
|
|
||||||
Properly handle monitor reconfiguration (kms vaapi, nvfbc).
|
Properly handle monitor reconfiguration (kms vaapi, nvfbc).
|
||||||
|
|
||||||
Better configure vaapi. The file size is too large.
|
Better configure vaapi. The file size is too large.
|
||||||
Better colors for vaapi. It looks a bit off when recording vscode for example.
|
|
||||||
|
|
||||||
Clear vaapi surface (for focused window).
|
Clear vaapi surface (for focused window).
|
||||||
|
|
||||||
|
@ -38,6 +38,7 @@ typedef void (*__eglMustCastToProperFunctionPointerType)(void);
|
|||||||
#define EGL_BUFFER_SIZE 0x3020
|
#define EGL_BUFFER_SIZE 0x3020
|
||||||
#define EGL_RENDERABLE_TYPE 0x3040
|
#define EGL_RENDERABLE_TYPE 0x3040
|
||||||
#define EGL_OPENGL_ES2_BIT 0x0004
|
#define EGL_OPENGL_ES2_BIT 0x0004
|
||||||
|
#define EGL_OPENGL_ES_API 0x30A0
|
||||||
#define EGL_NONE 0x3038
|
#define EGL_NONE 0x3038
|
||||||
#define EGL_CONTEXT_CLIENT_VERSION 0x3098
|
#define EGL_CONTEXT_CLIENT_VERSION 0x3098
|
||||||
#define EGL_BACK_BUFFER 0x3084
|
#define EGL_BACK_BUFFER 0x3084
|
||||||
@ -59,8 +60,10 @@ typedef void (*__eglMustCastToProperFunctionPointerType)(void);
|
|||||||
#define EGL_ALPHA_SIZE 0x3021
|
#define EGL_ALPHA_SIZE 0x3021
|
||||||
#define EGL_BLUE_SIZE 0x3022
|
#define EGL_BLUE_SIZE 0x3022
|
||||||
#define EGL_GREEN_SIZE 0x3023
|
#define EGL_GREEN_SIZE 0x3023
|
||||||
#define EGL_SURFACE_TYPE 0x3033
|
#define EGL_CONTEXT_PRIORITY_LEVEL_IMG 0x3100
|
||||||
#define EGL_PBUFFER_BIT 0x0001
|
#define EGL_CONTEXT_PRIORITY_HIGH_IMG 0x3101
|
||||||
|
#define EGL_CONTEXT_PRIORITY_MEDIUM_IMG 0x3102
|
||||||
|
#define EGL_CONTEXT_PRIORITY_LOW_IMG 0x3103
|
||||||
|
|
||||||
#define GL_FLOAT 0x1406
|
#define GL_FLOAT 0x1406
|
||||||
#define GL_FALSE 0
|
#define GL_FALSE 0
|
||||||
|
@ -214,12 +214,13 @@ static bool gsr_egl_create_window(gsr_egl *self, bool wayland) {
|
|||||||
const int32_t attr[] = {
|
const int32_t attr[] = {
|
||||||
EGL_BUFFER_SIZE, 24,
|
EGL_BUFFER_SIZE, 24,
|
||||||
EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
|
EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
|
||||||
EGL_NONE
|
EGL_NONE, EGL_NONE
|
||||||
};
|
};
|
||||||
|
|
||||||
const int32_t ctxattr[] = {
|
const int32_t ctxattr[] = {
|
||||||
EGL_CONTEXT_CLIENT_VERSION, 2,
|
EGL_CONTEXT_CLIENT_VERSION, 2,
|
||||||
EGL_NONE
|
EGL_CONTEXT_PRIORITY_LEVEL_IMG, EGL_CONTEXT_PRIORITY_HIGH_IMG,
|
||||||
|
EGL_NONE, EGL_NONE
|
||||||
};
|
};
|
||||||
|
|
||||||
if(wayland) {
|
if(wayland) {
|
||||||
@ -251,7 +252,7 @@ static bool gsr_egl_create_window(gsr_egl *self, bool wayland) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
self->eglBindAPI(EGL_OPENGL_ES2_BIT);
|
self->eglBindAPI(EGL_OPENGL_ES_API);
|
||||||
|
|
||||||
self->egl_display = self->eglGetDisplay(self->wayland.dpy ? (EGLNativeDisplayType)self->wayland.dpy : (EGLNativeDisplayType)self->x11.dpy);
|
self->egl_display = self->eglGetDisplay(self->wayland.dpy ? (EGLNativeDisplayType)self->wayland.dpy : (EGLNativeDisplayType)self->x11.dpy);
|
||||||
if(!self->egl_display) {
|
if(!self->egl_display) {
|
||||||
|
@ -210,6 +210,7 @@ bool get_monitor_by_name(void *connection, gsr_connection_type connection_type,
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool gl_get_gpu_info(gsr_egl *egl, gsr_gpu_info *info) {
|
bool gl_get_gpu_info(gsr_egl *egl, gsr_gpu_info *info) {
|
||||||
|
const char *software_renderers[] = { "llvmpipe", "SWR", "softpipe", NULL };
|
||||||
bool supported = true;
|
bool supported = true;
|
||||||
const unsigned char *gl_vendor = egl->glGetString(GL_VENDOR);
|
const unsigned char *gl_vendor = egl->glGetString(GL_VENDOR);
|
||||||
const unsigned char *gl_renderer = egl->glGetString(GL_RENDERER);
|
const unsigned char *gl_renderer = egl->glGetString(GL_RENDERER);
|
||||||
@ -222,11 +223,15 @@ bool gl_get_gpu_info(gsr_egl *egl, gsr_gpu_info *info) {
|
|||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(gl_renderer && strstr((const char*)gl_renderer, "llvmpipe")) {
|
if(gl_renderer) {
|
||||||
fprintf(stderr, "gsr error: your opengl environment is not properly setup. It's using llvmpipe (cpu fallback) for opengl instead of your graphics card\n");
|
for(int i = 0; software_renderers[i]; ++i) {
|
||||||
|
if(strstr((const char*)gl_renderer, software_renderers[i])) {
|
||||||
|
fprintf(stderr, "gsr error: your opengl environment is not properly setup. It's using %s (software rendering) for opengl instead of your graphics card. Please make sure your graphics driver is properly installed\n", software_renderers[i]);
|
||||||
supported = false;
|
supported = false;
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(strstr((const char*)gl_vendor, "AMD"))
|
if(strstr((const char*)gl_vendor, "AMD"))
|
||||||
info->vendor = GSR_GPU_VENDOR_AMD;
|
info->vendor = GSR_GPU_VENDOR_AMD;
|
||||||
|
Loading…
Reference in New Issue
Block a user