tests: Mark interface packing pipeline creation as todo on MoltenVK.

Most Vulkan drivers are happy to compile a pipeline with interstage
interface mismatches, even if the pipeline will be broken. Metal,
and therefore MoltenVK, instead doesn't and errors out immediately.
This commit is contained in:
Giovanni Mascellani 2024-10-19 11:13:07 +02:00 committed by Henri Verbeet
parent b411086398
commit dff7c0e7b8
Notes: Henri Verbeet 2024-10-22 20:55:14 +02:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1203
5 changed files with 78 additions and 15 deletions

View File

@ -114,16 +114,17 @@ float4 main(data input) : SV_Target
} }
[test] [test]
draw triangle list 3 clear rtv 0 -1.0 -1.0 -1.0 -1.0
probe (0, 0) rgba ( 0.0, 0.0, 0.0, 0.0) todo(mvk & vulkan) draw triangle list 3
probe (1, 0) rgba ( 1.0, 12.0, 13.0, 14.0) todo(mvk) probe (0, 0) rgba ( 0.0, 0.0, 0.0, 0.0)
probe (2, 0) rgba ( 2.0, 15.0, 16.0, 22.0) todo(mvk) probe (1, 0) rgba ( 1.0, 12.0, 13.0, 14.0)
probe (3, 0) rgba ( 3.0, 4.0, 5.0, 26.0) todo(mvk) probe (2, 0) rgba ( 2.0, 15.0, 16.0, 22.0)
probe (4, 0) rgba ( 6.0, 17.0, 20.0, 21.0) todo(mvk) probe (3, 0) rgba ( 3.0, 4.0, 5.0, 26.0)
probe (5, 0) rgba ( 7.0, 18.0, 19.0, 0.0) todo(mvk) probe (4, 0) rgba ( 6.0, 17.0, 20.0, 21.0)
probe (6, 0) rgba (27.0, 28.0, 0.0, 0.0) todo(mvk) probe (5, 0) rgba ( 7.0, 18.0, 19.0, 0.0)
probe (7, 0) rgba ( 8.0, 9.0, 10.0, 11.0) todo(mvk) probe (6, 0) rgba (27.0, 28.0, 0.0, 0.0)
probe (8, 0) rgba (23.0, 24.0, 25.0, 0.0) todo(mvk) probe (7, 0) rgba ( 8.0, 9.0, 10.0, 11.0)
todo(mvk) probe (8, 0) rgba (23.0, 24.0, 25.0, 0.0)
[require] [require]
shader model >= 3.0 shader model >= 3.0
@ -157,5 +158,5 @@ float4 main(float4 pos : SV_Position, float4 color : COLOR) : SV_Target
} }
[test] [test]
draw triangle list 3 todo(mvk & sm<4) draw triangle list 3
todo(sm<4) probe (0, 0) rgba (1.0, 10.0, 11.0, 4.0) todo(sm<4) probe (0, 0) rgba (1.0, 10.0, 11.0, 4.0)

View File

@ -147,6 +147,8 @@ static bool check_qualifier_args_conjunction(struct shader_runner *runner, const
{"sm<6", SHADER_MODEL_2_0, SHADER_MODEL_6_0 - 1}, {"sm<6", SHADER_MODEL_2_0, SHADER_MODEL_6_0 - 1},
{"glsl", 0, 0, true}, {"glsl", 0, 0, true},
{"d3d12", 0, 0, true}, {"d3d12", 0, 0, true},
{"mvk", 0, 0, true},
{"vulkan", 0, 0, true},
}; };
while (*line != ')' && *line != '|') while (*line != ')' && *line != '|')

View File

