metal: work on depth/stencil textures, MSAA

This commit is contained in:
Alex Szpakowski
2021-04-02 22:10:01 -03:00
parent 3accf51eb2
commit a4d0761e84
3 changed files with 153 additions and 65 deletions
+10 -2
View File
@@ -910,8 +910,16 @@ id<MTLRenderPipelineState> Shader::getCachedRenderPipeline(const RenderPipelineK
desc.colorAttachments[i] = attachment;
}
// TODO: depth/stencil attachment formats
auto dsformat = (PixelFormat) key.depthStencilFormat;
if (isPixelFormatDepthStencil(dsformat))
{
bool isSRGB = false;
auto formatdesc = Metal::convertPixelFormat(dsformat, isSRGB);
if (isPixelFormatDepth(dsformat))
desc.depthAttachmentPixelFormat = formatdesc.format;
if (isPixelFormatStencil(dsformat))
desc.stencilAttachmentPixelFormat = formatdesc.format;
}
{
MTLVertexDescriptor *vertdesc = [MTLVertexDescriptor vertexDescriptor];