Implement render target layers support.
This adds the ability to render to a specific layer of a 2D array
texture.
Change-Id: I3055d62c9964b2729704785efb068b82eef4f9ce
Reviewed-on: https://swiftshader-review.googlesource.com/14668
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
diff --git a/src/Renderer/PixelProcessor.cpp b/src/Renderer/PixelProcessor.cpp
index f76c387..7ae45e9 100644
--- a/src/Renderer/PixelProcessor.cpp
+++ b/src/Renderer/PixelProcessor.cpp
@@ -159,19 +159,22 @@
}
}
- void PixelProcessor::setRenderTarget(int index, Surface *renderTarget)
+ void PixelProcessor::setRenderTarget(int index, Surface *renderTarget, unsigned int layer)
{
context->renderTarget[index] = renderTarget;
+ context->renderTargetLayer[index] = layer;
}
- void PixelProcessor::setDepthBuffer(Surface *depthBuffer)
+ void PixelProcessor::setDepthBuffer(Surface *depthBuffer, unsigned int layer)
{
context->depthBuffer = depthBuffer;
+ context->depthBufferLayer = layer;
}
- void PixelProcessor::setStencilBuffer(Surface *stencilBuffer)
+ void PixelProcessor::setStencilBuffer(Surface *stencilBuffer, unsigned int layer)
{
context->stencilBuffer = stencilBuffer;
+ context->stencilBufferLayer = layer;
}
void PixelProcessor::setTexCoordIndex(unsigned int stage, int texCoordIndex)