Skip to content
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

Viewport fixes #14609

Merged
merged 2 commits into from
Jul 12, 2021
Merged

Viewport fixes #14609

merged 2 commits into from
Jul 12, 2021

Conversation

hrydgard
Copy link
Owner

New attempt at fixing #13921.

The viewport clipping logic can result in negative or zero values if the viewport is outside the scissor.

At least Vulkan rejects 0-sized viewports so let's simply set the dimension to 1px in this case, which already should result in no drawing due to being outside the scissor.

@Panderner can you check if Gradius Collection is okay when this is in?

It's ok if this emits a single pixel sized viewport, since the cause of
this is generally the viewport being specified outside the scissor
rectangle.

Fixes #13921
@hrydgard hrydgard added Vulkan GE emulation Backend-independent GPU issues labels Jul 12, 2021
@hrydgard hrydgard added this to the v1.12.0 milestone Jul 12, 2021
@hrydgard hrydgard merged commit 11957dd into master Jul 12, 2021
@hrydgard hrydgard deleted the viewport-fixes branch July 12, 2021 20:04
@Panderner
Copy link
Contributor

Yes @hrydgard it seems Gradius Collection is okay. All games are running ok.

@hrydgard
Copy link
Owner Author

Great, thanks for testing!

@unknownbrackets
Copy link
Collaborator

I guess we should do some actual tests to see what happens. I think I remember something odd happening when I accidentally specified a zero scale viewport (back when I was learning what those registers even really meant, and started calling them "scale" and "center".)

-[Unknown]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GE emulation Backend-independent GPU issues Vulkan
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants