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

Scissor and Viewport usage order matters with GLRenderer #5951

Open
smoogipoo opened this issue Jul 28, 2023 · 0 comments
Open

Scissor and Viewport usage order matters with GLRenderer #5951

smoogipoo opened this issue Jul 28, 2023 · 0 comments
Labels
area:renderer-gl priority:1 Very important. Feels bad without fix. Affects the majority of users.

Comments

@smoogipoo
Copy link
Contributor

These two functions should be independent of one another, however they are currently tied to each other in a very peculiar way because GLRenderer calculates the scissor's y-position based on the current viewport:

protected override void SetScissorImplementation(RectangleI scissor) => GL.Scissor(scissor.X, Viewport.Height - scissor.Bottom, scissor.Width, scissor.Height);

This means that the following order of operations leads to the wrong result:

PushViewport()
PushScissor()

PopScissor()
PopViewport()

Where the order of operations that leads to a correct result is:

PushViewport()
PushScissor()

PopViewport()
PopScissor()
@smoogipoo smoogipoo added priority:1 Very important. Feels bad without fix. Affects the majority of users. area:renderer-gl labels Jul 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:renderer-gl priority:1 Very important. Feels bad without fix. Affects the majority of users.
Projects
None yet
Development

No branches or pull requests

1 participant