MCPcopy Create free account
hub / github.com/crownengine/crown / lazyDisableVertexAttribArray

Function lazyDisableVertexAttribArray

3rdparty/bgfx/src/renderer_gl.cpp:1318–1338  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1316 }
1317
1318 void lazyDisableVertexAttribArray(GLuint index)
1319 {
1320 if (BX_ENABLED(BX_PLATFORM_EMSCRIPTEN) )
1321 {
1322 if (index >= 64)
1323 {
1324 // On WebGL platform calling out to WebGL API is detrimental to performance, so optimize
1325 // out redundant API calls to glEnable/DisableVertexAttribArray.
1326 GL_CHECK(glDisableVertexAttribArray(index) );
1327 return;
1328 }
1329
1330 const uint64_t mask = UINT64_C(1) << index;
1331 s_vertexAttribArraysPendingDisable |= mask & s_currentlyEnabledVertexAttribArrays;
1332 s_vertexAttribArraysPendingEnable &= ~mask;
1333 }
1334 else
1335 {
1336 GL_CHECK(glDisableVertexAttribArray(index) );
1337 }
1338 }
1339
1340 void applyLazyEnabledVertexAttributes()
1341 {

Callers 3

bindAttributesEndMethod · 0.85
unbindAttributesMethod · 0.85
unbindInstanceDataMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected