This commit is contained in:
elwrcl committed 2026-06-06 13:25:15 +03:00
1 parent 04d4dc8b09
commit 818cab85dc
12511 files changed
+6156641

No files matched your search

+50
View File
@@ -0,0 +1,50 @@
/*
* Copyright 2025 LunarG, Inc.
* Copyright 2025 Google LLC
* SPDX-License-Identifier: MIT
*/
#include "mtl_bridge.h"
// kk_image_layout.h should also includes "vulkan/vulkan.h", but just to be safe
#include "vulkan/vulkan.h"
#include "kk_image_layout.h"
#include "util/macros.h"
#include <Metal/MTLCommandBuffer.h>
#include <Metal/MTLCommandQueue.h>
#include <Metal/MTLDevice.h>
#include <Metal/MTLHeap.h>
#include <Metal/MTLEvent.h>
#include <QuartzCore/CAMetalLayer.h>
static_assert(sizeof(MTLResourceID) == sizeof(uint64_t), "Must match, otherwise descriptors are broken");
mtl_texture *
mtl_drawable_get_texture(void *drawable_ptr)
{
@autoreleasepool {
id<CAMetalDrawable> drawable = (id<CAMetalDrawable>)drawable_ptr;
return drawable.texture;
}
}
void *
mtl_retain(void *handle)
{
@autoreleasepool {
NSObject *obj = (NSObject *)handle;
return [obj retain];
}
}
void
mtl_release(void *handle)
{
@autoreleasepool {
NSObject *obj = (NSObject *)handle;
[obj release];
}
}