apitrace icon indicating copy to clipboard operation
apitrace copied to clipboard

glretrace: Handle glViewport better.

Open LeptonWu opened this issue 4 years ago • 1 comments

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.

LeptonWu avatar Aug 03 '21 05:08 LeptonWu

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 avatar Sep 01 '21 14:09 jrfonseca