MCPcopy Create free account
hub / github.com/axmolengine/axmol / reloadProgram

Method reloadProgram

core/renderer/backend/opengl/ProgramGL.cpp:163–179  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

161
162#if AX_ENABLE_CACHE_TEXTURE_DATA
163void ProgramGL::reloadProgram()
164{
165 _activeUniformInfos.clear();
166 _mapToCurrentActiveLocation.clear();
167 _mapToOriginalLocation.clear();
168 static_cast<ShaderModuleGL*>(_vertexShaderModule)->compileShader(backend::ShaderStage::VERTEX, _vertexShader);
169 static_cast<ShaderModuleGL*>(_fragmentShaderModule)->compileShader(backend::ShaderStage::FRAGMENT, _fragmentShader);
170 compileProgram();
171 computeUniformInfos();
172
173 for (const auto& uniform : _activeUniformInfos)
174 {
175 auto location = _originalUniformLocations[uniform.first];
176 _mapToCurrentActiveLocation[location] = uniform.second.location;
177 _mapToOriginalLocation[uniform.second.location] = location;
178 }
179}
180#endif
181
182void ProgramGL::compileProgram()

Callers 1

ProgramGLMethod · 0.95

Calls 2

compileShaderMethod · 0.80
clearMethod · 0.45

Tested by

no test coverage detected