@ -986,6 +986,12 @@ static void d3d12_runner_init_caps(struct d3d12_shader_runner *runner,
"d3d12", "d3d12",
}; };
static const char *const mvk_tags[] =
{
"d3d12",
"mvk",
};
static const enum DXGI_FORMAT formats[] = static const enum DXGI_FORMAT formats[] =
{ {
DXGI_FORMAT_R32_FLOAT, DXGI_FORMAT_R32_FLOAT,
@ -1028,8 +1034,17 @@ static void d3d12_runner_init_caps(struct d3d12_shader_runner *runner,
runner->caps.rov = options.ROVsSupported; runner->caps.rov = options.ROVsSupported;
runner->caps.wave_ops = options1.WaveOps; runner->caps.wave_ops = options1.WaveOps;
runner->caps.depth_bounds = options2.DepthBoundsTestSupported; runner->caps.depth_bounds = options2.DepthBoundsTestSupported;
runner->caps.tags = tags;
runner->caps.tag_count = ARRAY_SIZE(tags); if (is_mvk_device(device))
{
runner->caps.tags = mvk_tags;
runner->caps.tag_count = ARRAY_SIZE(mvk_tags);
}
else
{
runner->caps.tags = tags;
runner->caps.tag_count = ARRAY_SIZE(tags);
}
for (unsigned int i = 0; i < ARRAY_SIZE(formats); ++i) for (unsigned int i = 0; i < ARRAY_SIZE(formats); ++i)
{ {

View File

@ -52,6 +52,7 @@ struct vulkan_shader_runner
struct shader_runner r; struct shader_runner r;
struct shader_runner_caps caps; struct shader_runner_caps caps;
bool demote_to_helper_invocation; bool demote_to_helper_invocation;
bool driver_properties;
struct vulkan_test_context context; struct vulkan_test_context context;
@ -69,6 +70,8 @@ struct physical_device_info
VkPhysicalDeviceFeatures2 features2; VkPhysicalDeviceFeatures2 features2;
VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT interlock_features; VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT interlock_features;
VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT demote_to_helper_invocation_features; VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT demote_to_helper_invocation_features;
VkPhysicalDeviceProperties2 properties2;
VkPhysicalDeviceDriverPropertiesKHR driver_properties;
}; };
static struct vulkan_shader_runner *vulkan_shader_runner(struct shader_runner *r) static struct vulkan_shader_runner *vulkan_shader_runner(struct shader_runner *r)
@ -641,9 +644,11 @@ static VkPipeline create_graphics_pipeline(struct vulkan_shader_runner *runner,
ret &= create_shader_stage(runner, &stage_desc[stage_count++], "gs", ret &= create_shader_stage(runner, &stage_desc[stage_count++], "gs",
VK_SHADER_STAGE_GEOMETRY_BIT, runner->r.gs_source, NULL); VK_SHADER_STAGE_GEOMETRY_BIT, runner->r.gs_source, NULL);
todo_if (runner->r.is_todo) ok(ret, "Failed to compile shaders.\n");
if (!ret) if (!ret)
{ {
/* We ok() only when failing here, so that we don't result in a "todo
* succeeded" when the todo applies to pipeline linking. */
todo_if (runner->r.is_todo) ok(false, "Failed to compile shaders.\n");
for (i = 0; i < ARRAY_SIZE(stage_desc); ++i) for (i = 0; i < ARRAY_SIZE(stage_desc); ++i)
VK_CALL(vkDestroyShaderModule(device, stage_desc[i].module, NULL)); VK_CALL(vkDestroyShaderModule(device, stage_desc[i].module, NULL));
return VK_NULL_HANDLE; return VK_NULL_HANDLE;
@ -768,7 +773,7 @@ static VkPipeline create_graphics_pipeline(struct vulkan_shader_runner *runner,
} }
vr = VK_CALL(vkCreateGraphicsPipelines(context->device, VK_NULL_HANDLE, 1, &pipeline_desc, NULL, &pipeline)); vr = VK_CALL(vkCreateGraphicsPipelines(context->device, VK_NULL_HANDLE, 1, &pipeline_desc, NULL, &pipeline));
ok(vr == VK_SUCCESS, "Failed to create graphics pipeline, vr %d.\n", vr); todo_if (runner->r.is_todo) ok(vr == VK_SUCCESS, "Failed to create graphics pipeline, vr %d.\n", vr);
for (i = 0; i < ARRAY_SIZE(stage_desc); ++i) for (i = 0; i < ARRAY_SIZE(stage_desc); ++i)
VK_CALL(vkDestroyShaderModule(device, stage_desc[i].module, NULL)); VK_CALL(vkDestroyShaderModule(device, stage_desc[i].module, NULL));
@ -1410,6 +1415,7 @@ static bool check_device_extensions(struct vulkan_shader_runner *runner,
{VK_EXT_SHADER_DEMOTE_TO_HELPER_INVOCATION_EXTENSION_NAME}, {VK_EXT_SHADER_DEMOTE_TO_HELPER_INVOCATION_EXTENSION_NAME},
{VK_KHR_SHADER_DRAW_PARAMETERS_EXTENSION_NAME, true}, {VK_KHR_SHADER_DRAW_PARAMETERS_EXTENSION_NAME, true},
{VK_KHR_MAINTENANCE1_EXTENSION_NAME, true}, {VK_KHR_MAINTENANCE1_EXTENSION_NAME, true},
{VK_KHR_DRIVER_PROPERTIES_EXTENSION_NAME},
}; };
enabled_extensions->names = calloc(ARRAY_SIZE(device_extensions), sizeof(*enabled_extensions->names)); enabled_extensions->names = calloc(ARRAY_SIZE(device_extensions), sizeof(*enabled_extensions->names));
@ -1430,6 +1436,8 @@ static bool check_device_extensions(struct vulkan_shader_runner *runner,
runner->caps.rov = true; runner->caps.rov = true;
if (!strcmp(name, VK_EXT_SHADER_DEMOTE_TO_HELPER_INVOCATION_EXTENSION_NAME)) if (!strcmp(name, VK_EXT_SHADER_DEMOTE_TO_HELPER_INVOCATION_EXTENSION_NAME))
runner->demote_to_helper_invocation = true; runner->demote_to_helper_invocation = true;
if (!strcmp(name, VK_KHR_DRIVER_PROPERTIES_EXTENSION_NAME))
runner->driver_properties = true;
continue; continue;
} }
@ -1471,6 +1479,20 @@ static void get_physical_device_info(struct vulkan_shader_runner *runner, struct
VK_CALL(vkGetPhysicalDeviceFeatures2KHR(context->phys_device, &info->features2)); VK_CALL(vkGetPhysicalDeviceFeatures2KHR(context->phys_device, &info->features2));
else else
VK_CALL(vkGetPhysicalDeviceFeatures(context->phys_device, &info->features2.features)); VK_CALL(vkGetPhysicalDeviceFeatures(context->phys_device, &info->features2.features));
if (runner->driver_properties)
{
void *list = info->properties2.pNext;
info->properties2.pNext = &info->driver_properties;
info->driver_properties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES_KHR;
info->driver_properties.pNext = list;
}
if (context->vkGetPhysicalDeviceFeatures2KHR)
VK_CALL(vkGetPhysicalDeviceProperties2KHR(context->phys_device, &info->properties2));
else
VK_CALL(vkGetPhysicalDeviceProperties(context->phys_device, &info->properties2.properties));
} }
static uint32_t get_format_support(const struct vulkan_test_context *context, enum DXGI_FORMAT format) static uint32_t get_format_support(const struct vulkan_test_context *context, enum DXGI_FORMAT format)
@ -1526,6 +1548,16 @@ static bool init_vulkan_runner(struct vulkan_shader_runner *runner)
DXGI_FORMAT_R8_UINT, DXGI_FORMAT_R8_UINT,
DXGI_FORMAT_R8_SINT, DXGI_FORMAT_R8_SINT,
}; };
static const char *const tags[] =
{
"vulkan",
};
static const char *const mvk_tags[] =
{
"vulkan",
"mvk",
};
if (!vulkan_test_context_init_instance(context, instance_extensions, ARRAY_SIZE(instance_extensions))) if (!vulkan_test_context_init_instance(context, instance_extensions, ARRAY_SIZE(instance_extensions)))
return false; return false;
@ -1559,6 +1591,17 @@ static bool init_vulkan_runner(struct vulkan_shader_runner *runner)
get_physical_device_info(runner, &device_info); get_physical_device_info(runner, &device_info);
ret_features = &device_info.features2.features; ret_features = &device_info.features2.features;
if (device_info.driver_properties.driverID == VK_DRIVER_ID_MOLTENVK)
{
runner->caps.tags = mvk_tags;
runner->caps.tag_count = ARRAY_SIZE(mvk_tags);
}
else
{
runner->caps.tags = tags;
runner->caps.tag_count = ARRAY_SIZE(tags);
}
runner->caps.clip_planes = true; runner->caps.clip_planes = true;
runner->caps.point_size = true; runner->caps.point_size = true;

View File

@ -42,6 +42,8 @@ VK_INSTANCE_PFN(vkGetPhysicalDeviceFeatures)
VK_INSTANCE_PFN(vkGetPhysicalDeviceFeatures2KHR) VK_INSTANCE_PFN(vkGetPhysicalDeviceFeatures2KHR)
VK_INSTANCE_PFN(vkGetPhysicalDeviceFormatProperties) VK_INSTANCE_PFN(vkGetPhysicalDeviceFormatProperties)
VK_INSTANCE_PFN(vkGetPhysicalDeviceMemoryProperties) VK_INSTANCE_PFN(vkGetPhysicalDeviceMemoryProperties)
VK_INSTANCE_PFN(vkGetPhysicalDeviceProperties)
VK_INSTANCE_PFN(vkGetPhysicalDeviceProperties2KHR)
VK_INSTANCE_PFN(vkGetPhysicalDeviceQueueFamilyProperties) VK_INSTANCE_PFN(vkGetPhysicalDeviceQueueFamilyProperties)
/* Device functions (obtained by vkGetDeviceProcAddr). */ /* Device functions (obtained by vkGetDeviceProcAddr). */