mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-07-14 09:06:11 +00:00
Use const*const* to annotate color state descriptors
Color state descriptors are a sequence of descriptors embedded in RenderPipeline descriptor. We should use const*const* to annotate them for supporting potential extended features added in color state descriptors in future. BUG=dawn:77 Change-Id: Id755569fa5076668c3db7b219b699845bc2a1d69 Reviewed-on: https://dawn-review.googlesource.com/c/4880 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Yunchao He <yunchao.he@intel.com>
This commit is contained in:
parent
f20f5b9493
commit
938811eef9
@ -863,7 +863,7 @@
|
||||
{"name": "sample count", "type": "uint32_t"},
|
||||
{"name": "depth stencil state", "type": "depth stencil state descriptor", "annotation": "const*", "optional": true},
|
||||
{"name": "num color states", "type": "uint32_t"},
|
||||
{"name": "color states", "type": "color state descriptor", "annotation": "const*", "length": "num color states"}
|
||||
{"name": "color states", "type": "color state descriptor", "annotation": "const*const*", "length": "num color states"}
|
||||
]
|
||||
},
|
||||
"sampler": {
|
||||
|
@ -115,7 +115,7 @@ void init() {
|
||||
descriptor.cFragmentStage.module = fsModule;
|
||||
descriptor.depthStencilState = &descriptor.cDepthStencilState;
|
||||
descriptor.cDepthStencilState.format = dawn::TextureFormat::D32FloatS8Uint;
|
||||
descriptor.cColorStates[0].format = GetPreferredSwapChainTextureFormat();
|
||||
descriptor.cColorStates[0]->format = GetPreferredSwapChainTextureFormat();
|
||||
|
||||
pipeline = device.CreateRenderPipeline(&descriptor);
|
||||
|
||||
|
@ -72,8 +72,6 @@ void init() {
|
||||
|
||||
descriptor.sampleCount = 1;
|
||||
|
||||
descriptor.numColorStates = 1;
|
||||
|
||||
dawnBlendDescriptor blendDescriptor;
|
||||
blendDescriptor.operation = DAWN_BLEND_OPERATION_ADD;
|
||||
blendDescriptor.srcFactor = DAWN_BLEND_FACTOR_ONE;
|
||||
@ -84,7 +82,10 @@ void init() {
|
||||
colorStateDescriptor.alphaBlend = blendDescriptor;
|
||||
colorStateDescriptor.colorBlend = blendDescriptor;
|
||||
colorStateDescriptor.colorWriteMask = DAWN_COLOR_WRITE_MASK_ALL;
|
||||
descriptor.colorStates = &colorStateDescriptor;
|
||||
|
||||
descriptor.numColorStates = 1;
|
||||
dawnColorStateDescriptor* colorStatesPtr[] = {&colorStateDescriptor};
|
||||
descriptor.colorStates = colorStatesPtr;
|
||||
|
||||
dawnPipelineLayoutDescriptor pl;
|
||||
pl.nextInChain = nullptr;
|
||||
|
@ -158,7 +158,7 @@ void initRender() {
|
||||
descriptor.inputState = inputState;
|
||||
descriptor.depthStencilState = &descriptor.cDepthStencilState;
|
||||
descriptor.cDepthStencilState.format = dawn::TextureFormat::D32FloatS8Uint;
|
||||
descriptor.cColorStates[0].format = GetPreferredSwapChainTextureFormat();
|
||||
descriptor.cColorStates[0]->format = GetPreferredSwapChainTextureFormat();
|
||||
|
||||
renderPipeline = device.CreateRenderPipeline(&descriptor);
|
||||
}
|
||||
|
@ -142,7 +142,7 @@ void init() {
|
||||
descriptor.inputState = inputState;
|
||||
descriptor.depthStencilState = &descriptor.cDepthStencilState;
|
||||
descriptor.cDepthStencilState.format = dawn::TextureFormat::D32FloatS8Uint;
|
||||
descriptor.cColorStates[0].format = GetPreferredSwapChainTextureFormat();
|
||||
descriptor.cColorStates[0]->format = GetPreferredSwapChainTextureFormat();
|
||||
|
||||
pipeline = device.CreateRenderPipeline(&descriptor);
|
||||
|
||||
|
@ -217,7 +217,7 @@ void init() {
|
||||
descriptor.inputState = inputState;
|
||||
descriptor.depthStencilState = &descriptor.cDepthStencilState;
|
||||
descriptor.cDepthStencilState.format = dawn::TextureFormat::D32FloatS8Uint;
|
||||
descriptor.cColorStates[0].format = GetPreferredSwapChainTextureFormat();
|
||||
descriptor.cColorStates[0]->format = GetPreferredSwapChainTextureFormat();
|
||||
descriptor.cDepthStencilState.depthWriteEnabled = true;
|
||||
descriptor.cDepthStencilState.depthCompare = dawn::CompareFunction::Less;
|
||||
|
||||
@ -230,7 +230,7 @@ void init() {
|
||||
pDescriptor.inputState = inputState;
|
||||
pDescriptor.depthStencilState = &pDescriptor.cDepthStencilState;
|
||||
pDescriptor.cDepthStencilState.format = dawn::TextureFormat::D32FloatS8Uint;
|
||||
pDescriptor.cColorStates[0].format = GetPreferredSwapChainTextureFormat();
|
||||
pDescriptor.cColorStates[0]->format = GetPreferredSwapChainTextureFormat();
|
||||
pDescriptor.cDepthStencilState.stencilFront.passOp = dawn::StencilOperation::Replace;
|
||||
pDescriptor.cDepthStencilState.stencilBack.passOp = dawn::StencilOperation::Replace;
|
||||
pDescriptor.cDepthStencilState.depthCompare = dawn::CompareFunction::Less;
|
||||
@ -244,7 +244,7 @@ void init() {
|
||||
rfDescriptor.inputState = inputState;
|
||||
rfDescriptor.depthStencilState = &rfDescriptor.cDepthStencilState;
|
||||
rfDescriptor.cDepthStencilState.format = dawn::TextureFormat::D32FloatS8Uint;
|
||||
rfDescriptor.cColorStates[0].format = GetPreferredSwapChainTextureFormat();
|
||||
rfDescriptor.cColorStates[0]->format = GetPreferredSwapChainTextureFormat();
|
||||
rfDescriptor.cDepthStencilState.stencilFront.compare = dawn::CompareFunction::Equal;
|
||||
rfDescriptor.cDepthStencilState.stencilBack.compare = dawn::CompareFunction::Equal;
|
||||
rfDescriptor.cDepthStencilState.stencilFront.passOp = dawn::StencilOperation::Replace;
|
||||
|
@ -321,7 +321,7 @@ namespace {
|
||||
descriptor.indexFormat = dawn::IndexFormat::Uint16;
|
||||
descriptor.depthStencilState = &descriptor.cDepthStencilState;
|
||||
descriptor.cDepthStencilState.format = dawn::TextureFormat::D32FloatS8Uint;
|
||||
descriptor.cColorStates[0].format = GetPreferredSwapChainTextureFormat();
|
||||
descriptor.cColorStates[0]->format = GetPreferredSwapChainTextureFormat();
|
||||
descriptor.cDepthStencilState.depthWriteEnabled = true;
|
||||
descriptor.cDepthStencilState.depthCompare = dawn::CompareFunction::Less;
|
||||
|
||||
|
@ -131,7 +131,7 @@ namespace dawn_native {
|
||||
}
|
||||
|
||||
for (uint32_t i = 0; i < descriptor->numColorStates; ++i) {
|
||||
DAWN_TRY(ValidateColorStateDescriptor(&descriptor->colorStates[i]));
|
||||
DAWN_TRY(ValidateColorStateDescriptor(descriptor->colorStates[i]));
|
||||
}
|
||||
|
||||
if (descriptor->depthStencilState) {
|
||||
@ -197,7 +197,7 @@ namespace dawn_native {
|
||||
|
||||
for (uint32_t i = 0; i < descriptor->numColorStates; ++i) {
|
||||
mColorAttachmentsSet.set(i);
|
||||
mColorStates[i] = descriptor->colorStates[i];
|
||||
mColorStates[i] = *descriptor->colorStates[i];
|
||||
}
|
||||
|
||||
// TODO(cwallez@chromium.org): Check against the shader module that the correct color
|
||||
|
@ -130,7 +130,7 @@ TEST_P(BindGroupTests, ReusedUBO) {
|
||||
textureDescriptor.layout = pipelineLayout;
|
||||
textureDescriptor.cVertexStage.module = vsModule;
|
||||
textureDescriptor.cFragmentStage.module = fsModule;
|
||||
textureDescriptor.cColorStates[0].format = renderPass.colorFormat;
|
||||
textureDescriptor.cColorStates[0]->format = renderPass.colorFormat;
|
||||
|
||||
dawn::RenderPipeline pipeline = device.CreateRenderPipeline(&textureDescriptor);
|
||||
|
||||
@ -215,7 +215,7 @@ TEST_P(BindGroupTests, UBOSamplerAndTexture) {
|
||||
pipelineDescriptor.layout = pipelineLayout;
|
||||
pipelineDescriptor.cVertexStage.module = vsModule;
|
||||
pipelineDescriptor.cFragmentStage.module = fsModule;
|
||||
pipelineDescriptor.cColorStates[0].format = renderPass.colorFormat;
|
||||
pipelineDescriptor.cColorStates[0]->format = renderPass.colorFormat;
|
||||
|
||||
dawn::RenderPipeline pipeline = device.CreateRenderPipeline(&pipelineDescriptor);
|
||||
|
||||
@ -337,7 +337,7 @@ TEST_P(BindGroupTests, MultipleBindLayouts) {
|
||||
textureDescriptor.layout = pipelineLayout;
|
||||
textureDescriptor.cVertexStage.module = vsModule;
|
||||
textureDescriptor.cFragmentStage.module = fsModule;
|
||||
textureDescriptor.cColorStates[0].format = renderPass.colorFormat;
|
||||
textureDescriptor.cColorStates[0]->format = renderPass.colorFormat;
|
||||
|
||||
dawn::RenderPipeline pipeline = device.CreateRenderPipeline(&textureDescriptor);
|
||||
|
||||
@ -431,7 +431,7 @@ TEST_P(BindGroupTests, DrawTwiceInSamePipelineWithFourBindGroupSets)
|
||||
pipelineDescriptor.layout = pipelineLayout;
|
||||
pipelineDescriptor.cVertexStage.module = vsModule;
|
||||
pipelineDescriptor.cFragmentStage.module = fsModule;
|
||||
pipelineDescriptor.cColorStates[0].format = renderPass.colorFormat;
|
||||
pipelineDescriptor.cColorStates[0]->format = renderPass.colorFormat;
|
||||
|
||||
dawn::RenderPipeline pipeline = device.CreateRenderPipeline(&pipelineDescriptor);
|
||||
dawn::CommandEncoder encoder = device.CreateCommandEncoder();
|
||||
|
@ -54,7 +54,7 @@ class ColorStateTest : public DawnTest {
|
||||
|
||||
// Set up basePipeline and testPipeline. testPipeline has the given blend state on the first
|
||||
// attachment. basePipeline has no blending
|
||||
void SetupSingleSourcePipelines(const dawn::ColorStateDescriptor& colorStateDescriptor) {
|
||||
void SetupSingleSourcePipelines(dawn::ColorStateDescriptor colorStateDescriptor) {
|
||||
dawn::ShaderModule fsModule =
|
||||
utils::CreateShaderModule(device, dawn::ShaderStage::Fragment, R"(
|
||||
#version 450
|
||||
@ -73,7 +73,7 @@ class ColorStateTest : public DawnTest {
|
||||
baseDescriptor.layout = pipelineLayout;
|
||||
baseDescriptor.cVertexStage.module = vsModule;
|
||||
baseDescriptor.cFragmentStage.module = fsModule;
|
||||
baseDescriptor.cColorStates[0].format = renderPass.colorFormat;
|
||||
baseDescriptor.cColorStates[0]->format = renderPass.colorFormat;
|
||||
|
||||
basePipeline = device.CreateRenderPipeline(&baseDescriptor);
|
||||
|
||||
@ -81,8 +81,8 @@ class ColorStateTest : public DawnTest {
|
||||
testDescriptor.layout = pipelineLayout;
|
||||
testDescriptor.cVertexStage.module = vsModule;
|
||||
testDescriptor.cFragmentStage.module = fsModule;
|
||||
testDescriptor.cColorStates[0] = colorStateDescriptor;
|
||||
testDescriptor.cColorStates[0].format = renderPass.colorFormat;
|
||||
testDescriptor.cColorStates[0] = &colorStateDescriptor;
|
||||
testDescriptor.cColorStates[0]->format = renderPass.colorFormat;
|
||||
|
||||
testPipeline = device.CreateRenderPipeline(&testDescriptor);
|
||||
}
|
||||
@ -834,14 +834,14 @@ TEST_P(ColorStateTest, IndependentColorState) {
|
||||
blend3.srcFactor = dawn::BlendFactor::One;
|
||||
blend3.dstFactor = dawn::BlendFactor::One;
|
||||
|
||||
testDescriptor.cColorStates[0].colorBlend = blend1;
|
||||
testDescriptor.cColorStates[0].alphaBlend = blend1;
|
||||
testDescriptor.cColorStates[0]->colorBlend = blend1;
|
||||
testDescriptor.cColorStates[0]->alphaBlend = blend1;
|
||||
|
||||
testDescriptor.cColorStates[1].colorBlend = blend2;
|
||||
testDescriptor.cColorStates[1].alphaBlend = blend2;
|
||||
testDescriptor.cColorStates[1]->colorBlend = blend2;
|
||||
testDescriptor.cColorStates[1]->alphaBlend = blend2;
|
||||
|
||||
testDescriptor.cColorStates[3].colorBlend = blend3;
|
||||
testDescriptor.cColorStates[3].alphaBlend = blend3;
|
||||
testDescriptor.cColorStates[3]->colorBlend = blend3;
|
||||
testDescriptor.cColorStates[3]->alphaBlend = blend3;
|
||||
|
||||
testPipeline = device.CreateRenderPipeline(&testDescriptor);
|
||||
|
||||
@ -909,7 +909,7 @@ TEST_P(ColorStateTest, DefaultBlendColor) {
|
||||
baseDescriptor.layout = pipelineLayout;
|
||||
baseDescriptor.cVertexStage.module = vsModule;
|
||||
baseDescriptor.cFragmentStage.module = fsModule;
|
||||
baseDescriptor.cColorStates[0].format = renderPass.colorFormat;
|
||||
baseDescriptor.cColorStates[0]->format = renderPass.colorFormat;
|
||||
|
||||
basePipeline = device.CreateRenderPipeline(&baseDescriptor);
|
||||
|
||||
@ -917,14 +917,14 @@ TEST_P(ColorStateTest, DefaultBlendColor) {
|
||||
testDescriptor.layout = pipelineLayout;
|
||||
testDescriptor.cVertexStage.module = vsModule;
|
||||
testDescriptor.cFragmentStage.module = fsModule;
|
||||
testDescriptor.cColorStates[0].format = renderPass.colorFormat;
|
||||
testDescriptor.cColorStates[0]->format = renderPass.colorFormat;
|
||||
|
||||
dawn::BlendDescriptor blend;
|
||||
blend.operation = dawn::BlendOperation::Add;
|
||||
blend.srcFactor = dawn::BlendFactor::BlendColor;
|
||||
blend.dstFactor = dawn::BlendFactor::One;
|
||||
testDescriptor.cColorStates[0].colorBlend = blend;
|
||||
testDescriptor.cColorStates[0].alphaBlend = blend;
|
||||
testDescriptor.cColorStates[0]->colorBlend = blend;
|
||||
testDescriptor.cColorStates[0]->alphaBlend = blend;
|
||||
|
||||
testPipeline = device.CreateRenderPipeline(&testDescriptor);
|
||||
constexpr dawn::Color kWhite{1.0f, 1.0f, 1.0f, 1.0f};
|
||||
|
@ -64,7 +64,7 @@ class DrawIndexedTest : public DawnTest {
|
||||
descriptor.primitiveTopology = dawn::PrimitiveTopology::TriangleStrip;
|
||||
descriptor.indexFormat = dawn::IndexFormat::Uint32;
|
||||
descriptor.inputState = inputState;
|
||||
descriptor.cColorStates[0].format = renderPass.colorFormat;
|
||||
descriptor.cColorStates[0]->format = renderPass.colorFormat;
|
||||
|
||||
pipeline = device.CreateRenderPipeline(&descriptor);
|
||||
|
||||
|
@ -62,7 +62,7 @@ class DrawTest : public DawnTest {
|
||||
descriptor.primitiveTopology = dawn::PrimitiveTopology::TriangleStrip;
|
||||
descriptor.indexFormat = dawn::IndexFormat::Uint32;
|
||||
descriptor.inputState = inputState;
|
||||
descriptor.cColorStates[0].format = renderPass.colorFormat;
|
||||
descriptor.cColorStates[0]->format = renderPass.colorFormat;
|
||||
|
||||
pipeline = device.CreateRenderPipeline(&descriptor);
|
||||
|
||||
|
@ -69,7 +69,7 @@ class IndexFormatTest : public DawnTest {
|
||||
descriptor.primitiveTopology = dawn::PrimitiveTopology::TriangleStrip;
|
||||
descriptor.indexFormat = format;
|
||||
descriptor.inputState = inputState;
|
||||
descriptor.cColorStates[0].format = renderPass.colorFormat;
|
||||
descriptor.cColorStates[0]->format = renderPass.colorFormat;
|
||||
|
||||
return device.CreateRenderPipeline(&descriptor);
|
||||
}
|
||||
|
@ -125,7 +125,7 @@ class InputStateTest : public DawnTest {
|
||||
descriptor.cVertexStage.module = vsModule;
|
||||
descriptor.cFragmentStage.module = fsModule;
|
||||
descriptor.inputState = inputState;
|
||||
descriptor.cColorStates[0].format = renderPass.colorFormat;
|
||||
descriptor.cColorStates[0]->format = renderPass.colorFormat;
|
||||
|
||||
return device.CreateRenderPipeline(&descriptor);
|
||||
}
|
||||
|
@ -203,7 +203,7 @@ class PrimitiveTopologyTest : public DawnTest {
|
||||
descriptor.cFragmentStage.module = fsModule;
|
||||
descriptor.primitiveTopology = primitiveTopology;
|
||||
descriptor.inputState = inputState;
|
||||
descriptor.cColorStates[0].format = renderPass.colorFormat;
|
||||
descriptor.cColorStates[0]->format = renderPass.colorFormat;
|
||||
|
||||
dawn::RenderPipeline pipeline = device.CreateRenderPipeline(&descriptor);
|
||||
|
||||
|
@ -195,8 +195,8 @@ class PushConstantTest: public DawnTest {
|
||||
blend.operation = dawn::BlendOperation::Add;
|
||||
blend.srcFactor = dawn::BlendFactor::One;
|
||||
blend.dstFactor = dawn::BlendFactor::One;
|
||||
descriptor.cColorStates[0].alphaBlend = blend;
|
||||
descriptor.cColorStates[0].colorBlend = blend;
|
||||
descriptor.cColorStates[0]->alphaBlend = blend;
|
||||
descriptor.cColorStates[0]->colorBlend = blend;
|
||||
|
||||
return device.CreateRenderPipeline(&descriptor);
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ protected:
|
||||
descriptor.cFragmentStage.module = fsModule;
|
||||
descriptor.primitiveTopology = dawn::PrimitiveTopology::TriangleStrip;
|
||||
descriptor.indexFormat = dawn::IndexFormat::Uint32;
|
||||
descriptor.cColorStates[0].format = kFormat;
|
||||
descriptor.cColorStates[0]->format = kFormat;
|
||||
|
||||
pipeline = device.CreateRenderPipeline(&descriptor);
|
||||
}
|
||||
|
@ -77,7 +77,7 @@ protected:
|
||||
pipelineDescriptor.layout = pipelineLayout;
|
||||
pipelineDescriptor.cVertexStage.module = vsModule;
|
||||
pipelineDescriptor.cFragmentStage.module = fsModule;
|
||||
pipelineDescriptor.cColorStates[0].format = mRenderPass.colorFormat;
|
||||
pipelineDescriptor.cColorStates[0]->format = mRenderPass.colorFormat;
|
||||
|
||||
mPipeline = device.CreateRenderPipeline(&pipelineDescriptor);
|
||||
|
||||
|
@ -40,7 +40,7 @@ class ScissorTest: public DawnTest {
|
||||
utils::ComboRenderPipelineDescriptor descriptor(device);
|
||||
descriptor.cVertexStage.module = vsModule;
|
||||
descriptor.cFragmentStage.module = fsModule;
|
||||
descriptor.cColorStates[0].format = format;
|
||||
descriptor.cColorStates[0]->format = format;
|
||||
|
||||
return device.CreateRenderPipeline(&descriptor);
|
||||
}
|
||||
|
@ -172,7 +172,7 @@ protected:
|
||||
textureDescriptor.cVertexStage.module = mVSModule;
|
||||
textureDescriptor.cFragmentStage.module = fsModule;
|
||||
textureDescriptor.layout = mPipelineLayout;
|
||||
textureDescriptor.cColorStates[0].format = mRenderPass.colorFormat;
|
||||
textureDescriptor.cColorStates[0]->format = mRenderPass.colorFormat;
|
||||
|
||||
dawn::RenderPipeline pipeline = device.CreateRenderPipeline(&textureDescriptor);
|
||||
|
||||
@ -516,7 +516,7 @@ class TextureViewRenderingTest : public DawnTest {
|
||||
utils::ComboRenderPipelineDescriptor pipelineDescriptor(device);
|
||||
pipelineDescriptor.cVertexStage.module = vsModule;
|
||||
pipelineDescriptor.cFragmentStage.module = oneColorFsModule;
|
||||
pipelineDescriptor.cColorStates[0].format = kDefaultFormat;
|
||||
pipelineDescriptor.cColorStates[0]->format = kDefaultFormat;
|
||||
|
||||
dawn::RenderPipeline oneColorPipeline = device.CreateRenderPipeline(&pipelineDescriptor);
|
||||
|
||||
|
@ -40,7 +40,7 @@ TEST_P(ViewportOrientationTests, OriginAt0x0) {
|
||||
descriptor.cVertexStage.module = vsModule;
|
||||
descriptor.cFragmentStage.module = fsModule;
|
||||
descriptor.primitiveTopology = dawn::PrimitiveTopology::PointList;
|
||||
descriptor.cColorStates[0].format = renderPass.colorFormat;
|
||||
descriptor.cColorStates[0]->format = renderPass.colorFormat;
|
||||
|
||||
dawn::RenderPipeline pipeline = device.CreateRenderPipeline(&descriptor);
|
||||
|
||||
|
@ -39,7 +39,7 @@ class InputStateTest : public ValidationTest {
|
||||
descriptor.cVertexStage.module = vsModule;
|
||||
descriptor.cFragmentStage.module = fsModule;
|
||||
descriptor.inputState = inputState;
|
||||
descriptor.cColorStates[0].format = dawn::TextureFormat::R8G8B8A8Unorm;
|
||||
descriptor.cColorStates[0]->format = dawn::TextureFormat::R8G8B8A8Unorm;
|
||||
|
||||
if (!success) {
|
||||
ASSERT_DEVICE_ERROR(device.CreateRenderPipeline(&descriptor));
|
||||
|
@ -154,7 +154,8 @@ TEST_F(WireArgumentTests, CStringArgument) {
|
||||
pipelineDescriptor.fragmentStage = &fragmentStage;
|
||||
|
||||
pipelineDescriptor.numColorStates = 1;
|
||||
pipelineDescriptor.colorStates = &colorStateDescriptor;
|
||||
dawnColorStateDescriptor* colorStatesPtr[] = {&colorStateDescriptor};
|
||||
pipelineDescriptor.colorStates = colorStatesPtr;
|
||||
|
||||
pipelineDescriptor.sampleCount = 1;
|
||||
pipelineDescriptor.layout = layout;
|
||||
|
@ -139,7 +139,8 @@ TEST_F(WireOptionalTests, OptionalStructPointer) {
|
||||
pipelineDescriptor.fragmentStage = &fragmentStage;
|
||||
|
||||
pipelineDescriptor.numColorStates = 1;
|
||||
pipelineDescriptor.colorStates = &colorStateDescriptor;
|
||||
dawnColorStateDescriptor* colorStatesPtr[] = {&colorStateDescriptor};
|
||||
pipelineDescriptor.colorStates = colorStatesPtr;
|
||||
|
||||
pipelineDescriptor.sampleCount = 1;
|
||||
pipelineDescriptor.layout = layout;
|
||||
|
@ -52,7 +52,8 @@ namespace utils {
|
||||
colorStateDescriptor.colorBlend = blend;
|
||||
colorStateDescriptor.colorWriteMask = dawn::ColorWriteMask::All;
|
||||
for (uint32_t i = 0; i < kMaxColorAttachments; ++i) {
|
||||
cColorStates[i] = colorStateDescriptor;
|
||||
mColorStates[i] = colorStateDescriptor;
|
||||
cColorStates[i] = &mColorStates[i];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -30,10 +30,11 @@ namespace utils {
|
||||
dawn::PipelineStageDescriptor cVertexStage;
|
||||
dawn::PipelineStageDescriptor cFragmentStage;
|
||||
|
||||
std::array<dawn::ColorStateDescriptor, kMaxColorAttachments> cColorStates;
|
||||
std::array<dawn::ColorStateDescriptor*, kMaxColorAttachments> cColorStates;
|
||||
dawn::DepthStencilStateDescriptor cDepthStencilState;
|
||||
|
||||
private:
|
||||
dawn::ColorStateDescriptor mColorStates[kMaxColorAttachments];
|
||||
};
|
||||
|
||||
} // namespace utils
|
||||
|
Loading…
x
Reference in New Issue
Block a user