MCPcopy Create free account
hub / github.com/comaps/comaps / GetAttributeFormat

Function GetAttributeFormat

libs/drape/vulkan/vulkan_pipeline.cpp:74–149  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72}
73
74VkFormat GetAttributeFormat(uint8_t componentCount, glConst componentType)
75{
76 if (componentType == gl_const::GLFloatType)
77 {
78 switch (componentCount)
79 {
80 case 1: return VK_FORMAT_R32_SFLOAT;
81 case 2: return VK_FORMAT_R32G32_SFLOAT;
82 case 3: return VK_FORMAT_R32G32B32_SFLOAT;
83 case 4: return VK_FORMAT_R32G32B32A32_SFLOAT;
84 }
85 }
86 else if (componentType == gl_const::GLByteType)
87 {
88 switch (componentCount)
89 {
90 case 1: return VK_FORMAT_R8_SINT;
91 case 2: return VK_FORMAT_R8G8_SINT;
92 case 3: return VK_FORMAT_R8G8B8_SINT;
93 case 4: return VK_FORMAT_R8G8B8A8_SINT;
94 }
95 }
96 else if (componentType == gl_const::GLUnsignedByteType)
97 {
98 switch (componentCount)
99 {
100 case 1: return VK_FORMAT_R8_UINT;
101 case 2: return VK_FORMAT_R8G8_UINT;
102 case 3: return VK_FORMAT_R8G8B8_UINT;
103 case 4: return VK_FORMAT_R8G8B8A8_UINT;
104 }
105 }
106 else if (componentType == gl_const::GLShortType)
107 {
108 switch (componentCount)
109 {
110 case 1: return VK_FORMAT_R16_SINT;
111 case 2: return VK_FORMAT_R16G16_SINT;
112 case 3: return VK_FORMAT_R16G16B16_SINT;
113 case 4: return VK_FORMAT_R16G16B16A16_SINT;
114 }
115 }
116 else if (componentType == gl_const::GLUnsignedShortType)
117 {
118 switch (componentCount)
119 {
120 case 1: return VK_FORMAT_R16_UINT;
121 case 2: return VK_FORMAT_R16G16_UINT;
122 case 3: return VK_FORMAT_R16G16B16_UINT;
123 case 4: return VK_FORMAT_R16G16B16A16_UINT;
124 }
125 }
126 else if (componentType == gl_const::GLIntType)
127 {
128 switch (componentCount)
129 {
130 case 1: return VK_FORMAT_R32_SINT;
131 case 2: return VK_FORMAT_R32G32_SINT;

Callers 1

GetPipelineMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected