3 #include "core/debug/debug_window.h" 4 #include "util/string.h" 5 #include "util/vector.h" 7 #include "renderer/imgui/imgui.h" 8 #include "renderer/d3d12_includes.h" 10 #define BLOWBOX_PROFILER_HISTORY_MAX_SAMPLE_COUNT 2000 11 #define BLOWBOX_PROFILER_HISTORY_MIN_SAMPLE_COUNT 2 54 ResourceSortType_NAME,
55 ResourceSortType_NAME_REVERTED,
56 ResourceSortType_SIZE,
57 ResourceSortType_SIZE_REVERTED,
58 ResourceSortType_DIMENSION,
59 ResourceSortType_DIMENSION_REVERTED,
60 ResourceSortType_FORMAT,
61 ResourceSortType_FORMAT_REVERTED
Vector< GpuResource * > unsorted_gpu_resources_
An unsorted array of GpuResources. New entries are added to this array.
Definition: memory_profiler.h:111
Helper struct to compare ResourceData by its name, in the opposite order.
Definition: memory_profiler.h:134
void Condense(bool force=false)
Condenses all GpuResources in the MemoryProfiler into single entries.
Definition: memory_profiler.cc:387
eastl::vector< T > Vector
Typedef for wrapping the EASTL vector.
Definition: vector.h:14
ResourceSortType
The different sorting types in which resources can be sorted in the MemoryProfiler.
Definition: memory_profiler.h:52
DXGI_FORMAT format
The format of the resource being described.
Definition: memory_profiler.h:77
ImGuiTextFilter filter_
A text filter that is used to filter out ResourceDatas by name from the sorted_gpu_resources_ array...
Definition: memory_profiler.h:115
Base class for DebugWindows.
Definition: debug_window.h:8
String ConvertFormatToString(DXGI_FORMAT format)
Converts a DXGI_FORMAT to a readable string.
Definition: memory_profiler.cc:438
Helper struct to compare ResourceData by its dimension, in the opposite order.
Definition: memory_profiler.h:190
Map< WString, ResourceData > gpu_resources_map_
A map of resource names to ResourceData objects. This map is used to store both the condensed and unc...
Definition: memory_profiler.h:112
bool has_shutdown_
Whether the memory profiler has shutdown.
Definition: memory_profiler.h:106
Helper struct to compare ResourceData by its total size, in the opposite order.
Definition: memory_profiler.h:162
ResourceSortType sort_type_
The sorting type that is used to sort the gpu resources in the sorted_gpu_resources_ array...
Definition: memory_profiler.h:116
D3D12_RESOURCE_DIMENSION dimension
Dimension of the struct.
Definition: memory_profiler.h:76
eastl::map< Key, T > Map
Typedef for wrapping the EASTL map.
Definition: map.h:14
Wraps ID3D12Resource objects.
Definition: gpu_resource.h:19
Helper struct to compare ResourceData by its total size.
Definition: memory_profiler.h:148
Helper struct to compare ResourceData by its dimension.
Definition: memory_profiler.h:176
uint64_t total_size
The total (condensed) size of the different ResourceData.
Definition: memory_profiler.h:75
eastl::wstring WString
Typedef for wrapping the EASTL wstring.
Definition: string.h:20
uint32_t total_count
The number of GpuResources that are condensed in this ResourceData.
Definition: memory_profiler.h:78
eastl::string String
Typedef for wrapping the EASTL string.
Definition: string.h:13
bool show_window_
Whether the memory profiler window should be shown.
Definition: memory_profiler.h:107
Vector< ResourceData > sorted_gpu_resources_
A sorted array of ResourceDatas, based on the gpu_resources_map_. Used by the ImGui MemoryProfiler wi...
Definition: memory_profiler.h:113
void Uncondense()
Uncondenses all the GpuResources in the MemoryProfiler.
Definition: memory_profiler.cc:416
WString name
The name of the resource being described.
Definition: memory_profiler.h:74
void AddGpuResource(GpuResource *gpu_resource)
Adds a GpuResource to the memory profiler.
Definition: memory_profiler.cc:354
Helper struct to compare ResourceData by its name.
Definition: memory_profiler.h:120
String ConvertDimensionToString(D3D12_RESOURCE_DIMENSION dimension)
Converts a D3D12_RESOURCE_DIMENSION to a readable string.
Definition: memory_profiler.cc:422
bool condense_
Whether the different GpuResources in the MemoryProfiler should be condensed or not.
Definition: memory_profiler.h:108
The main Blowbox namespace.
Definition: image.cc:8
void RenderMenu() override
Renders the menu for the Profiler.
Definition: memory_profiler.cc:35
void Shutdown()
Shuts down the profiler.
Definition: memory_profiler.cc:348
void RenderWindow() override
Renders the actual window for the Profiler.
Definition: memory_profiler.cc:66
void NewFrame()
Starts a new profiling frame.
Definition: memory_profiler.cc:342
GpuResource * resource
The resource this ResourceData describes.
Definition: memory_profiler.h:73
bool is_condensed_
Whether the different GpuResources in the MemoryProfiler are condensed.
Definition: memory_profiler.h:109
void RemoveGpuResource(GpuResource *gpu_resource)
Removes a GpuResource from the memory profiler.
Definition: memory_profiler.cc:368
Provides memory profiling statistics.
Definition: memory_profiler.h:23
Used for condensing data into a single struct inside of the MemoryProfiler.
Definition: memory_profiler.h:71