Skip to content

Commit

Permalink
metal: Added some comments and FIXMEs.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Dec 9, 2017
1 parent dbce134 commit 85d12d8
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/render/metal/SDL_render_metal.m
Expand Up @@ -91,7 +91,12 @@ static int METAL_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect
(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}
};

Expand Down Expand Up @@ -285,7 +290,7 @@ @implementation METAL_RenderData
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;

Expand Down Expand Up @@ -694,6 +699,7 @@ static void METAL_ActivateRenderer(SDL_Renderer * renderer)
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;
Expand Down

0 comments on commit 85d12d8

Please sign in to comment.