Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resizing a window on Windows / D3D12 using sysgpu fails #1218

Open
hordurj opened this issue Jun 20, 2024 · 2 comments · May be fixed by #1219
Open

Resizing a window on Windows / D3D12 using sysgpu fails #1218

hordurj opened this issue Jun 20, 2024 · 2 comments · May be fixed by #1219
Labels
bug Something isn't working needs-triage Issues that need triaging

Comments

@hordurj
Copy link

hordurj commented Jun 20, 2024

Re-creating the swap chain fails when resizing a window.

thread 27560 panic: api error
.\mach\src\sysgpu\d3d12.zig:1381:13: 0xe26772 in init (core-sysgpu-triangle.exe.obj)
            return error.CreateSwapChainFailed;
            ^
.\mach\src\sysgpu\d3d12.zig:504:9: 0xe27f75 in createSwapChain (core-sysgpu-triangle.exe.obj)
        return SwapChain.init(device, surface, desc);
        ^
.\mach\src\core\platform\glfw\Core.zig:572:82: 0x11395e7 in appUpdateThreadTick__anon_155243 (core-sysgpu-triangle.exe.obj)
            self.swap_chain = self.gpu_device.createSwapChain(self.surface, &self.swap_chain_desc);
@hordurj hordurj added bug Something isn't working needs-triage Issues that need triaging labels Jun 20, 2024
@hordurj
Copy link
Author

hordurj commented Jun 21, 2024

The HRESULT returned from CreateSwapChainForHwnd is E_ACCESSDENIED (0x80070005).

I have confirmed the deinit is called on the previous swap chain. I haven't seen anything obvious causing this. Maybe there still is some unfinished work on the GPU that needs to be completed.

I am thinking of trying ResizeBuffers and seeing how that behaves.

@hordurj
Copy link
Author

hordurj commented Jun 22, 2024

I can see from the debug layer that the reason the new swap chain cannot be created is because someone is still holding a reference to the old swap chain. If I do an extra release on the swap chain the resize works.

@hordurj hordurj linked a pull request Jun 22, 2024 that will close this issue
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-triage Issues that need triaging
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant