-
Notifications
You must be signed in to change notification settings - Fork 879
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[d3d8] Validate viewport dimensions on SetViewport #4245
Conversation
Does anything happen to existing viewports when the app binds a smaller render target? |
Guess it's worth a quick test, but I doubt that affects anything unless the app also sets a new viewport. |
@doitsujin After setting a smaller sized render target, apparently we already automatically adjust the viewport to fit (at least with a following call to GetViewport its new dimensions are equal to the smaller render target). WineD3D behaves the same. So no need to worry about this bit, just games being silly with SetViewport as per above. |
Hmmm... I hadn't considered the X and Y (upper left) coordinates in the validation actually, and some games might do that. I'll adjust and retest this. |
292383a
to
8e4461e
Compare
Alright, this should be sufficient. Verified with WineD3D and native WinXP drivers that the validation also takes the X and Y offsets into account (which makes sense). |
7208343
to
5c08384
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The m_renderTarget
null check is technically unnecessary as far as I can tell but it doesn't hurt either so whatever.
5c08384
to
4d59c1d
Compare
D3D8 apparently validates this, while D3D9 does not. I've checked that WineD3D also performs this validation,
I am yet to check olden (WinXP) native behavior. Native d3d8 drivers, of WinXP fame, also perform this validation.P.S.: @Blisto91 Also tested on modern Windows with AMD and it also performs the validation.