Debug support

Advanced OpenGL source port fork from ZDoom, picking up where ZDoomGL left off.
[Home] [Download] [Git builds (Win)] [Git builds (Mac)] [Wiki] [Repo] [Bugs&Suggestions]

Moderator: Graf Zahl

Edward-san
Developer
Developer
Posts: 197
Joined: Sun Nov 29, 2009 16:36

Re: Debug support

Post by Edward-san »

1) Please fix missing 'string' include in gl_debug.cpp!

2) I got some info from my intel laptop while running gzdoom with square1.pk3:

Code: Select all

GL_VENDOR: Intel Open Source Technology Center
GL_RENDERER: Mesa DRI Intel(R) Sandybridge Mobile 
GL_VERSION: 3.0 Mesa 11.2.0 (Compatibility profile)
GL_SHADING_LANGUAGE_VERSION: 1.30
GL_EXTENSIONS: GL_3DFX_texture_compression_FXT1 GL_AMD_draw_buffers_blend GL_AMD_performance_monitor GL_AMD_seamless_cubemap_per_texture GL_AMD_shader_trinary_minmax GL_ANGLE_texture_compression_dxt3 GL_ANGLE_texture_compression_dxt5 GL_APPLE_object_purgeable GL_APPLE_packed_pixels GL_APPLE_vertex_array_object GL_ARB_ES2_compatibility GL_ARB_ES3_compatibility GL_ARB_arrays_of_arrays GL_ARB_blend_func_extended GL_ARB_buffer_storage GL_ARB_clear_buffer_object GL_ARB_clear_texture GL_ARB_clip_control GL_ARB_color_buffer_float GL_ARB_compressed_texture_pixel_storage GL_ARB_conditional_render_inverted GL_ARB_copy_buffer GL_ARB_copy_image GL_ARB_debug_output GL_ARB_depth_buffer_float GL_ARB_depth_clamp GL_ARB_depth_texture GL_ARB_draw_buffers GL_ARB_draw_buffers_blend GL_ARB_draw_elements_base_vertex GL_ARB_draw_instanced GL_ARB_explicit_attrib_location GL_ARB_explicit_uniform_location GL_ARB_fragment_coord_conventions GL_ARB_fragment_program GL_ARB_fragment_program_shadow GL_ARB_fragment_shader GL_ARB_framebuffer_object GL_ARB_framebuffer_sRGB GL_ARB_get_program_binary GL_ARB_get_texture_sub_image GL_ARB_half_float_pixel GL_ARB_half_float_vertex GL_ARB_instanced_arrays GL_ARB_internalformat_query GL_ARB_invalidate_subdata GL_ARB_map_buffer_alignment GL_ARB_map_buffer_range GL_ARB_multi_bind GL_ARB_multisample GL_ARB_multitexture GL_ARB_occlusion_query GL_ARB_occlusion_query2 GL_ARB_pipeline_statistics_query GL_ARB_pixel_buffer_object GL_ARB_point_parameters GL_ARB_point_sprite GL_ARB_program_interface_query GL_ARB_provoking_vertex GL_ARB_robustness GL_ARB_sample_shading GL_ARB_sampler_objects GL_ARB_seamless_cube_map GL_ARB_seamless_cubemap_per_texture GL_ARB_separate_shader_objects GL_ARB_shader_bit_encoding GL_ARB_shader_draw_parameters GL_ARB_shader_objects GL_ARB_shader_texture_lod GL_ARB_shading_language_100 GL_ARB_shading_language_420pack GL_ARB_shading_language_packing GL_ARB_shadow GL_ARB_sync GL_ARB_texture_barrier GL_ARB_texture_border_clamp GL_ARB_texture_compression GL_ARB_texture_compression_rgtc GL_ARB_texture_cube_map GL_ARB_texture_cube_map_array GL_ARB_texture_env_add GL_ARB_texture_env_combine GL_ARB_texture_env_crossbar GL_ARB_texture_env_dot3 GL_ARB_texture_float GL_ARB_texture_gather GL_ARB_texture_mirror_clamp_to_edge GL_ARB_texture_mirrored_repeat GL_ARB_texture_multisample GL_ARB_texture_non_power_of_two GL_ARB_texture_query_levels GL_ARB_texture_query_lod GL_ARB_texture_rectangle GL_ARB_texture_rg GL_ARB_texture_rgb10_a2ui GL_ARB_texture_storage GL_ARB_texture_storage_multisample GL_ARB_texture_swizzle GL_ARB_timer_query GL_ARB_transpose_matrix GL_ARB_uniform_buffer_object GL_ARB_vertex_array_bgra GL_ARB_vertex_array_object GL_ARB_vertex_attrib_binding GL_ARB_vertex_buffer_object GL_ARB_vertex_program GL_ARB_vertex_shader GL_ARB_vertex_type_10f_11f_11f_rev GL_ARB_vertex_type_2_10_10_10_rev GL_ARB_window_pos GL_ATI_blend_equation_separate GL_ATI_draw_buffers GL_ATI_separate_stencil GL_ATI_texture_env_combine3 GL_ATI_texture_float GL_EXT_abgr GL_EXT_bgra GL_EXT_blend_color GL_EXT_blend_equation_separate GL_EXT_blend_func_separate GL_EXT_blend_minmax GL_EXT_blend_subtract GL_EXT_compiled_vertex_array GL_EXT_copy_texture GL_EXT_draw_buffers2 GL_EXT_draw_instanced GL_EXT_draw_range_elements GL_EXT_fog_coord GL_EXT_framebuffer_blit GL_EXT_framebuffer_multisample GL_EXT_framebuffer_multisample_blit_scaled GL_EXT_framebuffer_object GL_EXT_framebuffer_sRGB GL_EXT_gpu_program_parameters GL_EXT_multi_draw_arrays GL_EXT_packed_depth_stencil GL_EXT_packed_float GL_EXT_packed_pixels GL_EXT_pixel_buffer_object GL_EXT_point_parameters GL_EXT_polygon_offset GL_EXT_polygon_offset_clamp GL_EXT_provoking_vertex GL_EXT_rescale_normal GL_EXT_secondary_color GL_EXT_separate_specular_color GL_EXT_shader_integer_mix GL_EXT_shadow_funcs GL_EXT_stencil_two_side GL_EXT_stencil_wrap GL_EXT_subtexture GL_EXT_texture GL_EXT_texture3D GL_EXT_texture_array GL_EXT_texture_compression_dxt1 GL_EXT_texture_compression_rgtc GL_EXT_texture_compression_s3tc GL_EXT_texture_cube_map GL_EXT_texture_edge_clamp GL_EXT_texture_env_add GL_EXT_texture_env_combine GL_EXT_texture_env_dot3 GL_EXT_texture_filter_anisotropic GL_EXT_texture_integer GL_EXT_texture_lod_bias GL_EXT_texture_object GL_EXT_texture_rectangle GL_EXT_texture_sRGB GL_EXT_texture_sRGB_decode GL_EXT_texture_shared_exponent GL_EXT_texture_snorm GL_EXT_texture_swizzle GL_EXT_timer_query GL_EXT_transform_feedback GL_EXT_vertex_array GL_EXT_vertex_array_bgra GL_IBM_multimode_draw_arrays GL_IBM_rasterpos_clip GL_IBM_texture_mirrored_repeat GL_INGR_blend_func_separate GL_INTEL_performance_query GL_KHR_context_flush_control GL_KHR_debug GL_MESA_pack_invert GL_MESA_texture_signed_rgba GL_MESA_window_pos GL_NV_blend_square GL_NV_conditional_render GL_NV_depth_clamp GL_NV_light_max_exponent GL_NV_packed_depth_stencil GL_NV_primitive_restart GL_NV_texgen_reflection GL_NV_texture_barrier GL_NV_texture_env_combine4 GL_NV_texture_rectangle GL_OES_EGL_image GL_OES_read_format GL_S3_s3tc GL_SGIS_generate_mipmap GL_SGIS_texture_border_clamp GL_SGIS_texture_edge_clamp GL_SGIS_texture_lod GL_SUN_multi_draw_arrays
Max. texture size: 8192
Max. texture units: 16
Max. varying: 128
Max. uniform block size: 65536
Uniform block alignment: 16
I got these from gl_debug with level 4 in the opening:

Code: Select all

[shader compiler] notification: FS SIMD8 shader: 5 inst, 0 loops, 24 cycles, 0:0 spills:fills, Promoted 0 constants, compacted 80 to 48 bytes.
[shader compiler] notification: FS SIMD16 shader: 5 inst, 0 loops, 34 cycles, 0:0 spills:fills, Promoted 0 constants, compacted 80 to 48 bytes.
[shader compiler] notification: VS vec4 shader: 8 inst, 0 loops, 66 cycles, compacted 128 to 128 bytes.
[shader compiler] notification: FS SIMD16 shader: 2 inst, 0 loops, 0 cycles, 0:0 spills:fills, Promoted 0 constants, compacted 32 to 32 bytes.
[shader compiler] notification: VS vec4 shader: 5 inst, 0 loops, 34 cycles, compacted 80 to 64 bytes.
[shader compiler] notification: FS SIMD8 shader: 468 inst, 5 loops, 154656 cycles, 0:0 spills:fills, Promoted 0 constants, compacted 7488 to 6208 bytes.
[shader compiler] notification: FS SIMD16 shader: 537 inst, 5 loops, 210652 cycles, 0:0 spills:fills, Promoted 0 constants, compacted 8592 to 7312 bytes.
[shader compiler] notification: VS vec4 shader: 76 inst, 0 loops, 462 cycles, compacted 1216 to 1136 bytes.
[shader compiler] notification: FS SIMD8 shader: 458 inst, 5 loops, 154618 cycles, 0:0 spills:fills, Promoted 0 constants, compacted 7328 to 6032 bytes.
[shader compiler] notification: FS SIMD16 shader: 527 inst, 5 loops, 210604 cycles, 0:0 spills:fills, Promoted 0 constants, compacted 8432 to 7136 bytes.
Resolution: 800 x 500


titlemap - Opening Sequence

[shader compiler] notification: FS SIMD8 shader: 21 inst, 0 loops, 308 cycles, 0:0 spills:fills, Promoted 1 constants, compacted 336 to 288 bytes.
[shader compiler] notification: FS SIMD16 shader: 30 inst, 0 loops, 328 cycles, 0:0 spills:fills, Promoted 1 constants, compacted 480 to 416 bytes.
[shader compiler] notification: VS vec4 shader: 6 inst, 0 loops, 34 cycles, compacted 96 to 80 bytes.
Then I opened e1a9 for some heavy stuff, then I got this:

Code: Select all

]map e1a9


e1a9 - Launch Base

[api] medium severity, performance: Stalling on the GPU for mapping a busy buffer object

[api] medium severity, performance: CPU mapping a busy MapBufferRange BO stalled and took 2.275 ms.

[api] medium severity, performance: CPU mapping a busy MapBufferRange BO stalled and took 1.611 ms.

[api] medium severity, performance: CPU mapping a busy MapBufferRange BO stalled and took 1.734 ms.

[api] medium severity, performance: CPU mapping a busy MapBufferRange BO stalled and took 2.377 ms.

[api] medium severity, performance: CPU mapping a busy MapBufferRange BO stalled and took 2.262 ms.

[api] medium severity, performance: CPU mapping a busy MapBufferRange BO stalled and took 2.311 ms.

[api] medium severity, performance: CPU mapping a busy MapBufferRange BO stalled and took 1.800 ms.

[api] medium severity, performance: CPU mapping a busy MapBufferRange BO stalled and took 5.652 ms.

[api] medium severity, performance: CPU mapping a busy MapBufferRange BO stalled and took 2.340 ms.

[api] medium severity, performance: CPU mapping a busy MapBufferRange BO stalled and took 2.341 ms.

[api] medium severity, performance: CPU mapping a busy MapBufferRange BO stalled and took 1.660 ms.

[api] medium severity, performance: CPU mapping a busy MapBufferRange BO stalled and took 2.117 ms.

[api] medium severity, performance: CPU mapping a busy MapBufferRange BO stalled and took 4.739 ms.

[api] medium severity, performance: CPU mapping a busy MapBufferRange BO stalled and took 2.118 ms.

[api] medium severity, performance: CPU mapping a busy MapBufferRange BO stalled and took 5.508 ms.

[api] medium severity, performance: CPU mapping a busy MapBufferRange BO stalled and took 2.081 ms.

[api] medium severity, performance: CPU mapping a busy MapBufferRange BO stalled and took 2.058 ms.

[api] medium severity, performance: CPU mapping a busy MapBufferRange BO stalled and took 5.993 ms.

[api] medium severity, performance: CPU mapping a busy MapBufferRange BO stalled and took 2.200 ms.

[api] medium severity, performance: CPU mapping a busy MapBufferRange BO stalled and took 2.089 ms.

[api] medium severity, performance: CPU mapping a busy MapBufferRange BO stalled and took 2.098 ms.

[api] medium severity, performance: CPU mapping a busy MapBufferRange BO stalled and took 2.102 ms.

[api] medium severity, performance: CPU mapping a busy MapBufferRange BO stalled and took 2.136 ms.

[api] medium severity, performance: CPU mapping a busy MapBufferRange BO stalled and took 2.142 ms.

[api] medium severity, performance: CPU mapping a busy MapBufferRange BO stalled and took 6.372 ms.

[api] medium severity, performance: CPU mapping a busy MapBufferRange BO stalled and took 2.103 ms.

[api] medium severity, performance: CPU mapping a busy MapBufferRange BO stalled and took 3.619 ms.

[api] medium severity, performance: CPU mapping a busy MapBufferRange BO stalled and took 2.181 ms.

[api] medium severity, performance: CPU mapping a busy MapBufferRange BO stalled and took 2.116 ms.

[api] medium severity, performance: CPU mapping a busy MapBufferRange BO stalled and took 2.147 ms.

[api] medium severity, performance: CPU mapping a busy MapBufferRange BO stalled and took 2.146 ms.

[api] medium severity, performance: CPU mapping a busy MapBufferRange BO stalled and took 2.120 ms.

[api] medium severity, performance: CPU mapping a busy MapBufferRange BO stalled and took 2.150 ms.

[api] medium severity, performance: CPU mapping a busy MapBufferRange BO stalled and took 2.135 ms.

[api] medium severity, performance: CPU mapping a busy MapBufferRange BO stalled and took 2.086 ms.

Max OpenGL debug messages reached. Suppressing further output.
Is this something to be expected?
ibm5155
Posts: 152
Joined: Tue Oct 25, 2011 13:05

Re: Debug support

Post by ibm5155 »

Tracking the high api error from intel resulted in this note:
the problematic call start from "wipe = screen->WipeStartScreen (wipetype);" under d_main.cpp .
On WipeStartScreen with type equals 1, when the function "glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, viewport.left, viewport.top, viewport.width, viewport.height);" (line 165, gl_wipe.cpp) is called, it then redirect to the debug print message.

glCopyTexSubImage2D is receiving the values (GL_TEXTURE_2D,0,0,0,0,0,1024,768);

EDIT:
one Weird thing is happening under the code, the AMD gpu is calling the screen->WipeStartScreen code when you start the game, while the intel gpu only calls that code when you start the map.
EDIT2:
The amd gpu high error happens when you call "mDebug->Update();" inside the OpenGLFrameBuffer::OpenGLFrameBuffer.
But that must be related to the OpenGLFrameBuffer::InitializeState call where there's an "glEnable(GL_TEXTURE_2D);" inside of it.

EDIT3:
On intel side: the game is triggering a breakpoint under "glBindFramebuffer(GL_FRAMEBUFFER, 0);" (line 185 gl_renderbuffers.cpp), but only with intel, if I run the game without visual studio the game just crash..
Last edited by ibm5155 on Sat Aug 20, 2016 17:29, edited 1 time in total.
dpJudas
Developer
Developer
Posts: 798
Joined: Sat Jul 23, 2016 7:53

Re: Debug support

Post by dpJudas »

So far my experience is that level 3 (low severity) and level 4 (notifications) is mostly spam. Think of it like running a compiler with max warning level where anything that could possibly ever be considered an issue is mentioned. Level 1 (high severity) has been actual GL_ERROR producing stuff so far from what I've seen.

The shader compiler messages for example are just MESA reporting back how well it compiled a shader. Unless you're some shader optimization guru this stuff is probably useless info. Personally I'm not. In good Intel tradition it seems Mesa forgot to write out the associated object name linked with the shader, so who knows which shader it was talking about. :)

The stall warning may be important - I'm not sure. It basically means it couldn't map this particular buffer because the GPU is still using it for rendering. That's very bad because the CPU then has to stop and wait until GPU releases its lock. Usually you really don't want to have this.
dpJudas
Developer
Developer
Posts: 798
Joined: Sat Jul 23, 2016 7:53

Re: Debug support

Post by dpJudas »

ibm5155 wrote:glCopyTexSubImage2D is receiving the values (GL_TEXTURE_2D,0,0,0,0,0,1024,768);
That's a clear error. The second argument needs to be a texture handle.

Edit: never mind. Misread the OpenGL reference pages.
User avatar
Saya-chan
Posts: 10
Joined: Mon Dec 26, 2011 16:48
Location: Vigo, Galicia
Contact:

Re: Debug support

Post by Saya-chan »

Edward-san wrote:1) Please fix missing 'string' include in gl_debug.cpp!
Funny. I dashed to this forum to mention this. God I haven't used this account in ages.
dpJudas
Developer
Developer
Posts: 798
Joined: Sat Jul 23, 2016 7:53

Re: Debug support

Post by dpJudas »

Seems the glEnable error listed by all the vendors is due to this line: https://github.com/coelckers/gzdoom/blo ... r.cpp#L160

Graf: what is the best way to fix this? I'm assuming that line is being used by the compatibility or 2.0 stuff. The error in itself is harmless, so this is fairly low priority but might be good to fix anyhow.
User avatar
Graf Zahl
GZDoom Developer
GZDoom Developer
Posts: 7148
Joined: Wed Jul 20, 2005 9:48
Location: Germany
Contact:

Re: Debug support

Post by Graf Zahl »

The easiest way is to do it only 'if (gl.glslversion == 0)'.
_mental_
Developer
Developer
Posts: 259
Joined: Sun Aug 07, 2011 13:36

Re: Debug support

Post by _mental_ »

There are no checks for availability of extensions (and OpenGL version) used by this feature. Setting a debug CVAR to non-zero just crashes GZDoom if the corresponding extension isn't supported.
Is it intentional? I.e. this is debug feature and it isn't worth checking for support.
dpJudas
Developer
Developer
Posts: 798
Joined: Sat Jul 23, 2016 7:53

Re: Debug support

Post by dpJudas »

I mainly meant it for debugging purposes, although I suppose it could check for it and write out if it isn't supported.
User avatar
Graf Zahl
GZDoom Developer
GZDoom Developer
Posts: 7148
Joined: Wed Jul 20, 2005 9:48
Location: Germany
Contact:

Re: Debug support

Post by Graf Zahl »

Crashes are never good, even for this.
dpJudas
Developer
Developer
Posts: 798
Joined: Sat Jul 23, 2016 7:53

Re: Debug support

Post by dpJudas »

Locked

Return to “GZDoom”