The Wait() implementation was added some time ago and these tests succeed.
Signed-off-by: Conor McCarthy cmccarthy@codeweavers.com --- tests/d3d12.c | 7 ------- 1 file changed, 7 deletions(-)
diff --git a/tests/d3d12.c b/tests/d3d12.c index 3b0c4242..c1956fa3 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -33268,12 +33268,6 @@ static void test_queue_wait(void) check_readback_data_uint(&rb, NULL, 0xff00ff00, 0); release_resource_readback(&rb);
- if (!vkd3d_test_platform_is_windows()) - { - skip("Wait() is not implemented yet.\n"); /* FIXME */ - goto skip_tests; - } - /* Wait() before CPU signal */ update_buffer_data(cb, 0, sizeof(blue), &blue); queue_wait(queue, fence, 2); @@ -33349,7 +33343,6 @@ static void test_queue_wait(void) check_readback_data_uint(&rb, NULL, 0xff00ff00, 0); release_resource_readback(&rb);
-skip_tests: /* Signal() and Wait() in the same command queue */ update_buffer_data(cb, 0, sizeof(blue), &blue); queue_signal(queue, fence, 7);
It's technically correct in warning about overwriting the entire vec4 from the address of .x, if a bit overzealous. It's probably a good warning to keep enabled.
Signed-off-by: Conor McCarthy cmccarthy@codeweavers.com --- tests/d3d12.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-)
diff --git a/tests/d3d12.c b/tests/d3d12.c index c1956fa3..91e31578 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -4553,7 +4553,7 @@ static void test_clear_depth_stencil_view(void) static void test_clear_render_target_view(void) { static const unsigned int array_expected_colors[] = {0xff00ff00, 0xff0000ff, 0xffff0000}; - static const struct vec4 array_colors[] = + static const float array_colors[][4] = { {0.0f, 1.0f, 0.0f, 1.0f}, {1.0f, 0.0f, 0.0f, 1.0f}, @@ -4737,7 +4737,7 @@ static void test_clear_render_target_view(void)
ID3D12Device_CreateRenderTargetView(device, resource, &rtv_desc, rtv_handle);
- ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, rtv_handle, &array_colors[i].x, 0, NULL); + ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, rtv_handle, array_colors[i], 0, NULL); }
transition_resource_state(command_list, resource, @@ -4768,7 +4768,7 @@ static void test_clear_render_target_view(void)
ID3D12Device_CreateRenderTargetView(device, resource, &rtv_desc, rtv_handle);
- ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, rtv_handle, &array_colors[i].x, 0, NULL); + ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, rtv_handle, array_colors[i], 0, NULL); }
transition_resource_state(command_list, resource, @@ -5703,7 +5703,7 @@ static void test_unknown_rtv_format(void) create_render_target(&context, &desc, &render_targets[1], &rtvs[2]);
for (i = 0; i < ARRAY_SIZE(rtvs); ++i) - ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, rtvs[i], &white.x, 0, NULL); + ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, rtvs[i], (const float *)&white, 0, NULL);
/* NULL RTV */ memset(&rtv_desc, 0, sizeof(rtv_desc)); @@ -14086,7 +14086,7 @@ static void test_gather(void) {0.3f, 1.3f, 1.2f, 0.2f}, {1.3f, 2.3f, 2.2f, 1.2f}, {2.3f, 3.3f, 3.2f, 2.2f}, {3.3f, 3.3f, 3.2f, 3.2f}, {0.3f, 1.3f, 1.3f, 0.3f}, {1.3f, 2.3f, 2.3f, 1.3f}, {2.3f, 3.3f, 3.3f, 2.3f}, {3.3f, 3.3f, 3.3f, 3.3f}, }; - static const struct vec4 white = {1.0f, 1.0f, 1.0f, 1.0f}; + static const float white[] = {1.0f, 1.0f, 1.0f, 1.0f}; static const D3D12_SUBRESOURCE_DATA resource_data = {&texture_data, sizeof(texture_data) / 4};
memset(&desc, 0, sizeof(desc)); @@ -14123,7 +14123,7 @@ static void test_gather(void) context.pipeline_state = create_pipeline_state(context.device, context.root_signature, desc.rt_format, NULL, &ps_gather4, NULL);
- ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, context.rtv, &white.x, 0, NULL); + ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, context.rtv, white, 0, NULL);
ID3D12GraphicsCommandList_OMSetRenderTargets(command_list, 1, &context.rtv, false, NULL); ID3D12GraphicsCommandList_SetGraphicsRootSignature(command_list, context.root_signature); @@ -14161,7 +14161,7 @@ static void test_gather(void) context.pipeline_state = create_pipeline_state(context.device, context.root_signature, desc.rt_format, NULL, &ps_gather4_offset, NULL);
- ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, context.rtv, &white.x, 0, NULL); + ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, context.rtv, white, 0, NULL);
ID3D12GraphicsCommandList_OMSetRenderTargets(command_list, 1, &context.rtv, false, NULL); ID3D12GraphicsCommandList_SetGraphicsRootSignature(command_list, context.root_signature); @@ -14199,7 +14199,7 @@ static void test_gather(void) context.pipeline_state = create_pipeline_state(context.device, context.root_signature, desc.rt_format, NULL, &ps_gather4_green, NULL);
- ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, context.rtv, &white.x, 0, NULL); + ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, context.rtv, white, 0, NULL);
ID3D12GraphicsCommandList_OMSetRenderTargets(command_list, 1, &context.rtv, false, NULL); ID3D12GraphicsCommandList_SetGraphicsRootSignature(command_list, context.root_signature); @@ -14237,7 +14237,7 @@ static void test_gather(void) context.pipeline_state = create_pipeline_state(context.device, context.root_signature, desc.rt_format, NULL, &ps_gather4_po, NULL);
- ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, context.rtv, &white.x, 0, NULL); + ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, context.rtv, white, 0, NULL);
ID3D12GraphicsCommandList_OMSetRenderTargets(command_list, 1, &context.rtv, false, NULL); ID3D12GraphicsCommandList_SetGraphicsRootSignature(command_list, context.root_signature); @@ -14273,7 +14273,7 @@ static void test_gather(void) constants.offset_x = 0; constants.offset_y = 0;
- ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, context.rtv, &white.x, 0, NULL); + ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, context.rtv, white, 0, NULL);
ID3D12GraphicsCommandList_OMSetRenderTargets(command_list, 1, &context.rtv, false, NULL); ID3D12GraphicsCommandList_SetGraphicsRootSignature(command_list, context.root_signature); @@ -14407,7 +14407,7 @@ static void test_gather_c(void) {0.0f, 0.0f, 0.0f, 0.0f}, {0.0f, 1.0f, 1.0f, 0.0f}, {1.0f, 1.0f, 1.0f, 1.0f}, {1.0f, 1.0f, 1.0f, 1.0f}, {0.0f, 0.0f, 0.0f, 0.0f}, {0.0f, 1.0f, 1.0f, 0.0f}, {1.0f, 1.0f, 1.0f, 1.0f}, {1.0f, 1.0f, 1.0f, 1.0f}, }; - static const struct vec4 white = {1.0f, 1.0f, 1.0f, 1.0f}; + static const float white[] = {1.0f, 1.0f, 1.0f, 1.0f}; static const D3D12_SUBRESOURCE_DATA resource_data = {&texture_data, sizeof(texture_data) / 4}; static const D3D12_STATIC_SAMPLER_DESC sampler_desc = { @@ -14463,7 +14463,7 @@ static void test_gather_c(void) context.pipeline_state = create_pipeline_state(context.device, context.root_signature, desc.rt_format, NULL, &ps_gather4_c, NULL);
- ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, context.rtv, &white.x, 0, NULL); + ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, context.rtv, white, 0, NULL);
ID3D12GraphicsCommandList_OMSetRenderTargets(command_list, 1, &context.rtv, false, NULL); ID3D12GraphicsCommandList_SetGraphicsRootSignature(command_list, context.root_signature); @@ -14501,7 +14501,7 @@ static void test_gather_c(void) context.pipeline_state = create_pipeline_state(context.device, context.root_signature, desc.rt_format, NULL, &ps_gather4_po_c, NULL);
- ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, context.rtv, &white.x, 0, NULL); + ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, context.rtv, white, 0, NULL);
ID3D12GraphicsCommandList_OMSetRenderTargets(command_list, 1, &context.rtv, false, NULL); ID3D12GraphicsCommandList_SetGraphicsRootSignature(command_list, context.root_signature); @@ -14537,7 +14537,7 @@ static void test_gather_c(void) constants.offset_x = 0; constants.offset_y = 0;
- ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, context.rtv, &white.x, 0, NULL); + ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, context.rtv, white, 0, NULL);
ID3D12GraphicsCommandList_OMSetRenderTargets(command_list, 1, &context.rtv, false, NULL); ID3D12GraphicsCommandList_SetGraphicsRootSignature(command_list, context.root_signature); @@ -15282,7 +15282,7 @@ static void test_multisample_array_texture(void) }; static const D3D12_SHADER_BYTECODE ps = {ps_code, sizeof(ps_code)}; static const float white[] = {1.0f, 1.0f, 1.0f, 1.0f}; - static const struct vec4 colors[] = + static const float colors[][4] = { {1.0f, 0.0f, 0.0f, 1.0f}, {0.0f, 1.0f, 0.0f, 1.0f}, @@ -15388,7 +15388,7 @@ static void test_multisample_array_texture(void) rtv_desc.Texture2DMSArray.ArraySize = 1; ID3D12Device_CreateRenderTargetView(device, texture, &rtv_desc, cpu_handle);
- ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, cpu_handle, &colors[i].x, 0, NULL); + ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, cpu_handle, colors[i], 0, NULL); }
transition_resource_state(command_list, texture,
On Mon, 10 Jan 2022 at 15:01, Conor McCarthy cmccarthy@codeweavers.com wrote:
@@ -5703,7 +5703,7 @@ static void test_unknown_rtv_format(void) create_render_target(&context, &desc, &render_targets[1], &rtvs[2]);
for (i = 0; i < ARRAY_SIZE(rtvs); ++i)
ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, rtvs[i], &white.x, 0, NULL);
ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, rtvs[i], (const float *)&white, 0, NULL);
/* NULL RTV */ memset(&rtv_desc, 0, sizeof(rtv_desc));
@@ -14086,7 +14086,7 @@ static void test_gather(void) {0.3f, 1.3f, 1.2f, 0.2f}, {1.3f, 2.3f, 2.2f, 1.2f}, {2.3f, 3.3f, 3.2f, 2.2f}, {3.3f, 3.3f, 3.2f, 3.2f}, {0.3f, 1.3f, 1.3f, 0.3f}, {1.3f, 2.3f, 2.3f, 1.3f}, {2.3f, 3.3f, 3.3f, 2.3f}, {3.3f, 3.3f, 3.3f, 3.3f}, };
- static const struct vec4 white = {1.0f, 1.0f, 1.0f, 1.0f};
static const float white[] = {1.0f, 1.0f, 1.0f, 1.0f}; static const D3D12_SUBRESOURCE_DATA resource_data = {&texture_data, sizeof(texture_data) / 4};
memset(&desc, 0, sizeof(desc));
@@ -14123,7 +14123,7 @@ static void test_gather(void) context.pipeline_state = create_pipeline_state(context.device, context.root_signature, desc.rt_format, NULL, &ps_gather4, NULL);
- ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, context.rtv, &white.x, 0, NULL);
ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, context.rtv, white, 0, NULL);
ID3D12GraphicsCommandList_OMSetRenderTargets(command_list, 1, &context.rtv, false, NULL); ID3D12GraphicsCommandList_SetGraphicsRootSignature(command_list, context.root_signature);
Note that you're using two different approaches above. I'm not particularly fond of either one, but I think I prefer keeping the struct vec4 and adding a cast over changing these to plain arrays. It may also be worth considering making struct vec4 a union of an array and the individual fields, although that's not without its drawbacks either.
On 1/10/22 08:00, Conor McCarthy wrote:
The Wait() implementation was added some time ago and these tests succeed.
Signed-off-by: Conor McCarthy cmccarthy@codeweavers.com
tests/d3d12.c | 7 ------- 1 file changed, 7 deletions(-)
Not on my machine ;-)
I'm getting test hangs on most runs. I also see messages like these pretty much every time:
meg@uriel:~/git/build-vkd3d$ ./tests/d3d12 d3d12:582: Driver name: radv, driver info: Mesa 21.3.3. fixme:d3d12_command_queue_Wait: Failed to acquire Vulkan semaphore for fence 0x55cba26777b0, value 0x2, completed value 0x1. d3d12:33296: Test failed: Got unexpected return value 0. d3d12:33298: Test failed: Got 0xffff0000, expected 0xff00ff00 at (0, 0, 0). d3d12:33301: Test failed: Got unexpected value 1.
Looking at the implementation I'm not sure how it's supposed to work when Wait() is called before Signal() or before a signal operation is queued. Nor do I see any indication that this is invalid in the documentation. Am I missing something?
I'm getting two failures which didn't occur with the original patch a few months ago. Looks like todos are needed while I figure out what's happening.
On Sat, Jan 15, 2022 at 4:40 AM Zebediah Figura (she/her) < zfigura@codeweavers.com> wrote:
On 1/10/22 08:00, Conor McCarthy wrote:
The Wait() implementation was added some time ago and these tests
succeed.
Signed-off-by: Conor McCarthy cmccarthy@codeweavers.com
tests/d3d12.c | 7 ------- 1 file changed, 7 deletions(-)
Not on my machine ;-)
I'm getting test hangs on most runs. I also see messages like these pretty much every time:
meg@uriel:~/git/build-vkd3d$ ./tests/d3d12 d3d12:582: Driver name: radv, driver info: Mesa 21.3.3. fixme:d3d12_command_queue_Wait: Failed to acquire Vulkan semaphore for fence 0x55cba26777b0, value 0x2, completed value 0x1. d3d12:33296: Test failed: Got unexpected return value 0. d3d12:33298: Test failed: Got 0xffff0000, expected 0xff00ff00 at (0, 0, 0). d3d12:33301: Test failed: Got unexpected value 1.
Looking at the implementation I'm not sure how it's supposed to work when Wait() is called before Signal() or before a signal operation is queued. Nor do I see any indication that this is invalid in the documentation. Am I missing something?