win-capture: Support linear SRGB

For game capture, neither GL nor D3D9 support SRGB shared textures, so
disable linear SRGB support if the texture format doesn't support it.

Similarly, DXGI display capture doesn't work with SRGB at the moment.
Unsure if it will with more work, but disable for now.

Also force linear SRGB off if using GDI-compatible textures.
This commit is contained in:
jpark37
2021-01-20 08:20:51 -08:00
parent 015ed39923
commit a311299606
3 changed files with 24 additions and 1 deletions

View File

@@ -236,6 +236,8 @@ static void duplicator_capture_render(void *data, gs_effect_t *effect)
rot = capture->rot;
const bool previous = gs_set_linear_srgb(false);
while (gs_effect_loop(effect, "Draw")) {
if (rot != 0) {
float x = 0.0f;
@@ -265,6 +267,8 @@ static void duplicator_capture_render(void *data, gs_effect_t *effect)
gs_matrix_pop();
}
gs_set_linear_srgb(previous);
if (capture->capture_cursor) {
effect = obs_get_base_effect(OBS_EFFECT_DEFAULT);