Conversation
|
Hey David, you've managed to get ahead of me! I wanted to dig into this sooner but I've been very busy for the last 6 weeks on my job and personal matters. |
|
So I did a lot of testing today but too tired to wrap it all up properly. I don't want to lose context, so I'm just dumping here my findings 🙇 In short: I have dual-gpu system. Intel Arc 310 as the output, and RTX 3080 as offload for games / CUDA. Wayland/hyprland. I did not know I could run OBS on NVIDIA like this
Your patch is also working but something happened to the preview colors (where @@ static void vkcapture_source_render(void *data, gs_effect_t *effect)
- const enum gs_color_space color_space = gs_get_color_space();
- const bool linear_srgb = gs_get_linear_srgb();
- const char *tech_name = linear_srgb ? "DrawSrgbDecompress" : "Draw";
+ const enum gs_color_space color_space = gs_get_color_space();
+
+ /* Allow overriding sRGB path from environment.
+ OBS_VKCAPTURE_SRGB=0 -> always "Draw" (NO sRGB decompression)
+ OBS_VKCAPTURE_SRGB=1 -> always "DrawSrgbDecompress"
+ unset -> OBS default (gs_get_linear_srgb()) */
+ bool linear_srgb = gs_get_linear_srgb();
+ {
+ const char *env = getenv("OBS_VKCAPTURE_SRGB");
+ if (env && *env) {
+ if (env[0] == '0') linear_srgb = false;
+ else if (env[0] == '1') linear_srgb = true;
+ }
+ }
+ const char *tech_name = linear_srgb ? "DrawSrgbDecompress" : "Draw";
@@
- bool previous = gs_framebuffer_srgb_enabled();
- gs_enable_framebuffer_srgb(linear_srgb);
+ bool previous = gs_framebuffer_srgb_enabled();
+ gs_enable_framebuffer_srgb(linear_srgb);
@@
- gs_enable_framebuffer_srgb(previous);
+ gs_enable_framebuffer_srgb(previous);and then setting Here's how the colors look like: Preview (different than
|
|
The extension is an OpenGL extension, not EGL. It is not supported in any stable Mesa release. So any tests you do, please test it with NVIDIA running both game and OBS and only with games using Vulkan. |
diff --git a/src/vkcapture.c b/src/vkcapture.c
index 58f2f83..f4f1615 100644
--- a/src/vkcapture.c
+++ b/src/vkcapture.c
@@ -647,9 +647,14 @@ static void vkcapture_source_render(void *data, gs_effect_t *effect)
p_glSemaphoreParameterui64vEXT(ctx->semaphore, GL_TIMELINE_SEMAPHORE_VALUE_NV, &value);
p_glWaitSemaphoreEXT(ctx->semaphore, 0, NULL, 1, gs_texture_get_obj(ctx->texture), &layout);
+ const bool previous = gs_framebuffer_srgb_enabled();
+ gs_enable_framebuffer_srgb(false);
+
gs_copy_texture(ctx->texture_copy, ctx->texture);
value++;
+ gs_enable_framebuffer_srgb(previous);
+
p_glSemaphoreParameterui64vEXT(ctx->semaphore, GL_TIMELINE_SEMAPHORE_VALUE_NV, &value);
p_glSignalSemaphoreEXT(ctx->semaphore, 0, NULL, 1, gs_texture_get_obj(ctx->texture), &layout);
Does this help with the colors? |


@konovalov-nk You can try if this helps with the nvidia issue.