Skip to content

libs/vkd3d: Implement d3d12_command_list_OMSetDepthBounds().

Anna (navi) Figueiredo Gomes requested to merge navi/vkd3d:depth-bounds into master

API: https://learn.microsoft.com/en-us/windows/win32/api/d3d12/nf-d3d12-id3d12graphicscommandlist1-omsetdepthbounds

Design Doc: https://microsoft.github.io/DirectX-Specs/d3d/DepthBoundsTest.html#detailed-design

Based on the design document, "The runtime will not clamp or validate the input, but implementations may clamp to the range [0,1] if necessary.", so we test for the EXT_depth_range_unrestricted extension, and only clamp if it's not available (thus, necessary to do so).

NaNs are converted to zero as per "NaNs must be treated as 0, but the runtime will convert NaNs to 0 on behalf of the implementation."

The opengl extension is not behaving properly on my machine, failing tests, so we may have to force caps->depth_bounds to false on it.

Since DepthBoundsTest can only be enabled on Device2::CreatePipelineState, i made it so that the pipeline creation for the d3d12 backend would use it should Device2 be available.

I am unsure of what behavior vulkan has when some pipeline state is both set as dynamic and provided on the pipeline creation step.

All tests still pass locally, so it seems to use the pipeline static values as the default, but i can't find that specified anywhere in the spec, so we might want store the depth bounds values and always call the vkCmdSetBounds when drawing?

And, being able to upload data directly to the rtv/dsv would simplify the test a lot. i attempted to implement it like that for the shader_runner in a local branch although it's not fully working yet, so if it's of interest, i can continue that work on a follow up.

Superceeds !632 (closed)

Edited by Anna (navi) Figueiredo Gomes

Merge request reports

Loading