| 117 | } |
| 118 | |
| 119 | bool 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 | |
| 139 | bool GenericConstBufferLayout::getDesc(const String& name, ParamDesc& param) const |
| 140 | { |
no test coverage detected