Re: [PATCH 3/6] d3d9/tests: Add helpers to avoid multiple readbacks of the render target surface.
On 8 October 2015 at 01:26, Matteo Bruni <mbruni(a)codeweavers.com> wrote:
My feeling is that we could improve the readback performance further in wined3d, regardless of this patch. Possibly, but note that GetRenderTargetData() isn't terribly fast on Windows either.
I like the concept, but the implementation probably needs some work. I'd like to have an interface that can work for d3d10/11 as well, so the device parameter probably needs to go. (See also how get_texture_color() is used in d3d10core.) Maybe return a structure that wraps both the readback surface and locked rect to avoid declaring those as separate parameters. E.g.: struct surface_readback rb; get_surface_readback(backbuffer, &rb) color = get_readback_color(&rb, x, y); release_surface_readback(&rb); (Not sure on the naming.) I also think getPixelColor() should then be implemented on top of this. I think masking out the alpha/X channel was the wrong decision, and we should fix that at some point, but for the time being you can of course still mask the result of get_readback_color().
participants (1)
-
Henri Verbeet