Support separate depth and stencil buffers.
Bug 27460431
Change-Id: If11e16597b3fdfbfa6f1f2282e287b302b541f63
Reviewed-on: https://swiftshader-review.googlesource.com/4976
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
diff --git a/src/Renderer/PixelProcessor.cpp b/src/Renderer/PixelProcessor.cpp
index f0ad980..f736233 100644
--- a/src/Renderer/PixelProcessor.cpp
+++ b/src/Renderer/PixelProcessor.cpp
@@ -172,9 +172,14 @@
context->renderTarget[index] = renderTarget;
}
- void PixelProcessor::setDepthStencil(Surface *depthStencil)
+ void PixelProcessor::setDepthBuffer(Surface *depthBuffer)
{
- context->depthStencil = depthStencil;
+ context->depthBuffer = depthBuffer;
+ }
+
+ void PixelProcessor::setStencilBuffer(Surface *stencilBuffer)
+ {
+ context->stencilBuffer = stencilBuffer;
}
void PixelProcessor::setTexCoordIndex(unsigned int stage, int texCoordIndex)
@@ -939,9 +944,9 @@
{
state.depthTestActive = true;
state.depthCompareMode = context->depthCompareMode;
- state.quadLayoutDepthBuffer = context->depthStencil->getInternalFormat() != FORMAT_D32F_LOCKABLE &&
- context->depthStencil->getInternalFormat() != FORMAT_D32FS8_TEXTURE &&
- context->depthStencil->getInternalFormat() != FORMAT_D32FS8_SHADOW;
+ state.quadLayoutDepthBuffer = context->depthBuffer->getInternalFormat() != FORMAT_D32F_LOCKABLE &&
+ context->depthBuffer->getInternalFormat() != FORMAT_D32FS8_TEXTURE &&
+ context->depthBuffer->getInternalFormat() != FORMAT_D32FS8_SHADOW;
}
state.occlusionEnabled = context->occlusionEnabled;