| 29 | } |
| 30 | |
| 31 | void RenderCommand::Issue() |
| 32 | { |
| 33 | ZoneScopedC(0x81A861); |
| 34 | |
| 35 | if (geometry_.numVertices_ == 0 && geometry_.numIndices_ == 0) { |
| 36 | return; |
| 37 | } |
| 38 | |
| 39 | material_.Bind(); |
| 40 | material_.CommitUniforms(); |
| 41 | |
| 42 | GLScissorTest::State scissorTestState = GLScissorTest::GetState(); |
| 43 | if (scissorRect_.W > 0 && scissorRect_.H > 0) { |
| 44 | GLScissorTest::Enable(scissorRect_); |
| 45 | } |
| 46 | |
| 47 | std::uint32_t offset = 0; |
| 48 | #if (defined(WITH_OPENGLES) && !GL_ES_VERSION_3_2) || defined(DEATH_TARGET_EMSCRIPTEN) |
| 49 | // Simulating missing `glDrawElementsBaseVertex()` on OpenGL ES 3.0 |
| 50 | if (geometry_.numIndices_ > 0) { |
| 51 | offset = geometry_.GetVboParams().offset + (geometry_.firstVertex_ * geometry_.numElementsPerVertex_ * sizeof(GLfloat)); |
| 52 | } |
| 53 | #endif |
| 54 | material_.DefineVertexFormat(geometry_.GetVboParams().object, geometry_.GetIboParams().object, offset); |
| 55 | geometry_.Bind(); |
| 56 | geometry_.Draw(numInstances_); |
| 57 | |
| 58 | GLScissorTest::SetState(scissorTestState); |
| 59 | } |
| 60 | |
| 61 | void RenderCommand::SetScissor(GLint x, GLint y, GLsizei width, GLsizei height) |
| 62 | { |
no test coverage detected