소스 검색

plugins: Update plugins to use default draw effect for Metal

PatTheMav 1 년 전
부모
커밋
95ea65136f
4개의 변경된 파일23개의 추가작업 그리고 4개의 파일을 삭제
  1. 6 1
      plugins/mac-avcapture/plugin-main.m
  2. 6 1
      plugins/mac-capture/mac-display-capture.m
  3. 6 1
      plugins/mac-capture/mac-sck-video-capture.m
  4. 5 1
      plugins/mac-syphon/syphon.m

+ 6 - 1
plugins/mac-avcapture/plugin-main.m

@@ -34,7 +34,12 @@ static void *av_fast_capture_create(obs_data_t *settings, obs_source_t *source)
     capture_info->isFastPath = true;
     capture_info->settings = settings;
     capture_info->source = source;
-    capture_info->effect = obs_get_base_effect(OBS_EFFECT_DEFAULT_RECT);
+
+    if (gs_get_device_type() == GS_DEVICE_OPENGL) {
+        capture_info->effect = obs_get_base_effect(OBS_EFFECT_DEFAULT_RECT);
+    } else {
+        capture_info->effect = obs_get_base_effect(OBS_EFFECT_DEFAULT);
+    }
     capture_info->frameSize = CGRectZero;
 
     if (!capture_info->effect) {

+ 6 - 1
plugins/mac-capture/mac-display-capture.m

@@ -255,7 +255,12 @@ static void *display_capture_create(obs_data_t *settings, obs_source_t *source)
     dc->source = source;
     dc->hide_cursor = !obs_data_get_bool(settings, "show_cursor");
 
-    dc->effect = obs_get_base_effect(OBS_EFFECT_DEFAULT_RECT);
+    if (gs_get_device_type() == GS_DEVICE_OPENGL) {
+        dc->effect = obs_get_base_effect(OBS_EFFECT_DEFAULT_RECT);
+    } else {
+        dc->effect = obs_get_base_effect(OBS_EFFECT_DEFAULT);
+    }
+
     if (!dc->effect)
         goto fail;
 

+ 6 - 1
plugins/mac-capture/mac-sck-video-capture.m

@@ -291,7 +291,12 @@ API_AVAILABLE(macos(12.5)) static void *sck_video_capture_create(obs_data_t *set
     sc->capture_delegate = [[ScreenCaptureDelegate alloc] init];
     sc->capture_delegate.sc = sc;
 
-    sc->effect = obs_get_base_effect(OBS_EFFECT_DEFAULT_RECT);
+    if (gs_get_device_type() == GS_DEVICE_OPENGL) {
+        sc->effect = obs_get_base_effect(OBS_EFFECT_DEFAULT_RECT);
+    } else {
+        sc->effect = obs_get_base_effect(OBS_EFFECT_DEFAULT);
+    }
+
     if (!sc->effect)
         goto fail;
 

+ 5 - 1
plugins/mac-syphon/syphon.m

@@ -314,7 +314,11 @@ static inline bool init_obs_graphics_objects(syphon_t s)
     s->vertbuffer = create_vertbuffer();
     obs_leave_graphics();
 
-    s->effect = obs_get_base_effect(OBS_EFFECT_DEFAULT_RECT);
+    if (gs_get_device_type() == GS_DEVICE_OPENGL) {
+        s->effect = obs_get_base_effect(OBS_EFFECT_DEFAULT_RECT);
+    } else {
+        s->effect = obs_get_base_effect(OBS_EFFECT_DEFAULT);
+    }
 
     return s->sampler != NULL && s->vertbuffer != NULL && s->effect != NULL;
 }