Flutter Impeller
vertex_descriptor_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 
7 #include <cstdint>
8 
9 namespace impeller {
10 
11 vk::Format ToVertexDescriptorFormat(const ShaderStageIOSlot& input) {
12  switch (input.GetVertexAttributeFormat()) {
14  return vk::Format::eR32Sfloat;
16  return vk::Format::eR32G32Sfloat;
18  return vk::Format::eR32G32B32Sfloat;
20  return vk::Format::eR32G32B32A32Sfloat;
22  return vk::Format::eR16Sfloat;
24  return vk::Format::eR16G16Sfloat;
26  return vk::Format::eR16G16B16Sfloat;
28  return vk::Format::eR16G16B16A16Sfloat;
30  return vk::Format::eR8Sint;
32  return vk::Format::eR8G8Sint;
34  return vk::Format::eR8G8B8Sint;
36  return vk::Format::eR8G8B8A8Sint;
38  return vk::Format::eR8Uint;
40  return vk::Format::eR8G8Uint;
42  return vk::Format::eR8G8B8Uint;
44  return vk::Format::eR8G8B8A8Uint;
46  return vk::Format::eR16Sint;
48  return vk::Format::eR16G16Sint;
50  return vk::Format::eR16G16B16Sint;
52  return vk::Format::eR16G16B16A16Sint;
54  return vk::Format::eR16Uint;
56  return vk::Format::eR16G16Uint;
58  return vk::Format::eR16G16B16Uint;
60  return vk::Format::eR16G16B16A16Uint;
62  return vk::Format::eR32Sint;
64  return vk::Format::eR32G32Sint;
66  return vk::Format::eR32G32B32Sint;
68  return vk::Format::eR32G32B32A32Sint;
70  return vk::Format::eR32Uint;
72  return vk::Format::eR32G32Uint;
74  return vk::Format::eR32G32B32Uint;
76  return vk::Format::eR32G32B32A32Uint;
78  return vk::Format::eUndefined;
79  }
80 }
81 
82 } // namespace impeller
vk::Format ToVertexDescriptorFormat(const ShaderStageIOSlot &input)
constexpr VertexAttributeFormat GetVertexAttributeFormat() const
Derives the flat vertex attribute format from this slot's scalar type, bit width, and component count...
Definition: shader_types.h:258