Problem
The DXMT indexed draw path currently carries the indexed draw base vertex through unsigned fields.
D3D11's BaseVertexLocation is signed, and Metal's baseVertex argument is signed as well. Negative base vertices are legal. Reinterpreting the value through uint32_t can turn a valid negative base vertex into a very large positive offset before the command reaches the winemetal encoder.
Proposed fix
Keep the base vertex signed across the DXMT/winemetal command boundary:
DXMT_DRAW_INDEXED_ARGUMENTS::BaseVertex
wmtcmd_render_draw_indexed::base_vertex
Validation
Signed-off-by: Roberto Nibali rnibali@gmail.com
Problem
The DXMT indexed draw path currently carries the indexed draw base vertex through unsigned fields.
D3D11's
BaseVertexLocationis signed, and Metal'sbaseVertexargument is signed as well. Negative base vertices are legal. Reinterpreting the value throughuint32_tcan turn a valid negative base vertex into a very large positive offset before the command reaches the winemetal encoder.Proposed fix
Keep the base vertex signed across the DXMT/winemetal command boundary:
DXMT_DRAW_INDEXED_ARGUMENTS::BaseVertexwmtcmd_render_draw_indexed::base_vertexValidation
git diff --checkpassed.kmk VBoxDxMtcompleted successfully on macOS/Arm with LLVM 15.0.7.Signed-off-by: Roberto Nibali rnibali@gmail.com