Repository navigation
fix(dx12): no UAV for sRGB views of storage textures; free a removed device's submissions - #18
Merged
Merged
Conversation
…ith INVALID_CALL) A texture made with STORAGE_BINDING got a UAV for every view, its sRGB view included. Direct3D 12 has no sRGB UAV, and CreateUnorderedAccessView returns nothing: the invalid call removed the device (DXGI_ERROR_INVALID_CALL, no command list submitted). openOMSI's ray tracing texture atlas is such a texture (Rgba8Unorm, sampled through an Rgba8UnormSrgb view): with ray tracing on, every NVIDIA card lost the device while the renderer was built. - mx-types: is_storage_view_format, shared by is_heap_storage_view - mx-dx12: a view in such a format gets no UAV - mx-vulkan: such a view of a storage image leaves STORAGE out of its usage (VUID-VkImageViewCreateInfo-usage-02275) - mx: Device::is_lost (Direct3D 12's removed device; false elsewhere), so a renderer is not built again on a device that cannot come back
poll returned on a removed device (the fence at u64::MAX) without freeing the in-flight submissions. They held the last frames' swapchain buffers, and so the flip-model swapchain on the window: after the game went on with Vulkan, the window kept showing the last Direct3D 12 picture (a grey loading screen over a running game, openOMSI #4223).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Direct3D 12 fixes for openOMSI's ray tracing on NVIDIA (openOMSI#4223; logs from RTX 3060, 3070 and 5070 Ti). With ray tracing on, the Direct3D 12 device was removed while openOMSI built its renderer, with
DXGI_ERROR_INVALID_CALLand no command list submitted.STORAGE_BINDINGgot a UAV for every view, its sRGB views included. Direct3D 12 has no sRGB UAV, andCreateUnorderedAccessViewreturns nothing, so the invalid call removed the device. openOMSI's RT texture atlas isRgba8Unormwith storage, sampled through anRgba8UnormSrgbview. The newmx_types::is_storage_view_formatis false for sRGB, depth and block-compressed formats.is_heap_storage_viewuses it, and mx-dx12 makes no UAV for such a view. mx-vulkan leavesSTORAGEout of such a view's usage (VUID-VkImageViewCreateInfo-usage-02275). Test:an_srgb_view_of_a_storage_texture_is_no_storage_view.Device::is_lost. True once Direct3D 12 has removed the device; false on the other backends. openOMSI uses it so it does not build its renderer again on a device that cannot come back.u64::MAX),pollreturned without freeing the in-flight submissions. They held the last frames' swapchain buffers, and so the flip-model swapchain on the window. After openOMSI went on with Vulkan, the window kept showing the last Direct3D 12 picture: the grey loading screen of #4223.Checked:
cargo checkfor mx-types, mx-vulkan, mx-gl, mx-metal and mx-noop on macOS; mx, mx-dx12 and mx-dx11 forx86_64-pc-windows-msvc;cargo test -p mx-types. Not run yet on a Windows machine with an NVIDIA card.