MCPcopy Create free account
hub / github.com/defold/defold / ApplyComputeProgramConstants

Function ApplyComputeProgramConstants

engine/render/src/render/compute.cpp:69–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67 }
68
69 void ApplyComputeProgramConstants(dmRender::HRenderContext render_context, HComputeProgram compute_program)
70 {
71 dmGraphics::HContext graphics_context = dmRender::GetGraphicsContext(render_context);
72 const dmArray<RenderConstant>& render_constants = compute_program->m_Constants;
73
74 dmVMath::Matrix4 world_matrix;
75 dmVMath::Matrix4 texture_matrix;
76
77 for (int i = 0; i < render_constants.Size(); ++i)
78 {
79 const RenderConstant& material_constant = render_constants[i];
80 const HConstant constant = material_constant.m_Constant;
81 dmGraphics::HUniformLocation location = GetConstantLocation(constant);
82 dmRenderDDF::MaterialDesc::ConstantType type = GetConstantType(constant);
83 SetProgramConstant(render_context, graphics_context, world_matrix, texture_matrix, type, location, constant);
84 }
85 }
86
87 void SetComputeProgramConstant(HComputeProgram compute_program, dmhash_t name_hash, Vector4* values, uint32_t count)
88 {

Callers 1

DispatchComputeFunction · 0.85

Calls 5

GetGraphicsContextFunction · 0.85
GetConstantLocationFunction · 0.85
GetConstantTypeFunction · 0.85
SetProgramConstantFunction · 0.85
SizeMethod · 0.45

Tested by

no test coverage detected