Rename variables in DepthStencilStateDescriptor, in order to match web idl

Bug:dawn:31
Change-Id: Ie3326e13f62446bf020ae60f47c8dfa6687d7b9a
Reviewed-on: https://dawn-review.googlesource.com/c/4240
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
This commit is contained in:
Yunchao He 2019-01-30 21:11:43 +00:00 committed by Commit Bot service account
parent 8749506bae
commit baa3741c9f
11 changed files with 128 additions and 125 deletions

View File

@ -513,8 +513,8 @@
"members": [
{"name": "depth write enabled", "type": "bool"},
{"name": "depth compare", "type": "compare function"},
{"name": "front", "type": "stencil state face descriptor"},
{"name": "back", "type": "stencil state face descriptor"},
{"name": "stencil front", "type": "stencil state face descriptor"},
{"name": "stencil back", "type": "stencil state face descriptor"},
{"name": "stencil read mask", "type": "uint32_t"},
{"name": "stencil write mask", "type": "uint32_t"}
]
@ -937,7 +937,7 @@
"extensible": false,
"members": [
{"name": "compare", "type": "compare function"},
{"name": "stencil fail op", "type": "stencil operation"},
{"name": "fail op", "type": "stencil operation"},
{"name": "depth fail op", "type": "stencil operation"},
{"name": "pass op", "type": "stencil operation"}
]

View File

