Skip to content

winemetal: validate render draw state before encoding#759

Open
moreaki wants to merge 1 commit into
VirtualBox:mainfrom
moreaki:agent/winemetal-validate-render-draws
Open

winemetal: validate render draw state before encoding#759
moreaki wants to merge 1 commit into
VirtualBox:mainfrom
moreaki:agent/winemetal-validate-render-draws

Conversation

@moreaki

@moreaki moreaki commented Jul 8, 2026

Copy link
Copy Markdown

Summary

Validate winemetal render draw state before encoding draw calls into Metal.

This patch keeps track of whether the render encoder currently has a valid pipeline state and skips draw commands when no valid PSO is active. It also validates indexed draw buffer presence, type, offset/count range, and indirect draw argument buffer bounds before calling into Metal.

The intent is to keep invalid guest or failed pipeline state from becoming an Objective-C Metal validation exception and VM process crash.

Validation

Closes #756.

Signed-off-by: Roberto Nibali rnibali@gmail.com

Guard render draw commands before passing them to Metal. If pipeline creation failed or an indexed draw carries an invalid index buffer/range, skip the draw and report the condition instead of letting Objective-C Metal validation raise an exception from the encoder.

Persist whether a render encoder has seen a valid pipeline state across command batches by attaching the state to the encoder object.

Signed-off-by: Roberto Nibali <rnibali@gmail.com>
@oracle-contributor-agreement

Copy link
Copy Markdown

Thank you for your pull request and welcome to our community! To contribute, please sign the Oracle Contributor Agreement (OCA).
The following contributors of this PR have not signed the OCA:

To sign the OCA, please create an Oracle account and sign the OCA in Oracle's Contributor Agreement Application.

When signing the OCA, please provide your GitHub username. After signing the OCA and getting an OCA approval from Oracle, this PR will be automatically updated.

If you are an Oracle employee, please make sure that you are a member of the main Oracle GitHub organization, and your membership in this organization is public.

@oracle-contributor-agreement oracle-contributor-agreement Bot added the OCA Required At least one contributor does not have an approved Oracle Contributor Agreement. label Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OCA Required At least one contributor does not have an approved Oracle Contributor Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

winemetal: validate render draw state before encoding

1 participant