21struct VertexLayoutCreateInfo;
133 strideType(PerVertex),
146 streamIndex(streamIndex_),
148 strideType(strideType_),
207 case Float:
return 4;
212 case Half2:
return 4;
213 case Half3:
return 6;
214 case Half4:
return 8;
216 case UInt2:
return 8;
217 case UInt3:
return 12;
218 case UInt4:
return 16;
221 case Int3:
return 12;
222 case Int4:
return 16;
223 case Short:
return 2;
233 case Byte4:
return 4;
253 case Float:
return "Float";
254 case Float2:
return "Float2";
255 case Float3:
return "Float3";
256 case Float4:
return "Float4";
257 case Half:
return "Half";
258 case Half2:
return "Half2";
259 case Half3:
return "Half3";
260 case Half4:
return "Half4";
261 case UInt:
return "UInt";
262 case UInt2:
return "UInt2";
263 case UInt3:
return "UInt3";
264 case UInt4:
return "UInt4";
265 case Int:
return "Int";
266 case Int2:
return "Int2";
267 case Int3:
return "Int3";
268 case Int4:
return "Int4";
269 case Short:
return "Short";
270 case Short2:
return "Short2";
271 case Short3:
return "Short3";
272 case Short4:
return "Short4";
273 case UShort:
return "UShort";
274 case UShort2:
return "UShort2";
275 case UShort3:
return "UShort3";
276 case UShort4:
return "UShort4";
278 case UByte4:
return "UByte4";
279 case Byte4:
return "Byte4";
280 case UByte4N:
return "UByte4N";
281 case Byte4N:
return "Byte4N";
284 case Short2N:
return "Short2N";
285 case Short4N:
return "Short4N";
288 n_error(
"VertexComponent::FormatToString(): invalid Format code!");
301 case Float:
return "f";
305 case Half:
return "h";
306 case Half2:
return "h2";
307 case Half3:
return "h3";
308 case Half4:
return "h4";
309 case UInt:
return "ui";
310 case UInt2:
return "ui2";
311 case UInt3:
return "ui3";
312 case UInt4:
return "ui4";
313 case Int:
return "i";
314 case Int2:
return "i2";
315 case Int3:
return "i3";
316 case Int4:
return "i4";
317 case Short:
return "s";
326 case UByte4:
return "ub4";
327 case Byte4:
return "b4";
329 case Byte4N:
return "b4n";
337 n_error(
"VertexComponent::FormatToString(): invalid Format code!");
348 if (str ==
"Float")
return Float;
349 else if (str ==
"Float2")
return Float2;
350 else if (str ==
"Float3")
return Float3;
351 else if (str ==
"Float4")
return Float4;
352 else if (str ==
"Half")
return Half;
353 else if (str ==
"Half2")
return Half2;
354 else if (str ==
"Half3")
return Half3;
355 else if (str ==
"Half4")
return Half4;
356 else if (str ==
"UInt")
return UInt;
357 else if (str ==
"UInt2")
return UInt2;
358 else if (str ==
"UInt3")
return UInt3;
359 else if (str ==
"UInt4")
return UInt4;
360 else if (str ==
"Int")
return Int;
361 else if (str ==
"Int2")
return Int2;
362 else if (str ==
"Int3")
return Int3;
363 else if (str ==
"Int4")
return Int4;
364 else if (str ==
"Short")
return Short;
365 else if (str ==
"Short2")
return Short2;
366 else if (str ==
"Short3")
return Short3;
367 else if (str ==
"Short4")
return Short4;
368 else if (str ==
"UShort")
return UShort;
369 else if (str ==
"UShort2")
return UShort2;
370 else if (str ==
"UShort3")
return UShort3;
371 else if (str ==
"UShort4")
return UShort4;
373 else if (str ==
"UByte4")
return UByte4;
374 else if (str ==
"Byte4")
return Byte4;
375 else if (str ==
"UByte4N")
return UByte4N;
376 else if (str ==
"Byte4N")
return Byte4N;
377 else if (str ==
"UShort2N")
return UShort2N;
378 else if (str ==
"UShort4N")
return UShort4N;
379 else if (str ==
"Short2N")
return Short2N;
380 else if (str ==
"Short4N")
return Short4N;
384 n_error(
"VertexComponent::StringToFormat(): invalid string '%s'!\n", str.
AsCharPtr());
Definition vertexcomponentbase.h:28
static Util::String FormatToSignature(Format f)
convert format to signature
Definition vertexcomponentbase.h:297
Util::String GetSignature() const
get a unique signature of the vertex component
Definition vertexcomponentbase.h:393
SizeT GetByteSize() const
get the byte size of the vertex component
Definition vertexcomponentbase.h:203
Format GetFormat() const
get vertex component format
Definition vertexcomponentbase.h:167
IndexT byteOffset
Definition vertexcomponentbase.h:121
IndexT index
Definition vertexcomponentbase.h:116
static Format StringToFormat(const Util::String &str)
convert string to format
Definition vertexcomponentbase.h:346
StrideType GetStrideType() const
get stride type
Definition vertexcomponentbase.h:185
void SetByteOffset(IndexT offset)
set the vertex byte offset (called from VertexLayoutBase::Setup())
Definition vertexcomponentbase.h:405
IndexT GetIndex() const
get semantic index
Definition vertexcomponentbase.h:158
IndexT GetStreamIndex() const
get stream index
Definition vertexcomponentbase.h:176
static Util::String FormatToString(Format f)
convert format to string
Definition vertexcomponentbase.h:249
IndexT GetByteOffset() const
get the byte offset of this component (only valid when part of a VertexLayout)
Definition vertexcomponentbase.h:414
IndexT streamIndex
Definition vertexcomponentbase.h:120
StrideType
stride type tells if the compoent should be per-instance or per-vertex
Definition vertexcomponentbase.h:76
@ PerVertex
Definition vertexcomponentbase.h:77
@ PerInstance
Definition vertexcomponentbase.h:78
Format format
Definition vertexcomponentbase.h:117
VertexComponentBase()
default constructor
Definition vertexcomponentbase.h:128
StrideType strideType
Definition vertexcomponentbase.h:118
SizeT GetStride() const
get stride between instances
Definition vertexcomponentbase.h:194
SizeT stride
Definition vertexcomponentbase.h:119
Format
component format
Definition vertexcomponentbase.h:33
@ Int3
Definition vertexcomponentbase.h:48
@ Int2
Definition vertexcomponentbase.h:47
@ InvalidFormat
Definition vertexcomponentbase.h:70
@ Int
Definition vertexcomponentbase.h:46
@ Half2
Definition vertexcomponentbase.h:39
@ Short
Definition vertexcomponentbase.h:50
@ Short2
Definition vertexcomponentbase.h:51
@ UInt4
Definition vertexcomponentbase.h:45
@ UInt3
Definition vertexcomponentbase.h:44
@ UByte4N
Definition vertexcomponentbase.h:61
@ UShort4N
Definition vertexcomponentbase.h:67
@ Half3
Definition vertexcomponentbase.h:40
@ UShort4
Definition vertexcomponentbase.h:57
@ Short3
Definition vertexcomponentbase.h:52
@ Float4
Definition vertexcomponentbase.h:37
@ UInt2
Definition vertexcomponentbase.h:43
@ Float3
Definition vertexcomponentbase.h:36
@ UShort
Definition vertexcomponentbase.h:54
@ UInt
Definition vertexcomponentbase.h:42
@ Short2N
Definition vertexcomponentbase.h:64
@ UByte4
Definition vertexcomponentbase.h:59
@ UShort2N
Definition vertexcomponentbase.h:66
@ Int4
Definition vertexcomponentbase.h:49
@ UShort3
Definition vertexcomponentbase.h:56
@ Half4
Definition vertexcomponentbase.h:41
@ UShort2
Definition vertexcomponentbase.h:55
@ Byte4
Definition vertexcomponentbase.h:60
@ Short4N
Definition vertexcomponentbase.h:65
@ Half
Definition vertexcomponentbase.h:38
@ Float2
Definition vertexcomponentbase.h:35
@ Short4
Definition vertexcomponentbase.h:53
@ Float
Definition vertexcomponentbase.h:34
@ Byte4N
Definition vertexcomponentbase.h:62
void __cdecl n_error(const char *msg,...)
This function is called when a serious situation is encountered which requires abortion of the applic...
Definition debug.cc:138
Definition gamecontentserverbase.cc:10
Acceleration structures are used to enable ray tracing on the GPU by dividing the scene into a BVH.
Definition accelerationstructure.h:24
const VertexLayoutId CreateVertexLayout(const VertexLayoutCreateInfo &info)
create new vertex layout
Definition vkvertexlayout.cc:36
Definition vertexlayout.h:22
Definition vertexlayout.h:16
Nebula's universal string class.
Definition string.h:50
void Append(const String &str)
append string
Definition string.h:615
const char * AsCharPtr() const
return contents as character pointer
Definition string.h:540
void AppendInt(int val)
append int value
Definition string.h:1104
int SizeT
Definition types.h:49
int IndexT
Definition types.h:48