Skip to content

Commit 7c55685

Browse files
committed
Add more graphics debug scopes for code called in the main frame
1 parent ce519f0 commit 7c55685

File tree

5 files changed

+14
-0
lines changed

5 files changed

+14
-0
lines changed

code/graphics/opengl/gropengldraw.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1900,6 +1900,8 @@ void gr_opengl_scene_texture_begin()
19001900
return;
19011901
}
19021902

1903+
GR_DEBUG_SCOPE("Begin scene texture");
1904+
19031905
glBindFramebuffer(GL_FRAMEBUFFER, Scene_framebuffer);
19041906

19051907
if (GL_rendering_to_texture)
@@ -2016,6 +2018,8 @@ void gr_opengl_copy_effect_texture()
20162018

20172019
void opengl_clear_deferred_buffers()
20182020
{
2021+
GR_DEBUG_SCOPE("Clear deferred buffers");
2022+
20192023
GLboolean depth = GL_state.DepthTest(GL_FALSE);
20202024
GLboolean depth_mask = GL_state.DepthMask(GL_FALSE);
20212025
GLboolean blend = GL_state.Blend(GL_FALSE);
@@ -2347,6 +2351,8 @@ void gr_opengl_update_distortion()
23472351

23482352
void opengl_render_primitives(primitive_type prim_type, vertex_layout* layout, int n_verts, int buffer_handle, size_t vert_offset, size_t byte_offset)
23492353
{
2354+
GR_DEBUG_SCOPE("Render primitives");
2355+
23502356
if ( buffer_handle >= 0 ) {
23512357
opengl_bind_buffer_object(buffer_handle);
23522358
} else {

code/graphics/opengl/gropengldraw.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ inline void opengl_draw_textured_quad(
109109
GLfloat x1, GLfloat y1, GLfloat u1, GLfloat v1,
110110
GLfloat x2, GLfloat y2, GLfloat u2, GLfloat v2 )
111111
{
112+
GR_DEBUG_SCOPE("Draw textured quad");
113+
112114
GLfloat glVertices[4][4] = {
113115
{ x1, y1, u1, v1 },
114116
{ x1, y2, u1, v2 },

code/graphics/opengl/gropenglshader.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,8 @@ opengl_shader_t *Current_shader = NULL;
227227
void opengl_shader_set_current(opengl_shader_t *shader_obj)
228228
{
229229
if (Current_shader != shader_obj) {
230+
GR_DEBUG_SCOPE("Set shader");
231+
230232
GL_state.Array.ResetVertexAttribs();
231233

232234
if(shader_obj) {

code/graphics/opengl/gropengltnl.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,8 @@ int gr_opengl_create_index_buffer(bool static_buffer)
226226

227227
uint opengl_add_to_immediate_buffer(uint size, void *data)
228228
{
229+
GR_DEBUG_SCOPE("Add data to immediate buffer");
230+
229231
if ( GL_immediate_buffer_handle < 0 ) {
230232
GL_immediate_buffer_handle = opengl_create_buffer_object(GL_ARRAY_BUFFER, GL_STREAM_DRAW);
231233
}

code/scripting/scripting.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -848,6 +848,8 @@ int script_state::RunBytecodeSub(script_function& func, char format, void *data)
848848
return 1;
849849
}
850850

851+
GR_DEBUG_SCOPE("Lua code");
852+
851853
try {
852854
auto ret = func.function.call();
853855

0 commit comments

Comments
 (0)