Reorganized the getter methods of SwapChain11 and added a method to get the offscreen texture shader resource.
TRAC #22358
Signed-off-by: Nicolas Capens
Signed-off-by: Shannon Woods
Author: Geoff Lang
git-svn-id: https://angleproject.googlecode.com/svn/branches/dx11proto@1742 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/libGLESv2/renderer/SwapChain11.cpp b/src/libGLESv2/renderer/SwapChain11.cpp
index dc148ee..3d87951 100644
--- a/src/libGLESv2/renderer/SwapChain11.cpp
+++ b/src/libGLESv2/renderer/SwapChain11.cpp
@@ -477,6 +477,18 @@
return EGL_SUCCESS;
}
+// Increments refcount on texture.
+// caller must Release() the returned texture
+ID3D11Texture2D *SwapChain11::getOffscreenTexture()
+{
+ if (mOffscreenTexture)
+ {
+ mOffscreenTexture->AddRef();
+ }
+
+ return mOffscreenTexture;
+}
+
// Increments refcount on view.
// caller must Release() the returned view
ID3D11RenderTargetView *SwapChain11::getRenderTarget()
@@ -491,6 +503,18 @@
// Increments refcount on view.
// caller must Release() the returned view
+ID3D11ShaderResourceView *SwapChain11::getRenderTargetShaderResource()
+{
+ if (mOffscreenSRView)
+ {
+ mOffscreenSRView->AddRef();
+ }
+
+ return mOffscreenSRView;
+}
+
+// Increments refcount on view.
+// caller must Release() the returned view
ID3D11DepthStencilView *SwapChain11::getDepthStencil()
{
if (mDepthStencilDSView)
@@ -501,18 +525,6 @@
return mDepthStencilDSView;
}
-// Increments refcount on texture.
-// caller must Release() the returned texture
-ID3D11Texture2D *SwapChain11::getOffscreenTexture()
-{
- if (mOffscreenTexture)
- {
- mOffscreenTexture->AddRef();
- }
-
- return mOffscreenTexture;
-}
-
SwapChain11 *SwapChain11::makeSwapChain11(SwapChain *swapChain)
{
ASSERT(dynamic_cast<rx::SwapChain11*>(swapChain) != NULL);
@@ -520,4 +532,3 @@
}
}
-