mirror of
https://github.com/wolfpld/tracy
synced 2025-04-29 04:23:51 +00:00
Added server support for D3D12 contexts
This commit is contained in:
parent
4be5e0bfa1
commit
3282a8d27c
@ -132,7 +132,7 @@ namespace tracy
|
|||||||
MemWrite(&item->gpuNewContext.period, 1E+09f / static_cast<float>(timestampFrequency));
|
MemWrite(&item->gpuNewContext.period, 1E+09f / static_cast<float>(timestampFrequency));
|
||||||
MemWrite(&item->gpuNewContext.context, m_context);
|
MemWrite(&item->gpuNewContext.context, m_context);
|
||||||
MemWrite(&item->gpuNewContext.accuracyBits, uint8_t{ 0 });
|
MemWrite(&item->gpuNewContext.accuracyBits, uint8_t{ 0 });
|
||||||
MemWrite(&item->gpuNewContext.type, GpuContextType::Vulkan); // #TEMP: Add a Direct3D12 context type in the server.
|
MemWrite(&item->gpuNewContext.type, GpuContextType::Direct3D12);
|
||||||
|
|
||||||
#ifdef TRACY_ON_DEMAND
|
#ifdef TRACY_ON_DEMAND
|
||||||
GetProfiler().DeferItem(*item);
|
GetProfiler().DeferItem(*item);
|
||||||
|
@ -263,7 +263,8 @@ enum class GpuContextType : uint8_t
|
|||||||
{
|
{
|
||||||
Invalid,
|
Invalid,
|
||||||
OpenGl,
|
OpenGl,
|
||||||
Vulkan
|
Vulkan,
|
||||||
|
Direct3D12
|
||||||
};
|
};
|
||||||
|
|
||||||
struct QueueGpuNewContext
|
struct QueueGpuNewContext
|
||||||
|
@ -75,7 +75,8 @@ constexpr const char* s_tracyStackFrames[] = {
|
|||||||
constexpr const char* GpuContextNames[] = {
|
constexpr const char* GpuContextNames[] = {
|
||||||
"Invalid",
|
"Invalid",
|
||||||
"OpenGL",
|
"OpenGL",
|
||||||
"Vulkan"
|
"Vulkan",
|
||||||
|
"Direct3D 12"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -2472,7 +2473,7 @@ void View::DrawZones()
|
|||||||
draw->AddTriangle( wpos + ImVec2( to/2, oldOffset + to/2 ), wpos + ImVec2( to/2, oldOffset + ty - to/2 ), wpos + ImVec2( to/2 + th, oldOffset + ty * 0.5 ), 0xFF886666, 2.0f );
|
draw->AddTriangle( wpos + ImVec2( to/2, oldOffset + to/2 ), wpos + ImVec2( to/2, oldOffset + ty - to/2 ), wpos + ImVec2( to/2 + th, oldOffset + ty * 0.5 ), 0xFF886666, 2.0f );
|
||||||
}
|
}
|
||||||
|
|
||||||
const bool isMultithreaded = v->type == GpuContextType::Vulkan;
|
const bool isMultithreaded = (v->type == GpuContextType::Vulkan || v->type == GpuContextType::Direct3D12);
|
||||||
char buf[64];
|
char buf[64];
|
||||||
sprintf( buf, "%s context %zu", GpuContextNames[(int)v->type], i );
|
sprintf( buf, "%s context %zu", GpuContextNames[(int)v->type], i );
|
||||||
DrawTextContrast( draw, wpos + ImVec2( ty, oldOffset ), showFull ? 0xFFFFAAAA : 0xFF886666, buf );
|
DrawTextContrast( draw, wpos + ImVec2( ty, oldOffset ), showFull ? 0xFFFFAAAA : 0xFF886666, buf );
|
||||||
|
@ -5265,7 +5265,7 @@ void Worker::ProcessGpuZoneBeginImpl( GpuEvent* zone, const QueueGpuZoneBegin& e
|
|||||||
uint64_t ztid;
|
uint64_t ztid;
|
||||||
if( ctx->thread == 0 )
|
if( ctx->thread == 0 )
|
||||||
{
|
{
|
||||||
// Vulkan context is not bound to any single thread.
|
// Vulkan and Direct3D 12 contexts are not bound to any single thread.
|
||||||
zone->SetThread( CompressThread( ev.thread ) );
|
zone->SetThread( CompressThread( ev.thread ) );
|
||||||
ztid = ev.thread;
|
ztid = ev.thread;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user