| 354 | } |
| 355 | |
| 356 | void ApplyMaterialConstants(dmRender::HRenderContext render_context, HMaterial material, const RenderObject* render_object) |
| 357 | { |
| 358 | dmGraphics::HContext graphics_context = dmRender::GetGraphicsContext(render_context); |
| 359 | const dmArray<RenderConstant>& constants = material->m_Constants; |
| 360 | dmGraphics::HProgram program = material->m_Program; |
| 361 | |
| 362 | uint32_t n = constants.Size(); |
| 363 | for (uint32_t i = 0; i < n; ++i) |
| 364 | { |
| 365 | const RenderConstant& material_constant = constants[i]; |
| 366 | const HConstant constant = material_constant.m_Constant; |
| 367 | dmGraphics::HUniformLocation location = GetConstantLocation(constant); |
| 368 | dmRenderDDF::MaterialDesc::ConstantType type = GetConstantType(constant); |
| 369 | SetProgramConstant(render_context, graphics_context, render_object->m_WorldTransform, render_object->m_TextureTransform, type, location, constant); |
| 370 | } |
| 371 | } |
| 372 | |
| 373 | dmhash_t GetMaterialSamplerNameHash(HMaterial material, uint32_t unit) |
| 374 | { |
no test coverage detected