Use explicit front and back stencil state.

Previously stencil states were stored in array. This commit changes the
DepthStencilState to explicitly store a front and back stencil.
This commit is contained in:
Austin Eng
2017-05-31 09:29:05 -04:00
committed by Corentin Wallez
parent 376f1c6a8e
commit f51be34864
4 changed files with 37 additions and 43 deletions

View File

@@ -214,8 +214,8 @@ namespace opengl {
if (StencilIsEnabled()) {
glEnable(GL_STENCIL_TEST);
auto& back = GetStencil(nxt::Face::Back);
auto& front = GetStencil(nxt::Face::Front);
auto& back = GetBackStencil();
auto& front = GetFrontStencil();
glStencilOpSeparate(GL_BACK,
OpenGLStencilOperation(back.stencilFail),
@@ -238,8 +238,8 @@ namespace opengl {
void DepthStencilState::ApplyStencilReferenceNow(uint32_t backReference, uint32_t frontReference) {
if (StencilIsEnabled()) {
auto& back = GetStencil(nxt::Face::Back);
auto& front = GetStencil(nxt::Face::Front);
auto& back = GetBackStencil();
auto& front = GetFrontStencil();
glStencilFuncSeparate(GL_BACK,
OpenGLCompareFunction(back.compareFunction),
backReference,