17struct VertexLayoutCreateInfo;
139 strideType(PerVertex),
154 strideType(strideType_),
156 streamIndex(streamIndex_),
215 case Float:
return 4;
220 case Half2:
return 4;
221 case Half3:
return 6;
222 case Half4:
return 8;
224 case UInt2:
return 8;
225 case UInt3:
return 12;
226 case UInt4:
return 16;
229 case Int3:
return 12;
230 case Int4:
return 16;
231 case Short:
return 2;
241 case Byte4:
return 4;
262 case Float:
return "Float";
263 case Float2:
return "Float2";
264 case Float3:
return "Float3";
265 case Float4:
return "Float4";
266 case Half:
return "Half";
267 case Half2:
return "Half2";
268 case Half3:
return "Half3";
269 case Half4:
return "Half4";
270 case UInt:
return "UInt";
271 case UInt2:
return "UInt2";
272 case UInt3:
return "UInt3";
273 case UInt4:
return "UInt4";
274 case Int:
return "Int";
275 case Int2:
return "Int2";
276 case Int3:
return "Int3";
277 case Int4:
return "Int4";
278 case Short:
return "Short";
279 case Short2:
return "Short2";
280 case Short3:
return "Short3";
281 case Short4:
return "Short4";
282 case UShort:
return "UShort";
283 case UShort2:
return "UShort2";
284 case UShort3:
return "UShort3";
285 case UShort4:
return "UShort4";
287 case UByte4:
return "UByte4";
288 case Byte4:
return "Byte4";
289 case UByte4N:
return "UByte4N";
290 case Byte4N:
return "Byte4N";
293 case Short2N:
return "Short2N";
294 case Short4N:
return "Short4N";
297 n_error(
"VertexComponent::FormatToString(): invalid Format code!");
310 case Float:
return "f";
314 case Half:
return "h";
315 case Half2:
return "h2";
316 case Half3:
return "h3";
317 case Half4:
return "h4";
318 case UInt:
return "ui";
319 case UInt2:
return "ui2";
320 case UInt3:
return "ui3";
321 case UInt4:
return "ui4";
322 case Int:
return "i";
323 case Int2:
return "i2";
324 case Int3:
return "i3";
325 case Int4:
return "i4";
326 case Short:
return "s";
335 case UByte4:
return "ub4";
336 case Byte4:
return "b4";
338 case Byte4N:
return "b4n";
346 n_error(
"VertexComponent::FormatToString(): invalid Format code!");
357 if (str ==
"Float")
return Float;
358 else if (str ==
"Float2")
return Float2;
359 else if (str ==
"Float3")
return Float3;
360 else if (str ==
"Float4")
return Float4;
361 else if (str ==
"Half")
return Half;
362 else if (str ==
"Half2")
return Half2;
363 else if (str ==
"Half3")
return Half3;
364 else if (str ==
"Half4")
return Half4;
365 else if (str ==
"UInt")
return UInt;
366 else if (str ==
"UInt2")
return UInt2;
367 else if (str ==
"UInt3")
return UInt3;
368 else if (str ==
"UInt4")
return UInt4;
369 else if (str ==
"Int")
return Int;
370 else if (str ==
"Int2")
return Int2;
371 else if (str ==
"Int3")
return Int3;
372 else if (str ==
"Int4")
return Int4;
373 else if (str ==
"Short")
return Short;
374 else if (str ==
"Short2")
return Short2;
375 else if (str ==
"Short3")
return Short3;
376 else if (str ==
"Short4")
return Short4;
377 else if (str ==
"UShort")
return UShort;
378 else if (str ==
"UShort2")
return UShort2;
379 else if (str ==
"UShort3")
return UShort3;
380 else if (str ==
"UShort4")
return UShort4;
382 else if (str ==
"UByte4")
return UByte4;
383 else if (str ==
"Byte4")
return Byte4;
384 else if (str ==
"UByte4N")
return UByte4N;
385 else if (str ==
"Byte4N")
return Byte4N;
386 else if (str ==
"UShort2N")
return UShort2N;
387 else if (str ==
"UShort4N")
return UShort4N;
388 else if (str ==
"Short2N")
return Short2N;
389 else if (str ==
"Short4N")
return Short4N;
393 n_error(
"VertexComponent::StringToFormat(): invalid string '%s'!\n", str.
AsCharPtr());
Describes a single vertex component in a vertex layout description.
Definition vertexcomponent.h:21
Format
component format
Definition vertexcomponent.h:25
@ Short2
Definition vertexcomponent.h:43
@ Short2N
Definition vertexcomponent.h:56
@ UInt4
Definition vertexcomponent.h:37
@ UInt2
Definition vertexcomponent.h:35
@ UShort2
Definition vertexcomponent.h:47
@ Byte4N
Definition vertexcomponent.h:54
@ Short3
Definition vertexcomponent.h:44
@ UByte4N
Definition vertexcomponent.h:53
@ UShort
Definition vertexcomponent.h:46
@ Half4
Definition vertexcomponent.h:33
@ UInt3
Definition vertexcomponent.h:36
@ Int4
Definition vertexcomponent.h:41
@ Int3
Definition vertexcomponent.h:40
@ UShort4N
Definition vertexcomponent.h:59
@ Float3
Definition vertexcomponent.h:28
@ Half3
Definition vertexcomponent.h:32
@ Byte4
Definition vertexcomponent.h:52
@ Float4
Definition vertexcomponent.h:29
@ Int2
Definition vertexcomponent.h:39
@ UInt
Definition vertexcomponent.h:34
@ UShort4
Definition vertexcomponent.h:49
@ UShort3
Definition vertexcomponent.h:48
@ Short4
Definition vertexcomponent.h:45
@ Float2
Definition vertexcomponent.h:27
@ UByte4
Definition vertexcomponent.h:51
@ Short4N
Definition vertexcomponent.h:57
@ InvalidFormat
Definition vertexcomponent.h:62
@ Int
Definition vertexcomponent.h:38
@ UShort2N
Definition vertexcomponent.h:58
@ Half
Definition vertexcomponent.h:30
@ Half2
Definition vertexcomponent.h:31
@ Short
Definition vertexcomponent.h:42
@ Float
Definition vertexcomponent.h:26
IndexT GetStreamIndex() const
get stream index
Definition vertexcomponent.h:184
static Format StringToFormat(const Util::String &str)
convert string to format
Definition vertexcomponent.h:355
SizeT stride
Definition vertexcomponent.h:127
StrideType
stride type tells if the compoent should be per-instance or per-vertex
Definition vertexcomponent.h:84
@ PerVertex
Definition vertexcomponent.h:85
@ PerInstance
Definition vertexcomponent.h:86
IndexName
Definition vertexcomponent.h:66
@ Binormal
Definition vertexcomponent.h:71
@ SkinWeights
Definition vertexcomponent.h:74
@ Position
Definition vertexcomponent.h:67
@ SkinJIndices
Definition vertexcomponent.h:75
@ Normal
Definition vertexcomponent.h:68
@ Tangent
Definition vertexcomponent.h:70
@ Invalid
Definition vertexcomponent.h:79
@ TexCoord3
Definition vertexcomponent.h:76
@ TexCoord4
Definition vertexcomponent.h:77
@ TexCoord1
Definition vertexcomponent.h:69
@ TexCoord2
Definition vertexcomponent.h:73
SizeT GetStride() const
get stride between instances
Definition vertexcomponent.h:202
VertexComponent()
default constructor
Definition vertexcomponent.h:136
IndexT GetByteOffset() const
get the byte offset of this component (only valid when part of a VertexLayout)
Definition vertexcomponent.h:423
IndexT byteOffset
Definition vertexcomponent.h:129
Util::String GetSignature() const
get a unique signature of the vertex component
Definition vertexcomponent.h:402
static Util::String FormatToSignature(Format f)
convert format to signature
Definition vertexcomponent.h:306
Format GetFormat() const
get vertex component format
Definition vertexcomponent.h:175
Format format
Definition vertexcomponent.h:125
SizeT GetByteSize() const
get the byte size of the vertex component
Definition vertexcomponent.h:211
IndexT index
Definition vertexcomponent.h:124
IndexT GetIndex() const
get semantic index
Definition vertexcomponent.h:166
StrideType strideType
Definition vertexcomponent.h:126
void SetByteOffset(IndexT offset)
set the vertex byte offset (called from VertexLayoutBase::Setup())
Definition vertexcomponent.h:414
StrideType GetStrideType() const
get stride type
Definition vertexcomponent.h:193
IndexT streamIndex
Definition vertexcomponent.h:128
static Util::String FormatToString(Format f)
convert format to string
Definition vertexcomponent.h:258
For now just a wrapper around Math::vec4 for type safety.
Definition color.h:18
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
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:617
const char * AsCharPtr() const
return contents as character pointer
Definition string.h:542
void AppendInt(int val)
append int value
Definition string.h:1106
int SizeT
Definition types.h:49
int IndexT
Definition types.h:48