| 82 | } |
| 83 | |
| 84 | void SetProgramRenderConstant(const dmArray<RenderConstant>& constants, dmhash_t name_hash, const dmVMath::Vector4* values, uint32_t count) |
| 85 | { |
| 86 | const RenderConstant* rc = GetRenderConstant(constants, name_hash); |
| 87 | if (!rc) |
| 88 | return; |
| 89 | |
| 90 | uint32_t num_default_values; |
| 91 | dmVMath::Vector4* constant_values = dmRender::GetConstantValues(rc->m_Constant, &num_default_values); |
| 92 | |
| 93 | // we cannot set more values than are already registered with the program |
| 94 | if (num_default_values < count) |
| 95 | { |
| 96 | count = num_default_values; |
| 97 | } |
| 98 | |
| 99 | // we musn't set less values than are already registered with the program |
| 100 | // so we write to the previous buffer |
| 101 | memcpy(constant_values, values, count * sizeof(dmVMath::Vector4)); |
| 102 | } |
| 103 | |
| 104 | void SetProgramConstantType(const dmArray<RenderConstant>& constants, dmhash_t name_hash, dmRenderDDF::MaterialDesc::ConstantType type) |
| 105 | { |
no test coverage detected