1
0
mirror of https://github.com/wolfpld/tracy synced 2025-04-29 12:23:53 +00:00

Differentiate Vulkan/OpenGL in options menu.

This commit is contained in:
Bartosz Taudul 2018-06-18 01:08:56 +02:00
parent 53e3eee9ee
commit 021dd853b9

View File

@ -3204,20 +3204,28 @@ void View::DrawOptions()
const auto tw = ImGui::GetFontSize(); const auto tw = ImGui::GetFontSize();
ImGui::Begin( "Options", &m_showOptions, ImGuiWindowFlags_AlwaysAutoResize ); ImGui::Begin( "Options", &m_showOptions, ImGuiWindowFlags_AlwaysAutoResize );
auto sz = m_worker.GetGpuData().size(); const auto& gpuData = m_worker.GetGpuData();
if( sz > 0 ) if( !gpuData.empty() )
{ {
ImGui::Checkbox( "Draw GPU zones", &m_drawGpuZones ); ImGui::Checkbox( "Draw GPU zones", &m_drawGpuZones );
const auto expand = ImGui::TreeNode( "GPU zones" ); const auto expand = ImGui::TreeNode( "GPU zones" );
ImGui::SameLine(); ImGui::SameLine();
ImGui::TextDisabled( "(%zu)", sz ); ImGui::TextDisabled( "(%zu)", gpuData.size() );
if( expand ) if( expand )
{ {
for( size_t i=0; i<sz; i++ ) for( size_t i=0; i<gpuData.size(); i++ )
{ {
const bool isVulkan = gpuData[i]->thread == 0;
char buf[1024]; char buf[1024];
sprintf( buf, "GPU context %zu", i ); if( isVulkan )
ImGui::Checkbox( buf, &Visible( m_worker.GetGpuData()[i] ) ); {
sprintf( buf, "Vulkan context %zu", i );
}
else
{
sprintf( buf, "OpenGL context %zu", i );
}
ImGui::Checkbox( buf, &Visible( gpuData[i] ) );
} }
ImGui::TreePop(); ImGui::TreePop();
} }