[v2 PATCH] d2d1: Support shared bitmaps created from dxgi surface

Henri Verbeet hverbeet at gmail.com
Mon Oct 10 06:52:47 CDT 2016


On 10 October 2016 at 13:33, Nikolay Sivov <bunglehead at gmail.com> wrote:
>> It's in fact possible to share dxgi resources between different
>> devices and supposedly even different processes, but doing that would
>> require using IDXGIResource::GetSharedHandle(),
>> ID3D10Device::OpenSharedResource(), and D3D10_RESOURCE_MISC_SHARED,
>> all of which are currently unimplemented in Wine. I'm not sure if d2d1
>> allows it.
>
> This sounds like too much, with nothing that depends on this yet.
Yeah, implementing resource sharing is going to be a little painful.
More so because you can also share e.g. d3d9 surfaces with d3d11.

> I guess different device case/same process is easy to test,
> but if it's a general sharing rule of dxgi/d3d10/11 to restrict resource
> to device it was created from, tests should go to dxgi/d3d10/11 instead.
>
Possibly. In general using resources from a different device is
certainly not going to work correctly, but the API may not explicitly
enforce that everywhere and just crash or ignore calls. It should be
easy enough to test for something like CreateShaderResourceView(), but
e.g. VSSetShaderResources() would have less opportunities for giving
feedback about using a view from a different device, and you likely
wouldn't notice anything until you tried to draw with that setup.

> Undefined because same surface is used for render target and bitmap?
Yeah. Generally speaking binding resources as both inputs and outputs
at the same time results in undefined behaviour, although that
behaviour may very well end up being "does what you'd expect" on the
particular hardware and driver you're testing with at the time.

> Do you want me to change that?
Not necessarily, I think it's fine for the test to show that this is
allowed, although I do wonder a little if the Vista failure might be
related.



More information about the wine-devel mailing list