mirror of
https://github.com/elwrcl/intel-hard-graphics.git
synced 2026-11-01 11:18:03 +03:00
init
This commit is contained in:
12511 files changed
+6156641
No files matched your search
@@ -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];
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user