| 149 | } |
| 150 | |
| 151 | void PipelineCache::draw_gui() |
| 152 | { |
| 153 | get_gui().show_options_window( |
| 154 | /* body = */ [this]() { |
| 155 | if (ImGui::Checkbox("Pipeline cache", &enable_pipeline_cache)) |
| 156 | { |
| 157 | vkb::ResourceCache &resource_cache = get_device().get_resource_cache(); |
| 158 | |
| 159 | if (enable_pipeline_cache) |
| 160 | { |
| 161 | // Use pipeline cache to store pipelines |
| 162 | resource_cache.set_pipeline_cache(pipeline_cache); |
| 163 | } |
| 164 | else |
| 165 | { |
| 166 | // Don't use a pipeline cache |
| 167 | resource_cache.set_pipeline_cache(VK_NULL_HANDLE); |
| 168 | } |
| 169 | } |
| 170 | |
| 171 | ImGui::SameLine(); |
| 172 | |
| 173 | if (ImGui::Button("Destroy Pipelines", button_size)) |
| 174 | { |
| 175 | get_device().wait_idle(); |
| 176 | get_device().get_resource_cache().clear_pipelines(); |
| 177 | record_frame_time_next_frame = true; |
| 178 | } |
| 179 | |
| 180 | if (rebuild_pipelines_frame_time_ms > 0.0f) |
| 181 | { |
| 182 | ImGui::Text("Pipeline rebuild frame time: %.1f ms", rebuild_pipelines_frame_time_ms); |
| 183 | } |
| 184 | else |
| 185 | { |
| 186 | ImGui::Text("Pipeline rebuild frame time: N/A"); |
| 187 | } |
| 188 | }, |
| 189 | /* lines = */ 2); |
| 190 | } |
| 191 | |
| 192 | void PipelineCache::update(float delta_time) |
| 193 | { |
nothing calls this directly
no test coverage detected