-- v16: 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. tests: Mark count buffers as buggy on MoltenVK. tests: Mark a timestamp query test as buggy on MoltenVK. tests: Mark clip distance as unsupported on MoltenVK. tests: Mark cull distance as buggy on MoltenVK. tests: Mark unbounded descriptor ranges as buggy on MoltenVK. tests: Mark loading from stencil as buggy on MoltenVK.
From: Giovanni Mascellani gmascellani@codeweavers.com
Specifically, MoltenVK seems to be able to load from stencil, but the specific replicating swizzle (repeating the stencil value on all the channels) is not honored. The stencil value is read only on the red channel. --- tests/d3d12.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/tests/d3d12.c b/tests/d3d12.c index 427e59c22..07e0fec12 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -21326,11 +21326,13 @@ static void test_stencil_load(void)
transition_sub_resource_state(command_list, context.render_target, 0, D3D12_RESOURCE_STATE_RENDER_TARGET, D3D12_RESOURCE_STATE_COPY_SOURCE); + bug_if(is_mvk_device(context.device)) check_sub_resource_uvec4(context.render_target, 0, queue, command_list, &uvec4);
reset_command_list(command_list, context.allocator); transition_sub_resource_state(command_list, texture, 0, D3D12_RESOURCE_STATE_UNORDERED_ACCESS, D3D12_RESOURCE_STATE_COPY_SOURCE); + bug_if(is_mvk_device(context.device)) check_sub_resource_uvec4(texture, 0, queue, command_list, &uvec4);
reset_command_list(command_list, context.allocator);
From: Giovanni Mascellani gmascellani@codeweavers.com
They require Vulkan descriptor indexing extension, which is exposed by MoltenVK but known to be buggy, so we assume it is disabled. --- tests/d3d12.c | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/tests/d3d12.c b/tests/d3d12.c index 07e0fec12..0183ae27f 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -2899,6 +2899,7 @@ static void test_create_root_signature(void) descriptor_ranges[1].RegisterSpace = 0; descriptor_ranges[1].OffsetInDescriptorsFromTableStart = 16; hr = create_root_signature(device, &root_signature_desc, &root_signature); + bug_if(is_mvk_device(device)) ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
/* A bounded range overlapping an unbounded one, mapped to the same @@ -2918,6 +2919,7 @@ static void test_create_root_signature(void) descriptor_ranges[1].RangeType = D3D12_DESCRIPTOR_RANGE_TYPE_SRV; descriptor_ranges[1].NumDescriptors = UINT_MAX; hr = create_root_signature(device, &root_signature_desc, &root_signature); + bug_if(is_mvk_device(device)) ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
/* And unbounded range overlapping a bounded one, mapped to the same @@ -2926,6 +2928,7 @@ static void test_create_root_signature(void) descriptor_ranges[1].BaseShaderRegister = 0; descriptor_ranges[1].OffsetInDescriptorsFromTableStart = 15; hr = create_root_signature(device, &root_signature_desc, &root_signature); + bug_if(is_mvk_device(device)) ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
refcount = ID3D12Device_Release(device); @@ -36752,6 +36755,7 @@ static void test_unbounded_resource_arrays(void) root_signature_desc.NumParameters = ARRAY_SIZE(root_parameters); root_signature_desc.pParameters = root_parameters; hr = create_root_signature(device, &root_signature_desc, &context.root_signature); + bug_if(is_mvk_device(device)) ok(hr == S_OK, "Failed to create root signature, hr %#x.\n", hr); if (FAILED(hr)) goto done; @@ -36915,6 +36919,7 @@ static void test_unbounded_samplers(void) root_signature_desc.pParameters = root_parameters;
hr = create_root_signature(device, &root_signature_desc, &context.root_signature); + bug_if(is_mvk_device(device)) ok(SUCCEEDED(hr), "Failed to create root signature, hr %#x.\n", hr); if (FAILED(hr)) goto done;
From: Giovanni Mascellani gmascellani@codeweavers.com
The generated MSL code is not accepted by the Metal runtime, and it looks wrong anyway. --- tests/d3d12.c | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/tests/d3d12.c b/tests/d3d12.c index 0183ae27f..047bef12c 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -31863,6 +31863,13 @@ static void test_combined_clip_and_cull_distances(void) command_list = context.list; queue = context.queue;
+ if (is_mvk_device(device)) + { + skip("Cull distance not supported on MoltenVK.\n"); + destroy_test_context(&context); + return; + } + input_layout.pInputElementDescs = layout_desc; input_layout.NumElements = ARRAY_SIZE(layout_desc);
From: Giovanni Mascellani gmascellani@codeweavers.com
At least for tessellation and geometry shaders. --- tests/d3d12.c | 159 ++++++++++++++++++++++++++------------------------ 1 file changed, 83 insertions(+), 76 deletions(-)
diff --git a/tests/d3d12.c b/tests/d3d12.c index 047bef12c..83f3f00a7 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -31516,92 +31516,99 @@ static void test_clip_distance(void)
ID3D12PipelineState_Release(pso);
- /* tessellation shaders */ - pso_desc.HS = hs; - pso_desc.DS = ds; - pso_desc.PrimitiveTopologyType = D3D12_PRIMITIVE_TOPOLOGY_TYPE_PATCH; - hr = ID3D12Device_CreateGraphicsPipelineState(device, &pso_desc, - &IID_ID3D12PipelineState, (void **)&pso); - ok(hr == S_OK, "Failed to create pipeline state, hr %#x.\n", hr); + if (is_mvk_device(device)) + { + skip("Clipping not supported in tessellation and geometry shaders on MoltenVK.\n"); + } + else + { + /* tessellation shaders */ + pso_desc.HS = hs; + pso_desc.DS = ds; + pso_desc.PrimitiveTopologyType = D3D12_PRIMITIVE_TOPOLOGY_TYPE_PATCH; + hr = ID3D12Device_CreateGraphicsPipelineState(device, &pso_desc, + &IID_ID3D12PipelineState, (void **)&pso); + ok(hr == S_OK, "Failed to create pipeline state, hr %#x.\n", hr);
- check_clip_distance(&context, pso, D3D_PRIMITIVE_TOPOLOGY_4_CONTROL_POINT_PATCHLIST, - vbv, vb[1], vs_cb, tess_cb, gs_cb); + check_clip_distance(&context, pso, D3D_PRIMITIVE_TOPOLOGY_4_CONTROL_POINT_PATCHLIST, + vbv, vb[1], vs_cb, tess_cb, gs_cb);
- cb_data.use_constant = false; - cb_data.tessellation_factor = 2.0f; - update_buffer_data(tess_cb, 0, sizeof(cb_data), &cb_data); + cb_data.use_constant = false; + cb_data.tessellation_factor = 2.0f; + update_buffer_data(tess_cb, 0, sizeof(cb_data), &cb_data);
- for (i = 0; i < ARRAY_SIZE(vertices); ++i) - vertices[i].clip_distance0 = 1.0f; - update_buffer_data(vb[1], 0, sizeof(vertices), &vertices); + for (i = 0; i < ARRAY_SIZE(vertices); ++i) + vertices[i].clip_distance0 = 1.0f; + update_buffer_data(vb[1], 0, sizeof(vertices), &vertices);
- ID3D12GraphicsCommandList_OMSetRenderTargets(command_list, 1, &context.rtv, false, NULL); - ID3D12GraphicsCommandList_SetGraphicsRootSignature(command_list, context.root_signature); - ID3D12GraphicsCommandList_SetGraphicsRootConstantBufferView(command_list, 0, - ID3D12Resource_GetGPUVirtualAddress(vs_cb)); - ID3D12GraphicsCommandList_SetGraphicsRootConstantBufferView(command_list, 1, - ID3D12Resource_GetGPUVirtualAddress(tess_cb)); - ID3D12GraphicsCommandList_SetGraphicsRootConstantBufferView(command_list, 2, - ID3D12Resource_GetGPUVirtualAddress(tess_cb)); - ID3D12GraphicsCommandList_SetGraphicsRootConstantBufferView(command_list, 3, - ID3D12Resource_GetGPUVirtualAddress(gs_cb)); - ID3D12GraphicsCommandList_SetPipelineState(command_list, pso); - ID3D12GraphicsCommandList_IASetPrimitiveTopology(command_list, D3D_PRIMITIVE_TOPOLOGY_4_CONTROL_POINT_PATCHLIST); - ID3D12GraphicsCommandList_RSSetViewports(command_list, 1, &context.viewport); - ID3D12GraphicsCommandList_RSSetScissorRects(command_list, 1, &context.scissor_rect); - ID3D12GraphicsCommandList_IASetVertexBuffers(command_list, 0, ARRAY_SIZE(vbv), vbv); - ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, context.rtv, white, 0, NULL); - ID3D12GraphicsCommandList_DrawInstanced(command_list, 4, 1, 0, 0); - transition_resource_state(command_list, context.render_target, - D3D12_RESOURCE_STATE_RENDER_TARGET, D3D12_RESOURCE_STATE_COPY_SOURCE); - check_sub_resource_uint(context.render_target, 0, queue, command_list, 0xff00ff00, 0); + ID3D12GraphicsCommandList_OMSetRenderTargets(command_list, 1, &context.rtv, false, NULL); + ID3D12GraphicsCommandList_SetGraphicsRootSignature(command_list, context.root_signature); + ID3D12GraphicsCommandList_SetGraphicsRootConstantBufferView(command_list, 0, + ID3D12Resource_GetGPUVirtualAddress(vs_cb)); + ID3D12GraphicsCommandList_SetGraphicsRootConstantBufferView(command_list, 1, + ID3D12Resource_GetGPUVirtualAddress(tess_cb)); + ID3D12GraphicsCommandList_SetGraphicsRootConstantBufferView(command_list, 2, + ID3D12Resource_GetGPUVirtualAddress(tess_cb)); + ID3D12GraphicsCommandList_SetGraphicsRootConstantBufferView(command_list, 3, + ID3D12Resource_GetGPUVirtualAddress(gs_cb)); + ID3D12GraphicsCommandList_SetPipelineState(command_list, pso); + ID3D12GraphicsCommandList_IASetPrimitiveTopology(command_list, D3D_PRIMITIVE_TOPOLOGY_4_CONTROL_POINT_PATCHLIST); + ID3D12GraphicsCommandList_RSSetViewports(command_list, 1, &context.viewport); + ID3D12GraphicsCommandList_RSSetScissorRects(command_list, 1, &context.scissor_rect); + ID3D12GraphicsCommandList_IASetVertexBuffers(command_list, 0, ARRAY_SIZE(vbv), vbv); + ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, context.rtv, white, 0, NULL); + ID3D12GraphicsCommandList_DrawInstanced(command_list, 4, 1, 0, 0); + transition_resource_state(command_list, context.render_target, + D3D12_RESOURCE_STATE_RENDER_TARGET, D3D12_RESOURCE_STATE_COPY_SOURCE); + check_sub_resource_uint(context.render_target, 0, queue, command_list, 0xff00ff00, 0);
- ID3D12PipelineState_Release(pso); - reset_command_list(command_list, context.allocator); - transition_resource_state(command_list, context.render_target, - D3D12_RESOURCE_STATE_COPY_SOURCE, D3D12_RESOURCE_STATE_RENDER_TARGET); + ID3D12PipelineState_Release(pso); + reset_command_list(command_list, context.allocator); + transition_resource_state(command_list, context.render_target, + D3D12_RESOURCE_STATE_COPY_SOURCE, D3D12_RESOURCE_STATE_RENDER_TARGET);
- cb_data.use_constant = true; - cb_data.clip_distance0 = -1.0f; - update_buffer_data(tess_cb, 0, sizeof(cb_data), &cb_data); + cb_data.use_constant = true; + cb_data.clip_distance0 = -1.0f; + update_buffer_data(tess_cb, 0, sizeof(cb_data), &cb_data);
- /* geometry shader */ - pso_desc.GS = gs; - hr = ID3D12Device_CreateGraphicsPipelineState(device, &pso_desc, - &IID_ID3D12PipelineState, (void **)&pso); - ok(hr == S_OK, "Failed to create pipeline state, hr %#x.\n", hr); + /* geometry shader */ + pso_desc.GS = gs; + hr = ID3D12Device_CreateGraphicsPipelineState(device, &pso_desc, + &IID_ID3D12PipelineState, (void **)&pso); + ok(hr == S_OK, "Failed to create pipeline state, hr %#x.\n", hr);
- check_clip_distance(&context, pso, D3D_PRIMITIVE_TOPOLOGY_4_CONTROL_POINT_PATCHLIST, - vbv, vb[1], vs_cb, tess_cb, gs_cb); + check_clip_distance(&context, pso, D3D_PRIMITIVE_TOPOLOGY_4_CONTROL_POINT_PATCHLIST, + vbv, vb[1], vs_cb, tess_cb, gs_cb);
- cb_data.use_constant = true; - cb_data.clip_distance0 = 1.0f; - update_buffer_data(gs_cb, 0, sizeof(cb_data), &cb_data); - ID3D12GraphicsCommandList_OMSetRenderTargets(command_list, 1, &context.rtv, false, NULL); - ID3D12GraphicsCommandList_SetGraphicsRootSignature(command_list, context.root_signature); - ID3D12GraphicsCommandList_SetGraphicsRootConstantBufferView(command_list, 0, - ID3D12Resource_GetGPUVirtualAddress(vs_cb)); - ID3D12GraphicsCommandList_SetGraphicsRootConstantBufferView(command_list, 1, - ID3D12Resource_GetGPUVirtualAddress(tess_cb)); - ID3D12GraphicsCommandList_SetGraphicsRootConstantBufferView(command_list, 2, - ID3D12Resource_GetGPUVirtualAddress(tess_cb)); - ID3D12GraphicsCommandList_SetGraphicsRootConstantBufferView(command_list, 3, - ID3D12Resource_GetGPUVirtualAddress(gs_cb)); - ID3D12GraphicsCommandList_SetPipelineState(command_list, pso); - ID3D12GraphicsCommandList_IASetPrimitiveTopology(command_list, D3D_PRIMITIVE_TOPOLOGY_4_CONTROL_POINT_PATCHLIST); - ID3D12GraphicsCommandList_RSSetViewports(command_list, 1, &context.viewport); - ID3D12GraphicsCommandList_RSSetScissorRects(command_list, 1, &context.scissor_rect); - ID3D12GraphicsCommandList_IASetVertexBuffers(command_list, 0, ARRAY_SIZE(vbv), vbv); - ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, context.rtv, white, 0, NULL); - ID3D12GraphicsCommandList_DrawInstanced(command_list, 4, 1, 0, 0); - transition_resource_state(command_list, context.render_target, - D3D12_RESOURCE_STATE_RENDER_TARGET, D3D12_RESOURCE_STATE_COPY_SOURCE); - check_sub_resource_uint(context.render_target, 0, queue, command_list, 0xff00ff00, 0); + cb_data.use_constant = true; + cb_data.clip_distance0 = 1.0f; + update_buffer_data(gs_cb, 0, sizeof(cb_data), &cb_data); + ID3D12GraphicsCommandList_OMSetRenderTargets(command_list, 1, &context.rtv, false, NULL); + ID3D12GraphicsCommandList_SetGraphicsRootSignature(command_list, context.root_signature); + ID3D12GraphicsCommandList_SetGraphicsRootConstantBufferView(command_list, 0, + ID3D12Resource_GetGPUVirtualAddress(vs_cb)); + ID3D12GraphicsCommandList_SetGraphicsRootConstantBufferView(command_list, 1, + ID3D12Resource_GetGPUVirtualAddress(tess_cb)); + ID3D12GraphicsCommandList_SetGraphicsRootConstantBufferView(command_list, 2, + ID3D12Resource_GetGPUVirtualAddress(tess_cb)); + ID3D12GraphicsCommandList_SetGraphicsRootConstantBufferView(command_list, 3, + ID3D12Resource_GetGPUVirtualAddress(gs_cb)); + ID3D12GraphicsCommandList_SetPipelineState(command_list, pso); + ID3D12GraphicsCommandList_IASetPrimitiveTopology(command_list, D3D_PRIMITIVE_TOPOLOGY_4_CONTROL_POINT_PATCHLIST); + ID3D12GraphicsCommandList_RSSetViewports(command_list, 1, &context.viewport); + ID3D12GraphicsCommandList_RSSetScissorRects(command_list, 1, &context.scissor_rect); + ID3D12GraphicsCommandList_IASetVertexBuffers(command_list, 0, ARRAY_SIZE(vbv), vbv); + ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, context.rtv, white, 0, NULL); + ID3D12GraphicsCommandList_DrawInstanced(command_list, 4, 1, 0, 0); + transition_resource_state(command_list, context.render_target, + D3D12_RESOURCE_STATE_RENDER_TARGET, D3D12_RESOURCE_STATE_COPY_SOURCE); + check_sub_resource_uint(context.render_target, 0, queue, command_list, 0xff00ff00, 0);
- ID3D12PipelineState_Release(pso); - reset_command_list(command_list, context.allocator); - transition_resource_state(command_list, context.render_target, - D3D12_RESOURCE_STATE_COPY_SOURCE, D3D12_RESOURCE_STATE_RENDER_TARGET); + ID3D12PipelineState_Release(pso); + reset_command_list(command_list, context.allocator); + transition_resource_state(command_list, context.render_target, + D3D12_RESOURCE_STATE_COPY_SOURCE, D3D12_RESOURCE_STATE_RENDER_TARGET); + }
/* multiple clip distances */ pso_desc.VS = vs_multiple;
From: Giovanni Mascellani gmascellani@codeweavers.com
The generated Vulkan calls look right and do not trigger any validation error, but the returned timestamp is 0. A valid timestamp is returned if the CopyResource() call is commented, or the second EndQuery() call is moved before CopyResource(), or the first EndQuery() call is commented. I am not seeing any sensible pattern here, so I guess there is just a bug in MoltenVK. --- tests/d3d12.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/tests/d3d12.c b/tests/d3d12.c index 83f3f00a7..2e1dd71e3 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -24783,6 +24783,7 @@ static void test_resolve_non_issued_query_data(void) "Got unexpected timestamp %#"PRIx64".\n", timestamps[0]); ok(!timestamps[1], "Got unexpected timestamp %#"PRIx64".\n", timestamps[1]); ok(!timestamps[2], "Got unexpected timestamp %#"PRIx64".\n", timestamps[2]); + bug_if(is_mvk_device(device)) ok(timestamps[3] != initial_data[3] && timestamps[3] > 0, "Got unexpected timestamp %#"PRIx64".\n", timestamps[3]); release_resource_readback(&rb);
From: Giovanni Mascellani gmascellani@codeweavers.com
They require Vulkan indirect draw count extension. --- tests/d3d12.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/tests/d3d12.c b/tests/d3d12.c index 2e1dd71e3..ec4302bd6 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -25155,6 +25155,7 @@ static void test_execute_indirect(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, 0xff00ff00, 0);
reset_command_list(command_list, context.allocator); @@ -25252,6 +25253,7 @@ static void test_execute_indirect(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, 0xffffff00, 0);
ID3D12PipelineState_Release(pipeline_state);
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 ec4302bd6..363ec1195 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -25812,7 +25812,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 363ec1195..fa28c86f1 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -33925,11 +33925,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 */ @@ -33968,20 +33968,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 @@ -34003,14 +34003,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) @@ -34036,7 +34036,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(); } @@ -34086,7 +34086,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 | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/tests/d3d12.c b/tests/d3d12.c index fa28c86f1..2d9776ca8 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -27858,6 +27858,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); @@ -27872,6 +27873,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); @@ -28077,12 +28079,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); @@ -28229,6 +28234,7 @@ static void test_ps_layer(void)
for (i = 0; i < ARRAY_SIZE(expected_results); ++i) { + bug_if(is_mvk_device(device)) check_sub_resource_uint(context.render_target, i, queue, command_list, expected_results[i], 0); reset_command_list(command_list, context.allocator); }
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 2d9776ca8..19b3c409e 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -29643,6 +29643,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); @@ -30300,7 +30301,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 19b3c409e..0985d14d3 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -20484,12 +20484,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; @@ -20520,6 +20520,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); @@ -20673,6 +20674,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[] = { @@ -20682,8 +20684,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)); @@ -20786,39 +20790,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) { @@ -20842,33 +20846,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 0985d14d3..67ad0db3a 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -33631,11 +33631,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},
@@ -33711,6 +33714,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); }