From 91f3da4208b660a074c49c8113f1bfcf26042f8b Mon Sep 17 00:00:00 2001 From: PatTheMav Date: Fri, 20 Jun 2025 21:25:47 +0200 Subject: [PATCH] Add check for Metal in render function Metal does not require the "rect" effect and can use the default effect just like D3D11. --- obs-browser-source.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/obs-browser-source.cpp b/obs-browser-source.cpp index 87dcc9bb6..edad36eda 100644 --- a/obs-browser-source.cpp +++ b/obs-browser-source.cpp @@ -633,7 +633,14 @@ void BrowserSource::Render() if (texture) { #ifdef __APPLE__ - gs_effect_t *effect = obs_get_base_effect((hwaccel) ? OBS_EFFECT_DEFAULT_RECT : OBS_EFFECT_DEFAULT); + int type = gs_get_device_type(); + gs_effect_t *effect; + + if (type == GS_DEVICE_OPENGL) { + effect = obs_get_base_effect((hwaccel) ? OBS_EFFECT_DEFAULT_RECT : OBS_EFFECT_DEFAULT); + } else { + effect = obs_get_base_effect(OBS_EFFECT_DEFAULT); + } #else gs_effect_t *effect = obs_get_base_effect(OBS_EFFECT_DEFAULT); #endif