Blowbox 2017
A 3D Game Engine by Riko Ophorst using DirectX 12
Classes | Public Member Functions | Protected Types | Protected Member Functions | Private Attributes | Friends | List of all members
blowbox::MemoryProfiler Class Reference

#include <memory_profiler.h>

Classes

struct  CompareGpuResourceByDimension
 
struct  CompareGpuResourceByDimensionReverted
 
struct  CompareGpuResourceByFormat
 
struct  CompareGpuResourceByFormatReverted
 
struct  CompareGpuResourceByName
 
struct  CompareGpuResourceByNameReverted
 
struct  CompareGpuResourceBySize
 
struct  CompareGpuResourceBySizeReverted
 
struct  ResourceData
 

Public Member Functions

void RenderMenu () override
 
void RenderWindow () override
 
void NewFrame ()
 
void Shutdown ()
 

Protected Types

enum  ResourceSortType {
  ResourceSortType_NAME, ResourceSortType_NAME_REVERTED, ResourceSortType_SIZE, ResourceSortType_SIZE_REVERTED,
  ResourceSortType_DIMENSION, ResourceSortType_DIMENSION_REVERTED, ResourceSortType_FORMAT, ResourceSortType_FORMAT_REVERTED
}
 

Protected Member Functions

void AddGpuResource (GpuResource *gpu_resource)
 
void RemoveGpuResource (GpuResource *gpu_resource)
 
void Condense (bool force=false)
 
void Uncondense ()
 
String ConvertDimensionToString (D3D12_RESOURCE_DIMENSION dimension)
 
String ConvertFormatToString (DXGI_FORMAT format)
 

Private Attributes

bool has_shutdown_
 
bool show_window_
 
bool condense_
 
bool is_condensed_
 
Vector< GpuResource * > unsorted_gpu_resources_
 
Map< WString, ResourceDatagpu_resources_map_
 
Vector< ResourceDatasorted_gpu_resources_
 
ImGuiTextFilter filter_
 
ResourceSortType sort_type_
 

Friends

class GpuResource
 

Detailed Description

Provides memory profiling statistics.

The MemoryProfiler is a debug functionality that allows you to gain insights into how VRAM is being utilized by the application.

Inheritance diagram for blowbox::MemoryProfiler:
blowbox::DebugWindow

Member Enumeration Documentation

The different sorting types in which resources can be sorted in the MemoryProfiler.

Member Function Documentation

void blowbox::MemoryProfiler::AddGpuResource ( GpuResource gpu_resource)
protected

Adds a GpuResource to the memory profiler.

void blowbox::MemoryProfiler::Condense ( bool  force = false)
protected

Condenses all GpuResources in the MemoryProfiler into single entries.

Parameters
[in]forceWhether the condense operation should be forced. By default, it is off - because it only needs to condense if anything changed.
String blowbox::MemoryProfiler::ConvertDimensionToString ( D3D12_RESOURCE_DIMENSION  dimension)
protected

Converts a D3D12_RESOURCE_DIMENSION to a readable string.

Parameters
[in]dimensionThe dimension to be converted.
String blowbox::MemoryProfiler::ConvertFormatToString ( DXGI_FORMAT  format)
protected

Converts a DXGI_FORMAT to a readable string.

Parameters
[in]formatThe format to be converted.
void blowbox::MemoryProfiler::NewFrame ( )

Starts a new profiling frame.

void blowbox::MemoryProfiler::RemoveGpuResource ( GpuResource gpu_resource)
protected

Removes a GpuResource from the memory profiler.

void blowbox::MemoryProfiler::RenderMenu ( )
overridevirtual

Renders the menu for the Profiler.

Implements blowbox::DebugWindow.

void blowbox::MemoryProfiler::RenderWindow ( )
overridevirtual

Renders the actual window for the Profiler.

Implements blowbox::DebugWindow.

void blowbox::MemoryProfiler::Shutdown ( )

Shuts down the profiler.

void blowbox::MemoryProfiler::Uncondense ( )
protected

Uncondenses all the GpuResources in the MemoryProfiler.

Member Data Documentation

bool blowbox::MemoryProfiler::condense_
private

Whether the different GpuResources in the MemoryProfiler should be condensed or not.

ImGuiTextFilter blowbox::MemoryProfiler::filter_
private

A text filter that is used to filter out ResourceDatas by name from the sorted_gpu_resources_ array.

Map<WString, ResourceData> blowbox::MemoryProfiler::gpu_resources_map_
private

A map of resource names to ResourceData objects. This map is used to store both the condensed and uncondensed resource data.

bool blowbox::MemoryProfiler::has_shutdown_
private

Whether the memory profiler has shutdown.

bool blowbox::MemoryProfiler::is_condensed_
private

Whether the different GpuResources in the MemoryProfiler are condensed.

bool blowbox::MemoryProfiler::show_window_
private

Whether the memory profiler window should be shown.

ResourceSortType blowbox::MemoryProfiler::sort_type_
private

The sorting type that is used to sort the gpu resources in the sorted_gpu_resources_ array.

Vector<ResourceData> blowbox::MemoryProfiler::sorted_gpu_resources_
private

A sorted array of ResourceDatas, based on the gpu_resources_map_. Used by the ImGui MemoryProfiler window to display the ResourceData in the correct order.

Vector<GpuResource*> blowbox::MemoryProfiler::unsorted_gpu_resources_
private

An unsorted array of GpuResources. New entries are added to this array.


The documentation for this class was generated from the following files: