RenderTarget11 now stores a Resource instead of a Texture2D.

TRAC #22705

Signed-off-by: Jamie Madill
Signed-off-by: Shannon Woods
Author: Geoff Lang

git-svn-id: https://angleproject.googlecode.com/svn/branches/es3proto@2163 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/libGLESv2/renderer/renderer11_utils.h b/src/libGLESv2/renderer/renderer11_utils.h
index 1bc48c1..48ed871 100644
--- a/src/libGLESv2/renderer/renderer11_utils.h
+++ b/src/libGLESv2/renderer/renderer11_utils.h
@@ -75,6 +75,25 @@
 
 HRESULT SetDebugName(ID3D11DeviceChild *resource, const char *name);
 
+template <typename outType>
+outType* DynamicCastComObject(IUnknown* object)
+{
+    outType *outObject = NULL;
+    HRESULT result = object->QueryInterface(__uuidof(outType), reinterpret_cast<void**>(&outObject));
+    if (SUCCEEDED(result))
+    {
+        return outObject;
+    }
+    else
+    {
+        if (outObject)
+        {
+            outObject->Release();
+        }
+        return NULL;
+    }
+}
+
 inline bool isDeviceLostError(HRESULT errorCode)
 {
     switch (errorCode)