VirtualBox

Opened 2 months ago

Last modified 2 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

Attachments (4)

svga3d_d3d11_clear_flag-svn.patch (940 bytes ) - added by JHRobotics 2 months ago.
Patch for SVN
svga3d_d3d11_clear_flag-7.0.14.patch (870 bytes ) - added by JHRobotics 2 months ago.
Patch for 7.0.14
VirtualBox_MP_original.png (126.3 KB ) - added by JHRobotics 2 months ago.
3D application without patch
VirtualBox_MP_after_patch.jpg (330.3 KB ) - added by JHRobotics 2 months ago.
3D application after patch

Download all attachments as: .zip

Change History (5)

by JHRobotics, 2 months ago

Patch for SVN

by JHRobotics, 2 months ago

Patch for 7.0.14

by JHRobotics, 2 months ago

Attachment: VirtualBox_MP_original.png added

3D application without patch

by JHRobotics, 2 months ago

3D application after patch

comment:1 by sunlover1, 2 months ago

Thanks for the report! Great catch. This will be fixed.

Note: See TracTickets for help on using tickets.

© 2023 Oracle
ContactPrivacy policyTerms of Use