metal: Added some comments and FIXMEs.
authorRyan C. Gordon <icculus@icculus.org>
Sat, 09 Dec 2017 03:27:52 -0500
changeset 11749799404c93d48
parent 11748 28497e7866fc
child 11750 e2a349c9dd30
metal: Added some comments and FIXMEs.
src/render/metal/SDL_render_metal.m
     1.1 --- a/src/render/metal/SDL_render_metal.m	Sat Dec 09 03:24:01 2017 -0500
     1.2 +++ b/src/render/metal/SDL_render_metal.m	Sat Dec 09 03:27:52 2017 -0500
     1.3 @@ -91,7 +91,12 @@
     1.4       (SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC | SDL_RENDERER_TARGETTEXTURE),
     1.5       2,
     1.6       {SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ABGR8888},
     1.7 -     4096,  // !!! FIXME: how do you query Metal for this?
     1.8 +
     1.9 +     // !!! FIXME: how do you query Metal for this?
    1.10 +     // (the weakest GPU supported by Metal on iOS has 4k texture max, and
    1.11 +     //  other models might be 2x or 4x more. On macOS, it's 16k across the
    1.12 +     //  board right now.)
    1.13 +     4096,
    1.14       4096}
    1.15  };
    1.16  
    1.17 @@ -285,7 +290,7 @@
    1.18      data.mtllayer = layer;
    1.19      data.mtlcmdqueue = [data.mtldevice newCommandQueue];
    1.20      data.mtlcmdqueue.label = @"SDL Metal Renderer";
    1.21 -    data.mtlpassdesc = [MTLRenderPassDescriptor renderPassDescriptor];  // !!! FIXME: is this autoreleased?
    1.22 +    data.mtlpassdesc = [MTLRenderPassDescriptor renderPassDescriptor];
    1.23  
    1.24      NSError *err = nil;
    1.25  
    1.26 @@ -694,6 +699,7 @@
    1.27                      Uint32 pixel_format, void * pixels, int pitch)
    1.28  { @autoreleasepool {
    1.29      METAL_ActivateRenderer(renderer);
    1.30 +    // !!! FIXME: this probably needs to commit the current command buffer, and probably waitUntilCompleted
    1.31      METAL_RenderData *data = (__bridge METAL_RenderData *) renderer->driverdata;
    1.32      MTLRenderPassColorAttachmentDescriptor *colorAttachment = data.mtlpassdesc.colorAttachments[0];
    1.33      id<MTLTexture> mtltexture = colorAttachment.texture;