| Flutter Impeller |

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
5 #include "impeller/renderer/backend/vulkan/formats_vk.h"
6
7 namespace impeller {
8
9 vk::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
impeller::ToVKPipelineDepthStencilStateCreateInfo
vk::PipelineDepthStencilStateCreateInfo ToVKPipelineDepthStencilStateCreateInfo(std::optional< DepthAttachmentDescriptor > depth, std::optional< StencilAttachmentDescriptor > front, std::optional< StencilAttachmentDescriptor > back)
Definition: formats_vk.cc:9
formats_vk.h
impeller::ToVKStencilOpState
constexpr vk::StencilOpState ToVKStencilOpState(const StencilAttachmentDescriptor &desc)
Definition: formats_vk.h:553
impeller::ToVKCompareOp
constexpr vk::CompareOp ToVKCompareOp(CompareFunction op)
Definition: formats_vk.h:508
impeller
Definition: aiks_context.cc:10