aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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");