[Commits] SDL: metal: Added some comments and FIXMEs.

libsdl.org revision control commits-owner at libsdl.org
Sat Dec 9 00:28:48 PST 2017


details:   https://hg.libsdl.org/SDL/rev/799404c93d48
changeset: 11749:799404c93d48
user:      Ryan C. Gordon <icculus at icculus.org>
date:      Sat Dec 09 03:27:52 2017 -0500
description:
metal: Added some comments and FIXMEs.

diffstat:

 src/render/metal/SDL_render_metal.m |  10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diffs (34 lines):

diff -r 28497e7866fc -r 799404c93d48 src/render/metal/SDL_render_metal.m
--- a/src/render/metal/SDL_render_metal.m	Sat Dec 09 03:24:01 2017 -0500
+++ b/src/render/metal/SDL_render_metal.m	Sat Dec 09 03:27:52 2017 -0500
@@ -91,7 +91,12 @@
      (SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC | SDL_RENDERER_TARGETTEXTURE),
      2,
      {SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ABGR8888},
-     4096,  // !!! FIXME: how do you query Metal for this?
+
+     // !!! FIXME: how do you query Metal for this?
+     // (the weakest GPU supported by Metal on iOS has 4k texture max, and
+     //  other models might be 2x or 4x more. On macOS, it's 16k across the
+     //  board right now.)
+     4096,
      4096}
 };
 
@@ -285,7 +290,7 @@
     data.mtllayer = layer;
     data.mtlcmdqueue = [data.mtldevice newCommandQueue];
     data.mtlcmdqueue.label = @"SDL Metal Renderer";
-    data.mtlpassdesc = [MTLRenderPassDescriptor renderPassDescriptor];  // !!! FIXME: is this autoreleased?
+    data.mtlpassdesc = [MTLRenderPassDescriptor renderPassDescriptor];
 
     NSError *err = nil;
 
@@ -694,6 +699,7 @@
                     Uint32 pixel_format, void * pixels, int pitch)
 { @autoreleasepool {
     METAL_ActivateRenderer(renderer);
+    // !!! FIXME: this probably needs to commit the current command buffer, and probably waitUntilCompleted
     METAL_RenderData *data = (__bridge METAL_RenderData *) renderer->driverdata;
     MTLRenderPassColorAttachmentDescriptor *colorAttachment = data.mtlpassdesc.colorAttachments[0];
     id<MTLTexture> mtltexture = colorAttachment.texture;


More information about the commits mailing list