File: apple_wsi.mm

package info (click to toggle)
vulkan-validationlayers 1.4.321.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 47,412 kB
  • sloc: cpp: 594,175; python: 11,321; sh: 24; makefile: 20; xml: 14
file content (19 lines) | stat: -rw-r--r-- 559 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include "apple_wsi.h"
#include <vulkan/utility/vk_struct_helper.hpp>

// Needed to get the CAMetalLayer
#import <QuartzCore/CAMetalLayer.h>

namespace vkt {

// This function is based off of glfw's WSI code for MoltenVK.
// Main exception is we do link against the QuartzCore framework.
// https://github.com/glfw/glfw/blob/3.3.8/src/cocoa_window.m#L1832
VkMetalSurfaceCreateInfoEXT CreateMetalSurfaceInfoEXT() {
    VkMetalSurfaceCreateInfoEXT info = vku::InitStructHelper();
    info.pLayer = [CAMetalLayer layer];

    return info;
}

}  // namespace vkt