[PATCH 2/5] wined3d: Pass a context to read_from_framebuffer.
stefandoesinger at gmail.com
Tue Oct 13 05:53:25 CDT 2015
Henri once upon a time didn't like this (I haven't looked for my
previous patch attempt from 2 years ago) and suggested a
context_restore call instead. This is what I did here.
I guess it would be nicer if context_restore accepted two contexts,
but we're intentionally not using a separate GL context nor struct
wined3d_context for backbuffer offscreen rendering. Neither the GL
context switch nor keeping track of all d3d states is necessary for
backbuffer ORM to do its job.
2015-10-13 12:29 GMT+02:00 Matteo Bruni <matteo.mystral at gmail.com>:
> 2015-10-12 22:34 GMT+02:00 Stefan Dösinger <stefan at codeweavers.com>:
>> Sometimes the context won't be reusable because we need a specific
>> context to access the WGL drawable. Afterwards we need to switch back to
>> the caller's context. Bug 34574 is related to this. This is only
>> relevant for backbuffer offscreen rendering, and in practise it is rare.
>> It'll only matter if the application is blitting from an onscreen
>> surface to a currently active offscreen one. For everything else the
>> offscreen surface is copied into the texture when it is deactivated.
>> Note that in most cases the wined3d_context * structure is the same for
>> both surfaces involved in the blit, but context->render_offscreen
>> differs for source and destination. That's why context_restore needs a
>> surface and not the old context.
>> I'm open to placing the extra context_acquire / context_release calls
>> into the callers. We need them in 4 places: read_from_framebuffer,
>> surface_blt_to_drawable, surface_blt_fbo and surface_load_fb_texture.
> Yes, IMHO that would be better, although I haven't actually tried that
> so it might turn out to be bad in practice. Obviously ignore this
> suggestion altogether if Henri thinks otherwise :P
More information about the wine-devel