Procházet zdrojové kódy

device: add layer for debug graphs

Daniele Bartolini před 6 roky
rodič
revize
247adff62f
2 změnil soubory, kde provedl 5 přidání a 1 odebrání
  1. 3 0
      src/device/device.cpp
  2. 2 1
      src/device/pipeline.h

+ 3 - 0
src/device/device.cpp

@@ -592,6 +592,7 @@ void Device::render(World& world, UnitId camera_unit)
 	bgfx::setViewRect(VIEW_MESH, 0, 0, _width, _height);
 	bgfx::setViewRect(VIEW_DEBUG, 0, 0, _width, _height);
 	bgfx::setViewRect(VIEW_GUI, 0, 0, _width, _height);
+	bgfx::setViewRect(VIEW_GRAPH, 0, 0, _width, _height);
 
 	bgfx::setViewMode(VIEW_SPRITE_0, bgfx::ViewMode::DepthAscending);
 	bgfx::setViewMode(VIEW_SPRITE_1, bgfx::ViewMode::DepthAscending);
@@ -614,6 +615,7 @@ void Device::render(World& world, UnitId camera_unit)
 	bgfx::setViewFrameBuffer(VIEW_MESH, _pipeline->_frame_buffer);
 	bgfx::setViewFrameBuffer(VIEW_DEBUG, _pipeline->_frame_buffer);
 	bgfx::setViewFrameBuffer(VIEW_GUI, _pipeline->_frame_buffer);
+	bgfx::setViewFrameBuffer(VIEW_GRAPH, _pipeline->_frame_buffer);
 
 	bgfx::touch(VIEW_SPRITE_0);
 	bgfx::touch(VIEW_SPRITE_1);
@@ -626,6 +628,7 @@ void Device::render(World& world, UnitId camera_unit)
 	bgfx::touch(VIEW_MESH);
 	bgfx::touch(VIEW_DEBUG);
 	bgfx::touch(VIEW_GUI);
+	bgfx::touch(VIEW_GRAPH);
 
 	world.render(view);
 

+ 2 - 1
src/device/pipeline.h

@@ -19,7 +19,8 @@
 #define VIEW_MESH      16
 #define VIEW_DEBUG     17
 #define VIEW_GUI      128
-#define VIEW_IMGUI    129
+#define VIEW_GRAPH    129
+#define VIEW_IMGUI    255
 
 namespace crown
 {