Fix GPU contexts in options menu.

This commit is contained in:
Bartosz Taudul 2022-09-04 13:52:53 +02:00
parent 06d0989161
commit 135d3b7f30
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3

View File

@ -5,6 +5,7 @@
#include "TracyImGui.hpp"
#include "TracyMouse.hpp"
#include "TracyPrint.hpp"
#include "TracyTimelineItemGpu.hpp"
#include "TracyUtility.hpp"
#include "TracyView.hpp"
@ -94,9 +95,7 @@ void View::DrawOptions()
for( size_t i=0; i<gpuData.size(); i++ )
{
const auto& timeline = gpuData[i]->threadData.begin()->second.timeline;
char buf[1024];
sprintf( buf, "%s context %zu", GpuContextNames[(int)gpuData[i]->type], i );
SmallCheckbox( buf, &m_tc.Vis( gpuData[i] ).visible );
m_tc.GetItem( gpuData[i] ).VisibilityCheckbox();
ImGui::SameLine();
if( gpuData[i]->threadData.size() == 1 )
{
@ -108,8 +107,11 @@ void View::DrawOptions()
}
if( gpuData[i]->name.Active() )
{
char buf[64];
auto& item = (TimelineItemGpu&)( m_tc.GetItem( gpuData[i] ) );
sprintf( buf, "%s context %zu", GpuContextNames[(int)gpuData[i]->type], item.GetIdx() );
ImGui::PushFont( m_smallFont );
TextFocused( "Name:", m_worker.GetString( gpuData[i]->name ) );
ImGui::TextUnformatted( buf );
ImGui::PopFont();
}
if( !gpuData[i]->hasCalibration )