mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-05 01:20:42 +00:00
65b567a944
* For now it expects a CALayer since this works around a MoltenVK bug
19 lines
523 B
Plaintext
19 lines
523 B
Plaintext
#import <Cocoa/Cocoa.h>
|
|
#include <QuartzCore/CAMetalLayer.h>
|
|
|
|
// taken from Arseny's comment explaining how to make Qt widgets metal compatible:
|
|
// https://github.com/KhronosGroup/MoltenVK/issues/78#issuecomment-369838674
|
|
extern "C" void *makeNSViewMetalCompatible(void *handle)
|
|
{
|
|
NSView *view = (NSView *)handle;
|
|
assert([view isKindOfClass:[NSView class]]);
|
|
|
|
if(![view.layer isKindOfClass:[CAMetalLayer class]])
|
|
{
|
|
[view setLayer:[CAMetalLayer layer]];
|
|
[view setWantsLayer:YES];
|
|
}
|
|
|
|
return view.layer;
|
|
}
|