MCPcopy Create free account
hub / github.com/KhronosGroup/Vulkan-Samples / draw_gui

Method draw_gui

samples/performance/pipeline_cache/pipeline_cache.cpp:151–190  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

149}
150
151void 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
192void PipelineCache::update(float delta_time)
193{

Callers

nothing calls this directly

Calls 4

show_options_windowMethod · 0.80
set_pipeline_cacheMethod · 0.45
wait_idleMethod · 0.45
clear_pipelinesMethod · 0.45

Tested by

no test coverage detected