History

mac/vulkan: add support for visibility check for rendering

der richter committed 1 year ago

Commit 5010c241 parent 49b8f392 files · +11 −0Browse files

Unified · Split

2 files
  1. video/out/mac_common.swift +4 −0
  2. video/out/vulkan/context_mac.m +7 −0
video/out/mac_common.swift+4−0
@@ -109,6 +109,10 @@ class MacCommon: Common { · 108 unmodified lines
109 info.pointee.last_queue_display_time = next?.time ?? -1109 info.pointee.last_queue_display_time = next?.time ?? -1
110 }110 }
111 111
112 @objc func isVisible() -> Bool {
113 return window?.occlusionState.contains(.visible) ?? false
114 }
115
112 override func displayLinkCallback(_ displayLink: CVDisplayLink,116 override func displayLinkCallback(_ displayLink: CVDisplayLink,
113 _ inNow: UnsafePointer<CVTimeStamp>,117 _ inNow: UnsafePointer<CVTimeStamp>,
114 _ inOutputTime: UnsafePointer<CVTimeStamp>,118 _ inOutputTime: UnsafePointer<CVTimeStamp>,
video/out/vulkan/context_mac.m+7−0
@@ -55,6 +55,12 @@ static int mac_vk_color_depth(struct ra_ctx *ctx) · 54 unmodified lines
55 return 0;55 return 0;
56}56}
57 57
58static bool mac_vk_check_visible(struct ra_ctx *ctx)
59{
60 struct priv *p = ctx->priv;
61 return [p->vo_mac isVisible];
62}
63
58static bool mac_vk_init(struct ra_ctx *ctx)64static bool mac_vk_init(struct ra_ctx *ctx)
59{65{
60 struct priv *p = ctx->priv = talloc_zero(ctx, struct priv);66 struct priv *p = ctx->priv = talloc_zero(ctx, struct priv);
@@ -84,6 +90,7 @@ static bool mac_vk_init(struct ra_ctx *ctx) · 23 unmodified lines
84 .swap_buffers = mac_vk_swap_buffers,90 .swap_buffers = mac_vk_swap_buffers,
85 .get_vsync = mac_vk_get_vsync,91 .get_vsync = mac_vk_get_vsync,
86 .color_depth = mac_vk_color_depth,92 .color_depth = mac_vk_color_depth,
93 .check_visible = mac_vk_check_visible,
87 };94 };
88 95
89 VkInstance inst = vk->vkinst->instance;96 VkInstance inst = vk->vkinst->instance;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t