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

glretrace: Handle glViewport better. #758

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

LeptonWu
Copy link

@LeptonWu LeptonWu commented Aug 3, 2021

If a user call glViewport with non default framebuffer bind first,
and then bind the default framebuffer to draw, the current apitrace
won't show anything on screen and complain glViewport hasn't been
called yet. Fix this by caching the width/height value in current
context.

If a user call glViewport with non default framebuffer bind first,
and then bind the default framebuffer to draw, the current apitrace
won't show anything on screen and complain glViewport hasn't been
called yet. Fix this by caching the width/height value in current
context.
@jrfonseca
Copy link
Member

I don't quite understand the problem or the proposed fix.

If a user call glViewport with non default framebuffer bind first, and then bind the default framebuffer to draw, the current apitrace won't show anything on screen and complain glViewport hasn't been called yet.

This should never happen.

When tracing, apitrace will emit a fake glViewport call the very first time a context is bound. See _fake_glViewport().

So if you do see such trace, then I suspect the problem actually happened when tracing, and the right fix is to ensure _fake_glViewport() is called the very first time the context is bound.

Also, width and height should be initialized to zero.

@jrfonseca jrfonseca added Further Work Needed For PRs which need more work. Replaying labels Sep 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Further Work Needed For PRs which need more work. Replaying
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants