MCPcopy Create free account
hub / github.com/deathkiller/jazz2-native / Issue

Method Issue

Sources/nCine/Graphics/RenderCommand.cpp:31–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers 1

DrawMethod · 0.80

Calls 4

BindMethod · 0.45
CommitUniformsMethod · 0.45
DefineVertexFormatMethod · 0.45
DrawMethod · 0.45

Tested by

no test coverage detected