Error operator()(CommandBufferImpl*) { if(!m_query.isCreated() || !m_query.get().skipDrawcall()) { glDrawArraysInstancedBaseInstance( m_mode, m_info.m_first, m_info.m_count, m_info.m_instanceCount, m_info.m_baseInstance); ANKI_COUNTER_INC(GL_DRAWCALLS_COUNT, (U64)1); } return ErrorCode::NONE; }
Error operator()(GlState&) { OcclusionQueryImpl& impl = m_q->getImplementation(); impl.init(m_condRenderingBit); GlObject::State oldState = impl.setStateAtomically(GlObject::State::CREATED); (void)oldState; ANKI_ASSERT(oldState == GlObject::State::TO_BE_CREATED); return ErrorCode::NONE; }
Error operator()(CommandBufferImpl*) { ANKI_ASSERT(m_indexSize != 0); GLenum indicesType = 0; switch(m_indexSize) { case 1: indicesType = GL_UNSIGNED_BYTE; break; case 2: indicesType = GL_UNSIGNED_SHORT; break; case 4: indicesType = GL_UNSIGNED_INT; break; default: ANKI_ASSERT(0); break; }; if(!m_query.isCreated() || !m_query.get().skipDrawcall()) { glDrawElementsInstancedBaseVertexBaseInstance( m_mode, m_info.m_count, indicesType, (const void*)(PtrSize)(m_info.m_firstIndex * m_indexSize), m_info.m_instanceCount, m_info.m_baseVertex, m_info.m_baseInstance); ANKI_COUNTER_INC(GL_DRAWCALLS_COUNT, (U64)1); } return ErrorCode::NONE; }
Error operator()(GlState&) { m_handle->getImplementation().end(); return ErrorCode::NONE; }