mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-04-10 09:48:58 +02:00
some tracy instrumentation
This commit is contained in:
parent
0b2e265d6d
commit
e72e3c9bbb
16 changed files with 142 additions and 2 deletions
|
|
@ -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<s64> 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<std::chrono::nanoseconds> 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();
|
||||
|
||||
|
|
|
|||
|
|
@ -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"};
|
||||
|
|
|
|||
|
|
@ -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; });
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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<std::chrono::nanoseconds> {
|
||||
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<std::chrono::nanoseconds> {
|
||||
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();
|
||||
|
|
|
|||
|
|
@ -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<P>::DisableGraphicsUniformBuffer(size_t stage, u32 index) {
|
|||
|
||||
template <class P>
|
||||
void BufferCache<P>::UpdateGraphicsBuffers(bool is_indexed) {
|
||||
TRACY_ZONE_SCOPED
|
||||
do {
|
||||
channel_state->has_deleted_buffers = false;
|
||||
DoUpdateGraphicsBuffers(is_indexed);
|
||||
|
|
@ -353,6 +356,8 @@ void BufferCache<P>::UpdateComputeBuffers() {
|
|||
|
||||
template <class P>
|
||||
void BufferCache<P>::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<P>::BindHostGeometryBuffers(bool is_indexed) {
|
|||
|
||||
template <class P>
|
||||
void BufferCache<P>::BindHostStageBuffers(size_t stage) {
|
||||
TRACY_ZONE_SCOPED
|
||||
|
||||
BindHostGraphicsUniformBuffers(stage);
|
||||
BindHostGraphicsStorageBuffers(stage);
|
||||
BindHostGraphicsTextureBuffers(stage);
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@
|
|||
#include <intrin.h>
|
||||
#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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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<SubmitListCommand>(&next.data)) {
|
||||
TRACY_ZONE_SCOPEDN("Push Command List");
|
||||
scheduler.Push(submit_list->channel, std::move(submit_list->entries));
|
||||
} else if (std::holds_alternative<GPUTickCommand>(next.data)) {
|
||||
TRACY_ZONE_SCOPEDN("TickWork");
|
||||
system.GPU().TickWork();
|
||||
} else if (const auto* flush = std::get_if<FlushRegionCommand>(&next.data)) {
|
||||
TRACY_ZONE_SCOPEDN("FlushRegion");
|
||||
rasterizer->FlushRegion(flush->addr, flush->size);
|
||||
} else if (const auto* invalidate = std::get_if<InvalidateRegionCommand>(&next.data)) {
|
||||
TRACY_ZONE_SCOPEDN("OnCacheInvalidation");
|
||||
rasterizer->OnCacheInvalidation(invalidate->addr, invalidate->size);
|
||||
} else {
|
||||
ASSERT(false);
|
||||
|
|
|
|||
|
|
@ -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<const u32> parameters, [[maybe_unused]] u32 method) {
|
||||
//TRACY_ZONE_SCOPED
|
||||
TRACY_MSG_C("DrawArraysIndirect", 0xff4040)
|
||||
|
||||
auto topology = static_cast<Maxwell3D::Regs::PrimitiveTopology>(parameters[0]);
|
||||
if (!maxwell3d.AnyParametersDirty() || !IsTopologySafe(topology)) {
|
||||
Fallback(maxwell3d, parameters);
|
||||
|
|
@ -136,6 +141,9 @@ void HLE_DrawArraysIndirect::Fallback(Engines::Maxwell3D& maxwell3d, std::span<c
|
|||
}
|
||||
|
||||
void HLE_DrawIndexedIndirect::Execute(Engines::Maxwell3D& maxwell3d, std::span<const u32> parameters, [[maybe_unused]] u32 method) {
|
||||
//TRACY_ZONE_SCOPED
|
||||
TRACY_MSG_C("DrawIndexedIndirect", 0xff4040)
|
||||
|
||||
auto topology = static_cast<Maxwell3D::Regs::PrimitiveTopology>(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<const u32> 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::span<const
|
|||
maxwell3d.draw_manager->Clear(num_layers);
|
||||
}
|
||||
void HLE_MultiDrawIndexedIndirectCount::Execute(Engines::Maxwell3D& maxwell3d, std::span<const u32> 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<const u32> 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<const u32> 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<cons
|
|||
const_buffer.offset = offset;
|
||||
}
|
||||
void HLE_D7333D26E0A93EDE::Execute(Engines::Maxwell3D& maxwell3d, std::span<const u32> 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<cons
|
|||
const_buffer.address_low = address << 8;
|
||||
}
|
||||
void HLE_BindShader::Execute(Engines::Maxwell3D& maxwell3d, std::span<const u32> 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<const u32>
|
|||
maxwell3d.ProcessCBBind(bind_group_id);
|
||||
}
|
||||
void HLE_SetRasterBoundingBox::Execute(Engines::Maxwell3D& maxwell3d, std::span<const u32> 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<const u32> parameters, [[maybe_unused]] u32 method) {
|
||||
//TRACY_ZONE_SCOPED
|
||||
TRACY_MSG_C("ClearConstBuffer", 0xff4040)
|
||||
|
||||
static constexpr std::array<u32, 0x7000> 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<cons
|
|||
maxwell3d.ProcessCBMultiData(zeroes.data(), parameters[2] * 4);
|
||||
}
|
||||
void HLE_ClearMemory::Execute(Engines::Maxwell3D& maxwell3d, std::span<const u32> 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<const u32
|
|||
maxwell3d.CallMultiMethod(size_t(MAXWELL3D_REG_INDEX(inline_data)), zero_memory.data(), needed_memory, needed_memory);
|
||||
}
|
||||
void HLE_TransformFeedbackSetup::Execute(Engines::Maxwell3D& maxwell3d, std::span<const u32> parameters, [[maybe_unused]] u32 method) {
|
||||
//TRACY_ZONE_SCOPED
|
||||
TRACY_MSG_C("TransformFeedbackSetup", 0xff4040)
|
||||
|
||||
maxwell3d.RefreshParameters();
|
||||
auto& regs = maxwell3d.regs;
|
||||
regs.transform_feedback_enabled = 1;
|
||||
|
|
|
|||
|
|
@ -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 <typename Spec>
|
||||
bool GraphicsPipeline::ConfigureImpl(bool is_indexed) {
|
||||
TRACY_ZONE_SCOPED
|
||||
|
||||
std::array<VideoCommon::ImageViewInOut, MAX_IMAGE_ELEMENTS> views;
|
||||
std::array<VideoCommon::SamplerId, MAX_IMAGE_ELEMENTS> 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
|
||||
|
|
|
|||
|
|
@ -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] {
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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<SubresourceBase> base;
|
||||
|
|
|
|||
|
|
@ -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<P>::MarkModification(ImageId id) noexcept {
|
|||
template <class P>
|
||||
template <bool has_blacklists>
|
||||
void TextureCache<P>::FillGraphicsImageViews(std::span<ImageViewInOut> views) {
|
||||
TRACY_ZONE_SCOPED
|
||||
FillImageViews<has_blacklists>(channel_state->graphics_image_table,
|
||||
channel_state->graphics_image_view_ids, views);
|
||||
}
|
||||
|
||||
template <class P>
|
||||
void TextureCache<P>::FillComputeImageViews(std::span<ImageViewInOut> views) {
|
||||
TRACY_ZONE_SCOPED
|
||||
FillImageViews<true>(channel_state->compute_image_table, channel_state->compute_image_view_ids,
|
||||
views);
|
||||
}
|
||||
|
|
@ -442,6 +446,8 @@ void TextureCache<P>::SynchronizeComputeDescriptors() {
|
|||
|
||||
template <class P>
|
||||
bool TextureCache<P>::RescaleRenderTargets() {
|
||||
TRACY_ZONE_SCOPED
|
||||
|
||||
auto& flags = maxwell3d->dirty.flags;
|
||||
u32 scale_rating = 0;
|
||||
bool rescaled = false;
|
||||
|
|
@ -538,6 +544,8 @@ bool TextureCache<P>::RescaleRenderTargets() {
|
|||
|
||||
template <class P>
|
||||
void TextureCache<P>::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<P>::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<P>::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<P>::ScaleDown(Image& image) {
|
|||
template <class P>
|
||||
ImageId TextureCache<P>::InsertImage(const ImageInfo& info, GPUVAddr gpu_addr,
|
||||
RelaxedOptions options) {
|
||||
TRACY_ZONE_SCOPED
|
||||
|
||||
std::optional<DAddr> cpu_addr = gpu_memory->GpuToCpuAddress(gpu_addr);
|
||||
if (!cpu_addr) {
|
||||
const auto size = CalculateGuestSizeInBytes(info);
|
||||
|
|
@ -2689,6 +2702,8 @@ void TextureCache<P>::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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue