Metal: Use RGBA instead of BGRA and clear render targets by default

This makes rendering of the samples have the wrong colors on the Metal
backend, but using BGRA made end2end tests fail. The rendering color
will be fixed when the WSI is introduced.
This commit is contained in:
Corentin Wallez 2017-07-03 23:00:21 -04:00 committed by Corentin Wallez
parent 8859178703
commit c6f9006b02
2 changed files with 4 additions and 2 deletions

View File

@ -97,7 +97,8 @@ namespace metal {
usingBackbuffer = true;
}
descriptor.colorAttachments[index].texture = texture;
descriptor.colorAttachments[index].loadAction = MTLLoadActionLoad;
descriptor.colorAttachments[index].loadAction = MTLLoadActionClear;
descriptor.colorAttachments[index].clearColor = MTLClearColorMake(0.0, 0.0, 0.0, 0.0);
descriptor.colorAttachments[index].storeAction = MTLStoreActionStore;
}
// TODO(kainino@chromium.org): load depth attachment from subpass

View File

@ -68,7 +68,8 @@ namespace metal {
}
}
descriptor.colorAttachments[0].pixelFormat = MTLPixelFormatBGRA8Unorm;
// TODO(cwallez@chromium.org): get the attachment formats from the subpass
descriptor.colorAttachments[0].pixelFormat = MTLPixelFormatRGBA8Unorm;
descriptor.depthAttachmentPixelFormat = MTLPixelFormatDepth32Float;
InputState* inputState = ToBackend(GetInputState());