Opened 13 months ago
Last modified 13 months ago
#22011 new defect
VMSVGA/VBoxSVGA: wrong ClearDepthStencilView flags in DX11 mode
Reported by: | JHRobotics | Owned by: | |
---|---|---|---|
Component: | 3D support | Version: | VirtualBox-7.0.14 |
Keywords: | SVGA3D DirectX11 | Cc: | JHRobotics |
Guest type: | all | Host type: | all |
Description
Hello, when SVGA3D driver emits SVGA_3D_CMD_DX_CLEAR_DEPTHSTENCIL_VIEW
command, a flags field is bitfield contains what to clear (SVGA3dClearFlag
enum in svga3d_types.h
) and this flag is directly passed to ClearDepthStencilView
DX11 call. But this is wrong, because for example SVGA3D_CLEAR_DEPTH
is 0x2, but D3D11_CLEAR_DEPTH
is 0x1.
(MS documentation: https://learn.microsoft.com/en-us/windows/win32/api/d3d11/ne-d3d11-d3d11_clear_flag)
It’s breaking all 3D application which doesn’t clear depth buffer same time as colour buffer (SVGA3D_CLEAR_COLOR
equals to D3D11_CLEAR_DEPTH
). I’m also sending patch (for SVN and for stable 7.0.14) and attached screenshots on original state and after patch.
Best regards
JH
Patch for SVN