wined3d: Bind device framebuffer in ActivateContext

Stefan Dösinger stefan at codeweavers.com
Mon Dec 17 05:18:41 CST 2007


Am Samstag, 15. Dezember 2007 19:19:25 schrieb Allan Tong:

Sorry for the late reply, your mail got stuck in my messy inbox :-(

> The second patch moves FBO draw buffer selection to ActivateContext.
> For onscreen rendering, not much changes except binding framebuffer 0.
>  For offscreen rendering, the behavior depends on the specified
> context usage.  For BLIT and RESOURCE_LOAD, the target surface is
> attached to dst_fbo and used as the draw buffer.  For DRAWPRIM and
> CLEAR, I simply call apply_fbo_state.  This assumes that DRAWPRIM and
> CLEAR will always be used with device->render_targets[0].
There is a problem with GL_COLOR_ATTACHMENT1_EXT and higher, and the depth 
attachment. You're only applying the first color attachment, but that can 
lead to incomplete fbos, if for example the render target and depth stencil 
are changed. If you're only reapplying the first color attachment, you can 
get a size mismatch, which makes the driver pretty angry and can slow 
everything down.

You don't have to apply the fbo state in CTXUSAGE_RESOURCELOAD in theory. 
Resourceload never draws anything, nor does it read from the framebuffer, so 
it should be fine with any drawable / framebuffer.



More information about the wine-devel mailing list