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
parent b68d2bbe
...@@ -1604,6 +1604,7 @@ void Renderer11::readPixels(gl::Framebuffer *framebuffer, GLint x, GLint y, GLsi ...@@ -1604,6 +1604,7 @@ void Renderer11::readPixels(gl::Framebuffer *framebuffer, GLint x, GLint y, GLsi
GLsizei outputPitch, bool packReverseRowOrder, GLint packAlignment, void* pixels) GLsizei outputPitch, bool packReverseRowOrder, GLint packAlignment, void* pixels)
{ {
ID3D11Texture2D *colorBufferTexture = NULL; ID3D11Texture2D *colorBufferTexture = NULL;
unsigned int subresourceIndex = 0;
gl::Renderbuffer *colorbuffer = framebuffer->getColorbuffer(); gl::Renderbuffer *colorbuffer = framebuffer->getColorbuffer();
if (colorbuffer) if (colorbuffer)
...@@ -1611,6 +1612,8 @@ void Renderer11::readPixels(gl::Framebuffer *framebuffer, GLint x, GLint y, GLsi ...@@ -1611,6 +1612,8 @@ void Renderer11::readPixels(gl::Framebuffer *framebuffer, GLint x, GLint y, GLsi
RenderTarget11 *renderTarget = RenderTarget11::makeRenderTarget11(colorbuffer->getRenderTarget()); RenderTarget11 *renderTarget = RenderTarget11::makeRenderTarget11(colorbuffer->getRenderTarget());
if (renderTarget) if (renderTarget)
{ {
subresourceIndex = renderTarget->getSubresourceIndex();
ID3D11RenderTargetView *colorBufferRTV = renderTarget->getRenderTargetView(); ID3D11RenderTargetView *colorBufferRTV = renderTarget->getRenderTargetView();
if (colorBufferRTV) if (colorBufferRTV)
{ {
...@@ -1641,8 +1644,8 @@ void Renderer11::readPixels(gl::Framebuffer *framebuffer, GLint x, GLint y, GLsi ...@@ -1641,8 +1644,8 @@ void Renderer11::readPixels(gl::Framebuffer *framebuffer, GLint x, GLint y, GLsi
area.width = width; area.width = width;
area.height = height; area.height = height;
readTextureData(colorBufferTexture, 0, area, format, type, outputPitch, packReverseRowOrder, readTextureData(colorBufferTexture, subresourceIndex, area, format, type, outputPitch,
packAlignment, pixels); packReverseRowOrder, packAlignment, pixels);
colorBufferTexture->Release(); colorBufferTexture->Release();
colorBufferTexture = NULL; colorBufferTexture = NULL;
......
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