Reorganized the getter methods of SwapChain11 and added a method to get the…

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
parent f2685e5f
......@@ -477,6 +477,18 @@ EGLint SwapChain11::swapRect(EGLint x, EGLint y, EGLint width, EGLint height)
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,26 +503,26 @@ ID3D11RenderTargetView *SwapChain11::getRenderTarget()
// Increments refcount on view.
// caller must Release() the returned view
ID3D11DepthStencilView *SwapChain11::getDepthStencil()
ID3D11ShaderResourceView *SwapChain11::getRenderTargetShaderResource()
{
if (mDepthStencilDSView)
if (mOffscreenSRView)
{
mDepthStencilDSView->AddRef();
mOffscreenSRView->AddRef();
}
return mDepthStencilDSView;
return mOffscreenSRView;
}
// Increments refcount on texture.
// caller must Release() the returned texture
ID3D11Texture2D *SwapChain11::getOffscreenTexture()
// Increments refcount on view.
// caller must Release() the returned view
ID3D11DepthStencilView *SwapChain11::getDepthStencil()
{
if (mOffscreenTexture)
if (mDepthStencilDSView)
{
mOffscreenTexture->AddRef();
mDepthStencilDSView->AddRef();
}
return mOffscreenTexture;
return mDepthStencilDSView;
}
SwapChain11 *SwapChain11::makeSwapChain11(SwapChain *swapChain)
......@@ -520,4 +532,3 @@ SwapChain11 *SwapChain11::makeSwapChain11(SwapChain *swapChain)
}
}
......@@ -28,9 +28,11 @@ class SwapChain11 : public SwapChain
virtual EGLint reset(EGLint backbufferWidth, EGLint backbufferHeight, EGLint swapInterval);
virtual EGLint swapRect(EGLint x, EGLint y, EGLint width, EGLint height);
virtual ID3D11Texture2D *getOffscreenTexture();
virtual ID3D11RenderTargetView *getRenderTarget();
virtual ID3D11ShaderResourceView *getRenderTargetShaderResource();
virtual ID3D11DepthStencilView *getDepthStencil();
virtual ID3D11Texture2D *getOffscreenTexture();
EGLint getWidth() const { return mWidth; }
EGLint getHeight() const { return mHeight; }
......@@ -53,10 +55,10 @@ class SwapChain11 : public SwapChain
ID3D11Texture2D *mOffscreenTexture;
ID3D11RenderTargetView *mOffscreenRTView;
ID3D11ShaderResourceView *mOffscreenSRView;
ID3D11Texture2D *mDepthStencilTexture;
ID3D11DepthStencilView *mDepthStencilDSView;
ID3D11ShaderResourceView *mOffscreenSRView;
ID3D11Buffer *mQuadVB;
ID3D11SamplerState *mPassThroughSampler;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment