diff --git a/src/core/core_timing.cpp b/src/core/core_timing.cpp index b216dc2094..871189596c 100644 --- a/src/core/core_timing.cpp +++ b/src/core/core_timing.cpp @@ -21,6 +21,8 @@ #include "core/core_timing.h" #include "core/hardware_properties.h" +#include "common/tracy_instrumentation.h" + namespace Core::Timing { constexpr s64 MAX_SLICE_LENGTH = 10000; @@ -235,15 +237,20 @@ std::optional CoreTiming::Advance() { basic_lock.unlock(); + { TRACY_ZONE_SCOPEDN("CoreTiming::event_callback") event_type->callback( evt_time, std::chrono::nanoseconds{GetGlobalTimeNs().count() - evt_time}); + } basic_lock.lock(); } else { basic_lock.unlock(); - const auto new_schedule_time{event_type->callback( - evt_time, std::chrono::nanoseconds{GetGlobalTimeNs().count() - evt_time})}; + std::optional new_schedule_time; + { TRACY_ZONE_SCOPEDN("CoreTiming::event_callback") + new_schedule_time = event_type->callback( + evt_time, std::chrono::nanoseconds{GetGlobalTimeNs().count() - evt_time}); + } basic_lock.lock(); diff --git a/src/core/cpu_manager.cpp b/src/core/cpu_manager.cpp index 10fdcdf8a2..e2016acdac 100644 --- a/src/core/cpu_manager.cpp +++ b/src/core/cpu_manager.cpp @@ -18,6 +18,8 @@ #include "core/hle/kernel/physical_core.h" #include "video_core/gpu.h" +#include "common/tracy_instrumentation.h" + namespace Core { CpuManager::CpuManager(System& system_) : system{system_} {} @@ -101,6 +103,9 @@ void CpuManager::MultiCoreRunIdleThread() { physical_core.Idle(); } + #if TRACY_ENABLE + TRACY_ZONE_SCOPEDN("IdleThread::HandleInterrupt"); + #endif HandleInterrupt(); } } @@ -184,6 +189,10 @@ void CpuManager::ShutdownThread() { } void CpuManager::RunThread(std::stop_token token, std::size_t core) { +#if TRACY_ENABLE + TRACY_ZONE_SCOPEDN("RunThread"); +#endif + /// Initialization system.RegisterCoreThread(core); std::string name = is_multicore ? ("CPUCore_" + std::to_string(core)) : std::string{"CPUThread"}; diff --git a/src/core/hle/kernel/physical_core.cpp b/src/core/hle/kernel/physical_core.cpp index 77cdab76d7..023c67cf75 100644 --- a/src/core/hle/kernel/physical_core.cpp +++ b/src/core/hle/kernel/physical_core.cpp @@ -14,6 +14,8 @@ #include "core/hle/kernel/physical_core.h" #include "core/hle/kernel/svc.h" +#include "common/tracy_instrumentation.h" + namespace Kernel { PhysicalCore::PhysicalCore(KernelCore& kernel, std::size_t core_index) @@ -217,6 +219,10 @@ void PhysicalCore::LogBacktrace() { } void PhysicalCore::Idle() { +#if TRACY_ENABLE + ZoneScopedC(0xc0c0c0); +#endif + std::unique_lock lk{m_guard}; m_on_interrupt.wait(lk, [this] { return m_is_interrupted; }); } diff --git a/src/core/hle/service/vi/conductor.cpp b/src/core/hle/service/vi/conductor.cpp index 801a135dd7..dd79b53895 100644 --- a/src/core/hle/service/vi/conductor.cpp +++ b/src/core/hle/service/vi/conductor.cpp @@ -12,6 +12,8 @@ #include "core/hle/service/vi/display_list.h" #include "core/hle/service/vi/vsync_manager.h" +#include "common/tracy_instrumentation.h" + constexpr auto FrameNs = std::chrono::nanoseconds{1000000000 / 60}; namespace Service::VI { @@ -27,6 +29,7 @@ Conductor::Conductor(Core::System& system, Container& container, DisplayList& di "ScreenComposition", [this](s64 time, std::chrono::nanoseconds ns_late) -> std::optional { + TRACY_ZONE_SCOPEDN("Conductor vsync callback") m_signal.Set(); return std::chrono::nanoseconds(this->GetNextTicks()); }); @@ -38,6 +41,7 @@ Conductor::Conductor(Core::System& system, Container& container, DisplayList& di "ScreenComposition", [this](s64 time, std::chrono::nanoseconds ns_late) -> std::optional { + TRACY_ZONE_SCOPEDN("Conductor vsync callback") this->ProcessVsync(); return std::chrono::nanoseconds(this->GetNextTicks()); }); @@ -68,6 +72,8 @@ void Conductor::UnlinkVsyncEvent(u64 display_id, Event* event) { } void Conductor::ProcessVsync() { + TRACY_ZONE_SCOPED + for (auto& [display_id, manager] : m_vsync_managers) { m_container.ComposeOnDisplay(&m_swap_interval, &m_compose_speed_scale, display_id); manager.SignalVsync(); diff --git a/src/video_core/buffer_cache/buffer_cache.h b/src/video_core/buffer_cache/buffer_cache.h index 014b4a318e..e77eaeb777 100644 --- a/src/video_core/buffer_cache/buffer_cache.h +++ b/src/video_core/buffer_cache/buffer_cache.h @@ -16,6 +16,8 @@ #include "video_core/host1x/gpu_device_memory_manager.h" #include "video_core/texture_cache/util.h" +#include "common/tracy_instrumentation.h" + namespace VideoCommon { using Core::DEVICE_PAGESIZE; @@ -337,6 +339,7 @@ void BufferCache

::DisableGraphicsUniformBuffer(size_t stage, u32 index) { template void BufferCache

::UpdateGraphicsBuffers(bool is_indexed) { + TRACY_ZONE_SCOPED do { channel_state->has_deleted_buffers = false; DoUpdateGraphicsBuffers(is_indexed); @@ -353,6 +356,8 @@ void BufferCache

::UpdateComputeBuffers() { template void BufferCache

::BindHostGeometryBuffers(bool is_indexed) { + TRACY_ZONE_SCOPED + if (is_indexed) { BindHostIndexBuffer(); } else if constexpr (!HAS_FULL_INDEX_AND_PRIMITIVE_SUPPORT) { @@ -372,6 +377,8 @@ void BufferCache

::BindHostGeometryBuffers(bool is_indexed) { template void BufferCache

::BindHostStageBuffers(size_t stage) { + TRACY_ZONE_SCOPED + BindHostGraphicsUniformBuffers(stage); BindHostGraphicsStorageBuffers(stage); BindHostGraphicsTextureBuffers(stage); diff --git a/src/video_core/dma_pusher.cpp b/src/video_core/dma_pusher.cpp index 3844a8e2f9..7c50f75f55 100644 --- a/src/video_core/dma_pusher.cpp +++ b/src/video_core/dma_pusher.cpp @@ -18,6 +18,8 @@ #include #endif +#include "common/tracy_instrumentation.h" + namespace Tegra { constexpr u32 MacroRegistersStart = 0xE00; @@ -31,6 +33,8 @@ DmaPusher::DmaPusher(Core::System& system_, GPU& gpu_, MemoryManager& memory_man DmaPusher::~DmaPusher() = default; void DmaPusher::DispatchCalls() { + TRACY_ZONE_SCOPED + dma_pushbuffer_subindex = 0; @@ -46,6 +50,8 @@ void DmaPusher::DispatchCalls() { } bool DmaPusher::Step() { + TRACY_ZONE_SCOPED + if (!ib_enable || dma_pushbuffer.empty()) { return false; } diff --git a/src/video_core/engines/draw_manager.cpp b/src/video_core/engines/draw_manager.cpp index 971025cb55..cf85fc9177 100644 --- a/src/video_core/engines/draw_manager.cpp +++ b/src/video_core/engines/draw_manager.cpp @@ -6,6 +6,8 @@ #include "video_core/engines/draw_manager.h" #include "video_core/rasterizer_interface.h" +#include "common/tracy_instrumentation.h" + namespace Tegra::Engines { DrawManager::DrawManager(Maxwell3D* maxwell3d_) : maxwell3d(maxwell3d_) {} @@ -263,6 +265,7 @@ void DrawManager::UpdateTopology() { void DrawManager::ProcessDraw(bool draw_indexed, u32 instance_count) { LOG_TRACE(HW_GPU, "called, topology={}, count={}", draw_state.topology, draw_indexed ? draw_state.index_buffer.count : draw_state.vertex_buffer.count); + TRACY_ZONE_SCOPED UpdateTopology(); @@ -277,6 +280,7 @@ void DrawManager::ProcessDrawIndirect() { "called, topology={}, is_indexed={}, includes_count={}, buffer_size={}, max_draw_count={}", draw_state.topology, indirect_state.is_indexed, indirect_state.include_count, indirect_state.buffer_size, indirect_state.max_draw_counts); + TRACY_ZONE_SCOPED UpdateTopology(); diff --git a/src/video_core/engines/engine_upload.cpp b/src/video_core/engines/engine_upload.cpp index ba21eec4c4..c3691b8b67 100644 --- a/src/video_core/engines/engine_upload.cpp +++ b/src/video_core/engines/engine_upload.cpp @@ -14,6 +14,8 @@ #include "video_core/rasterizer_interface.h" #include "video_core/textures/decoders.h" +#include "common/tracy_instrumentation.h" + namespace Tegra::Engines::Upload { State::State(MemoryManager& memory_manager_, Registers& regs_) @@ -26,6 +28,8 @@ void State::BindRasterizer(VideoCore::RasterizerInterface* rasterizer_) { } void State::ProcessExec(const bool is_linear_) { + TRACY_ZONE_SCOPED + write_offset = 0; copy_size = regs.line_length_in * regs.line_count; inner_buffer.resize_destructive(copy_size); @@ -33,6 +37,8 @@ void State::ProcessExec(const bool is_linear_) { } void State::ProcessData(const u32 data, const bool is_last_call) { + TRACY_ZONE_SCOPED + const u32 sub_copy_size = (std::min)(4U, copy_size - write_offset); std::memcpy(&inner_buffer[write_offset], &data, sub_copy_size); write_offset += sub_copy_size; diff --git a/src/video_core/engines/maxwell_3d.cpp b/src/video_core/engines/maxwell_3d.cpp index e48f294a5a..4fc94902fe 100644 --- a/src/video_core/engines/maxwell_3d.cpp +++ b/src/video_core/engines/maxwell_3d.cpp @@ -20,6 +20,8 @@ #include "video_core/rasterizer_interface.h" #include "video_core/textures/texture.h" +#include "common/tracy_instrumentation.h" + namespace Tegra::Engines { /// First register id that is actually a Macro call. @@ -324,6 +326,10 @@ void Maxwell3D::ProcessDirtyRegisters(u32 method, u32 argument) { dirty.flags[flag0] = true; if (flag1 != flag0) dirty.flags[flag1] = true; + + if (flag0 == VideoCommon::Dirty::RenderTargets || flag1 == VideoCommon::Dirty::RenderTargets) { + TRACY_MSG_C("BindRendertarget", 0x4040ff); + } } } diff --git a/src/video_core/gpu_thread.cpp b/src/video_core/gpu_thread.cpp index 8d8d857a02..91ec163985 100644 --- a/src/video_core/gpu_thread.cpp +++ b/src/video_core/gpu_thread.cpp @@ -17,6 +17,8 @@ #include "video_core/host1x/host1x.h" #include "video_core/renderer_base.h" +#include "common/tracy_instrumentation.h" + namespace VideoCommon::GPUThread { /// Runs the GPU thread @@ -37,13 +39,20 @@ static void RunThread(std::stop_token stop_token, Core::System& system, if (stop_token.stop_requested()) { break; } + + //TRACY_ZONE_SCOPEDN("Process Gpu Command"); + if (auto* submit_list = std::get_if(&next.data)) { + TRACY_ZONE_SCOPEDN("Push Command List"); scheduler.Push(submit_list->channel, std::move(submit_list->entries)); } else if (std::holds_alternative(next.data)) { + TRACY_ZONE_SCOPEDN("TickWork"); system.GPU().TickWork(); } else if (const auto* flush = std::get_if(&next.data)) { + TRACY_ZONE_SCOPEDN("FlushRegion"); rasterizer->FlushRegion(flush->addr, flush->size); } else if (const auto* invalidate = std::get_if(&next.data)) { + TRACY_ZONE_SCOPEDN("OnCacheInvalidation"); rasterizer->OnCacheInvalidation(invalidate->addr, invalidate->size); } else { ASSERT(false); diff --git a/src/video_core/macro.cpp b/src/video_core/macro.cpp index 66cea5afbd..61a7b3abf2 100644 --- a/src/video_core/macro.cpp +++ b/src/video_core/macro.cpp @@ -45,6 +45,8 @@ #endif #include "video_core/engines/maxwell_3d.h" +#include "common/tracy_instrumentation.h" + namespace Tegra { using Maxwell3D = Engines::Maxwell3D; @@ -77,6 +79,9 @@ bool IsTopologySafe(Maxwell3D::Regs::PrimitiveTopology topology) { } // Anonymous namespace void HLE_DrawArraysIndirect::Execute(Engines::Maxwell3D& maxwell3d, std::span parameters, [[maybe_unused]] u32 method) { + //TRACY_ZONE_SCOPED + TRACY_MSG_C("DrawArraysIndirect", 0xff4040) + auto topology = static_cast(parameters[0]); if (!maxwell3d.AnyParametersDirty() || !IsTopologySafe(topology)) { Fallback(maxwell3d, parameters); @@ -136,6 +141,9 @@ void HLE_DrawArraysIndirect::Fallback(Engines::Maxwell3D& maxwell3d, std::span parameters, [[maybe_unused]] u32 method) { + //TRACY_ZONE_SCOPED + TRACY_MSG_C("DrawIndexedIndirect", 0xff4040) + auto topology = static_cast(parameters[0]); if (!maxwell3d.AnyParametersDirty() || !IsTopologySafe(topology)) { Fallback(maxwell3d, parameters); @@ -197,6 +205,9 @@ void HLE_DrawIndexedIndirect::Fallback(Engines::Maxwell3D& maxwell3d, std::span< } } void HLE_MultiLayerClear::Execute(Engines::Maxwell3D& maxwell3d, std::span parameters, [[maybe_unused]] u32 method) { + //TRACY_ZONE_SCOPED + TRACY_MSG_C("MultiLayerClear", 0xff4040) + maxwell3d.RefreshParameters(); ASSERT(parameters.size() == 1); @@ -209,6 +220,9 @@ void HLE_MultiLayerClear::Execute(Engines::Maxwell3D& maxwell3d, std::spanClear(num_layers); } void HLE_MultiDrawIndexedIndirectCount::Execute(Engines::Maxwell3D& maxwell3d, std::span parameters, [[maybe_unused]] u32 method) { + //TRACY_ZONE_SCOPED + TRACY_MSG_C("MultiDrawIndexedIndirectCount", 0xff4040) + const auto topology = Maxwell3D::Regs::PrimitiveTopology(parameters[2]); if (!IsTopologySafe(topology)) { Fallback(maxwell3d, parameters); @@ -284,6 +298,9 @@ void HLE_MultiDrawIndexedIndirectCount::Fallback(Engines::Maxwell3D& maxwell3d, } } void HLE_DrawIndirectByteCount::Execute(Engines::Maxwell3D& maxwell3d, std::span parameters, [[maybe_unused]] u32 method) { + //TRACY_ZONE_SCOPED + TRACY_MSG_C("DrawIndirectByteCount", 0xff4040) + const bool force = maxwell3d.Rasterizer().HasDrawTransformFeedback(); auto topology = Maxwell3D::Regs::PrimitiveTopology(parameters[0] & 0xFFFFU); if (!force && (!maxwell3d.AnyParametersDirty() || !IsTopologySafe(topology))) { @@ -316,6 +333,9 @@ void HLE_DrawIndirectByteCount::Fallback(Engines::Maxwell3D& maxwell3d, std::spa maxwell3d.regs.draw_auto_byte_count / maxwell3d.regs.draw_auto_stride, 0, 1); } void HLE_C713C83D8F63CCF3::Execute(Engines::Maxwell3D& maxwell3d, std::span parameters, [[maybe_unused]] u32 method) { + //TRACY_ZONE_SCOPED + TRACY_MSG_C("ConstBuffer_1", 0xff4040) + maxwell3d.RefreshParameters(); const u32 offset = (parameters[0] & 0x3FFFFFFF) << 2; const u32 address = maxwell3d.regs.shadow_scratch[24]; @@ -326,6 +346,9 @@ void HLE_C713C83D8F63CCF3::Execute(Engines::Maxwell3D& maxwell3d, std::span parameters, [[maybe_unused]] u32 method) { + //TRACY_ZONE_SCOPED + TRACY_MSG_C("ConstBuffer_2", 0xff4040) + maxwell3d.RefreshParameters(); const size_t index = parameters[0]; const u32 address = maxwell3d.regs.shadow_scratch[42 + index]; @@ -336,6 +359,9 @@ void HLE_D7333D26E0A93EDE::Execute(Engines::Maxwell3D& maxwell3d, std::span parameters, [[maybe_unused]] u32 method) { + //TRACY_ZONE_SCOPED + TRACY_MSG_C("BindShader", 0x40ff40) + maxwell3d.RefreshParameters(); auto& regs = maxwell3d.regs; const u32 index = parameters[0]; @@ -360,6 +386,9 @@ void HLE_BindShader::Execute(Engines::Maxwell3D& maxwell3d, std::span maxwell3d.ProcessCBBind(bind_group_id); } void HLE_SetRasterBoundingBox::Execute(Engines::Maxwell3D& maxwell3d, std::span parameters, [[maybe_unused]] u32 method) { + //TRACY_ZONE_SCOPED + TRACY_MSG_C("SetRasterBoundingBox", 0xff4040) + maxwell3d.RefreshParameters(); const u32 raster_mode = parameters[0]; auto& regs = maxwell3d.regs; @@ -369,6 +398,9 @@ void HLE_SetRasterBoundingBox::Execute(Engines::Maxwell3D& maxwell3d, std::span< regs.raster_bounding_box.pad.Assign(scratch_data & raster_enabled); } void HLE_ClearConstBuffer::Execute(Engines::Maxwell3D& maxwell3d, std::span parameters, [[maybe_unused]] u32 method) { + //TRACY_ZONE_SCOPED + TRACY_MSG_C("ClearConstBuffer", 0xff4040) + static constexpr std::array zeroes{}; //must be bigger than either 7000 or 5F00 maxwell3d.RefreshParameters(); auto& regs = maxwell3d.regs; @@ -379,6 +411,9 @@ void HLE_ClearConstBuffer::Execute(Engines::Maxwell3D& maxwell3d, std::span parameters, [[maybe_unused]] u32 method) { + //TRACY_ZONE_SCOPED + TRACY_MSG_C("ClearMemory", 0xff4040) + maxwell3d.RefreshParameters(); const u32 needed_memory = parameters[2] / sizeof(u32); if (needed_memory > zero_memory.size()) { @@ -393,6 +428,9 @@ void HLE_ClearMemory::Execute(Engines::Maxwell3D& maxwell3d, std::span parameters, [[maybe_unused]] u32 method) { + //TRACY_ZONE_SCOPED + TRACY_MSG_C("TransformFeedbackSetup", 0xff4040) + maxwell3d.RefreshParameters(); auto& regs = maxwell3d.regs; regs.transform_feedback_enabled = 1; diff --git a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp index e989bf6b31..615d804869 100644 --- a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp +++ b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp @@ -29,6 +29,8 @@ #include "video_core/gpu_logging/gpu_logging.h" #include "common/settings.h" +#include "common/tracy_instrumentation.h" + #if defined(_MSC_VER) && defined(NDEBUG) #define LAMBDA_FORCEINLINE [[msvc::forceinline]] #else @@ -310,6 +312,8 @@ void GraphicsPipeline::AddTransition(GraphicsPipeline* transition) { template bool GraphicsPipeline::ConfigureImpl(bool is_indexed) { + TRACY_ZONE_SCOPED + std::array views; std::array samplers; size_t sampler_index{}; @@ -509,6 +513,8 @@ bool GraphicsPipeline::ConfigureImpl(bool is_indexed) { void GraphicsPipeline::ConfigureDraw(const RescalingPushConstant& rescaling, const RenderAreaPushConstant& render_area) { + TRACY_ZONE_SCOPED + scheduler.RequestRenderpass(texture_cache.GetFramebuffer()); if (!is_built.load(std::memory_order::relaxed)) { // Wait for the pipeline to be built diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index f867980a6f..4675232728 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp @@ -43,6 +43,8 @@ #include "video_core/vulkan_common/vulkan_device.h" #include "video_core/vulkan_common/vulkan_wrapper.h" +#include "common/tracy_instrumentation.h" + namespace Vulkan { using Maxwell = Tegra::Engines::Maxwell3D::Regs; @@ -238,6 +240,8 @@ void RasterizerVulkan::PrepareDraw(bool is_indexed, Func&& draw_func) { } void RasterizerVulkan::Draw(bool is_indexed, u32 instance_count) { + TRACY_ZONE_SCOPED + PrepareDraw(is_indexed, [this, is_indexed, instance_count] { const auto& draw_state = maxwell3d->draw_manager->GetDrawState(); const u32 num_instances{instance_count}; @@ -298,6 +302,8 @@ void RasterizerVulkan::Draw(bool is_indexed, u32 instance_count) { } void RasterizerVulkan::DrawIndirect() { + TRACY_ZONE_SCOPED + const auto& params = maxwell3d->draw_manager->GetIndirectParams(); buffer_cache.SetDrawIndirect(¶ms); PrepareDraw(params.is_indexed, [this, ¶ms] { diff --git a/src/video_core/renderer_vulkan/vk_scheduler.cpp b/src/video_core/renderer_vulkan/vk_scheduler.cpp index 947de6a80e..b17b27d5af 100644 --- a/src/video_core/renderer_vulkan/vk_scheduler.cpp +++ b/src/video_core/renderer_vulkan/vk_scheduler.cpp @@ -25,6 +25,8 @@ #include "video_core/vulkan_common/vulkan_device.h" #include "video_core/vulkan_common/vulkan_wrapper.h" +#include "common/tracy_instrumentation.h" + namespace Vulkan { @@ -223,7 +225,10 @@ void Scheduler::WorkerThread(std::stop_token stop_token) { // Perform the work, tracking whether the chunk was a submission // before executing. const bool has_submit = work->HasSubmit(); + + { TRACY_ZONE_SCOPEDN("Vulkan::Scheduler::ExecuteAll") work->ExecuteAll(current_cmdbuf, current_upload_cmdbuf); + } // If the chunk was a submission, reallocate the command buffer. if (has_submit) { diff --git a/src/video_core/texture_cache/image_base.cpp b/src/video_core/texture_cache/image_base.cpp index 077df28fb3..daaa785523 100644 --- a/src/video_core/texture_cache/image_base.cpp +++ b/src/video_core/texture_cache/image_base.cpp @@ -17,6 +17,8 @@ #include "video_core/texture_cache/image_view_info.h" #include "video_core/texture_cache/util.h" +#include "common/tracy_instrumentation.h" + namespace VideoCommon { using VideoCore::Surface::DefaultBlockHeight; @@ -159,6 +161,8 @@ void ImageBase::CheckAliasState() { } bool AddImageAlias(ImageBase& lhs, ImageBase& rhs, ImageId lhs_id, ImageId rhs_id) { + TRACY_ZONE_SCOPED + static constexpr auto OPTIONS = RelaxedOptions::Size | RelaxedOptions::Format; ASSERT(lhs.info.type == rhs.info.type); std::optional base; diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h index 71210ffe6e..5a4c641edd 100644 --- a/src/video_core/texture_cache/texture_cache.h +++ b/src/video_core/texture_cache/texture_cache.h @@ -25,6 +25,8 @@ #include "video_core/texture_cache/util.h" #include "video_core/textures/decoders.h" +#include "common/tracy_instrumentation.h" + namespace VideoCommon { using Tegra::Texture::TICEntry; @@ -275,12 +277,14 @@ void TextureCache

::MarkModification(ImageId id) noexcept { template template void TextureCache

::FillGraphicsImageViews(std::span views) { + TRACY_ZONE_SCOPED FillImageViews(channel_state->graphics_image_table, channel_state->graphics_image_view_ids, views); } template void TextureCache

::FillComputeImageViews(std::span views) { + TRACY_ZONE_SCOPED FillImageViews(channel_state->compute_image_table, channel_state->compute_image_view_ids, views); } @@ -442,6 +446,8 @@ void TextureCache

::SynchronizeComputeDescriptors() { template bool TextureCache

::RescaleRenderTargets() { + TRACY_ZONE_SCOPED + auto& flags = maxwell3d->dirty.flags; u32 scale_rating = 0; bool rescaled = false; @@ -538,6 +544,8 @@ bool TextureCache

::RescaleRenderTargets() { template void TextureCache

::UpdateRenderTargets(bool is_clear) { + TRACY_ZONE_SCOPED + using namespace VideoCommon::Dirty; auto& flags = maxwell3d->dirty.flags; if (!flags[Dirty::RenderTargets]) { @@ -549,6 +557,7 @@ void TextureCache

::UpdateRenderTargets(bool is_clear) { PrepareImageView(depth_buffer_id, true, is_clear && IsFullClear(depth_buffer_id)); return; } + TRACY_ZONE_NAMEDN(_tracy_zone, "UpdateRenderTargets_Dirty") const VideoCommon::RenderTargets previous_render_targets = render_targets; const bool rescaled = RescaleRenderTargets(); @@ -1200,6 +1209,8 @@ void TextureCache

::RefreshContents(Image& image, ImageId image_id) { return; } + TRACY_ZONE_SCOPEDN("RefreshContents_CpuModified") + TrackImage(image, image_id); if (image.info.num_samples > 1 && !runtime.CanUploadMSAA()) { @@ -1608,6 +1619,8 @@ bool TextureCache

::ScaleDown(Image& image) { template ImageId TextureCache

::InsertImage(const ImageInfo& info, GPUVAddr gpu_addr, RelaxedOptions options) { + TRACY_ZONE_SCOPED + std::optional cpu_addr = gpu_memory->GpuToCpuAddress(gpu_addr); if (!cpu_addr) { const auto size = CalculateGuestSizeInBytes(info); @@ -2689,6 +2702,8 @@ void TextureCache

::SynchronizeAliases(ImageId image_id) { if (aliased_images.empty()) { return; } + TRACY_ZONE_SCOPEDN("SynchronizeAliases_has_modified_aliases") + const bool can_rescale = ImageCanRescale(image); if (any_rescaled) { if (can_rescale) {