summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorPatrick Rudolph <[email protected]>2016-09-16 16:42:50 +0200
committerAxel Davy <[email protected]>2016-10-10 23:43:51 +0200
commitc1c8e852c158759ac8c551ab104ff05d683acf19 (patch)
tree0b7b77a041c91ac1b683ee0e6739ab52b59cdff2 /src/gallium
parentba0274c7d6c3b77a36bbe1b444f427b0c873e2f3 (diff)
st/nine: Return device in NineSurface9_GetContainer
According to MSDN the device is returned for surfaces that do not have a regular container. Such surfaces are: OffscreenPlainSurface, DepthStencilSurface and RenderTarget Tested and verified on Windows. Signed-off-by: Patrick Rudolph <[email protected]> Reviewed-by: Axel Davy <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/state_trackers/nine/surface9.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/gallium/state_trackers/nine/surface9.c b/src/gallium/state_trackers/nine/surface9.c
index e6a48e2041b..bf485bb4375 100644
--- a/src/gallium/state_trackers/nine/surface9.c
+++ b/src/gallium/state_trackers/nine/surface9.c
@@ -276,8 +276,16 @@ NineSurface9_GetContainer( struct NineSurface9 *This,
DBG("This=%p riid=%p id=%s ppContainer=%p\n",
This, riid, riid ? GUID_sprintf(guid_str, riid) : "", ppContainer);
- if (!NineUnknown(This)->container)
- return E_NOINTERFACE;
+ 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);
if (FAILED(hr))
DBG("QueryInterface FAILED!\n");