MCPcopy Create free account
hub / github.com/Autodesk/Aurora / getAlignment

Method getAlignment

Libraries/Aurora/Source/UniformBuffer.cpp:341–365  ·  view source on GitHub ↗

Following HLSL alignment rules.

Source from the content-addressed store, hash-verified

339
340// Following HLSL alignment rules.
341size_t UniformBuffer::getAlignment(PropertyValue::Type type)
342{
343 // Scalars and vectors of 3 or less fields have single word alignment, everything else is
344 // quadword.
345 switch (type)
346 {
347 case PropertyValue::Type::Bool:
348 return sizeof(int);
349 case PropertyValue::Type::Int:
350 return sizeof(int);
351 case PropertyValue::Type::Float:
352 return sizeof(float);
353 case PropertyValue::Type::Float2:
354 return sizeof(float);
355 case PropertyValue::Type::Float3:
356 return sizeof(float);
357 case PropertyValue::Type::Float4:
358 return sizeof(vec4);
359 case PropertyValue::Type::Matrix4:
360 return sizeof(vec4);
361 default:
362 AU_FAIL("Unsupported type for uniform block:%x", type);
363 return 0;
364 }
365}
366
367string UniformBuffer::getGLSLStringFromType(PropertyValue::Type type)
368{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected