Replace BlendState builder via BlendState descriptor.

This change also removes BlendState object.

Bug=dawn:32

Change-Id: I8bf4ff7531e7504efb17b6bae3ca01f1f2b4131e
Reviewed-on: https://dawn-review.googlesource.com/c/3042
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
This commit is contained in:
Yunchao He
2018-12-27 06:32:31 +00:00
committed by Commit Bot service account
parent cb71ba7b3a
commit 92700bfccd
43 changed files with 489 additions and 1043 deletions

View File

@@ -85,10 +85,18 @@ void init() {
descriptor.sampleCount = 1;
descriptor.numBlendStates = 1;
dawnBlendStateBuilder blendStateBuilder = dawnDeviceCreateBlendStateBuilder(device);
dawnBlendState blendState = dawnBlendStateBuilderGetResult(blendStateBuilder);
descriptor.blendStates = &blendState;
dawnBlendStateBuilderRelease(blendStateBuilder);
dawnBlendDescriptor blendDescriptor;
blendDescriptor.operation = DAWN_BLEND_OPERATION_ADD;
blendDescriptor.srcFactor = DAWN_BLEND_FACTOR_ONE;
blendDescriptor.dstFactor = DAWN_BLEND_FACTOR_ONE;
dawnBlendStateDescriptor blendStateDescriptor;
blendStateDescriptor.nextInChain = nullptr;
blendStateDescriptor.blendEnabled = false;
blendStateDescriptor.alphaBlend = blendDescriptor;
blendStateDescriptor.colorBlend = blendDescriptor;
blendStateDescriptor.colorWriteMask = DAWN_COLOR_WRITE_MASK_ALL;
descriptor.blendStates = &blendStateDescriptor;
dawnPipelineLayoutDescriptor pl;
pl.nextInChain = nullptr;
@@ -109,7 +117,6 @@ void init() {
pipeline = dawnDeviceCreateRenderPipeline(device, &descriptor);
dawnBlendStateRelease(descriptor.blendStates[0]);
dawnDepthStencilStateRelease(descriptor.depthStencilState);
dawnInputStateRelease(descriptor.inputState);
}