ability to specify debug groups for graphics commands

This commit is contained in:
Dmitry Stepanov
2025-11-08 12:54:07 +03:00
parent 0462d4800f
commit cbce959830
2 changed files with 21 additions and 0 deletions
+15
View File
@@ -1530,4 +1530,19 @@ impl GraphicsServer for GlGraphicsServer {
fn memory_usage(&self) -> ServerMemoryUsage {
self.memory_usage.borrow().clone()
}
fn push_debug_group(&self, name: &str) {
if self.gl.supports_debug() {
unsafe {
self.gl
.push_debug_group(glow::DEBUG_SOURCE_APPLICATION, 0, name)
}
}
}
fn pop_debug_group(&self) {
if self.gl.supports_debug() {
unsafe { self.gl.pop_debug_group() }
}
}
}
+6
View File
@@ -210,6 +210,12 @@ pub trait GraphicsServer: GraphicsServerAsAny {
/// Fetches the total amount of memory used by the graphics server.
fn memory_usage(&self) -> ServerMemoryUsage;
/// Begins a new named debug group.
fn push_debug_group(&self, name: &str);
/// Ends the current debug group.
fn pop_debug_group(&self);
/// A shortcut for [`Self::create_texture`], that creates a rectangular texture with the given
/// size and pixel kind.
fn create_2d_render_target(