From eb9e254b8c771a8722e25c360dc0009d19cf8e84 Mon Sep 17 00:00:00 2001 From: Giovanni Mascellani Date: Fri, 7 Mar 2025 23:53:12 +0100 Subject: [PATCH] tests/shader_runner_metal: Handle multisampled 2D texture arrays properly. They're not supported by the shader runner anyway, but there's no reason to make the code subtly wrong. --- tests/shader_runner_metal.m | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/shader_runner_metal.m b/tests/shader_runner_metal.m index 8b0f646d1..dd12dc6ef 100644 --- a/tests/shader_runner_metal.m +++ b/tests/shader_runner_metal.m @@ -199,9 +199,10 @@ static void init_resource_texture(struct metal_runner *runner, desc = [[MTLTextureDescriptor alloc] init]; if (params->desc.sample_count > 1) - desc.textureType = MTLTextureType2DMultisample; - else if (params->desc.depth > 1) - desc.textureType = MTLTextureType2DArray; + desc.textureType = params->desc.depth > 1 ? MTLTextureType2DMultisampleArray + : MTLTextureType2DMultisample; + else + desc.textureType = params->desc.depth > 1 ? MTLTextureType2DArray : MTLTextureType2D; desc.pixelFormat = get_metal_pixel_format(params->desc.format); ok(desc.pixelFormat != MTLPixelFormatInvalid, "Unhandled pixel format %#x.\n", params->desc.format); desc.width = params->desc.width;