Problem
The winemetal render encoder can currently reach Metal draw calls after earlier state setup failed or when indexed draw buffers/ranges are invalid.
On macOS/Arm this matters while working on the DXMT path because shader or pipeline creation failures can leave the command stream without a valid render pipeline state. Sending such commands to Metal turns a recoverable guest rendering problem into an Objective-C Metal validation exception and VM process crash. Invalid indexed draw buffer state has the same shape: the encoder should reject the draw before calling into Metal.
Proposed fix
Add defensive validation at the winemetal render command boundary:
- track whether the encoder currently has a valid render pipeline state
- skip draw calls when no valid pipeline state is active
- validate indexed draw index buffer presence, type, offset, count, and total range
- validate indirect indexed draw argument buffer offset and size before encoding
Validation
Signed-off-by: Roberto Nibali rnibali@gmail.com
Problem
The winemetal render encoder can currently reach Metal draw calls after earlier state setup failed or when indexed draw buffers/ranges are invalid.
On macOS/Arm this matters while working on the DXMT path because shader or pipeline creation failures can leave the command stream without a valid render pipeline state. Sending such commands to Metal turns a recoverable guest rendering problem into an Objective-C Metal validation exception and VM process crash. Invalid indexed draw buffer state has the same shape: the encoder should reject the draw before calling into Metal.
Proposed fix
Add defensive validation at the winemetal render command boundary:
Validation
git diff --checkpassed.kmk VBoxDxMtcompleted successfully on macOS/Arm with LLVM 15.0.7.Signed-off-by: Roberto Nibali rnibali@gmail.com