MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / setMatrix

Method setMatrix

Engine/source/gfx/genericConstBuffer.cpp:119–137  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

117}
118
119bool GenericConstBufferLayout::setMatrix(const ParamDesc& pd, const GFXShaderConstType constType, const U32 size, const void* data, U8* basePointer)
120{
121 PROFILE_SCOPE(GenericConstBufferLayout_setMatrix);
122
123 // We're generic, so just copy the full MatrixF in
124 AssertFatal(pd.size >= size, "Not enough room in the buffer for this data!");
125
126 // Matrices are an annoying case because of the alignment issues. There are alignment issues in the matrix itself, and then potential inter matrices alignment issues.
127 // So GL and DX will need to derive their own GenericConstBufferLayout classes and override this method to deal with that stuff. For GenericConstBuffer, copy the whole
128 // 4x4 matrix regardless of the target case.
129
130 if (dMemcmp(basePointer+pd.offset, data, size) != 0)
131 {
132 dMemcpy(basePointer+pd.offset, data, size);
133 return true;
134 }
135
136 return false;
137}
138
139bool GenericConstBufferLayout::getDesc(const String& name, ParamDesc& param) const
140{

Callers 1

DefineEngineMethodFunction · 0.45

Calls 2

dMemcmpFunction · 0.50
dMemcpyFunction · 0.50

Tested by

no test coverage detected