Skip to content

Commit 144efe3

Browse files
committed
Added metal availability attributes
1 parent bd906e3 commit 144efe3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/gpu/metal/SDL_gpu_metal.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ static MTLDepthClipMode SDLToMetal_DepthClipMode(
515515

516516
typedef struct MetalPipelineCache
517517
{
518-
id<MTLBinaryArchive> pipelineCache;
518+
@available(macOS 11.0, iOS 14.0, tvOS 14.0, *) id<MTLBinaryArchive> pipelineCache;
519519
size_t checksumSize;
520520
void* checksumData;
521521
size_t cacheBlobSize;
@@ -1120,7 +1120,7 @@ static void METAL_ReleasePipelineCache(
11201120
pipelineDescriptor = [MTLRenderPipelineDescriptor new];
11211121

11221122
/*
1123-
if(@available(macOS 11.0, *))
1123+
if(@available(macOS 11.0, iOS 14.0, tvOS 14.0, *))
11241124
{
11251125
if(pipelineCache->pipelineCache != nil)
11261126
{
@@ -1217,7 +1217,7 @@ static void METAL_ReleasePipelineCache(
12171217
}
12181218

12191219
/*
1220-
if(@available(macOS 11.0, *))
1220+
if(@available(macOS 11.0, iOS 14.0, tvOS 14.0, *))
12211221
{
12221222
if(pipelineCache != NULL){
12231223
[pipelineCache->pipelineCache addRenderPipelineFunctionsWithDescriptor:pipelineDescriptor error:&error];
@@ -1260,7 +1260,7 @@ static void METAL_ReleasePipelineCache(
12601260
{
12611261
// Implementing it is easy, but there's not way to get the binary data out of MTLBinaryArchive without bouncing it to a file first
12621262
/*
1263-
if(@available(macOS 11.0, *)){
1263+
if(@available(macOS 11.0, iOS 14.0, tvOS 14.0, *)){
12641264
@autoreleasepool {
12651265
MetalRenderer* renderer = (MetalRenderer*)driverData;
12661266
MetalPipelineCache* pipelineCache = (MetalPipelineCache*)SDL_malloc(sizeof(MetalPipelineCache));

0 commit comments

Comments
 (0)