Commit ac265bf3 authored by Giovanni Mascellani's avatar Giovanni Mascellani Committed by Alexandre Julliard

dxgi: Reset the back buffer index to zero on ResizeBuffers().

parent dc2a2eaf
......@@ -2249,6 +2249,8 @@ static HRESULT d3d12_swapchain_resize_buffers(struct d3d12_swapchain *swapchain,
if (!dxgi_validate_swapchain_desc(&new_desc))
return DXGI_ERROR_INVALID_CALL;
swapchain->current_buffer_index = 0;
if (desc->Width == new_desc.Width && desc->Height == new_desc.Height
&& desc->Format == new_desc.Format && desc->BufferCount == new_desc.BufferCount)
return S_OK;
......
......@@ -4988,7 +4988,6 @@ static void test_swapchain_backbuffer_index(IUnknown *device, BOOL is_d3d12)
{
index = IDXGISwapChain3_GetCurrentBackBufferIndex(swapchain3);
expected_index = is_d3d12 ? j % swapchain_desc.BufferCount : 0;
todo_wine_if(is_d3d12)
ok(index == expected_index, "Got back buffer index %u, expected %u.\n", index, expected_index);
hr = IDXGISwapChain3_Present(swapchain3, 0, 0);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
......@@ -5003,7 +5002,6 @@ static void test_swapchain_backbuffer_index(IUnknown *device, BOOL is_d3d12)
{
index = IDXGISwapChain3_GetCurrentBackBufferIndex(swapchain3);
expected_index = is_d3d12 ? j % swapchain_desc.BufferCount : 0;
todo_wine_if(is_d3d12)
ok(index == expected_index, "Got back buffer index %u, expected %u.\n", index, expected_index);
hr = IDXGISwapChain3_Present(swapchain3, 0, 0);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
......@@ -5017,7 +5015,6 @@ static void test_swapchain_backbuffer_index(IUnknown *device, BOOL is_d3d12)
{
index = IDXGISwapChain3_GetCurrentBackBufferIndex(swapchain3);
expected_index = is_d3d12 ? j % swapchain_desc.BufferCount : 0;
todo_wine_if(is_d3d12)
ok(index == expected_index, "Got back buffer index %u, expected %u.\n", index, expected_index);
hr = IDXGISwapChain3_Present(swapchain3, 0, 0);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment