The rest is in MR !531.
-- v2: 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: Skip unbounded descriptor ranges tests when they're unsupported.
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 are unsupported if the Vulkan descriptor indexing extension is not available; on MoltenVK it is known to be buggy, so it is disabled. --- tests/d3d12.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
diff --git a/tests/d3d12.c b/tests/d3d12.c index 07e0fec12..5c8d9fb10 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -36748,6 +36748,12 @@ static void test_unbounded_resource_arrays(void) command_list = context.list; queue = context.queue;
+ if (get_resource_binding_tier(device) < D3D12_RESOURCE_BINDING_TIER_2) + { + skip("Device doesn't support resource binding tier 2.\n"); + goto done; + } + memset(&root_signature_desc, 0, sizeof(root_signature_desc)); root_signature_desc.NumParameters = ARRAY_SIZE(root_parameters); root_signature_desc.pParameters = root_parameters; @@ -36908,6 +36914,12 @@ static void test_unbounded_samplers(void) command_list = context.list; queue = context.queue;
+ if (get_resource_binding_tier(device) < D3D12_RESOURCE_BINDING_TIER_2) + { + skip("Device doesn't support resource binding tier 2.\n"); + goto done; + } + root_signature_desc.NumParameters = ARRAY_SIZE(root_parameters); root_signature_desc.Flags = 0; root_signature_desc.NumStaticSamplers = 0;
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 5c8d9fb10..e2d1993fd 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -31860,6 +31860,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 e2d1993fd..e41b4ed7f 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -31513,92 +31513,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 e41b4ed7f..67c968320 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -24780,6 +24780,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 67c968320..9db7e3e65 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -25152,6 +25152,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); @@ -25249,6 +25250,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);
The reason these fail on MVK is because we check the device capabilities before we check the basic validity of the root signature. We should probably do that at the end of d3d12_root_signature_info_from_desc() instead of inside d3d12_root_signature_info_count_descriptors().
Right, though I had to move the check even further than that, after ranges are checked for overlapping. [This is what I could come up quickly with](https://gitlab.winehq.org/giomasce/vkd3d/-/commit/158ae1593030f2741227acb0f0...), but it is broken because it crashes other tests. Unfortunately resource mapping is still partially uncharted territory for me, so I'll leave this for when I have more time.