diff --git a/projects/apis/metal/src/pipelines/graphics_pipeline/metal_graphics_pipeline.m b/projects/apis/metal/src/pipelines/graphics_pipeline/metal_graphics_pipeline.m index 051b100..ad5521f 100644 --- a/projects/apis/metal/src/pipelines/graphics_pipeline/metal_graphics_pipeline.m +++ b/projects/apis/metal/src/pipelines/graphics_pipeline/metal_graphics_pipeline.m @@ -45,8 +45,7 @@ MTLCompareFunction mtlGrypnCompareOperation(gnCompareOperation operation) { gnReturnCode createMetalGraphicsPipeline(gnGraphicsPipeline graphicsPipeline, gnOutputDevice device, gnGraphicsPipelineInfo info) { graphicsPipeline->graphicsPipeline = malloc(sizeof(struct gnPlatformGraphicsPipeline_t)); MTLRenderPipelineDescriptor* descriptor = [[MTLRenderPipelineDescriptor alloc] init]; - // descriptor.rasterSampleCount = mtlSampleCount(info.multisample.samples); - descriptor.rasterSampleCount = 1; + descriptor.rasterSampleCount = mtlSampleCount(info.multisample.samples); descriptor.rasterizationEnabled = YES; mtlSubpass subpass = info.renderPassDescriptor->renderPassDescriptor->subpasses[info.subpassIndex]; mtlSubpassCopyInfo copyInfo = info.renderPassDescriptor->renderPassDescriptor->copyInfos[info.subpassIndex]; diff --git a/projects/apis/metal/src/texture/metal_texture.m b/projects/apis/metal/src/texture/metal_texture.m index 2dbf5ce..f15b523 100644 --- a/projects/apis/metal/src/texture/metal_texture.m +++ b/projects/apis/metal/src/texture/metal_texture.m @@ -10,7 +10,7 @@ NSUInteger mtlSampleCount(gnMultisampleCountFlags flags) { if ((flags & GN_SAMPLE_BIT_4) == GN_SAMPLE_BIT_4) { return 4; } if ((flags & GN_SAMPLE_BIT_2) == GN_SAMPLE_BIT_2) { return 2; } if ((flags & GN_SAMPLE_BIT_1) == GN_SAMPLE_BIT_1) { return 1; } - return 0; + return 1; } gnReturnCode createMetalTexture(gnTexture texture, gnDevice device, const gnTextureInfo info) { @@ -24,7 +24,7 @@ gnReturnCode createMetalTexture(gnTexture texture, gnDevice device, const gnText textureDescriptor.height = info.extent.height; textureDescriptor.pixelFormat = mtlGryphnFormatToMetalFormat(info.format); - if (textureDescriptor.sampleCount >= 2) + if (textureDescriptor.sampleCount > 1) textureDescriptor.textureType = MTLTextureType2DMultisample; else textureDescriptor.textureType = MTLTextureType2D;