@ -114,7 +114,7 @@ void init() {
dawnStencilStateFaceDescriptor stencilFace;
stencilFace.compare = DAWN_COMPARE_FUNCTION_ALWAYS;
stencilFace.stencilFailOp = DAWN_STENCIL_OPERATION_KEEP;
stencilFace.failOp = DAWN_STENCIL_OPERATION_KEEP;
stencilFace.depthFailOp = DAWN_STENCIL_OPERATION_KEEP;
stencilFace.passOp = DAWN_STENCIL_OPERATION_KEEP;
@ -122,8 +122,8 @@ void init() {
depthStencilState.nextInChain = nullptr;
depthStencilState.depthWriteEnabled = false;
depthStencilState.depthCompare = DAWN_COMPARE_FUNCTION_ALWAYS;
depthStencilState.back = stencilFace;
depthStencilState.front = stencilFace;
depthStencilState.stencilBack = stencilFace;
depthStencilState.stencilFront = stencilFace;
depthStencilState.stencilReadMask = 0xff;
depthStencilState.stencilWriteMask = 0xff;
descriptor.depthStencilState = &depthStencilState;

View File

@ -214,8 +214,8 @@ void init() {
pDescriptor.cAttachmentsState.hasDepthStencilAttachment = true;
pDescriptor.cDepthStencilAttachment.format = dawn::TextureFormat::D32FloatS8Uint;
pDescriptor.cColorAttachments[0]->format = GetPreferredSwapChainTextureFormat();
pDescriptor.cDepthStencilState.front.passOp = dawn::StencilOperation::Replace;
pDescriptor.cDepthStencilState.back.passOp = dawn::StencilOperation::Replace;
pDescriptor.cDepthStencilState.stencilFront.passOp = dawn::StencilOperation::Replace;
pDescriptor.cDepthStencilState.stencilBack.passOp = dawn::StencilOperation::Replace;
pDescriptor.cDepthStencilState.depthCompare = dawn::CompareFunction::Less;
planePipeline = device.CreateRenderPipeline(&pDescriptor);
@ -228,10 +228,10 @@ void init() {
rfDescriptor.cAttachmentsState.hasDepthStencilAttachment = true;
rfDescriptor.cDepthStencilAttachment.format = dawn::TextureFormat::D32FloatS8Uint;
rfDescriptor.cColorAttachments[0]->format = GetPreferredSwapChainTextureFormat();
pDescriptor.cDepthStencilState.front.compare = dawn::CompareFunction::Equal;
pDescriptor.cDepthStencilState.back.compare = dawn::CompareFunction::Equal;
pDescriptor.cDepthStencilState.front.passOp = dawn::StencilOperation::Replace;
pDescriptor.cDepthStencilState.back.passOp = dawn::StencilOperation::Replace;
pDescriptor.cDepthStencilState.stencilFront.compare = dawn::CompareFunction::Equal;
pDescriptor.cDepthStencilState.stencilBack.compare = dawn::CompareFunction::Equal;
pDescriptor.cDepthStencilState.stencilFront.passOp = dawn::StencilOperation::Replace;
pDescriptor.cDepthStencilState.stencilBack.passOp = dawn::StencilOperation::Replace;
rfDescriptor.cDepthStencilState.depthWriteEnabled = true;
rfDescriptor.cDepthStencilState.depthCompare = dawn::CompareFunction::Less;

View File

@ -91,14 +91,14 @@ namespace dawn_native {
return DAWN_VALIDATION_ERROR("nextInChain must be nullptr");
}
DAWN_TRY(ValidateCompareFunction(descriptor->depthCompare));
DAWN_TRY(ValidateCompareFunction(descriptor->front.compare));
DAWN_TRY(ValidateStencilOperation(descriptor->front.stencilFailOp));
DAWN_TRY(ValidateStencilOperation(descriptor->front.depthFailOp));
DAWN_TRY(ValidateStencilOperation(descriptor->front.passOp));
DAWN_TRY(ValidateCompareFunction(descriptor->back.compare));
DAWN_TRY(ValidateStencilOperation(descriptor->back.stencilFailOp));
DAWN_TRY(ValidateStencilOperation(descriptor->back.depthFailOp));
DAWN_TRY(ValidateStencilOperation(descriptor->back.passOp));
DAWN_TRY(ValidateCompareFunction(descriptor->stencilFront.compare));
DAWN_TRY(ValidateStencilOperation(descriptor->stencilFront.failOp));
DAWN_TRY(ValidateStencilOperation(descriptor->stencilFront.depthFailOp));
DAWN_TRY(ValidateStencilOperation(descriptor->stencilFront.passOp));
DAWN_TRY(ValidateCompareFunction(descriptor->stencilBack.compare));
DAWN_TRY(ValidateStencilOperation(descriptor->stencilBack.failOp));
DAWN_TRY(ValidateStencilOperation(descriptor->stencilBack.depthFailOp));
DAWN_TRY(ValidateStencilOperation(descriptor->stencilBack.passOp));
return {};
}
@ -159,14 +159,14 @@ namespace dawn_native {
}
bool StencilTestEnabled(const DepthStencilStateDescriptor* mDepthStencilState) {
return mDepthStencilState->back.compare != dawn::CompareFunction::Always ||
mDepthStencilState->back.stencilFailOp != dawn::StencilOperation::Keep ||
mDepthStencilState->back.depthFailOp != dawn::StencilOperation::Keep ||
mDepthStencilState->back.passOp != dawn::StencilOperation::Keep ||
mDepthStencilState->front.compare != dawn::CompareFunction::Always ||
mDepthStencilState->front.stencilFailOp != dawn::StencilOperation::Keep ||
mDepthStencilState->front.depthFailOp != dawn::StencilOperation::Keep ||
mDepthStencilState->front.passOp != dawn::StencilOperation::Keep;
return mDepthStencilState->stencilBack.compare != dawn::CompareFunction::Always ||
mDepthStencilState->stencilBack.failOp != dawn::StencilOperation::Keep ||
mDepthStencilState->stencilBack.depthFailOp != dawn::StencilOperation::Keep ||
mDepthStencilState->stencilBack.passOp != dawn::StencilOperation::Keep ||
mDepthStencilState->stencilFront.compare != dawn::CompareFunction::Always ||
mDepthStencilState->stencilFront.failOp != dawn::StencilOperation::Keep ||
mDepthStencilState->stencilFront.depthFailOp != dawn::StencilOperation::Keep ||
mDepthStencilState->stencilFront.passOp != dawn::StencilOperation::Keep;
}
// RenderPipelineBase

View File

@ -169,7 +169,7 @@ namespace dawn_native { namespace d3d12 {
D3D12_DEPTH_STENCILOP_DESC StencilOpDesc(const StencilStateFaceDescriptor descriptor) {
D3D12_DEPTH_STENCILOP_DESC desc;
desc.StencilFailOp = StencilOp(descriptor.stencilFailOp);
desc.StencilFailOp = StencilOp(descriptor.failOp);
desc.StencilDepthFailOp = StencilOp(descriptor.depthFailOp);
desc.StencilPassOp = StencilOp(descriptor.passOp);
desc.StencilFunc = ToD3D12ComparisonFunc(descriptor.compare);
@ -192,8 +192,8 @@ namespace dawn_native { namespace d3d12 {
mDepthStencilDescriptor.StencilWriteMask =
static_cast<UINT8>(descriptor->stencilWriteMask);
mDepthStencilDescriptor.FrontFace = StencilOpDesc(descriptor->front);
mDepthStencilDescriptor.BackFace = StencilOpDesc(descriptor->back);
mDepthStencilDescriptor.FrontFace = StencilOpDesc(descriptor->stencilFront);
mDepthStencilDescriptor.BackFace = StencilOpDesc(descriptor->stencilBack);
return mDepthStencilDescriptor;
}

View File

@ -178,24 +178,24 @@ namespace dawn_native { namespace metal {
MTLStencilDescriptor* frontFaceStencil = [[MTLStencilDescriptor new] autorelease];
backFaceStencil.stencilCompareFunction =
ToMetalCompareFunction(descriptor->back.compare);
ToMetalCompareFunction(descriptor->stencilBack.compare);
backFaceStencil.stencilFailureOperation =
MetalStencilOperation(descriptor->back.stencilFailOp);
MetalStencilOperation(descriptor->stencilBack.failOp);
backFaceStencil.depthFailureOperation =
MetalStencilOperation(descriptor->back.depthFailOp);
MetalStencilOperation(descriptor->stencilBack.depthFailOp);
backFaceStencil.depthStencilPassOperation =
MetalStencilOperation(descriptor->back.passOp);
MetalStencilOperation(descriptor->stencilBack.passOp);
backFaceStencil.readMask = descriptor->stencilReadMask;
backFaceStencil.writeMask = descriptor->stencilWriteMask;
frontFaceStencil.stencilCompareFunction =
ToMetalCompareFunction(descriptor->front.compare);
ToMetalCompareFunction(descriptor->stencilFront.compare);
frontFaceStencil.stencilFailureOperation =
MetalStencilOperation(descriptor->front.stencilFailOp);
MetalStencilOperation(descriptor->stencilFront.failOp);
frontFaceStencil.depthFailureOperation =
MetalStencilOperation(descriptor->front.depthFailOp);
MetalStencilOperation(descriptor->stencilFront.depthFailOp);
frontFaceStencil.depthStencilPassOperation =
MetalStencilOperation(descriptor->front.passOp);
MetalStencilOperation(descriptor->stencilFront.passOp);
frontFaceStencil.readMask = descriptor->stencilReadMask;
frontFaceStencil.writeMask = descriptor->stencilWriteMask;

View File

@ -156,17 +156,17 @@ namespace dawn_native { namespace opengl {
glDisable(GL_STENCIL_TEST);
}
GLenum backCompareFunction = ToOpenGLCompareFunction(descriptor->back.compare);
GLenum frontCompareFunction = ToOpenGLCompareFunction(descriptor->front.compare);
GLenum backCompareFunction = ToOpenGLCompareFunction(descriptor->stencilBack.compare);
GLenum frontCompareFunction = ToOpenGLCompareFunction(descriptor->stencilFront.compare);
persistentPipelineState->SetStencilFuncsAndMask(
backCompareFunction, frontCompareFunction, descriptor->stencilReadMask);
glStencilOpSeparate(GL_BACK, OpenGLStencilOperation(descriptor->back.stencilFailOp),
OpenGLStencilOperation(descriptor->back.depthFailOp),
OpenGLStencilOperation(descriptor->back.passOp));
glStencilOpSeparate(GL_FRONT, OpenGLStencilOperation(descriptor->front.stencilFailOp),
OpenGLStencilOperation(descriptor->front.depthFailOp),
OpenGLStencilOperation(descriptor->front.passOp));
glStencilOpSeparate(GL_BACK, OpenGLStencilOperation(descriptor->stencilBack.failOp),
OpenGLStencilOperation(descriptor->stencilBack.depthFailOp),
OpenGLStencilOperation(descriptor->stencilBack.passOp));
glStencilOpSeparate(GL_FRONT, OpenGLStencilOperation(descriptor->stencilFront.failOp),
OpenGLStencilOperation(descriptor->stencilFront.depthFailOp),
OpenGLStencilOperation(descriptor->stencilFront.passOp));
glStencilMask(descriptor->stencilWriteMask);
}

View File

@ -171,15 +171,17 @@ namespace dawn_native { namespace vulkan {
depthStencilState.stencilTestEnable =
StencilTestEnabled(descriptor) ? VK_TRUE : VK_FALSE;
depthStencilState.front.failOp = VulkanStencilOp(descriptor->front.stencilFailOp);
depthStencilState.front.passOp = VulkanStencilOp(descriptor->front.passOp);
depthStencilState.front.depthFailOp = VulkanStencilOp(descriptor->front.depthFailOp);
depthStencilState.front.compareOp = ToVulkanCompareOp(descriptor->front.compare);
depthStencilState.front.failOp = VulkanStencilOp(descriptor->stencilFront.failOp);
depthStencilState.front.passOp = VulkanStencilOp(descriptor->stencilFront.passOp);
depthStencilState.front.depthFailOp =
VulkanStencilOp(descriptor->stencilFront.depthFailOp);
depthStencilState.front.compareOp = ToVulkanCompareOp(descriptor->stencilFront.compare);
depthStencilState.back.failOp = VulkanStencilOp(descriptor->back.stencilFailOp);
depthStencilState.back.passOp = VulkanStencilOp(descriptor->back.passOp);
depthStencilState.back.depthFailOp = VulkanStencilOp(descriptor->back.depthFailOp);
depthStencilState.back.compareOp = ToVulkanCompareOp(descriptor->back.compare);
depthStencilState.back.failOp = VulkanStencilOp(descriptor->stencilBack.failOp);
depthStencilState.back.passOp = VulkanStencilOp(descriptor->stencilBack.passOp);
depthStencilState.back.depthFailOp =
VulkanStencilOp(descriptor->stencilBack.depthFailOp);
depthStencilState.back.compareOp = ToVulkanCompareOp(descriptor->stencilBack.compare);
// Dawn doesn't have separate front and back stencil masks.
depthStencilState.front.compareMask = descriptor->stencilReadMask;

View File

@ -121,23 +121,23 @@ class DepthStencilStateTest : public DawnTest {
void CheckDepthCompareFunction(dawn::CompareFunction compareFunction, bool less, bool equal, bool greater) {
dawn::StencilStateFaceDescriptor stencilFace;
stencilFace.compare = dawn::CompareFunction::Always;
stencilFace.stencilFailOp = dawn::StencilOperation::Keep;
stencilFace.failOp = dawn::StencilOperation::Keep;
stencilFace.depthFailOp = dawn::StencilOperation::Keep;
stencilFace.passOp = dawn::StencilOperation::Keep;
dawn::DepthStencilStateDescriptor baseState;
baseState.depthWriteEnabled = true;
baseState.depthCompare = dawn::CompareFunction::Always;
baseState.back = stencilFace;
baseState.front = stencilFace;
baseState.stencilBack = stencilFace;
baseState.stencilFront = stencilFace;
baseState.stencilReadMask = 0xff;
baseState.stencilWriteMask = 0xff;
dawn::DepthStencilStateDescriptor state;
state.depthWriteEnabled = true;
state.depthCompare = compareFunction;
state.back = stencilFace;
state.front = stencilFace;
state.stencilBack = stencilFace;
state.stencilFront = stencilFace;
state.stencilReadMask = 0xff;
state.stencilWriteMask = 0xff;
@ -149,7 +149,8 @@ class DepthStencilStateTest : public DawnTest {
// Base triangle at depth 0.5, depth always, depth write enabled
TestSpec base = { baseState, baseColor, 0.5f, 0u };
// Draw the base triangle, then a triangle in front of the base triangle with the given depth comparison function
// Draw the base triangle, then a triangle in stencilFront of the base triangle with the
// given depth comparison function
DoTest({ base, { state, lessColor, 0.f, 0u } }, less ? lessColor : baseColor);
// Draw the base triangle, then a triangle in at the same depth as the base triangle with the given depth comparison function
@ -164,27 +165,27 @@ class DepthStencilStateTest : public DawnTest {
void CheckStencilCompareFunction(dawn::CompareFunction compareFunction, bool less, bool equal, bool greater) {
dawn::StencilStateFaceDescriptor baseStencilFaceDescriptor;
baseStencilFaceDescriptor.compare = dawn::CompareFunction::Always;
baseStencilFaceDescriptor.stencilFailOp = dawn::StencilOperation::Keep;
baseStencilFaceDescriptor.failOp = dawn::StencilOperation::Keep;
baseStencilFaceDescriptor.depthFailOp = dawn::StencilOperation::Keep;
baseStencilFaceDescriptor.passOp = dawn::StencilOperation::Replace;
dawn::DepthStencilStateDescriptor baseState;
baseState.depthWriteEnabled = false;
baseState.depthCompare = dawn::CompareFunction::Always;
baseState.back = baseStencilFaceDescriptor;
baseState.front = baseStencilFaceDescriptor;
baseState.stencilBack = baseStencilFaceDescriptor;
baseState.stencilFront = baseStencilFaceDescriptor;
baseState.stencilReadMask = 0xff;
baseState.stencilWriteMask = 0xff;
dawn::StencilStateFaceDescriptor stencilFaceDescriptor;
stencilFaceDescriptor.compare = compareFunction;
stencilFaceDescriptor.stencilFailOp = dawn::StencilOperation::Keep;
stencilFaceDescriptor.failOp = dawn::StencilOperation::Keep;
stencilFaceDescriptor.depthFailOp = dawn::StencilOperation::Keep;
stencilFaceDescriptor.passOp = dawn::StencilOperation::Keep;
dawn::DepthStencilStateDescriptor state;
state.depthWriteEnabled = false;
state.depthCompare = dawn::CompareFunction::Always;
state.back = stencilFaceDescriptor;
state.front = stencilFaceDescriptor;
state.stencilBack = stencilFaceDescriptor;
state.stencilFront = stencilFaceDescriptor;
state.stencilReadMask = 0xff;
state.stencilWriteMask = 0xff;
@ -210,27 +211,27 @@ class DepthStencilStateTest : public DawnTest {
void CheckStencilOperation(dawn::StencilOperation stencilOperation, uint32_t initialStencil, uint32_t reference, uint32_t expectedStencil) {
dawn::StencilStateFaceDescriptor baseStencilFaceDescriptor;
baseStencilFaceDescriptor.compare = dawn::CompareFunction::Always;
baseStencilFaceDescriptor.stencilFailOp = dawn::StencilOperation::Keep;
baseStencilFaceDescriptor.failOp = dawn::StencilOperation::Keep;
baseStencilFaceDescriptor.depthFailOp = dawn::StencilOperation::Keep;
baseStencilFaceDescriptor.passOp = dawn::StencilOperation::Replace;
dawn::DepthStencilStateDescriptor baseState;
baseState.depthWriteEnabled = false;
baseState.depthCompare = dawn::CompareFunction::Always;
baseState.back = baseStencilFaceDescriptor;
baseState.front = baseStencilFaceDescriptor;
baseState.stencilBack = baseStencilFaceDescriptor;
baseState.stencilFront = baseStencilFaceDescriptor;
baseState.stencilReadMask = 0xff;
baseState.stencilWriteMask = 0xff;
dawn::StencilStateFaceDescriptor stencilFaceDescriptor;
stencilFaceDescriptor.compare = dawn::CompareFunction::Always;
stencilFaceDescriptor.stencilFailOp = dawn::StencilOperation::Keep;
stencilFaceDescriptor.failOp = dawn::StencilOperation::Keep;
stencilFaceDescriptor.depthFailOp = dawn::StencilOperation::Keep;
stencilFaceDescriptor.passOp = stencilOperation;
dawn::DepthStencilStateDescriptor state;
state.depthWriteEnabled = false;
state.depthCompare = dawn::CompareFunction::Always;
state.back = stencilFaceDescriptor;
state.front = stencilFaceDescriptor;
state.stencilBack = stencilFaceDescriptor;
state.stencilFront = stencilFaceDescriptor;
state.stencilReadMask = 0xff;
state.stencilWriteMask = 0xff;
@ -247,14 +248,14 @@ class DepthStencilStateTest : public DawnTest {
void CheckStencil(std::vector<TestSpec> testParams, uint32_t expectedStencil) {
dawn::StencilStateFaceDescriptor stencilFaceDescriptor;
stencilFaceDescriptor.compare = dawn::CompareFunction::Equal;
stencilFaceDescriptor.stencilFailOp = dawn::StencilOperation::Keep;
stencilFaceDescriptor.failOp = dawn::StencilOperation::Keep;
stencilFaceDescriptor.depthFailOp = dawn::StencilOperation::Keep;
stencilFaceDescriptor.passOp = dawn::StencilOperation::Keep;
dawn::DepthStencilStateDescriptor state;
state.depthWriteEnabled = false;
state.depthCompare = dawn::CompareFunction::Always;
state.back = stencilFaceDescriptor;
state.front = stencilFaceDescriptor;
state.stencilBack = stencilFaceDescriptor;
state.stencilFront = stencilFaceDescriptor;
state.stencilReadMask = 0xff;
state.stencilWriteMask = 0xff;
@ -332,15 +333,15 @@ class DepthStencilStateTest : public DawnTest {
TEST_P(DepthStencilStateTest, Basic) {
dawn::StencilStateFaceDescriptor stencilFace;
stencilFace.compare = dawn::CompareFunction::Always;
stencilFace.stencilFailOp = dawn::StencilOperation::Keep;
stencilFace.failOp = dawn::StencilOperation::Keep;
stencilFace.depthFailOp = dawn::StencilOperation::Keep;
stencilFace.passOp = dawn::StencilOperation::Keep;
dawn::DepthStencilStateDescriptor state;
state.depthWriteEnabled = false;
state.depthCompare = dawn::CompareFunction::Always;
state.back = stencilFace;
state.front = stencilFace;
state.stencilBack = stencilFace;
state.stencilFront = stencilFace;
state.stencilReadMask = 0xff;
state.stencilWriteMask = 0xff;
@ -353,15 +354,15 @@ TEST_P(DepthStencilStateTest, Basic) {
TEST_P(DepthStencilStateTest, DepthStencilDisabled) {
dawn::StencilStateFaceDescriptor stencilFace;
stencilFace.compare = dawn::CompareFunction::Always;
stencilFace.stencilFailOp = dawn::StencilOperation::Keep;
stencilFace.failOp = dawn::StencilOperation::Keep;
stencilFace.depthFailOp = dawn::StencilOperation::Keep;
stencilFace.passOp = dawn::StencilOperation::Keep;
dawn::DepthStencilStateDescriptor state;
state.depthWriteEnabled = false;
state.depthCompare = dawn::CompareFunction::Always;
state.back = stencilFace;
state.front = stencilFace;
state.stencilBack = stencilFace;
state.stencilFront = stencilFace;
state.stencilReadMask = 0xff;
state.stencilWriteMask = 0xff;
@ -418,31 +419,31 @@ TEST_P(DepthStencilStateTest, DepthNotEqual) {
TEST_P(DepthStencilStateTest, DepthWriteDisabled) {
dawn::StencilStateFaceDescriptor stencilFace;
stencilFace.compare = dawn::CompareFunction::Always;
stencilFace.stencilFailOp = dawn::StencilOperation::Keep;
stencilFace.failOp = dawn::StencilOperation::Keep;
stencilFace.depthFailOp = dawn::StencilOperation::Keep;
stencilFace.passOp = dawn::StencilOperation::Keep;
dawn::DepthStencilStateDescriptor baseState;
baseState.depthWriteEnabled = true;
baseState.depthCompare = dawn::CompareFunction::Always;
baseState.back = stencilFace;
baseState.front = stencilFace;
baseState.stencilBack = stencilFace;
baseState.stencilFront = stencilFace;
baseState.stencilReadMask = 0xff;
baseState.stencilWriteMask = 0xff;
dawn::DepthStencilStateDescriptor noDepthWrite;
noDepthWrite.depthWriteEnabled = false;
noDepthWrite.depthCompare = dawn::CompareFunction::Always;
noDepthWrite.back = stencilFace;
noDepthWrite.front = stencilFace;
noDepthWrite.stencilBack = stencilFace;
noDepthWrite.stencilFront = stencilFace;
noDepthWrite.stencilReadMask = 0xff;
noDepthWrite.stencilWriteMask = 0xff;
dawn::DepthStencilStateDescriptor checkState;
checkState.depthWriteEnabled = false;
checkState.depthCompare = dawn::CompareFunction::Equal;
checkState.back = stencilFace;
checkState.front = stencilFace;
checkState.stencilBack = stencilFace;
checkState.stencilFront = stencilFace;
checkState.stencilReadMask = 0xff;
checkState.stencilWriteMask = 0xff;
@ -527,27 +528,27 @@ TEST_P(DepthStencilStateTest, StencilDecrementWrap) {
TEST_P(DepthStencilStateTest, StencilReadMask) {
dawn::StencilStateFaceDescriptor baseStencilFaceDescriptor;
baseStencilFaceDescriptor.compare = dawn::CompareFunction::Always;
baseStencilFaceDescriptor.stencilFailOp = dawn::StencilOperation::Keep;
baseStencilFaceDescriptor.failOp = dawn::StencilOperation::Keep;
baseStencilFaceDescriptor.depthFailOp = dawn::StencilOperation::Keep;
baseStencilFaceDescriptor.passOp = dawn::StencilOperation::Replace;
dawn::DepthStencilStateDescriptor baseState;
baseState.depthWriteEnabled = false;
baseState.depthCompare = dawn::CompareFunction::Always;
baseState.back = baseStencilFaceDescriptor;
baseState.front = baseStencilFaceDescriptor;
baseState.stencilBack = baseStencilFaceDescriptor;
baseState.stencilFront = baseStencilFaceDescriptor;
baseState.stencilReadMask = 0xff;
baseState.stencilWriteMask = 0xff;
dawn::StencilStateFaceDescriptor stencilFaceDescriptor;
stencilFaceDescriptor.compare = dawn::CompareFunction::Equal;
stencilFaceDescriptor.stencilFailOp = dawn::StencilOperation::Keep;
stencilFaceDescriptor.failOp = dawn::StencilOperation::Keep;
stencilFaceDescriptor.depthFailOp = dawn::StencilOperation::Keep;
stencilFaceDescriptor.passOp = dawn::StencilOperation::Keep;
dawn::DepthStencilStateDescriptor state;
state.depthWriteEnabled = false;
state.depthCompare = dawn::CompareFunction::Always;
state.back = stencilFaceDescriptor;
state.front = stencilFaceDescriptor;
state.stencilBack = stencilFaceDescriptor;
state.stencilFront = stencilFaceDescriptor;
state.stencilReadMask = 0x2;
state.stencilWriteMask = 0xff;
@ -564,27 +565,27 @@ TEST_P(DepthStencilStateTest, StencilReadMask) {
TEST_P(DepthStencilStateTest, StencilWriteMask) {
dawn::StencilStateFaceDescriptor baseStencilFaceDescriptor;
baseStencilFaceDescriptor.compare = dawn::CompareFunction::Always;
baseStencilFaceDescriptor.stencilFailOp = dawn::StencilOperation::Keep;
baseStencilFaceDescriptor.failOp = dawn::StencilOperation::Keep;
baseStencilFaceDescriptor.depthFailOp = dawn::StencilOperation::Keep;
baseStencilFaceDescriptor.passOp = dawn::StencilOperation::Replace;
dawn::DepthStencilStateDescriptor baseState;
baseState.depthWriteEnabled = false;
baseState.depthCompare = dawn::CompareFunction::Always;
baseState.back = baseStencilFaceDescriptor;
baseState.front = baseStencilFaceDescriptor;
baseState.stencilBack = baseStencilFaceDescriptor;
baseState.stencilFront = baseStencilFaceDescriptor;
baseState.stencilReadMask = 0xff;
baseState.stencilWriteMask = 0x1;
dawn::StencilStateFaceDescriptor stencilFaceDescriptor;
stencilFaceDescriptor.compare = dawn::CompareFunction::Equal;
stencilFaceDescriptor.stencilFailOp = dawn::StencilOperation::Keep;
stencilFaceDescriptor.failOp = dawn::StencilOperation::Keep;
stencilFaceDescriptor.depthFailOp = dawn::StencilOperation::Keep;
stencilFaceDescriptor.passOp = dawn::StencilOperation::Keep;
dawn::DepthStencilStateDescriptor state;
state.depthWriteEnabled = false;
state.depthCompare = dawn::CompareFunction::Always;
state.back = stencilFaceDescriptor;
state.front = stencilFaceDescriptor;
state.stencilBack = stencilFaceDescriptor;
state.stencilFront = stencilFaceDescriptor;
state.stencilReadMask = 0xff;
state.stencilWriteMask = 0xff;
@ -600,27 +601,27 @@ TEST_P(DepthStencilStateTest, StencilWriteMask) {
TEST_P(DepthStencilStateTest, StencilFail) {
dawn::StencilStateFaceDescriptor baseStencilFaceDescriptor;
baseStencilFaceDescriptor.compare = dawn::CompareFunction::Always;
baseStencilFaceDescriptor.stencilFailOp = dawn::StencilOperation::Keep;
baseStencilFaceDescriptor.failOp = dawn::StencilOperation::Keep;
baseStencilFaceDescriptor.depthFailOp = dawn::StencilOperation::Keep;
baseStencilFaceDescriptor.passOp = dawn::StencilOperation::Replace;
dawn::DepthStencilStateDescriptor baseState;
baseState.depthWriteEnabled = false;
baseState.depthCompare = dawn::CompareFunction::Always;
baseState.back = baseStencilFaceDescriptor;
baseState.front = baseStencilFaceDescriptor;
baseState.stencilBack = baseStencilFaceDescriptor;
baseState.stencilFront = baseStencilFaceDescriptor;
baseState.stencilReadMask = 0xff;
baseState.stencilWriteMask = 0xff;
dawn::StencilStateFaceDescriptor stencilFaceDescriptor;
stencilFaceDescriptor.compare = dawn::CompareFunction::Less;
stencilFaceDescriptor.stencilFailOp = dawn::StencilOperation::Replace;
stencilFaceDescriptor.failOp = dawn::StencilOperation::Replace;
stencilFaceDescriptor.depthFailOp = dawn::StencilOperation::Keep;
stencilFaceDescriptor.passOp = dawn::StencilOperation::Keep;
dawn::DepthStencilStateDescriptor state;
state.depthWriteEnabled = false;
state.depthCompare = dawn::CompareFunction::Always;
state.back = stencilFaceDescriptor;
state.front = stencilFaceDescriptor;
state.stencilBack = stencilFaceDescriptor;
state.stencilFront = stencilFaceDescriptor;
state.stencilReadMask = 0xff;
state.stencilWriteMask = 0xff;
@ -634,27 +635,27 @@ TEST_P(DepthStencilStateTest, StencilFail) {
TEST_P(DepthStencilStateTest, StencilDepthFail) {
dawn::StencilStateFaceDescriptor baseStencilFaceDescriptor;
baseStencilFaceDescriptor.compare = dawn::CompareFunction::Always;
baseStencilFaceDescriptor.stencilFailOp = dawn::StencilOperation::Keep;
baseStencilFaceDescriptor.failOp = dawn::StencilOperation::Keep;
baseStencilFaceDescriptor.depthFailOp = dawn::StencilOperation::Keep;
baseStencilFaceDescriptor.passOp = dawn::StencilOperation::Replace;
dawn::DepthStencilStateDescriptor baseState;
baseState.depthWriteEnabled = true;
baseState.depthCompare = dawn::CompareFunction::Always;
baseState.back = baseStencilFaceDescriptor;
baseState.front = baseStencilFaceDescriptor;
baseState.stencilBack = baseStencilFaceDescriptor;
baseState.stencilFront = baseStencilFaceDescriptor;
baseState.stencilReadMask = 0xff;
baseState.stencilWriteMask = 0xff;
dawn::StencilStateFaceDescriptor stencilFaceDescriptor;
stencilFaceDescriptor.compare = dawn::CompareFunction::Greater;
stencilFaceDescriptor.stencilFailOp = dawn::StencilOperation::Keep;
stencilFaceDescriptor.failOp = dawn::StencilOperation::Keep;
stencilFaceDescriptor.depthFailOp = dawn::StencilOperation::Replace;
stencilFaceDescriptor.passOp = dawn::StencilOperation::Keep;
dawn::DepthStencilStateDescriptor state;
state.depthWriteEnabled = true;
state.depthCompare = dawn::CompareFunction::Less;
state.back = stencilFaceDescriptor;
state.front = stencilFaceDescriptor;
state.stencilBack = stencilFaceDescriptor;
state.stencilFront = stencilFaceDescriptor;
state.stencilReadMask = 0xff;
state.stencilWriteMask = 0xff;
@ -668,27 +669,27 @@ TEST_P(DepthStencilStateTest, StencilDepthFail) {
TEST_P(DepthStencilStateTest, StencilDepthPass) {
dawn::StencilStateFaceDescriptor baseStencilFaceDescriptor;
baseStencilFaceDescriptor.compare = dawn::CompareFunction::Always;
baseStencilFaceDescriptor.stencilFailOp = dawn::StencilOperation::Keep;
baseStencilFaceDescriptor.failOp = dawn::StencilOperation::Keep;
baseStencilFaceDescriptor.depthFailOp = dawn::StencilOperation::Keep;
baseStencilFaceDescriptor.passOp = dawn::StencilOperation::Replace;
dawn::DepthStencilStateDescriptor baseState;
baseState.depthWriteEnabled = true;
baseState.depthCompare = dawn::CompareFunction::Always;
baseState.back = baseStencilFaceDescriptor;
baseState.front = baseStencilFaceDescriptor;
baseState.stencilBack = baseStencilFaceDescriptor;
baseState.stencilFront = baseStencilFaceDescriptor;
baseState.stencilReadMask = 0xff;
baseState.stencilWriteMask = 0xff;
dawn::StencilStateFaceDescriptor stencilFaceDescriptor;
stencilFaceDescriptor.compare = dawn::CompareFunction::Greater;
stencilFaceDescriptor.stencilFailOp = dawn::StencilOperation::Keep;
stencilFaceDescriptor.failOp = dawn::StencilOperation::Keep;
stencilFaceDescriptor.depthFailOp = dawn::StencilOperation::Keep;
stencilFaceDescriptor.passOp = dawn::StencilOperation::Replace;
dawn::DepthStencilStateDescriptor state;
state.depthWriteEnabled = true;
state.depthCompare = dawn::CompareFunction::Less;
state.back = stencilFaceDescriptor;
state.front = stencilFaceDescriptor;
state.stencilBack = stencilFaceDescriptor;
state.stencilFront = stencilFaceDescriptor;
state.stencilReadMask = 0xff;
state.stencilWriteMask = 0xff;

View File

@ -365,7 +365,7 @@ TEST_F(WireTests, CStringArgument) {
// Create the depth-stencil state
dawnStencilStateFaceDescriptor stencilFace;
stencilFace.compare = DAWN_COMPARE_FUNCTION_ALWAYS;
stencilFace.stencilFailOp = DAWN_STENCIL_OPERATION_KEEP;
stencilFace.failOp = DAWN_STENCIL_OPERATION_KEEP;
stencilFace.depthFailOp = DAWN_STENCIL_OPERATION_KEEP;
stencilFace.passOp = DAWN_STENCIL_OPERATION_KEEP;
@ -373,8 +373,8 @@ TEST_F(WireTests, CStringArgument) {
depthStencilState.nextInChain = nullptr;
depthStencilState.depthWriteEnabled = false;
depthStencilState.depthCompare = DAWN_COMPARE_FUNCTION_ALWAYS;
depthStencilState.back = stencilFace;
depthStencilState.front = stencilFace;
depthStencilState.stencilBack = stencilFace;
depthStencilState.stencilFront = stencilFace;
depthStencilState.stencilReadMask = 0xff;
depthStencilState.stencilWriteMask = 0xff;

View File

@ -74,15 +74,15 @@ namespace utils {
{
dawn::StencilStateFaceDescriptor stencilFace;
stencilFace.compare = dawn::CompareFunction::Always;
stencilFace.stencilFailOp = dawn::StencilOperation::Keep;
stencilFace.failOp = dawn::StencilOperation::Keep;
stencilFace.depthFailOp = dawn::StencilOperation::Keep;
stencilFace.passOp = dawn::StencilOperation::Keep;
// dawn::DepthStencilStateDescriptor depthStencilState;
cDepthStencilState.depthWriteEnabled = false;
cDepthStencilState.depthCompare = dawn::CompareFunction::Always;
cDepthStencilState.back = stencilFace;
cDepthStencilState.front = stencilFace;
cDepthStencilState.stencilBack = stencilFace;
cDepthStencilState.stencilFront = stencilFace;
cDepthStencilState.stencilReadMask = 0xff;
cDepthStencilState.stencilWriteMask = 0xff;
descriptor->depthStencilState = &cDepthStencilState;