Vulkan pipelines creation time statistics.
This commit is contained in:
parent
b6fb89caaa
commit
12368a634f
|
|
@ -1117,6 +1117,9 @@ void RE_EndRegistration( void ) {
|
||||||
if (!Sys_LowPhysicalMemory()) {
|
if (!Sys_LowPhysicalMemory()) {
|
||||||
RB_ShowImages();
|
RB_ShowImages();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// VULKAN
|
||||||
|
ri.Printf(PRINT_ALL, "Vulkan: pipelines create time %d msec\n", (int)(vk_resources.pipeline_create_time * 1000));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1245,8 +1245,6 @@ void vk_shutdown() {
|
||||||
deinit_vulkan_library();
|
deinit_vulkan_library();
|
||||||
}
|
}
|
||||||
|
|
||||||
static float pipeline_create_time;
|
|
||||||
|
|
||||||
void vk_release_resources() {
|
void vk_release_resources() {
|
||||||
vkDeviceWaitIdle(vk.device);
|
vkDeviceWaitIdle(vk.device);
|
||||||
auto& res = vk_resources;
|
auto& res = vk_resources;
|
||||||
|
|
@ -1266,7 +1264,7 @@ void vk_release_resources() {
|
||||||
for (int i = 0; i < res.num_pipelines; i++)
|
for (int i = 0; i < res.num_pipelines; i++)
|
||||||
vkDestroyPipeline(vk.device, res.pipelines[i], nullptr);
|
vkDestroyPipeline(vk.device, res.pipelines[i], nullptr);
|
||||||
|
|
||||||
pipeline_create_time = 0.0f;
|
vk_resources.pipeline_create_time = 0.0f;
|
||||||
|
|
||||||
for (int i = 0; i < MAX_VK_IMAGES; i++) {
|
for (int i = 0; i < MAX_VK_IMAGES; i++) {
|
||||||
Vk_Image& image = res.images[i];
|
Vk_Image& image = res.images[i];
|
||||||
|
|
@ -1916,7 +1914,7 @@ VkPipeline vk_find_pipeline(const Vk_Pipeline_Def& def) {
|
||||||
|
|
||||||
Timer t;
|
Timer t;
|
||||||
VkPipeline pipeline = create_pipeline(def);
|
VkPipeline pipeline = create_pipeline(def);
|
||||||
pipeline_create_time += t.Elapsed_Seconds();
|
vk_resources.pipeline_create_time += t.Elapsed_Seconds();
|
||||||
|
|
||||||
vk_resources.pipeline_defs[vk_resources.num_pipelines] = def;
|
vk_resources.pipeline_defs[vk_resources.num_pipelines] = def;
|
||||||
vk_resources.pipelines[vk_resources.num_pipelines] = pipeline;
|
vk_resources.pipelines[vk_resources.num_pipelines] = pipeline;
|
||||||
|
|
|
||||||
|
|
@ -192,6 +192,7 @@ struct Vk_Resources {
|
||||||
int num_pipelines = 0;
|
int num_pipelines = 0;
|
||||||
Vk_Pipeline_Def pipeline_defs[MAX_VK_PIPELINES];
|
Vk_Pipeline_Def pipeline_defs[MAX_VK_PIPELINES];
|
||||||
VkPipeline pipelines[MAX_VK_PIPELINES];
|
VkPipeline pipelines[MAX_VK_PIPELINES];
|
||||||
|
float pipeline_create_time;
|
||||||
|
|
||||||
Vk_Image images[MAX_VK_IMAGES];
|
Vk_Image images[MAX_VK_IMAGES];
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user