MCPcopy Create free account
hub / github.com/OGRECave/ogre / bindProgramParameters

Method bindProgramParameters

RenderSystems/GL/src/OgreGLGpuProgram.cpp:117–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

115}
116
117void GLArbGpuProgram::bindProgramParameters(GpuProgramParametersSharedPtr params, uint16 mask)
118{
119 GLenum type = getProgramType();
120
121 // only supports float constants
122 GpuLogicalBufferStructPtr floatStruct = params->getLogicalBufferStruct();
123
124 for (const auto& m : floatStruct->map)
125 {
126 if (m.second.variability & mask)
127 {
128 GLuint logicalIndex = static_cast<GLuint>(m.first);
129 const float* pFloat = params->getFloatPointer(m.second.physicalIndex);
130 // Iterate over the params, set in 4-float chunks (low-level)
131 for (size_t j = 0; j < m.second.currentSize; j+=4)
132 {
133 glProgramLocalParameter4fvARB(type, logicalIndex, pFloat);
134 pFloat += 4;
135 ++logicalIndex;
136 }
137 }
138 }
139}
140
141void GLArbGpuProgram::unloadImpl(void)
142{

Callers 1

Calls 1

getProgramTypeFunction · 0.85

Tested by

no test coverage detected