-- v17: tests: Mark a strip cut test as buggy in MoltenVK. tests: Mark a depth sampling test as buggy on MoltenVK. tests: Mark the tessellation pipeline as buggy on MoltenVK. tests: Mark geometry shaders as buggy on MoltenVK. tests: Mark ReadFromSubresource() and WriteToSubresource() as todo on MoltenVK. tests: Mark a test related to instanced draws as buggy on MoltenVK.
From: Giovanni Mascellani gmascellani@codeweavers.com
I haven't been able to understand what's happening here exactly, but it doesn't look like we're generating bad Vulkan calls. --- tests/d3d12.c | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/tests/d3d12.c b/tests/d3d12.c index 73253f547..c75e112f1 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -25877,7 +25877,13 @@ static void test_instance_id(void) D3D12_RESOURCE_STATE_RENDER_TARGET, D3D12_RESOURCE_STATE_COPY_SOURCE); get_resource_readback_with_command_list(context.render_target, 0, &rb, queue, command_list); for (j = 0; j < ARRAY_SIZE(expected_results); ++j) + { + /* MoltenVK seems to have a bug with instanced draws when + * the instance data step rate is zero: in some cases + * StartVertexLocation seems to be ignored. */ + bug_if(is_mvk_device(context.device) && i == 0 && 8 <= j && j < 12) check_readback_data_uint(&rb.rb, &expected_results[j].box, tests[i].expected_colors[j], 1); + } release_resource_readback(&rb); reset_command_list(command_list, context.allocator); transition_resource_state(command_list, render_target,
From: Giovanni Mascellani gmascellani@codeweavers.com
--- tests/d3d12.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/tests/d3d12.c b/tests/d3d12.c index c75e112f1..39e7013df 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -34035,11 +34035,11 @@ static void test_read_write_subresource(void)
/* NULL box */ hr = ID3D12Resource_WriteToSubresource(src_texture, 0, NULL, dst_buffer, row_pitch, slice_pitch); - todo_if(is_nvidia_device(device)) + todo_if(is_nvidia_device(device) || is_mvk_device(device)) ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
hr = ID3D12Resource_ReadFromSubresource(src_texture, dst_buffer, row_pitch, slice_pitch, 0, NULL); - todo_if(is_nvidia_device(device)) + todo_if(is_nvidia_device(device) || is_mvk_device(device)) ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
/* Empty box */ @@ -34078,20 +34078,20 @@ static void test_read_write_subresource(void) if (i) { hr = ID3D12Resource_WriteToSubresource(src_texture, 0, NULL, zero_buffer, row_pitch, slice_pitch); - todo_if(is_nvidia_device(device)) + todo_if(is_nvidia_device(device) || is_mvk_device(device)) ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
/* Write region 1 */ set_box(&box, 0, 0, 0, 2, 2, 2); hr = ID3D12Resource_WriteToSubresource(src_texture, 0, &box, dst_buffer, row_pitch, slice_pitch); - todo_if(is_nvidia_device(device)) + todo_if(is_nvidia_device(device) || is_mvk_device(device)) ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
/* Write region 2 */ set_box(&box, 2, 2, 2, 11, 13, 17); hr = ID3D12Resource_WriteToSubresource(src_texture, 0, &box, &dst_buffer[2 * 128 * 100 + 2 * 128 + 2], row_pitch, slice_pitch); - todo_if(is_nvidia_device(device)) + todo_if(is_nvidia_device(device) || is_mvk_device(device)) ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); } else @@ -34113,14 +34113,14 @@ static void test_read_write_subresource(void) /* Read region 1 */ set_box(&box, 0, 0, 0, 2, 2, 2); hr = ID3D12Resource_ReadFromSubresource(src_texture, dst_buffer, row_pitch, slice_pitch, 0, &box); - todo_if(is_nvidia_device(device)) + todo_if(is_nvidia_device(device) || is_mvk_device(device)) ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
/* Read region 2 */ set_box(&box, 2, 2, 2, 11, 13, 17); hr = ID3D12Resource_ReadFromSubresource(src_texture, &dst_buffer[2 * 128 * 100 + 2 * 128 + 2], row_pitch, slice_pitch, 0, &box); - todo_if(is_nvidia_device(device)) + todo_if(is_nvidia_device(device) || is_mvk_device(device)) ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
for (z = 0; z < 64; ++z) @@ -34146,7 +34146,7 @@ static void test_read_write_subresource(void) if (got != expected) break; } - todo_if(is_nvidia_device(device)) + todo_if(is_nvidia_device(device) || is_mvk_device(device)) ok(got == expected, "Got unexpected value 0x%08x at (%u, %u, %u), expected 0x%08x.\n", got, x, y, z, expected); vkd3d_test_pop_context(); } @@ -34196,7 +34196,7 @@ static void test_read_write_subresource(void) if (got != expected) break; } - todo_if(is_nvidia_device(device)) + todo_if(is_nvidia_device(device) || is_mvk_device(device)) ok(got == expected, "Got unexpected value 0x%08x at (%u, %u, %u), expected 0x%08x.\n", got, x, y, z, expected); release_resource_readback(&rb);
From: Giovanni Mascellani gmascellani@codeweavers.com
--- tests/d3d12.c | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/tests/d3d12.c b/tests/d3d12.c index 39e7013df..4c218d83c 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -27923,6 +27923,7 @@ static void test_geometry_shader(void) color = get_readback_uint(&rb.rb, 255, 240, 0); ok(compare_color(color, 0xff0000ff, 1), "Got unexpected color 0x%08x.\n", color); color = get_readback_uint(&rb.rb, 320, 240, 0); + bug_if(is_mvk_device(device)) ok(compare_color(color, 0xffffff00, 1), "Got unexpected color 0x%08x.\n", color); color = get_readback_uint(&rb.rb, 385, 240, 0); ok(compare_color(color, 0xff0000ff, 1), "Got unexpected color 0x%08x.\n", color); @@ -27937,6 +27938,7 @@ static void test_geometry_shader(void) color = get_readback_uint(&rb.rb, 255, 240, 0); ok(compare_color(color, 0xff0000ff, 1), "Got unexpected color 0x%08x.\n", color); color = get_readback_uint(&rb.rb, 320, 240, 0); + bug_if(is_mvk_device(device)) ok(compare_color(color, 0xffffff00, 1), "Got unexpected color 0x%08x.\n", color); color = get_readback_uint(&rb.rb, 385, 240, 0); ok(compare_color(color, 0xff0000ff, 1), "Got unexpected color 0x%08x.\n", color); @@ -28142,12 +28144,15 @@ static void test_layered_rendering(void) transition_resource_state(command_list, context.render_target, D3D12_RESOURCE_STATE_RENDER_TARGET, D3D12_RESOURCE_STATE_COPY_SOURCE);
+ bug_if(is_mvk_device(device)) check_sub_resource_uint(context.render_target, 0, queue, command_list, 0xff00ff00, 0); reset_command_list(command_list, context.allocator); check_sub_resource_uint(context.render_target, 1, queue, command_list, 0xffffffff, 0); reset_command_list(command_list, context.allocator); + bug_if(is_mvk_device(device)) check_sub_resource_uint(context.render_target, 2, queue, command_list, 0x00000000, 0); reset_command_list(command_list, context.allocator); + bug_if(is_mvk_device(device)) check_sub_resource_uint(context.render_target, 3, queue, command_list, 0xffffff00, 0);
ID3D12Resource_Release(vb);
From: Giovanni Mascellani gmascellani@codeweavers.com
--- tests/d3d12.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tests/d3d12.c b/tests/d3d12.c index 4c218d83c..06e67f9ce 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -29752,6 +29752,7 @@ static void test_hull_shader_fork_phase(void)
transition_resource_state(command_list, context.render_target, D3D12_RESOURCE_STATE_RENDER_TARGET, D3D12_RESOURCE_STATE_COPY_SOURCE); + bug_if(is_mvk_device(context.device)) check_sub_resource_uint(context.render_target, 0, queue, command_list, 0xff000000, 0);
destroy_test_context(&context); @@ -30409,7 +30410,7 @@ static void test_tessellation_primitive_id(void)
transition_resource_state(command_list, context.render_target, D3D12_RESOURCE_STATE_RENDER_TARGET, D3D12_RESOURCE_STATE_COPY_SOURCE); - bug_if(is_nvidia_device(context.device)) + bug_if(is_nvidia_device(context.device) || is_mvk_device(context.device)) check_sub_resource_uint(context.render_target, 0, queue, command_list, 0xff00ff00, 0);
ID3D12Resource_Release(vb);
From: Giovanni Mascellani gmascellani@codeweavers.com
MoltenVK seems to be unable to handle tight inequalities (i.e., 0.5 <= 0.5) properly on 16 bit depth resources. --- tests/d3d12.c | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-)
diff --git a/tests/d3d12.c b/tests/d3d12.c index 06e67f9ce..beb2c9aa3 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -20549,12 +20549,12 @@ static void test_depth_clip(void) destroy_test_context(&context); }
-#define check_depth_stencil_sampling(a, b, c, d, e, f, g) \ - check_depth_stencil_sampling_(__LINE__, a, b, c, d, e, f, g) +#define check_depth_stencil_sampling(a, b, c, d, e, f, g, h) \ + check_depth_stencil_sampling_(__LINE__, a, b, c, d, e, f, g, h) static void check_depth_stencil_sampling_(unsigned int line, struct test_context *context, ID3D12PipelineState *pso, ID3D12Resource *cb, ID3D12Resource *texture, D3D12_CPU_DESCRIPTOR_HANDLE dsv_handle, ID3D12DescriptorHeap *srv_heap, - float expected_value) + float expected_value, bool is_bug) { static const float black[] = {0.0f, 0.0f, 0.0f, 0.0f}; ID3D12GraphicsCommandList *command_list; @@ -20585,6 +20585,7 @@ static void check_depth_stencil_sampling_(unsigned int line, struct test_context
transition_sub_resource_state(command_list, context->render_target, 0, D3D12_RESOURCE_STATE_RENDER_TARGET, D3D12_RESOURCE_STATE_COPY_SOURCE); + bug_if(is_bug) check_sub_resource_float_(line, context->render_target, 0, queue, command_list, expected_value, 2);
reset_command_list(command_list, context->allocator); @@ -20738,6 +20739,7 @@ static void test_depth_stencil_sampling(void) DXGI_FORMAT dsv_format; DXGI_FORMAT depth_view_format; DXGI_FORMAT stencil_view_format; + bool is_mvk_bug; } tests[] = { @@ -20747,8 +20749,10 @@ static void test_depth_stencil_sampling(void) DXGI_FORMAT_R32_FLOAT}, {DXGI_FORMAT_R24G8_TYPELESS, DXGI_FORMAT_D24_UNORM_S8_UINT, DXGI_FORMAT_R24_UNORM_X8_TYPELESS, DXGI_FORMAT_X24_TYPELESS_G8_UINT}, + /* For 16 bit depth MoltenVK doesn't handle properly the case + * when the comparison is tight (i.e., 0.5 <= 0.5). */ {DXGI_FORMAT_R16_TYPELESS, DXGI_FORMAT_D16_UNORM, - DXGI_FORMAT_R16_UNORM}, + DXGI_FORMAT_R16_UNORM, DXGI_FORMAT_UNKNOWN, true}, };
memset(&desc, 0, sizeof(desc)); @@ -20851,39 +20855,39 @@ static void test_depth_stencil_sampling(void) /* pso_compare */ ID3D12GraphicsCommandList_ClearDepthStencilView(command_list, dsv_handle, D3D12_CLEAR_FLAG_DEPTH, 1.0f, 0, 0, NULL); - check_depth_stencil_sampling(&context, pso_compare, cb, texture, dsv_handle, srv_heap, 0.0f); + check_depth_stencil_sampling(&context, pso_compare, cb, texture, dsv_handle, srv_heap, 0.0f, false);
reset_command_list(command_list, context.allocator); ID3D12GraphicsCommandList_ClearDepthStencilView(command_list, dsv_handle, D3D12_CLEAR_FLAG_DEPTH, 0.0f, 0, 0, NULL); - check_depth_stencil_sampling(&context, pso_compare, cb, texture, dsv_handle, srv_heap, 1.0f); + check_depth_stencil_sampling(&context, pso_compare, cb, texture, dsv_handle, srv_heap, 1.0f, false);
reset_command_list(command_list, context.allocator); ID3D12GraphicsCommandList_ClearDepthStencilView(command_list, dsv_handle, D3D12_CLEAR_FLAG_DEPTH, 0.5f, 0, 0, NULL); - check_depth_stencil_sampling(&context, pso_compare, cb, texture, dsv_handle, srv_heap, 0.0f); + check_depth_stencil_sampling(&context, pso_compare, cb, texture, dsv_handle, srv_heap, 0.0f, tests[i].is_mvk_bug);
reset_command_list(command_list, context.allocator); ID3D12GraphicsCommandList_ClearDepthStencilView(command_list, dsv_handle, D3D12_CLEAR_FLAG_DEPTH, 0.6f, 0, 0, NULL); - check_depth_stencil_sampling(&context, pso_compare, cb, texture, dsv_handle, srv_heap, 0.0f); + check_depth_stencil_sampling(&context, pso_compare, cb, texture, dsv_handle, srv_heap, 0.0f, false);
ps_constant.x = 0.7f; update_buffer_data(cb, 0, sizeof(ps_constant), &ps_constant);
reset_command_list(command_list, context.allocator); - check_depth_stencil_sampling(&context, pso_compare, cb, texture, dsv_handle, srv_heap, 1.0f); + check_depth_stencil_sampling(&context, pso_compare, cb, texture, dsv_handle, srv_heap, 1.0f, false);
/* pso_depth */ reset_command_list(command_list, context.allocator); ID3D12GraphicsCommandList_ClearDepthStencilView(command_list, dsv_handle, D3D12_CLEAR_FLAG_DEPTH, 1.0f, 0, 0, NULL); - check_depth_stencil_sampling(&context, pso_depth, cb, texture, dsv_handle, srv_heap, 1.0f); + check_depth_stencil_sampling(&context, pso_depth, cb, texture, dsv_handle, srv_heap, 1.0f, false);
reset_command_list(command_list, context.allocator); ID3D12GraphicsCommandList_ClearDepthStencilView(command_list, dsv_handle, D3D12_CLEAR_FLAG_DEPTH, 0.2f, 0, 0, NULL); - check_depth_stencil_sampling(&context, pso_depth, cb, texture, dsv_handle, srv_heap, 0.2f); + check_depth_stencil_sampling(&context, pso_depth, cb, texture, dsv_handle, srv_heap, 0.2f, false);
if (!tests[i].stencil_view_format) { @@ -20907,33 +20911,33 @@ static void test_depth_stencil_sampling(void) reset_command_list(command_list, context.allocator); ID3D12GraphicsCommandList_ClearDepthStencilView(command_list, dsv_handle, D3D12_CLEAR_FLAG_STENCIL, 0.0f, 0, 0, NULL); - check_depth_stencil_sampling(&context, pso_stencil, cb, texture, dsv_handle, srv_heap, 0.0f); + check_depth_stencil_sampling(&context, pso_stencil, cb, texture, dsv_handle, srv_heap, 0.0f, false);
reset_command_list(command_list, context.allocator); ID3D12GraphicsCommandList_ClearDepthStencilView(command_list, dsv_handle, D3D12_CLEAR_FLAG_STENCIL, 0.0f, 100, 0, NULL); - check_depth_stencil_sampling(&context, pso_stencil, cb, texture, dsv_handle, srv_heap, 100.0f); + check_depth_stencil_sampling(&context, pso_stencil, cb, texture, dsv_handle, srv_heap, 100.0f, false);
reset_command_list(command_list, context.allocator); ID3D12GraphicsCommandList_ClearDepthStencilView(command_list, dsv_handle, D3D12_CLEAR_FLAG_STENCIL, 0.0f, 255, 0, NULL); - check_depth_stencil_sampling(&context, pso_stencil, cb, texture, dsv_handle, srv_heap, 255.0f); + check_depth_stencil_sampling(&context, pso_stencil, cb, texture, dsv_handle, srv_heap, 255.0f, false);
/* pso_depth_stencil */ reset_command_list(command_list, context.allocator); ID3D12GraphicsCommandList_ClearDepthStencilView(command_list, dsv_handle, D3D12_CLEAR_FLAG_DEPTH | D3D12_CLEAR_FLAG_STENCIL, 0.3f, 3, 0, NULL); - check_depth_stencil_sampling(&context, pso_depth_stencil, cb, texture, dsv_handle, srv_heap, 3.3f); + check_depth_stencil_sampling(&context, pso_depth_stencil, cb, texture, dsv_handle, srv_heap, 3.3f, false);
reset_command_list(command_list, context.allocator); ID3D12GraphicsCommandList_ClearDepthStencilView(command_list, dsv_handle, D3D12_CLEAR_FLAG_DEPTH | D3D12_CLEAR_FLAG_STENCIL, 1.0f, 3, 0, NULL); - check_depth_stencil_sampling(&context, pso_depth_stencil, cb, texture, dsv_handle, srv_heap, 4.0f); + check_depth_stencil_sampling(&context, pso_depth_stencil, cb, texture, dsv_handle, srv_heap, 4.0f, false);
reset_command_list(command_list, context.allocator); ID3D12GraphicsCommandList_ClearDepthStencilView(command_list, dsv_handle, D3D12_CLEAR_FLAG_DEPTH | D3D12_CLEAR_FLAG_STENCIL, 0.0f, 0, 0, NULL); - check_depth_stencil_sampling(&context, pso_depth_stencil, cb, texture, dsv_handle, srv_heap, 0.0f); + check_depth_stencil_sampling(&context, pso_depth_stencil, cb, texture, dsv_handle, srv_heap, 0.0f, false);
destroy_depth_stencil(&ds);
From: Giovanni Mascellani gmascellani@codeweavers.com
Metal, and therefore MoltenVK, doesn't support disabling primitive restart. --- tests/d3d12.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/tests/d3d12.c b/tests/d3d12.c index beb2c9aa3..07d9c231c 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -33740,11 +33740,14 @@ static void test_primitive_restart(void) unsigned int last_index; bool full_quad; bool is_todo; + bool is_mvk_bug; } tests[] = { {D3D12_INDEX_BUFFER_STRIP_CUT_VALUE_DISABLED, DXGI_FORMAT_R16_UINT, indices16, sizeof(indices16), 0x0003, true}, - {D3D12_INDEX_BUFFER_STRIP_CUT_VALUE_DISABLED, DXGI_FORMAT_R16_UINT, indices16_max, sizeof(indices16_max), 0xffff, true}, + /* Metal, and therefore MoltenVK, doesn't support disabling + * primitive restart. */ + {D3D12_INDEX_BUFFER_STRIP_CUT_VALUE_DISABLED, DXGI_FORMAT_R16_UINT, indices16_max, sizeof(indices16_max), 0xffff, true, false, true}, {D3D12_INDEX_BUFFER_STRIP_CUT_VALUE_DISABLED, DXGI_FORMAT_R32_UINT, indices, sizeof(indices), 0x0003, true}, {D3D12_INDEX_BUFFER_STRIP_CUT_VALUE_DISABLED, DXGI_FORMAT_R32_UINT, indices_max16, sizeof(indices_max16), 0xffff, true},
@@ -33820,6 +33823,7 @@ static void test_primitive_restart(void) get_resource_readback_with_command_list(context.render_target, 0, &rb, queue, command_list); if (tests[i].full_quad) { + bug_if(is_mvk_device(context.device) && tests[i].is_mvk_bug) todo_if(tests[i].is_todo) check_readback_data_uint(&rb.rb, NULL, 0xff00ff00, 0); }
With the latest update this MR leaves only 26-28 tests failing on my M2 laptop with MoltenVK 1.2.7. The exact number changes at every run, there must be something a bit flacky. On current `master` I see 51-53 failures.
This merge request was approved by Giovanni Mascellani.
- check_depth_stencil_sampling(&context, pso_compare, cb, texture, dsv_handle, srv_heap, 0.0f); + check_depth_stencil_sampling(&context, pso_compare, cb, texture, dsv_handle, srv_heap, 0.0f, tests[i].is_mvk_bug);
Are we missing an is_mvk_device() there?