mirror of
https://github.com/FyroxEngine/Fyrox.git
synced 2026-10-12 02:02:20 +00:00
ability to specify debug groups for graphics commands
This commit is contained in:
@@ -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() }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user