Replace DepthStencilState builder via DepthStencilState descriptor.

This change also removes DepthStencilState object.

Bug=dawn:31

Change-Id: I7bb54ef4da527184bb2726c77d93d411d44c3956
Reviewed-on: https://dawn-review.googlesource.com/c/3541
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
This commit is contained in:
Yunchao He
2019-01-04 04:28:37 +00:00
committed by Commit Bot service account
parent 0b364067d0
commit ea56333c1e
47 changed files with 678 additions and 1235 deletions

View File

@@ -111,13 +111,24 @@ void init() {
descriptor.indexFormat = DAWN_INDEX_FORMAT_UINT32;
descriptor.primitiveTopology = DAWN_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST;
dawnDepthStencilStateBuilder depthStencilBuilder = dawnDeviceCreateDepthStencilStateBuilder(device);
descriptor.depthStencilState = dawnDepthStencilStateBuilderGetResult(depthStencilBuilder);
dawnDepthStencilStateBuilderRelease(depthStencilBuilder);
dawnStencilStateFaceDescriptor stencilFace;
stencilFace.compare = DAWN_COMPARE_FUNCTION_ALWAYS;
stencilFace.stencilFailOp = DAWN_STENCIL_OPERATION_KEEP;
stencilFace.depthFailOp = DAWN_STENCIL_OPERATION_KEEP;
stencilFace.passOp = DAWN_STENCIL_OPERATION_KEEP;
dawnDepthStencilStateDescriptor depthStencilState;
depthStencilState.nextInChain = nullptr;
depthStencilState.depthWriteEnabled = false;
depthStencilState.depthCompare = DAWN_COMPARE_FUNCTION_ALWAYS;
depthStencilState.back = stencilFace;
depthStencilState.front = stencilFace;
depthStencilState.stencilReadMask = 0xff;
depthStencilState.stencilWriteMask = 0xff;
descriptor.depthStencilState = &depthStencilState;
pipeline = dawnDeviceCreateRenderPipeline(device, &descriptor);
dawnDepthStencilStateRelease(descriptor.depthStencilState);
dawnInputStateRelease(descriptor.inputState);
}