On Tue Feb 28 14:32:48 2023 +0000, Henri Verbeet wrote:
It might not be a bad idea to test command list types that are
supposed to succeed as well, to avoid the CreateSwapChain() call failing due to e.g. an unsupported swapchain_desc parameter.
Creating a swap chain on a direct command queue is already well tested
in many other places. Here I think it would complicate the control flow without adding much useful signal. It wouldn't so much be to test swapchain creation on a direct command queue per se, but rather to show that the reason swapchain creation fails on the other queue types is the queue type, instead of e.g. an unsupported backbuffer format or backbuffer count. I.e., increasing the confidence that the test is testing what we think it's testing.
Should this perhaps be a d3d12 test instead?
You mean it should use the `run_on_d3d12()` helper? I figured that was
just for tests that could make sense for both D3D10 and D3D12. This doesn't make sense on D3D10, because the swapchain is not created from a command queue, so I thought it would be pointless to use that helper. But if you prefer to use it, it's not difficult to adapt it. No, I mean a test in dlls/d3d12/tests/d3d12.c. As you say, this test is fairly specific to d3d12 and doesn't make much sense for d3d10/11. That said, the argument that this is mainly testing code in dlls/dxgi instead of code in dlls/d3d12 is certainly valid too. The d3d12 tests do already have a create_command_queue() helper that takes a queue type as parameter though. (For what it's worth, neither of these points would be blockers for me if you disagree; I just think they're worth considering.)
Ok, I addressed both points.