mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-11 01:30:25 +01:00
st/nine: Improve Surface GetContainer
Prevents a crash in wine tests. Not sure this behaviour is the correct one, but at least it'll check the IID passed is the device before returning it. Signed-off-by: Axel Davy <davyaxel0@gmail.com> Acked-by: Timur Kristóf <timur.kristof@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10160>
This commit is contained in:
parent
17dc334b81
commit
d03f401fda
1 changed files with 4 additions and 9 deletions
|
|
@ -339,15 +339,10 @@ NineSurface9_GetContainer( struct NineSurface9 *This,
|
|||
|
||||
if (!ppContainer) return E_POINTER;
|
||||
|
||||
/* Return device for OffscreenPlainSurface, DepthStencilSurface and RenderTarget */
|
||||
if (!NineUnknown(This)->container) {
|
||||
*ppContainer = NineUnknown(This)->device;
|
||||
NineUnknown_AddRef(NineUnknown(*ppContainer));
|
||||
|
||||
return D3D_OK;
|
||||
}
|
||||
|
||||
hr = NineUnknown_QueryInterface(NineUnknown(This)->container, riid, ppContainer);
|
||||
/* Use device for OffscreenPlainSurface, DepthStencilSurface and RenderTarget */
|
||||
hr = NineUnknown_QueryInterface(NineUnknown(This)->container ?
|
||||
NineUnknown(This)->container : &NineUnknown(This)->device->base,
|
||||
riid, ppContainer);
|
||||
if (FAILED(hr))
|
||||
DBG("QueryInterface FAILED!\n");
|
||||
return hr;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue