mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-01-01 12:46:12 +00:00
c/main: Use get_vk more
This commit is contained in:
parent
c6031a26e8
commit
78936d2b4e
|
@ -68,6 +68,12 @@ comp_window_direct_nvidia_init_swapchain(struct comp_target *ct, uint32_t width,
|
|||
*
|
||||
*/
|
||||
|
||||
static inline struct vk_bundle *
|
||||
get_vk(struct comp_target *ct)
|
||||
{
|
||||
return &ct->c->vk;
|
||||
}
|
||||
|
||||
static void
|
||||
_flush(struct comp_target *ct)
|
||||
{
|
||||
|
@ -163,7 +169,7 @@ static bool
|
|||
comp_window_direct_nvidia_init(struct comp_target *ct)
|
||||
{
|
||||
struct comp_window_direct_nvidia *w_direct = (struct comp_window_direct_nvidia *)ct;
|
||||
struct vk_bundle *vk = &ct->c->vk;
|
||||
struct vk_bundle *vk = get_vk(ct);
|
||||
|
||||
// Sanity check.
|
||||
if (vk->instance == VK_NULL_HANDLE) {
|
||||
|
|
|
@ -174,9 +174,10 @@ static bool
|
|||
comp_window_direct_randr_init(struct comp_target *ct)
|
||||
{
|
||||
struct comp_window_direct_randr *w_direct = (struct comp_window_direct_randr *)ct;
|
||||
struct vk_bundle *vk = get_vk(w_direct);
|
||||
|
||||
// Sanity check.
|
||||
if (ct->c->vk.instance != VK_NULL_HANDLE) {
|
||||
if (vk->instance != VK_NULL_HANDLE) {
|
||||
COMP_ERROR(ct->c, "Vulkan initialized before RANDR init!");
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -66,6 +66,12 @@ comp_window_vk_display_init_swapchain(struct comp_target *ct, uint32_t width, ui
|
|||
*
|
||||
*/
|
||||
|
||||
static inline struct vk_bundle *
|
||||
get_vk(struct comp_target *ct)
|
||||
{
|
||||
return &ct->c->vk;
|
||||
}
|
||||
|
||||
static void
|
||||
_flush(struct comp_target *ct)
|
||||
{
|
||||
|
@ -152,7 +158,7 @@ static bool
|
|||
comp_window_vk_display_init(struct comp_target *ct)
|
||||
{
|
||||
struct comp_window_vk_display *w_direct = (struct comp_window_vk_display *)ct;
|
||||
struct vk_bundle *vk = &ct->c->vk;
|
||||
struct vk_bundle *vk = get_vk(ct);
|
||||
|
||||
// Sanity check.
|
||||
if (vk->instance == VK_NULL_HANDLE) {
|
||||
|
|
Loading…
Reference in a new issue