Skip to content

Commit e5f0dbf

Browse files
PatTheMavRytoEX
authored andcommitted
Add check for Metal in render function
Metal does not require the "rect" effect and can use the default effect just like D3D11.
1 parent bdabf83 commit e5f0dbf

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

obs-browser-source.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,14 @@ void BrowserSource::Render()
633633

634634
if (texture) {
635635
#ifdef __APPLE__
636-
gs_effect_t *effect = obs_get_base_effect((hwaccel) ? OBS_EFFECT_DEFAULT_RECT : OBS_EFFECT_DEFAULT);
636+
int type = gs_get_device_type();
637+
gs_effect_t *effect;
638+
639+
if (type == GS_DEVICE_OPENGL) {
640+
effect = obs_get_base_effect((hwaccel) ? OBS_EFFECT_DEFAULT_RECT : OBS_EFFECT_DEFAULT);
641+
} else {
642+
effect = obs_get_base_effect(OBS_EFFECT_DEFAULT);
643+
}
637644
#else
638645
gs_effect_t *effect = obs_get_base_effect(OBS_EFFECT_DEFAULT);
639646
#endif

0 commit comments

Comments
 (0)