Renderer11::readPixels queries the RenderTarget11 for the correct subresource to read from.
TRAC #22368
Signed-off-by: Nicolas Capens
Signed-off-by: Daniel Koch
Author: Geoff Lang
git-svn-id: https://angleproject.googlecode.com/svn/branches/dx11proto@1688 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/libGLESv2/renderer/Renderer11.cpp b/src/libGLESv2/renderer/Renderer11.cpp
index 5738be1..82009ab 100644
--- a/src/libGLESv2/renderer/Renderer11.cpp
+++ b/src/libGLESv2/renderer/Renderer11.cpp
@@ -1604,6 +1604,7 @@
GLsizei outputPitch, bool packReverseRowOrder, GLint packAlignment, void* pixels)
{
ID3D11Texture2D *colorBufferTexture = NULL;
+ unsigned int subresourceIndex = 0;
gl::Renderbuffer *colorbuffer = framebuffer->getColorbuffer();
if (colorbuffer)
@@ -1611,6 +1612,8 @@
RenderTarget11 *renderTarget = RenderTarget11::makeRenderTarget11(colorbuffer->getRenderTarget());
if (renderTarget)
{
+ subresourceIndex = renderTarget->getSubresourceIndex();
+
ID3D11RenderTargetView *colorBufferRTV = renderTarget->getRenderTargetView();
if (colorBufferRTV)
{
@@ -1641,8 +1644,8 @@
area.width = width;
area.height = height;
- readTextureData(colorBufferTexture, 0, area, format, type, outputPitch, packReverseRowOrder,
- packAlignment, pixels);
+ readTextureData(colorBufferTexture, subresourceIndex, area, format, type, outputPitch,
+ packReverseRowOrder, packAlignment, pixels);
colorBufferTexture->Release();
colorBufferTexture = NULL;