Flutter Engine
The Flutter Engine
formats_vk.cc
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
6
7namespace impeller {
8
9vk::PipelineDepthStencilStateCreateInfo ToVKPipelineDepthStencilStateCreateInfo(
10 std::optional<DepthAttachmentDescriptor> depth,
11 std::optional<StencilAttachmentDescriptor> front,
12 std::optional<StencilAttachmentDescriptor> back) {
13 vk::PipelineDepthStencilStateCreateInfo info;
14
15 if (depth.has_value()) {
16 info.depthTestEnable = true;
17 info.depthWriteEnable = depth->depth_write_enabled;
18 info.depthCompareOp = ToVKCompareOp(depth->depth_compare);
19 info.minDepthBounds = 0.0f;
20 info.maxDepthBounds = 1.0f;
21 }
22
23 if (front.has_value()) {
24 info.stencilTestEnable = true;
25 info.front = ToVKStencilOpState(*front);
26 }
27
28 if (back.has_value()) {
29 info.stencilTestEnable = true;
30 info.back = ToVKStencilOpState(*back);
31 }
32
33 return info;
34}
35
36} // namespace impeller
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
Definition: DM.cpp:213
constexpr vk::CompareOp ToVKCompareOp(CompareFunction op)
Definition: formats_vk.h:430
vk::PipelineDepthStencilStateCreateInfo ToVKPipelineDepthStencilStateCreateInfo(std::optional< DepthAttachmentDescriptor > depth, std::optional< StencilAttachmentDescriptor > front, std::optional< StencilAttachmentDescriptor > back)
Definition: formats_vk.cc:9
constexpr vk::StencilOpState ToVKStencilOpState(const StencilAttachmentDescriptor &desc)
Definition: formats_vk.h:475