Instantiate the CAMetalLayer so SDL_Vulkan_CreateSurface() doesn't fail
Error message was: [mvk-info] MoltenVK version 0.18.2. Vulkan version 1.0.51. [***MoltenVK ERROR***] VK_ERROR_INITIALIZATION_FAILED: On-screen rendering requires a view that is backed by a layer of type CAMetalLayer. 2017-08-28 02:17:29.579 testvulkan[95627:1716939] ERROR: SDL_Vulkan_CreateSurface(): vkCreateMacOSSurfaceMVK failed: VK_ERROR_INITIALIZATION_FAILED
This commit is contained in:
parent
73ca40b566
commit
314e598054
1 changed files with 2 additions and 1 deletions
|
@ -94,8 +94,9 @@ Cocoa_Mtl_AddMetalView(SDL_Window* window)
|
||||||
SDL_cocoametalview *metalview
|
SDL_cocoametalview *metalview
|
||||||
= [[SDL_cocoametalview alloc] initWithFrame:view.frame
|
= [[SDL_cocoametalview alloc] initWithFrame:view.frame
|
||||||
useHighDPI:(window->flags & SDL_WINDOW_ALLOW_HIGHDPI)];
|
useHighDPI:(window->flags & SDL_WINDOW_ALLOW_HIGHDPI)];
|
||||||
|
// Instantiate the CAMetalLayer
|
||||||
|
metalview.wantsLayer = YES;
|
||||||
[view addSubview:metalview];
|
[view addSubview:metalview];
|
||||||
|
|
||||||
return metalview;
|
return metalview;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue