[2.2] GL3PlusHardwareVertexBuffer destructor problems

Discussion area about developing with Ogre-Next (2.1, 2.2 and beyond)


marbey
Gnoblar
Posts: 9
Joined: Tue May 04, 2021 4:26 pm
x 1

[2.2] GL3PlusHardwareVertexBuffer destructor problems

Post by marbey »

Hello,

I have some "Access violation reading location" during the destruction of objects in relation with GL3PlusHardwareVertexBuffer (in my case with OverlaySystem) when OGRE_CHECK_GL_ERROR is activate. I activate it because I've memory leak after the closing of application and try to investigate it. Any ideas ?

Code: Select all

GL3PlusHardwareVertexBuffer::~GL3PlusHardwareVertexBuffer()
{
    OGRE_CHECK_GL_ERROR(glDeleteBuffers(1, &mBufferId));
}
In my case, I load the the PBS example, without display any objetcs, and close it.
User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5436
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1343

Re: [2.2] GL3PlusHardwareVertexBuffer destructor problems

Post by dark_sylinc »

Hi!

Please post more information, like:

OS
Ogre version
GPU
Driver version
Ogre.log
Callstack

Thanks.
Cheers!
marbey
Gnoblar
Posts: 9
Joined: Tue May 04, 2021 4:26 pm
x 1

Re: [2.2] GL3PlusHardwareVertexBuffer destructor problems

Post by marbey »

Yes, sorry :D

Version: 2.2.5
Render System: GL3Plus
OS: Win10 64x
GPU: Nvidia Quadro K620

And sometimes, the code stay blocked in a deadloop in

Code: Select all

    void GL3PlusStagingBuffer::wait( GLsync syncObj )
    {
        GLbitfield waitFlags    = 0;
        GLuint64 waitDuration   = 0;
        while( true )
        {
            GLenum waitRet = glClientWaitSync( syncObj, waitFlags, waitDuration ); // return 0
            if( waitRet == GL_ALREADY_SIGNALED || waitRet == GL_CONDITION_SATISFIED )
            {
                return;
            }

            if( waitRet == GL_WAIT_FAILED )
            {
                OGRE_EXCEPT( Exception::ERR_RENDERINGAPI_ERROR,
                             "Failure while waiting for a GL GLFence. Could be out of GPU memory. "
                             "Update your video card drivers. If that doesn't help, "
                             "contact the developers.", "GL3PlusStagingBuffer::wait" );
                return;
            }

            // After the first time, need to start flushing, and wait for a looong time.
            waitFlags = GL_SYNC_FLUSH_COMMANDS_BIT;
            waitDuration = kOneSecondInNanoSeconds;
        }
    }
I don't really know if it's related.

Code: Select all

// ogre.log
Creating resource group General
Creating resource group Internal
Creating resource group Autodetect
SceneManagerFactory for type 'DefaultSceneManager' registered.
Registering ResourceManager for type Material
Registering ResourceManager for type Mesh
Registering ResourceManager for type Mesh2
Registering ResourceManager for type OldSkeleton
MovableObjectFactory for type 'ParticleSystem' registered.
ArchiveFactory for archive type FileSystem registered.
ArchiveFactory for archive type Zip registered.
ArchiveFactory for archive type EmbeddedZip registered.
DDS codec registering
FreeImage version: 3.15.3
This program uses FreeImage, a free, open source image library supporting all common bitmap formats. See http://freeimage.sourceforge.net for details
Supported formats: bmp,ico,jpg,jif,jpeg,jpe,jng,koa,iff,lbm,mng,pbm,pbm,pcd,pcx,pgm,pgm,png,ppm,ppm,ras,tga,targa,tif,tiff,wap,wbmp,wbm,psd,cut,xbm,xpm,gif,hdr,g3,sgi,exr,j2k,j2c,jp2,pfm,pct,pict,pic
OITD codec registering
Registering ResourceManager for type HighLevelGpuProgram
MovableObjectFactory for type 'Decal' registered.
MovableObjectFactory for type 'InternalCubemapProbe' registered.
MovableObjectFactory for type 'Entity' registered.
MovableObjectFactory for type 'Item' registered.
MovableObjectFactory for type 'Light' registered.
MovableObjectFactory for type 'Rectangle2Dv2' registered.
MovableObjectFactory for type 'BillboardSet' registered.
MovableObjectFactory for type 'ManualObject2' registered.
MovableObjectFactory for type 'BillboardChain' registered.
MovableObjectFactory for type 'RibbonTrail' registered.
MovableObjectFactory for type 'WireAabb' registered.
*-*-* OGRE Initialising
*-*-* Version 2.2.5 (Cerberus)
Loading library RenderSystem_Direct3D11_d
Installing plugin: D3D11 RenderSystem
D3D11: Direct3D11 Rendering Subsystem created.
D3D11: Driver Detection Starts
D3D11: "NVIDIA Quadro K620"
D3D11: "Intel(R) HD Graphics 530"
D3D11: "Microsoft Basic Render Driver (software)"
D3D11: Driver Detection Ends
Plugin successfully installed
Loading library RenderSystem_GL3Plus_d
Installing plugin: GL 3+ RenderSystem
OpenGL 3+ Rendering Subsystem created.
Plugin successfully installed
CPU Identifier & Features
-------------------------
 *   CPU ID: GenuineIntel: Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz
 *   Logical cores: 8
 *      SSE: yes
 *     SSE2: yes
 *     SSE3: yes
 *      MMX: yes
 *   MMXEXT: yes
 *    3DNOW: no
 * 3DNOWEXT: no
 *     CMOV: yes
 *      TSC: yes
 *      FPU: yes
 *      PRO: yes
 *       HT: no
-------------------------
*** Starting Win32GL Subsystem ***
GL3PlusRenderSystem::_createRenderWindow "OGRE", 800x600 windowed  miscParams: FSAA=1 Video=Yes externalWindowHandle=1116382 gamma=No left=true reverse_depth=Yes title=OGRE top=true vsync=No 
Created GL 4.5 context
GL Version = 4.5.0.0
GL_VERSION = 4.5.0 NVIDIA 461.09
GL_VENDOR = NVIDIA Corporation
GL_RENDERER = Quadro K620/PCIe/SSE2
GL_EXTENSIONS = 
GL_AMD_multi_draw_indirect
GL_AMD_seamless_cubemap_per_texture
GL_ARB_arrays_of_arrays
GL_ARB_base_instance
GL_ARB_bindless_texture
GL_ARB_blend_func_extended
GL_ARB_buffer_storage
GL_ARB_cl_event
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_conservative_depth
GL_ARB_compute_shader
GL_ARB_compute_variable_group_size
GL_ARB_conditional_render_inverted
GL_ARB_copy_buffer
GL_ARB_copy_image
GL_ARB_cull_distance
GL_ARB_debug_output
GL_ARB_depth_buffer_float
GL_ARB_depth_clamp
GL_ARB_depth_texture
GL_ARB_derivative_control
GL_ARB_direct_state_access
GL_ARB_draw_buffers
GL_ARB_draw_buffers_blend
GL_ARB_draw_indirect
GL_ARB_draw_elements_base_vertex
GL_ARB_draw_instanced
GL_ARB_enhanced_layouts
GL_ARB_ES2_compatibility
GL_ARB_ES3_compatibility
GL_ARB_ES3_1_compatibility
GL_ARB_ES3_2_compatibility
GL_ARB_explicit_attrib_location
GL_ARB_explicit_uniform_location
GL_ARB_fragment_coord_conventions
GL_ARB_fragment_layer_viewport
GL_ARB_fragment_program
GL_ARB_fragment_program_shadow
GL_ARB_fragment_shader
GL_ARB_framebuffer_no_attachments
GL_ARB_framebuffer_object
GL_ARB_framebuffer_sRGB
GL_ARB_geometry_shader4
GL_ARB_get_program_binary
GL_ARB_get_texture_sub_image
GL_ARB_gl_spirv
GL_ARB_gpu_shader5
GL_ARB_gpu_shader_fp64
GL_ARB_gpu_shader_int64
GL_ARB_half_float_pixel
GL_ARB_half_float_vertex
GL_ARB_imaging
GL_ARB_indirect_parameters
GL_ARB_instanced_arrays
GL_ARB_internalformat_query
GL_ARB_internalformat_query2
GL_ARB_invalidate_subdata
GL_ARB_map_buffer_alignment
GL_ARB_map_buffer_range
GL_ARB_multi_bind
GL_ARB_multi_draw_indirect
GL_ARB_multisample
GL_ARB_multitexture
GL_ARB_occlusion_query
GL_ARB_occlusion_query2
GL_ARB_parallel_shader_compile
GL_ARB_pipeline_statistics_query
GL_ARB_pixel_buffer_object
GL_ARB_point_parameters
GL_ARB_point_sprite
GL_ARB_polygon_offset_clamp
GL_ARB_program_interface_query
GL_ARB_provoking_vertex
GL_ARB_query_buffer_object
GL_ARB_robust_buffer_access_behavior
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_atomic_counter_ops
GL_ARB_shader_atomic_counters
GL_ARB_shader_ballot
GL_ARB_shader_bit_encoding
GL_ARB_shader_clock
GL_ARB_shader_draw_parameters
GL_ARB_shader_group_vote
GL_ARB_shader_image_load_store
GL_ARB_shader_image_size
GL_ARB_shader_objects
GL_ARB_shader_precision
GL_ARB_shader_storage_buffer_object
GL_ARB_shader_subroutine
GL_ARB_shader_texture_image_samples
GL_ARB_shader_texture_lod
GL_ARB_shading_language_100
GL_ARB_shading_language_420pack
GL_ARB_shading_language_include
GL_ARB_shading_language_packing
GL_ARB_shadow
GL_ARB_sparse_buffer
GL_ARB_sparse_texture
GL_ARB_spirv_extensions
GL_ARB_stencil_texturing
GL_ARB_sync
GL_ARB_tessellation_shader
GL_ARB_texture_barrier
GL_ARB_texture_border_clamp
GL_ARB_texture_buffer_object
GL_ARB_texture_buffer_object_rgb32
GL_ARB_texture_buffer_range
GL_ARB_texture_compression
GL_ARB_texture_compression_bptc
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_filter_anisotropic
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_stencil8
GL_ARB_texture_storage
GL_ARB_texture_storage_multisample
GL_ARB_texture_swizzle
GL_ARB_texture_view
GL_ARB_timer_query
GL_ARB_transform_feedback2
GL_ARB_transform_feedback3
GL_ARB_transform_feedback_instanced
GL_ARB_transform_feedback_overflow_query
GL_ARB_transpose_matrix
GL_ARB_uniform_buffer_object
GL_ARB_vertex_array_bgra
GL_ARB_vertex_array_object
GL_ARB_vertex_attrib_64bit
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_viewport_array
GL_ARB_window_pos
GL_ATI_draw_buffers
GL_ATI_texture_float
GL_ATI_texture_mirror_once
GL_S3_s3tc
GL_EXT_texture_env_add
GL_EXT_abgr
GL_EXT_bgra
GL_EXT_bindable_uniform
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_Cg_shader
GL_EXT_depth_bounds_test
GL_EXT_direct_state_access
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_EXTX_framebuffer_mixed_formats
GL_EXT_framebuffer_multisample_blit_scaled
GL_EXT_framebuffer_object
GL_EXT_framebuffer_sRGB
GL_EXT_geometry_shader4
GL_EXT_gpu_program_parameters
GL_EXT_gpu_shader4
GL_EXT_multi_draw_arrays
GL_EXT_multiview_tessellation_geometry_shader
GL_EXT_multiview_texture_multisample
GL_EXT_multiview_timer_query
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_clamp
GL_EXT_provoking_vertex
GL_EXT_rescale_normal
GL_EXT_secondary_color
GL_EXT_separate_shader_objects
GL_EXT_separate_specular_color
GL_EXT_shader_image_load_formatted
GL_EXT_shader_image_load_store
GL_EXT_shader_integer_mix
GL_EXT_shadow_funcs
GL_EXT_stencil_two_side
GL_EXT_stencil_wrap
GL_EXT_texture3D
GL_EXT_texture_array
GL_EXT_texture_buffer_object
GL_EXT_texture_compression_dxt1
GL_EXT_texture_compression_latc
GL_EXT_texture_compression_rgtc
GL_EXT_texture_compression_s3tc
GL_EXT_texture_cube_map
GL_EXT_texture_edge_clamp
GL_EXT_texture_env_combine
GL_EXT_texture_env_dot3
GL_EXT_texture_filter_anisotropic
GL_EXT_texture_integer
GL_EXT_texture_lod
GL_EXT_texture_lod_bias
GL_EXT_texture_mirror_clamp
GL_EXT_texture_object
GL_EXT_texture_shadow_lod
GL_EXT_texture_shared_exponent
GL_EXT_texture_sRGB
GL_EXT_texture_sRGB_R8
GL_EXT_texture_sRGB_decode
GL_EXT_texture_storage
GL_EXT_texture_swizzle
GL_EXT_timer_query
GL_EXT_transform_feedback2
GL_EXT_vertex_array
GL_EXT_vertex_array_bgra
GL_EXT_vertex_attrib_64bit
GL_EXT_window_rectangles
GL_EXT_import_sync_object
GL_IBM_rasterpos_clip
GL_IBM_texture_mirrored_repeat
GL_KHR_context_flush_control
GL_KHR_debug
GL_EXT_memory_object
GL_EXT_memory_object_win32
GL_EXT_win32_keyed_mutex
GL_KHR_parallel_shader_compile
GL_KHR_no_error
GL_KHR_robust_buffer_access_behavior
GL_KHR_robustness
GL_EXT_semaphore
GL_EXT_semaphore_win32
GL_NV_timeline_semaphore
GL_KHR_shader_subgroup
GL_KTX_buffer_region
GL_NV_alpha_to_coverage_dither_control
GL_NV_bindless_multi_draw_indirect
GL_NV_bindless_multi_draw_indirect_count
GL_NV_bindless_texture
GL_NV_blend_equation_advanced
GL_NV_blend_equation_advanced_coherent
GL_NV_blend_minmax_factor
GL_NV_blend_square
GL_NV_command_list
GL_NV_compute_program5
GL_NV_conditional_render
GL_NV_copy_depth_to_color
GL_NV_copy_image
GL_NV_deep_texture3D
GL_NV_depth_buffer_float
GL_NV_depth_clamp
GL_NV_draw_texture
GL_NV_draw_vulkan_image
GL_NV_ES1_1_compatibility
GL_NV_ES3_1_compatibility
GL_NV_explicit_multisample
GL_NV_feature_query
GL_NV_fence
GL_NV_float_buffer
GL_NV_fog_distance
GL_NV_fragment_program
GL_NV_fragment_program_option
GL_NV_fragment_program2
GL_NV_framebuffer_multisample_coverage
GL_NV_geometry_shader4
GL_NV_gpu_program4
GL_NV_internalformat_sample_query
GL_NV_gpu_program4_1
GL_NV_gpu_program5
GL_NV_gpu_program5_mem_extended
GL_NV_gpu_program_fp64
GL_NV_gpu_shader5
GL_NV_half_float
GL_NV_light_max_exponent
GL_NV_multisample_coverage
GL_NV_multisample_filter_hint
GL_NV_occlusion_query
GL_NV_packed_depth_stencil
GL_NV_parameter_buffer_object
GL_NV_parameter_buffer_object2
GL_NV_path_rendering
GL_NV_pixel_data_range
GL_NV_point_sprite
GL_NV_primitive_restart
GL_NV_query_resource
GL_NV_query_resource_tag
GL_NV_register_combiners
GL_NV_register_combiners2
GL_NV_shader_atomic_counters
GL_NV_shader_atomic_float
GL_NV_shader_atomic_int64
GL_NV_shader_buffer_load
GL_NV_shader_storage_buffer_object
GL_NV_shader_subgroup_partitioned
GL_NV_texgen_reflection
GL_NV_texture_barrier
GL_NV_texture_compression_vtc
GL_NV_texture_env_combine4
GL_NV_texture_multisample
GL_NV_texture_rectangle
GL_NV_texture_rectangle_compressed
GL_NV_texture_shader
GL_NV_texture_shader2
GL_NV_texture_shader3
GL_NV_transform_feedback
GL_NV_transform_feedback2
GL_NV_uniform_buffer_unified_memory
GL_NV_vertex_array_range
GL_NV_vertex_array_range2
GL_NV_vertex_attrib_integer_64bit
GL_NV_vertex_buffer_unified_memory
GL_NV_vertex_program
GL_NV_vertex_program1_1
GL_NV_vertex_program2
GL_NV_vertex_program2_option
GL_NV_vertex_program3
GL_NVX_conditional_render
GL_NVX_linked_gpu_multicast
GL_NV_gpu_multicast
GL_NVX_gpu_multicast2
GL_NVX_progress_fence
GL_NVX_gpu_memory_info
GL_NVX_multigpu_info
GL_NVX_nvenc_interop
GL_NV_shader_thread_group
GL_NV_shader_thread_shuffle
GL_KHR_blend_equation_advanced
GL_KHR_blend_equation_advanced_coherent
GL_OVR_multiview
GL_OVR_multiview2
GL_SGIS_generate_mipmap
GL_SGIS_texture_lod
GL_SGIX_depth_texture
GL_SGIX_shadow
GL_SUN_slice_accum
GL_WIN_swap_hint
WGL_EXT_swap_control
Supported WGL extensions: WGL_ARB_buffer_region WGL_ARB_create_context WGL_ARB_create_context_no_error WGL_ARB_create_context_profile WGL_ARB_create_context_robustness WGL_ARB_context_flush_control WGL_ARB_extensions_string WGL_ARB_make_current_read WGL_ARB_multisample WGL_ARB_pbuffer WGL_ARB_pixel_format WGL_ARB_pixel_format_float WGL_ARB_render_texture WGL_ATI_pixel_format_float WGL_EXT_colorspace WGL_EXT_create_context_es_profile WGL_EXT_create_context_es2_profile WGL_EXT_extensions_string WGL_EXT_framebuffer_sRGB WGL_EXT_pixel_format_packed_float WGL_EXT_swap_control WGL_EXT_swap_control_tear WGL_NVX_DX_interop WGL_NV_DX_interop WGL_NV_DX_interop2 WGL_NV_copy_image WGL_NV_delay_before_swap WGL_NV_float_buffer WGL_NV_gpu_affinity WGL_NV_multisample_coverage WGL_NV_multigpu_context WGL_NV_render_depth_texture WGL_NV_render_texture_rectangle WGL_NV_swap_group 
**************************************
***   OpenGL 3+ Renderer Started   ***
**************************************
Registering ResourceManager for type GpuProgram
RenderSystem capabilities
-------------------------
RenderSystem Name: OpenGL 3+ Rendering Subsystem
GPU Vendor: nvidia
Device Name: Quadro K620/PCIe/SSE2
Driver Version: 4.5.0.0
 * Fixed function pipeline: no
 * Hardware generation of mipmaps: yes
 * Texture blending: yes
 * Anisotropic texture filtering: yes
 * Dot product texture operation: yes
 * Cube mapping: yes
 * Hardware stencil buffer: yes
   - Stencil depth: 8
   - Two sided stencil support: yes
   - Wrap stencil values: yes
 * Hardware vertex / index buffers: yes
 * 32-bit index buffers: yes
 * Vertex programs: yes
 * Number of floating-point constants for vertex programs: 4096
 * Number of integer constants for vertex programs: 4096
 * Number of boolean constants for vertex programs: 4096
 * Fragment programs: yes
 * Number of floating-point constants for fragment programs: 4096
 * Number of integer constants for fragment programs: 4096
 * Number of boolean constants for fragment programs: 4096
 * Geometry programs: yes
 * Number of floating-point constants for geometry programs: 2048
 * Number of integer constants for geometry programs: 2048
 * Number of boolean constants for geometry programs: 2048
 * Tessellation Hull programs: yes
 * Number of floating-point constants for tessellation hull programs: 2048
 * Number of integer constants for tessellation hull programs: 2048
 * Number of boolean constants for tessellation hull programs: 2048
 * Tessellation Domain programs: yes
 * Number of floating-point constants for tessellation domain programs: 2048
 * Number of integer constants for tessellation domain programs: 2048
 * Number of boolean constants for tessellation domain programs: 2048
 * Compute programs: yes
 * Number of floating-point constants for compute programs: 2048
 * Number of integer constants for compute programs: 2048
 * Number of boolean constants for compute programs: 2048
 * Supported Shader Profiles: glsl glsl130 glsl140 glsl150 glsl330 glsl400 glsl410 glsl420 glsl430 glsl440
 * Texture Compression: yes
   - DXT: yes
   - VTC: yes
   - PVRTC: no
   - ATC: no
   - ETC1: no
   - ETC2: yes
   - BC4/BC5: yes
   - BC6H/BC7: yes
   - ASTC: no
 * Hardware Occlusion Query: yes
 * User clip planes: yes
 * VET_UBYTE4 vertex element type: yes
 * Infinite far plane projection: yes
 * Hardware render-to-texture: yes
 * Floating point textures: yes
 * Non-power-of-two textures: yes
 * 1d textures: yes
 * Volume textures: yes
 * Max Texture resolution (2D) 16384
 * Max Texture resolution (3D) 4096
 * Max Texture resolution (Cubemaps) 16384
 * Multiple Render Targets: 8
   - With different bit depths: yes
 * Point Sprites: yes
 * Extended point parameters: yes
 * Max Point Size: 2047
 * Vertex texture fetch: yes
 * Number of world matrices: 0
 * Number of texture units: 16
 * Stencil buffer depth: 8
 * Number of vertex blend matrices: 0
   - Max vertex textures: 32
   - Vertex textures shared: yes
 * Render to Vertex Buffer : yes
 * Hardware Atomic Counters: yes
 * Compute max threads per threadgroup per axis: 1024, 1024, 64
 * Compute max threads per threadgroup total: 1024
 * GL 1.5 without VBO workaround: no
 * Frame Buffer objects: yes
 * Frame Buffer objects (ARB extension): no
 * Frame Buffer objects (ATI extension): no
 * PBuffer support: no
 * GL 1.5 without HW-occlusion workaround: no
 * Vertex Array Objects: yes
 * Separate shader objects: no
 * Using Reverse Z: yes
DefaultWorkQueue('Root') initialising on thread main.
Particle Renderer Type 'billboard' registered
OverlayElementFactory for type Panel registered.
OverlayElementFactory for type BorderPanel registered.
OverlayElementFactory for type TextArea registered.
Registering ResourceManager for type Font
Creating resource group Essential
Added resource location 'D:\Workspaces\BinDebug64_2019\Ogre\Media/packs/DebugPbs.zip' of type 'Zip' to resource group 'Essential'
Added resource location 'D:\Workspaces\BinDebug64_2019\Ogre\Media/Hlms/Common/Any' of type 'FileSystem' to resource group 'General'
Added resource location 'D:\Workspaces\BinDebug64_2019\Ogre\Media/Hlms/Common/GLSL' of type 'FileSystem' to resource group 'General'
Added resource location 'D:\Workspaces\BinDebug64_2019\Ogre\Media/Hlms/Common/HLSL' of type 'FileSystem' to resource group 'General'
Added resource location 'D:\Workspaces\BinDebug64_2019\Ogre\Media/Hlms/Common/Metal' of type 'FileSystem' to resource group 'General'
Added resource location 'D:\Workspaces\BinDebug64_2019\Ogre\Media/2.0/scripts/materials/Common' of type 'FileSystem' to resource group 'General'
Added resource location 'D:\Workspaces\BinDebug64_2019\Ogre\Media/2.0/scripts/materials/Common/Any' of type 'FileSystem' to resource group 'General'
Added resource location 'D:\Workspaces\BinDebug64_2019\Ogre\Media/2.0/scripts/materials/Common/GLSL' of type 'FileSystem' to resource group 'General'
Added resource location 'D:\Workspaces\BinDebug64_2019\Ogre\Media/2.0/scripts/materials/Common/GLSLES' of type 'FileSystem' to resource group 'General'
Added resource location 'D:\Workspaces\BinDebug64_2019\Ogre\Media/2.0/scripts/materials/Common/HLSL' of type 'FileSystem' to resource group 'General'
Added resource location 'D:\Workspaces\BinDebug64_2019\Ogre\Media/2.0/scripts/materials/Common/Metal' of type 'FileSystem' to resource group 'General'
Added resource location 'D:\Workspaces\BinDebug64_2019\Ogre\Media/2.0/scripts/materials/TutorialSky_Postprocess' of type 'FileSystem' to resource group 'General'
Added resource location 'D:\Workspaces\BinDebug64_2019\Ogre\Media/Compute/Algorithms/IBL' of type 'FileSystem' to resource group 'General'
Added resource location 'D:\Workspaces\BinDebug64_2019\Ogre\Media/Compute/Tools/Any' of type 'FileSystem' to resource group 'General'
Creating resource group Popular
Added resource location 'D:\Workspaces\BinDebug64_2019\Ogre\Media/models' of type 'FileSystem' to resource group 'Popular'
Added resource location 'D:\Workspaces\BinDebug64_2019\Ogre\Media/packs/textures' of type 'FileSystem' to resource group 'Popular'
Loading HlmsDiskCache from hlmsDiskCache1.bin
Applying HlmsDiskCache 1
Loading HlmsDiskCache from hlmsDiskCache3.bin
Applying HlmsDiskCache 3
Loading HlmsDiskCache from hlmsDiskCache4.bin
Applying HlmsDiskCache 4
Creating resource group Mesh
Creating resource group Cloud
Parsing scripts for resource group Autodetect
Finished parsing scripts for resource group Autodetect
Creating resources for group Autodetect
All done
Parsing scripts for resource group Essential
Parsing script PbsMaterials.material
Parsing script OgreRendererVRWorkspace.compositor
Parsing script ShadowMapDebugging.compositor
Parsing script Tutorial_DynamicCubemap.compositor
Parsing script DebugFont.fontdef
Finished parsing scripts for resource group Essential
Creating resources for group Essential
All done
Parsing scripts for resource group General
Parsing script Quad.program
Parsing script Copyback.material
Parsing script DepthUtils.material
Parsing script DPM.material
Parsing script DPSM.material
Parsing script EsmGaussianBlurLogFilter.material
Parsing script HiddenAreaMeshVr.material
Parsing script PccDepthCompressor.material
Parsing script RadialDensityMask.material
Parsing script Sky.material
Parsing script SkyPostprocess.material
Parsing script EsmGaussianBlurLogFilter.material.json
Parsing script Mipmaps.material.json
Parsing script IBL.material.json
Finished parsing scripts for resource group General
Creating resources for group General
All done
Parsing scripts for resource group Internal
Finished parsing scripts for resource group Internal
Creating resources for group Internal
All done
Parsing scripts for resource group Cloud
Finished parsing scripts for resource group Cloud
Creating resources for group Cloud
All done
Parsing scripts for resource group Mesh
Finished parsing scripts for resource group Mesh
Creating resources for group Mesh
All done
Parsing scripts for resource group Popular
Finished parsing scripts for resource group Popular
Creating resources for group Popular
All done
Clearing resource group Mesh
Finished clearing resource group Mesh
Unloading resource group Mesh
Finished unloading resource group Mesh
Clearing resource group Cloud
Finished clearing resource group Cloud
Unloading resource group Cloud
Finished unloading resource group Cloud
Initialising resource group Mesh
Initialising resource group Cloud
Mesh: Loading Cube_d.mesh.
Mesh: Loading Sphere1000.mesh.
Font DebugFont using texture size 512x512
Info: Freetype returned null for character 127 in font DebugFont
Info: Freetype returned null for character 128 in font DebugFont
Info: Freetype returned null for character 129 in font DebugFont
Info: Freetype returned null for character 130 in font DebugFont
Info: Freetype returned null for character 131 in font DebugFont
Info: Freetype returned null for character 132 in font DebugFont
Info: Freetype returned null for character 133 in font DebugFont
Info: Freetype returned null for character 134 in font DebugFont
Info: Freetype returned null for character 135 in font DebugFont
Info: Freetype returned null for character 136 in font DebugFont
Info: Freetype returned null for character 137 in font DebugFont
Info: Freetype returned null for character 138 in font DebugFont
Info: Freetype returned null for character 139 in font DebugFont
Info: Freetype returned null for character 140 in font DebugFont
Info: Freetype returned null for character 141 in font DebugFont
Info: Freetype returned null for character 142 in font DebugFont
Info: Freetype returned null for character 143 in font DebugFont
Info: Freetype returned null for character 144 in font DebugFont
Info: Freetype returned null for character 145 in font DebugFont
Info: Freetype returned null for character 146 in font DebugFont
Info: Freetype returned null for character 147 in font DebugFont
Info: Freetype returned null for character 148 in font DebugFont
Info: Freetype returned null for character 149 in font DebugFont
Info: Freetype returned null for character 150 in font DebugFont
Info: Freetype returned null for character 151 in font DebugFont
Info: Freetype returned null for character 152 in font DebugFont
Info: Freetype returned null for character 153 in font DebugFont
Info: Freetype returned null for character 154 in font DebugFont
Info: Freetype returned null for character 155 in font DebugFont
Info: Freetype returned null for character 156 in font DebugFont
Info: Freetype returned null for character 157 in font DebugFont
Info: Freetype returned null for character 158 in font DebugFont
Info: Freetype returned null for character 159 in font DebugFont
Info: Freetype returned null for character 160 in font DebugFont
OpenGL:performance(medium) 131154: Pixel-path performance warning: Pixel transfer is synchronized with 3D rendering.
OpenGL:performance(medium) 131154: Pixel-path performance warning: Pixel transfer is synchronized with 3D rendering.
OpenGL:performance(medium) 131154: Pixel-path performance warning: Pixel transfer is synchronized with 3D rendering.
OpenGL:performance(medium) 131154: Pixel-path performance warning: Pixel transfer is synchronized with 3D rendering.
OpenGL:performance(medium) 131154: Pixel-path performance warning: Pixel transfer is synchronized with 3D rendering.
OpenGL:performance(medium) 131154: Pixel-path performance warning: Pixel transfer is synchronized with 3D rendering.
Saving HlmsDiskCache to hlmsDiskCache1.bin
Saving HlmsDiskCache to hlmsDiskCache3.bin
Saving HlmsDiskCache to hlmsDiskCache4.bin
Unregistering ResourceManager for type Font
DefaultWorkQueue('Root') shutting down on thread main.
*-*-* OGRE Shutdown
Unregistering ResourceManager for type OldSkeleton
Unregistering ResourceManager for type Mesh2
Unregistering ResourceManager for type Mesh
Unregistering ResourceManager for type Material
Unregistering ResourceManager for type HighLevelGpuProgram
Uninstalling plugin: GL 3+ RenderSystem
Unregistering ResourceManager for type GpuProgram
*** Stopping Win32GL Subsystem ***
Plugin successfully uninstalled
Unloading library RenderSystem_GL3Plus_d
Uninstalling plugin: D3D11 RenderSystem
D3D11: Shutting down cleanly.
D3D11: Direct3D11 Rendering Subsystem destroyed.
Plugin successfully uninstalled
Unloading library RenderSystem_Direct3D11_d

Code: Select all

// Call Stack
RenderSystem_GL3Plus_d.dll!Ogre::v1::GL3PlusHardwareVertexBuffer::~GL3PlusHardwareVertexBuffer() Line 64	C++
[External Code]	
OgreMain_d.dll!Ogre::SharedPtrInfoDelete<Ogre::v1::HardwareVertexBuffer>::~SharedPtrInfoDelete<Ogre::v1::HardwareVertexBuffer>() Line 79	C++
[External Code]	
OgreMain_d.dll!Ogre::SharedPtr<Ogre::v1::HardwareVertexBuffer>::destroy() Line 344	C++
OgreMain_d.dll!Ogre::SharedPtr<Ogre::v1::HardwareVertexBuffer>::release() Line 333	C++
OgreMain_d.dll!Ogre::SharedPtr<Ogre::v1::HardwareVertexBuffer>::~SharedPtr<Ogre::v1::HardwareVertexBuffer>() Line 241	C++
[External Code]	
OgreMain_d.dll!Ogre::v1::VertexBufferBinding::unsetAllBindings() Line 943	C++
OgreMain_d.dll!Ogre::v1::VertexBufferBinding::~VertexBufferBinding() Line 917	C++
[External Code]	
OgreMain_d.dll!Ogre::v1::HardwareBufferManagerBase::destroyVertexBufferBindingImpl(Ogre::v1::VertexBufferBinding * binding) Line 134	C++
OgreMain_d.dll!Ogre::v1::HardwareBufferManagerBase::destroyVertexBufferBinding(Ogre::v1::VertexBufferBinding * binding) Line 115	C++
OgreMain_d.dll!Ogre::v1::HardwareBufferManager::destroyVertexBufferBinding(Ogre::v1::VertexBufferBinding * binding) Line 484	C++
OgreMain_d.dll!Ogre::v1::VertexData::~VertexData() Line 68	C++
[External Code]	
OgreMain_d.dll!Ogre::v1::Rectangle2D::~Rectangle2D() Line 186	C++
[External Code]	
OgreMain_d.dll!Ogre::CompositorManager2::~CompositorManager2() Line 200	C++
[External Code]	
OgreMain_d.dll!Ogre::Root::shutdown() Line 1184	C++
OgreMain_d.dll!Ogre::Root::~Root() Line 340	C++
[External Code]	
OgreImpl.dll!OgreRenderer::Close() Line 874	C++
AppMFC.exe!AppMFCView::OnDestroy() Line 782	C++
[External Code]	
AppMFC.exe!wWinMain(HINSTANCE__ * hInstance, HINSTANCE__ * hPrevInstance, wchar_t * lpCmdLine, int nCmdShow) Line 26	C++
[External Code]	
User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5436
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1343

Re: [2.2] GL3PlusHardwareVertexBuffer destructor problems

Post by dark_sylinc »

My guess based on your callstack is that all the render windows have been destroyed by the time you reach there which caused GL to shutdown too early.

Due to ancient legacy reasons Ogre wants the main render window always alive. A quick workaround is to create a 1x1 window first when initializing Ogre, and hiding it.
marbey
Gnoblar
Posts: 9
Joined: Tue May 04, 2021 4:26 pm
x 1

Re: [2.2] GL3PlusHardwareVertexBuffer destructor problems

Post by marbey »

Thanks, now, I can see OpenGL errors, and find a Ogre memory leak when created Ogre::RaySceneQuery by the way.
But I've still some errors

Code: Select all

// ogre.log
Ogre: GL3PlusRenderSystem::_createRenderWindow "TmpHidden", 1x1 windowed  miscParams: externalWindowHandle=1904164 
The thread 0x5154 has exited with code 0 (0x0).
The thread 0x61c4 has exited with code 0 (0x0).
The thread 0x6244 has exited with code 0 (0x0).
Ogre: Created GL 4.5 context
Ogre: Clearing resource group Mesh
Ogre: Finished clearing resource group Mesh
Ogre: Unloading resource group Mesh
Ogre: Finished unloading resource group Mesh
Ogre: Clearing resource group Cloud
Ogre: Finished clearing resource group Cloud
Ogre: Unloading resource group Cloud
Ogre: Finished unloading resource group Cloud
Ogre: Initialising resource group Mesh
Ogre: Initialising resource group Cloud
Ogre: Unregistering ResourceManager for type Font
Ogre: DefaultWorkQueue('Root') shutting down on thread main.
Ogre: *-*-* OGRE Shutdown
Ogre: OpenGL error 0x0502 GL_INVALID_OPERATION in Ogre::GL3PlusBufferInterface::unmap at line 134 for glBindBuffer

Ogre: OpenGL error 0x0502 GL_INVALID_OPERATION in Ogre::GL3PlusDynamicBuffer::flush at line 105 for glFlushMappedBufferRange

The thread 0x4df8 has exited with code 0 (0x0).
The thread 0x2ad0 has exited with code 0 (0x0).
The thread 0x43cc has exited with code 0 (0x0).
Ogre: Unregistering ResourceManager for type OldSkeleton
Ogre: Unregistering ResourceManager for type Mesh2
Ogre: Unregistering ResourceManager for type Mesh
Ogre: Unregistering ResourceManager for type Material
Ogre: OpenGL error 0x0502 GL_INVALID_OPERATION in Ogre::GL3PlusBufferInterface::unmap at line 134 for glBindBuffer

Ogre: OpenGL error 0x0502 GL_INVALID_OPERATION in Ogre::GL3PlusDynamicBuffer::flush at line 105 for glFlushMappedBufferRange

Ogre: OpenGL error 0x0502 GL_INVALID_OPERATION in Ogre::GL3PlusBufferInterface::unmap at line 134 for glBindBuffer

Ogre: OpenGL error 0x0502 GL_INVALID_OPERATION in Ogre::GL3PlusDynamicBuffer::flush at line 105 for glFlushMappedBufferRange

Ogre: OpenGL error 0x0502 GL_INVALID_OPERATION in Ogre::GL3PlusBufferInterface::unmap at line 134 for glBindBuffer

Ogre: OpenGL error 0x0502 GL_INVALID_OPERATION in Ogre::GL3PlusDynamicBuffer::flush at line 105 for glFlushMappedBufferRange

Ogre: OpenGL error 0x0502 GL_INVALID_OPERATION in Ogre::GL3PlusBufferInterface::unmap at line 134 for glBindBuffer

Ogre: OpenGL error 0x0502 GL_INVALID_OPERATION in Ogre::GL3PlusDynamicBuffer::flush at line 105 for glFlushMappedBufferRange

Ogre: OpenGL error 0x0502 GL_INVALID_OPERATION in Ogre::GL3PlusBufferInterface::unmap at line 134 for glBindBuffer

Ogre: OpenGL error 0x0502 GL_INVALID_OPERATION in Ogre::GL3PlusDynamicBuffer::flush at line 105 for glFlushMappedBufferRange

Ogre: OpenGL error 0x0502 GL_INVALID_OPERATION in Ogre::GL3PlusDynamicBuffer::unmap at line 118 for glUnmapBuffer

Ogre: OpenGL error 0x0502 GL_INVALID_OPERATION in Ogre::GL3PlusBufferInterface::unmap at line 134 for glBindBuffer

Ogre: OpenGL error 0x0502 GL_INVALID_OPERATION in Ogre::GL3PlusDynamicBuffer::flush at line 105 for glFlushMappedBufferRange

Ogre: OpenGL error 0x0502 GL_INVALID_OPERATION in Ogre::GL3PlusDynamicBuffer::unmap at line 118 for glUnmapBuffer

Ogre: Unregistering ResourceManager for type HighLevelGpuProgram
Ogre: Uninstalling plugin: GL 3+ RenderSystem
Ogre: OpenGL error 0x0502 GL_INVALID_OPERATION in Ogre::GL3PlusStagingTexture::stopMapRegion at line 107 for glBindBuffer

Ogre: OpenGL error 0x0502 GL_INVALID_OPERATION in Ogre::GL3PlusDynamicBuffer::flush at line 105 for glFlushMappedBufferRange

Ogre: OpenGL error 0x0502 GL_INVALID_OPERATION in Ogre::GL3PlusStagingTexture::stopMapRegion at line 107 for glBindBuffer

Ogre: OpenGL error 0x0502 GL_INVALID_OPERATION in Ogre::GL3PlusDynamicBuffer::flush at line 105 for glFlushMappedBufferRange

Ogre: OpenGL error 0x0502 GL_INVALID_OPERATION in Ogre::GL3PlusStagingTexture::stopMapRegion at line 107 for glBindBuffer

Ogre: OpenGL error 0x0502 GL_INVALID_OPERATION in Ogre::GL3PlusDynamicBuffer::flush at line 105 for glFlushMappedBufferRange

Ogre: OpenGL error 0x0502 GL_INVALID_OPERATION in Ogre::GL3PlusStagingTexture::stopMapRegion at line 107 for glBindBuffer

Ogre: OpenGL error 0x0502 GL_INVALID_OPERATION in Ogre::GL3PlusDynamicBuffer::flush at line 105 for glFlushMappedBufferRange

Ogre: OpenGL error 0x0502 GL_INVALID_OPERATION in Ogre::GL3PlusStagingTexture::_unmapBuffer at line 69 for glBindBuffer

Ogre: OpenGL error 0x0502 GL_INVALID_OPERATION in Ogre::GL3PlusDynamicBuffer::unmap at line 118 for glUnmapBuffer

Ogre: OpenGL error 0x0502 GL_INVALID_OPERATION in Ogre::GL3PlusStagingTexture::_unmapBuffer at line 69 for glBindBuffer

Ogre: OpenGL error 0x0502 GL_INVALID_OPERATION in Ogre::GL3PlusDynamicBuffer::unmap at line 118 for glUnmapBuffer

Ogre: OpenGL error 0x0502 GL_INVALID_OPERATION in Ogre::GL3PlusStagingTexture::_unmapBuffer at line 69 for glBindBuffer

Ogre: OpenGL error 0x0502 GL_INVALID_OPERATION in Ogre::GL3PlusDynamicBuffer::unmap at line 118 for glUnmapBuffer

Ogre: OpenGL error 0x0502 GL_INVALID_OPERATION in Ogre::GL3PlusStagingTexture::_unmapBuffer at line 69 for glBindBuffer

Ogre: OpenGL error 0x0502 GL_INVALID_OPERATION in Ogre::GL3PlusDynamicBuffer::unmap at line 118 for glUnmapBuffer

Ogre: OpenGL error 0x0502 GL_INVALID_OPERATION in Ogre::GLSLMonolithicProgram::~GLSLMonolithicProgram at line 101 for glDeleteProgram

Ogre: OpenGL error 0x0502 GL_INVALID_OPERATION in Ogre::GLSLProgram::~GLSLProgram at line 84 for glDeleteProgram

Ogre: OpenGL error 0x0502 GL_INVALID_OPERATION in Ogre::GL3PlusOldVertexArrayObject::~GL3PlusOldVertexArrayObject at line 53 for glDeleteVertexArrays

Ogre: OpenGL error 0x0502 GL_INVALID_OPERATION in Ogre::GLSLMonolithicProgram::~GLSLMonolithicProgram at line 101 for glDeleteProgram

Ogre: OpenGL error 0x0502 GL_INVALID_OPERATION in Ogre::GLSLProgram::~GLSLProgram at line 84 for glDeleteProgram

Ogre: OpenGL error 0x0502 GL_INVALID_OPERATION in Ogre::GL3PlusOldVertexArrayObject::~GL3PlusOldVertexArrayObject at line 53 for glDeleteVertexArrays

Ogre: OpenGL error 0x0502 GL_INVALID_OPERATION in Ogre::GLSLMonolithicProgram::~GLSLMonolithicProgram at line 101 for glDeleteProgram

Ogre: OpenGL error 0x0502 GL_INVALID_OPERATION in Ogre::GLSLProgram::~GLSLProgram at line 84 for glDeleteProgram

Ogre: OpenGL error 0x0502 GL_INVALID_OPERATION in Ogre::GL3PlusOldVertexArrayObject::~GL3PlusOldVertexArrayObject at line 53 for glDeleteVertexArrays

Ogre: OpenGL error 0x0502 GL_INVALID_OPERATION in Ogre::GLSLMonolithicProgram::~GLSLMonolithicProgram at line 101 for glDeleteProgram

Ogre: OpenGL error 0x0502 GL_INVALID_OPERATION in Ogre::GLSLProgram::~GLSLProgram at line 84 for glDeleteProgram

Ogre: OpenGL error 0x0502 GL_INVALID_OPERATION in Ogre::GL3PlusOldVertexArrayObject::~GL3PlusOldVertexArrayObject at line 53 for glDeleteVertexArrays

Ogre: OpenGL error 0x0502 GL_INVALID_OPERATION in Ogre::GLSLMonolithicProgram::~GLSLMonolithicProgram at line 101 for glDeleteProgram

Ogre: OpenGL error 0x0502 GL_INVALID_OPERATION in Ogre::GLSLProgram::~GLSLProgram at line 84 for glDeleteProgram

Ogre: OpenGL error 0x0502 GL_INVALID_OPERATION in Ogre::GL3PlusOldVertexArrayObject::~GL3PlusOldVertexArrayObject at line 53 for glDeleteVertexArrays

Ogre: OpenGL error 0x0502 GL_INVALID_OPERATION in Ogre::GLSLMonolithicProgram::~GLSLMonolithicProgram at line 101 for glDeleteProgram

Ogre: OpenGL error 0x0502 GL_INVALID_OPERATION in Ogre::GLSLProgram::~GLSLProgram at line 84 for glDeleteProgram
The thread 0x6684 has exited with code 0 (0x0).

Ogre: OpenGL error 0x0502 GL_INVALID_OPERATION in Ogre::GL3PlusOldVertexArrayObject::~GL3PlusOldVertexArrayObject at line 53 for glDeleteVertexArrays

Ogre: OpenGL error 0x0502 GL_INVALID_OPERATION in Ogre::GLSLMonolithicProgram::~GLSLMonolithicProgram at line 101 for glDeleteProgram

Ogre: OpenGL error 0x0502 GL_INVALID_OPERATION in Ogre::GLSLProgram::~GLSLProgram at line 84 for glDeleteProgram

Ogre: OpenGL error 0x0502 GL_INVALID_OPERATION in Ogre::GL3PlusOldVertexArrayObject::~GL3PlusOldVertexArrayObject at line 53 for glDeleteVertexArrays

Ogre: Unregistering ResourceManager for type GpuProgram
Ogre: OpenGL error 0x0502 GL_INVALID_OPERATION in Ogre::GL3PlusRenderSystem::shutdown at line 702 for glDeleteFramebuffers

Ogre: *** Stopping Win32GL Subsystem ***
Ogre: OpenGL error 0x0502 GL_INVALID_OPERATION in Ogre::GL3PlusRenderSystem::shutdown at line 714 for glBindVertexArray

Ogre: OpenGL error 0x0502 GL_INVALID_OPERATION in Ogre::GL3PlusRenderSystem::shutdown at line 715 for glDeleteVertexArrays

Ogre: Plugin successfully uninstalled
Ogre: Unloading library RenderSystem_GL3Plus_d
Ogre: Uninstalling plugin: D3D11 RenderSystem
Ogre: D3D11: Shutting down cleanly.
Ogre: D3D11: Direct3D11 Rendering Subsystem destroyed.
Ogre: Plugin successfully uninstalled
Ogre: Unloading library RenderSystem_Direct3D11_d
The thread 0x3da0 has exited with code 0 (0x0).
The thread 0x3f44 has exited with code 0 (0x0).
The thread 0x1e30 has exited with code 0 (0x0).
The thread 0x1428 has exited with code 0 (0x0).
The thread 0x4be4 has exited with code 0 (0x0).
The thread 0x28f8 has exited with code 0 (0x0).
Ogre Memory: No memory leaks
Dumping objects ->
{510780} normal block at 0x0000014063EEDB30, 8 bytes long.
 Data: <        > 18 E7 BE AB FE 7F 00 00 
Object dump complete.
The program '[26420] AppMFC.exe' has exited with code 0 (0x0).
And the call stack for the first OpenGL error

Code: Select all

RenderSystem_GL3Plus_d.dll!Ogre::GL3PlusBufferInterface::unmap(Ogre::UnmapOptions unmapOption, unsigned __int64 flushStartElem, unsigned __int64 flushSizeElem) Line 135	C++
OgreMain_d.dll!Ogre::BufferPacked::unmap(Ogre::UnmapOptions unmapOption, unsigned __int64 flushStartElem, unsigned __int64 flushSizeElem) Line 217	C++
OgreMain_d.dll!Ogre::RenderQueue::~RenderQueue() Line 127	C++
[External Code]	
OgreMain_d.dll!Ogre::SceneManager::~SceneManager() Line 268	C++
OgreMain_d.dll!Ogre::DefaultSceneManager::~DefaultSceneManager() Line 340	C++
[External Code]	
OgreMain_d.dll!Ogre::DefaultSceneManagerFactory::destroyInstance(Ogre::SceneManager * instance) Line 329	C++
OgreMain_d.dll!Ogre::SceneManagerEnumerator::~SceneManagerEnumerator() Line 69	C++
[External Code]	
OgreMain_d.dll!Ogre::Root::~Root() Line 342	C++
[External Code]	
OgreImpl.dll!OgreRenderer::Close() Line 879	C++
AppMFC.exe!CAppMFCView::OnDestroy() Line 782	C++
[External Code]	
AppMFC.exe!wWinMain(HINSTANCE__ * hInstance, HINSTANCE__ * hPrevInstance, wchar_t * lpCmdLine, int nCmdShow) Line 26	C++
[External Code]	
User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5436
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1343

Re: [2.2] GL3PlusHardwareVertexBuffer destructor problems

Post by dark_sylinc »

Mmm, are you able/allowed to show what's in OgreRenderer::Close?

Cheers

Edit: Oh btw! Since you're on Windows, have you tried D3D11? Sometimes trying a different API will give different errors, which help troubleshooting what's wrong.
marbey
Gnoblar
Posts: 9
Joined: Tue May 04, 2021 4:26 pm
x 1

Re: [2.2] GL3PlusHardwareVertexBuffer destructor problems

Post by marbey »

Code: Select all

void OgreRenderer::Close()
{
    if (m_pThread)
    {
        // kill the Worker thread
        SetEvent(m_hKillEvent);

        // wait for it to die
        DWORD dwRet = WaitForSingleObject(m_pThread->m_hThread, 5000);

        SaveTextureCache();
        SaveHlmsDiskCache();

        Ogre::NameValuePairList params;
        params.insert(std::make_pair("externalWindowHandle", Ogre::StringConverter::toString((uintptr_t)m_hwnd)));
        Ogre::Window* pWindowTmp = m_pRoot->createRenderWindow("TmpHidden", 1, 1, false, &params);

        //m_pScenes->CleanScene()
        {
            Ogre::SceneManager* pSceneManager = GetSceneManager(OgreNames::c_sSceneManagerName);

            Ogre::SceneNode* pRootSceneNodeDyn = GetRootSceneNode(Ogre::SceneMemoryMgrTypes::SCENE_DYNAMIC);
            if (pRootSceneNodeDyn)
            {
                pRootSceneNodeDyn->removeAndDestroyAllChildren();
            }

            Ogre::SceneNode* pRootSceneNodeSta = GetRootSceneNode(Ogre::SceneMemoryMgrTypes::SCENE_STATIC);
            if (pRootSceneNodeSta)
            {
                RootSceneNodeSta->removeAndDestroyAllChildren();
            }

            m_arObjTextDisplay.clear();
            pSceneManager->destroyAllItems();

            Ogre::MeshManager::getSingleton().removeUnreferencedResources();
            Ogre::MeshManager::getSingleton().unloadUnreferencedResources();

            Ogre::ResourceGroupManager::getSingleton().clearResourceGroup(OgreNames::c_sMeshResourceGroupName);
            Ogre::ResourceGroupManager::getSingleton().unloadResourceGroup(OgreNames::c_sMeshResourceGroupName);
            Ogre::ResourceGroupManager::getSingleton().clearResourceGroup(OgreNames::c_sCloudResourceGroupName);
            Ogre::ResourceGroupManager::getSingleton().unloadResourceGroup(OgreNames::c_sCloudResourceGroupName);

            Ogre::ResourceGroupManager::getSingleton().initialiseResourceGroup(OgreNames::c_sMeshResourceGroupName, false);
            Ogre::ResourceGroupManager::getSingleton().initialiseResourceGroup(OgreNames::c_sCloudResourceGroupName, false);

            pSceneManager->shrinkToFitMemoryPools();

            Ogre::RenderSystem* pRenderSystem = m_pRoot->getRenderSystem();
            Ogre::VaoManager* pVaoManager = pRenderSystem ? pRenderSystem->getVaoManager() : nullptr;
            if (pVaoManager)
            {
                pVaoManager->cleanupEmptyPools();
            }
        }   

        try
        {
            Ogre::SceneManager* pSceneManager = m_pRoot->getSceneManager(MgOgreNames::c_sSceneManagerName);
            if (pSceneManager)
            {
                pSceneManager->removeRenderQueueListener(m_pOverlaySystem);
            }
        }
        catch (const Ogre::Exception&)
        {
        }

        OGRE_DELETE m_pOverlaySystem;
        m_pOverlaySystem = nullptr;

        OGRE_DELETE m_pRoot;
        m_pRoot = nullptr;
        m_pWindow = nullptr;
        m_pSceneManager = nullptr;
        pWindowTmp = nullptr;
    }
}
I don't have problems with D3D11, but always have Detected memory leaks!, not from Ogre apparently

Code: Select all

Ogre: Saving HlmsDiskCache to hlmsDiskCache1.bin
Ogre: Saving HlmsDiskCache to hlmsDiskCache3.bin
Ogre: D3D11RenderSystem::_createRenderWindow "TmpHidden", 1x1 windowed  miscParams: externalWindowHandle=3933986 
Ogre: Clearing resource group Mesh
Ogre: Finished clearing resource group Mesh
Ogre: Unloading resource group Mesh
Ogre: Finished unloading resource group Mesh
Ogre: Clearing resource group Cloud
Ogre: Finished clearing resource group Cloud
Ogre: Unloading resource group Cloud
Ogre: Finished unloading resource group Cloud
Ogre: Initialising resource group Mesh
Ogre: Initialising resource group Cloud
The thread 0x6348 has exited with code 0 (0x0).
The thread 0x1214 has exited with code 0 (0x0).
The thread 0x68b0 has exited with code 0 (0x0).
Ogre: Unregistering ResourceManager for type Font
Ogre: DefaultWorkQueue('Root') shutting down on thread main.
Ogre: *-*-* OGRE Shutdown
The thread 0x8988 has exited with code 0 (0x0).
Ogre: Unregistering ResourceManager for type OldSkeleton
Ogre: Unregistering ResourceManager for type Mesh2
Ogre: Unregistering ResourceManager for type Mesh
Ogre: Unregistering ResourceManager for type Material
Ogre: Unregistering ResourceManager for type HighLevelGpuProgram
Ogre: Uninstalling plugin: GL 3+ RenderSystem
Ogre: *** Stopping Win32GL Subsystem ***
Ogre: Plugin successfully uninstalled
Ogre: Unloading library RenderSystem_GL3Plus_d
'AppMFC.exe' (Win32): Unloaded 'D:\Workspaces\Ogre2.2.5\bin\Debug\RenderSystem_GL3Plus_d.dll'
Ogre: Uninstalling plugin: D3D11 RenderSystem
The thread 0xedc has exited with code 0 (0x0).
The thread 0x3474 has exited with code 0 (0x0).
The thread 0x6f74 has exited with code 0 (0x0).
The thread 0x3b0c has exited with code 0 (0x0).
The thread 0x78b4 has exited with code 0 (0x0).
The thread 0x5ccc has exited with code 0 (0x0).
The thread 0x2854 has exited with code 0 (0x0).
The thread 0x6e80 has exited with code 0 (0x0).
The thread 0x5290 has exited with code 0 (0x0).
The thread 0x8af8 has exited with code 0 (0x0).
The thread 0x5fdc has exited with code 0 (0x0).
The thread 0x8a4c has exited with code 0 (0x0).
The thread 0x2294 has exited with code 0 (0x0).
The thread 0x37e0 has exited with code 0 (0x0).
The thread 0x2098 has exited with code 0 (0x0).
The thread 0x5e8 has exited with code 0 (0x0).
The thread 0x5d24 has exited with code 0 (0x0).
'AppMFC.exe' (Win32): Unloaded 'C:\Windows\System32\DriverStore\FileRepository\nv_dispwi.inf_amd64_88d4ccbfda631a0a\nvwgf2umx.dll'
'AppMFC.exe' (Win32): Unloaded 'C:\Windows\System32\DriverStore\FileRepository\nv_dispwi.inf_amd64_88d4ccbfda631a0a\nvldumdx.dll'
Ogre: D3D11: Shutting down cleanly.
Ogre: Unregistering ResourceManager for type GpuProgram
Ogre: D3D11: Direct3D11 Rendering Subsystem destroyed.
Ogre: Plugin successfully uninstalled
Ogre: Unloading library RenderSystem_Direct3D11_d
'AppMFC.exe' (Win32): Unloaded 'D:\Workspaces\Ogre2.2.5\bin\Debug\amd_ags_x64.dll'
'AppMFC.exe' (Win32): Unloaded 'C:\Windows\System32\D3DCompiler_47.dll'
'AppMFC.exe' (Win32): Unloaded 'D:\Workspaces\Ogre2.2.5\bin\Debug\RenderSystem_Direct3D11_d.dll'
d:\a01\_work\2\s\src\vctools\VC7Libs\Ship\ATLMFC\Src\MFC\doccore.cpp(88) : AppMsg - Warning: destroying an unsaved document.
'AppMFC.exe' (Win32): Unloaded 'C:\Windows\System32\twinapi.dll'
'AppMFC.exe' (Win32): Unloaded 'C:\Program Files\Common Files\microsoft shared\ink\tiptsf.dll'
'AppMFC.exe' (Win32): Unloaded 'C:\Windows\System32\mfc110u.dll'
'AppMFC.exe' (Win32): Unloaded 'C:\Windows\System32\msvcr110.dll'
'AppMFC.exe' (Win32): Unloaded 'C:\Program Files\Metrologic Group\X4\V14GA x64\AdditionalExe\MgAePreview.dll'
The thread 0x890c has exited with code 0 (0x0).
The thread 0x204c has exited with code 0 (0x0).
The thread 0x4690 has exited with code 0 (0x0).
The thread 0x1bb0 has exited with code 0 (0x0).
The thread 0x6e20 has exited with code 0 (0x0).
The thread 0x477c has exited with code 0 (0x0).
The thread 0x89d4 has exited with code 0 (0x0).
The thread 0x6eb0 has exited with code 0 (0x0).
The thread 0x5160 has exited with code 0 (0x0).
The thread 0x5a80 has exited with code 0 (0x0).
The thread 0x6808 has exited with code 0 (0x0).
The thread 0x6380 has exited with code 0 (0x0).
The thread 0x5c64 has exited with code 0 (0x0).
The thread 0x29ec has exited with code 0 (0x0).
The thread 0x2984 has exited with code 0 (0x0).
The thread 0x3f44 has exited with code 0 (0x0).
The thread 0x6cac has exited with code 0 (0x0).
The thread 0x8448 has exited with code 0 (0x0).
The thread 0x8074 has exited with code 0 (0x0).
The thread 0x2e64 has exited with code 0 (0x0).
Ogre Memory: No memory leaks
Detected memory leaks!
Dumping objects ->
{510780} normal block at 0x000001AB5D6B4090, 8 bytes long.
 Data: <        > 18 E7 8B AC FE 7F 00 00 
Object dump complete.
The program '[4204] AppMFC.exe' has exited with code 0 (0x0).