[Mesa-dev] [RFC] Haiku viewport / framebuffer invalidation

Jose Fonseca jfonseca at vmware.com
Mon Nov 11 11:02:10 PST 2013

----- Original Message -----
> I've been banging my head against a wall for a while now on this.
> So the Haiku applications that call glViewport(.. for window
> resizes,etc never actually execute the Driver's Viewport call.
> (aka ctx->Driver.Viewport:
> http://cgit.freedesktop.org/mesa/mesa/tree/src/gallium/targets/haiku-softpipe/GalliumContext.cpp#n346)
> I found "void GLAPIENTRY _mesa_Viewport" in viewport.c, however I
> have a feeling this never gets called as softpipe is a Gallium
> driver not a Mesa driver.

They execute src/mesa/state_tracker/st_cb_viewport.c

I'm not sure I fully understand the Haiku case, but I suggest you look at the WGL state tracker, particular src/gallium/state_trackers/wgl/stw_framebuffer.c and friends, as it might be useful for you.

On Windows, we get a callback (stw_call_window_proc) whenever windows get resized. We simply note down the new size, and set a flag "must_resize". The actual resize happens when stw_framebuffer::validate happens, in stw_st_framebuffer_validate. 

I hope this helps.


> I know there are stamp's in the st_context and st_framebuffer, however
> ++'ing them on a window resize doesn't seem to solve the issue.
> Our libGL actually is aware of window resizes, so I have a fix in that
> manually calls the viewport calls on resize.. however I don't think
> this is a good long term fix as the viewport is always forced to the
> size of the window (which isn't correct was far as I know)
> http://cgit.freedesktop.org/mesa/mesa/commit/?id=e759f1c111018949db114e76ebf1a723525fb802
> Thoughts?
>  -- Alex
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev

More information about the mesa-dev mailing list