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

Function GetUniformLocation

engine/graphics/src/test/test_app_graphics.cpp:68–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66};
67
68static dmGraphics::HUniformLocation GetUniformLocation(dmGraphics::HProgram program, const char* name)
69{
70 dmhash_t hash = dmHashString64(name);
71 for (int i = 0; i < dmGraphics::GetUniformCount(program); ++i)
72 {
73 dmGraphics::Uniform uniform;
74 dmGraphics::GetUniform(program, i, &uniform);
75
76 if (uniform.m_NameHash == hash)
77 {
78 return uniform.m_Location;
79 }
80 }
81 return dmGraphics::INVALID_UNIFORM_LOCATION;
82}
83
84// From engine_loop.cpp
85

Callers 2

InitializeMethod · 0.85
ExecuteMethod · 0.85

Calls 2

GetUniformCountFunction · 0.85
GetUniformFunction · 0.50

Tested by

no test coverage detected