Commit 36884525 authored by Niklas Haas's avatar Niklas Haas Committed by Hugo Beauzée-Luyssen
Browse files

vulkan: remove refcount from vlc_vk_platform_t

I can't think of a use case for this ever being refcounted. It made more
sense back when it held the actual instance, but the platform/surface is
only ever going to be used by whatever also owns the vout_window_t.
parent f6e9e324
......@@ -27,7 +27,6 @@
#include <vlc_common.h>
#include <vlc_modules.h>
#include <vlc_atomic.h>
#include "platform.h"
......@@ -70,21 +69,12 @@ vlc_vk_platform_t *vlc_vk_platform_Create(struct vout_window_t *wnd, const char
vlc_object_delete(vk);
return NULL;
}
vlc_atomic_rc_init(&vk->ref_count);
return vk;
}
void vlc_vk_platform_Hold(vlc_vk_platform_t *vk)
{
vlc_atomic_rc_inc(&vk->ref_count);
}
void vlc_vk_platform_Release(vlc_vk_platform_t *vk)
{
if (!vlc_atomic_rc_dec(&vk->ref_count))
return;
if (vk->ops)
vk->ops->close(vk);
......
......@@ -22,7 +22,6 @@
#define VLC_VULKAN_PLATFORM_H
#include <vlc_common.h>
#include <vlc_atomic.h>
#include <vlc_vout_window.h>
#include <vulkan/vulkan.h>
......@@ -44,7 +43,6 @@ typedef struct vlc_vk_platform_t
// fields internal to platform.c, should not be touched
struct vlc_object_t obj;
module_t *module;
vlc_atomic_rc_t ref_count;
void *platform_sys;
const char *platform_ext;
......@@ -55,7 +53,6 @@ typedef struct vlc_vk_platform_t
vlc_vk_platform_t *vlc_vk_platform_Create(struct vout_window_t *, const char *) VLC_USED;
void vlc_vk_platform_Release(vlc_vk_platform_t *);
void vlc_vk_platform_Hold(vlc_vk_platform_t *);
// Create a vulkan surface and store it to `surface_out`
static inline int vlc_vk_CreateSurface(vlc_vk_platform_t * vk, VkInstance instance,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment