renderer_vulkan: Move microprofile defines to top of file

This commit is contained in:
GPUCode
2023-02-04 16:42:36 +02:00
parent 5849d29fc1
commit c1c68a3487
5 changed files with 16 additions and 20 deletions

View File

@ -17,6 +17,9 @@
#include "video_core/renderer_vulkan/vk_shader_gen_spv.h"
#include "video_core/renderer_vulkan/vk_shader_util.h"
MICROPROFILE_DEFINE(Vulkan_Pipeline, "Vulkan", "Pipeline Building", MP_RGB(0, 192, 32));
MICROPROFILE_DEFINE(Vulkan_Bind, "Vulkan", "Pipeline Bind", MP_RGB(192, 32, 32));
namespace Vulkan {
u32 AttribBytes(Pica::PipelineRegs::VertexAttributeFormat format, u32 size) {
@ -132,7 +135,6 @@ PipelineCache::GraphicsPipeline::~GraphicsPipeline() {
}
}
MICROPROFILE_DEFINE(Vulkan_Pipeline, "Vulkan", "Pipeline Building", MP_RGB(0, 192, 32));
bool PipelineCache::GraphicsPipeline::Build(bool fail_on_compile_required) {
if (fail_on_compile_required) {
if (!instance.IsPipelineCreationCacheControlSupported()) {
@ -461,7 +463,6 @@ void PipelineCache::SaveDiskCache() {
cache_file.Close();
}
MICROPROFILE_DEFINE(Vulkan_Bind, "Vulkan", "Pipeline Bind", MP_RGB(192, 32, 32));
bool PipelineCache::BindPipeline(const PipelineInfo& info, bool wait_built) {
MICROPROFILE_SCOPE(Vulkan_Bind);

View File

@ -15,7 +15,12 @@
#include "video_core/renderer_vulkan/vk_instance.h"
#include "video_core/renderer_vulkan/vk_rasterizer.h"
#include "video_core/renderer_vulkan/vk_scheduler.h"
#include "video_core/video_core.h"
MICROPROFILE_DEFINE(Vulkan_VS, "Vulkan", "Vertex Shader Setup", MP_RGB(192, 128, 128));
MICROPROFILE_DEFINE(Vulkan_GS, "Vulkan", "Geometry Shader Setup", MP_RGB(128, 192, 128));
MICROPROFILE_DEFINE(Vulkan_Drawing, "Vulkan", "Drawing", MP_RGB(128, 128, 192));
MICROPROFILE_DEFINE(Vulkan_CacheManagement, "Vulkan", "Cache Mgmt", MP_RGB(100, 255, 100));
MICROPROFILE_DEFINE(Vulkan_Blits, "Vulkan", "Blits", MP_RGB(100, 100, 255));
namespace Vulkan {
@ -339,14 +344,12 @@ void RasterizerVulkan::SetupFixedAttribs() {
stream_buffer.Commit(offset);
}
MICROPROFILE_DEFINE(Vulkan_VS, "Vulkan", "Vertex Shader Setup", MP_RGB(192, 128, 128));
bool RasterizerVulkan::SetupVertexShader() {
MICROPROFILE_SCOPE(Vulkan_VS);
return pipeline_cache.UseProgrammableVertexShader(Pica::g_state.regs, Pica::g_state.vs,
pipeline_info.vertex_layout);
}
MICROPROFILE_DEFINE(Vulkan_GS, "Vulkan", "Geometry Shader Setup", MP_RGB(128, 192, 128));
bool RasterizerVulkan::SetupGeometryShader() {
MICROPROFILE_SCOPE(Vulkan_GS);
const auto& regs = Pica::g_state.regs;
@ -459,7 +462,6 @@ void RasterizerVulkan::DrawTriangles() {
Draw(false, false);
}
MICROPROFILE_DEFINE(Vulkan_Drawing, "Vulkan", "Drawing", MP_RGB(128, 128, 192));
bool RasterizerVulkan::Draw(bool accelerate, bool is_indexed) {
MICROPROFILE_SCOPE(Vulkan_Drawing);
const auto& regs = Pica::g_state.regs;
@ -834,7 +836,6 @@ void RasterizerVulkan::NotifyFixedFunctionPicaRegisterChanged(u32 id) {
}
}
MICROPROFILE_DEFINE(Vulkan_CacheManagement, "Vulkan", "Cache Mgmt", MP_RGB(100, 255, 100));
void RasterizerVulkan::FlushAll() {
MICROPROFILE_SCOPE(Vulkan_CacheManagement);
res_cache.FlushAll();
@ -860,7 +861,6 @@ void RasterizerVulkan::ClearAll(bool flush) {
res_cache.ClearAll(flush);
}
MICROPROFILE_DEFINE(Vulkan_Blits, "Vulkan", "Blits", MP_RGB(100, 100, 255));
bool RasterizerVulkan::AccelerateDisplayTransfer(const GPU::Regs::DisplayTransferConfig& config) {
MICROPROFILE_SCOPE(Vulkan_Blits);

View File

@ -9,6 +9,9 @@
#include "video_core/renderer_vulkan/vk_renderpass_cache.h"
#include "video_core/renderer_vulkan/vk_scheduler.h"
MICROPROFILE_DEFINE(Vulkan_WaitForWorker, "Vulkan", "Wait for worker", MP_RGB(255, 192, 192));
MICROPROFILE_DEFINE(Vulkan_Submit, "Vulkan", "Submit Exectution", MP_RGB(255, 192, 255));
namespace Vulkan {
void Scheduler::CommandChunk::ExecuteAll(vk::CommandBuffer cmdbuf) {
@ -49,7 +52,6 @@ void Scheduler::Finish(vk::Semaphore signal, vk::Semaphore wait) {
Wait(presubmit_tick);
}
MICROPROFILE_DEFINE(Vulkan_WaitForWorker, "Vulkan", "Wait for worker", MP_RGB(255, 192, 192));
void Scheduler::WaitWorker() {
if (!use_worker_thread) {
return;
@ -110,7 +112,6 @@ void Scheduler::AllocateWorkerCommandBuffers() {
current_cmdbuf.begin(begin_info);
}
MICROPROFILE_DEFINE(Vulkan_Submit, "Vulkan", "Submit Exectution", MP_RGB(255, 192, 255));
void Scheduler::SubmitExecution(vk::Semaphore signal_semaphore, vk::Semaphore wait_semaphore) {
const vk::Semaphore handle = master_semaphore.Handle();
const u64 signal_value = master_semaphore.NextTick();

View File

@ -8,7 +8,6 @@
#include "common/assert.h"
#include "common/literals.h"
#include "common/logging/log.h"
#include "common/microprofile.h"
#include "video_core/renderer_vulkan/vk_shader_util.h"
namespace Vulkan {
@ -159,16 +158,12 @@ bool InitializeCompiler() {
return true;
}
MICROPROFILE_DEFINE(Vulkan_GLSLCompilation, "VulkanShader", "GLSL Shader Compilation",
MP_RGB(100, 255, 52));
vk::ShaderModule Compile(std::string_view code, vk::ShaderStageFlagBits stage, vk::Device device,
ShaderOptimization level) {
if (!InitializeCompiler()) {
return VK_NULL_HANDLE;
}
MICROPROFILE_SCOPE(Vulkan_GLSLCompilation);
EProfile profile = ECoreProfile;
EShMessages messages =
static_cast<EShMessages>(EShMsgDefault | EShMsgSpvRules | EShMsgVulkanRules);

View File

@ -14,6 +14,10 @@
#include <vk_mem_alloc.h>
#include <vulkan/vulkan_format_traits.hpp>
MICROPROFILE_DEFINE(Vulkan_ImageAlloc, "Vulkan", "Texture Allocation", MP_RGB(192, 52, 235));
MICROPROFILE_DEFINE(Vulkan_Upload, "Vulkan", "Texture Upload", MP_RGB(128, 192, 64));
MICROPROFILE_DEFINE(Vulkan_Download, "Vulkan", "Texture Download", MP_RGB(128, 192, 64));
namespace Vulkan {
struct RecordParams {
@ -152,9 +156,7 @@ StagingData TextureRuntime::FindStaging(u32 size, bool upload) {
};
}
MICROPROFILE_DEFINE(Vulkan_Finish, "Vulkan", "Scheduler Finish", MP_RGB(52, 192, 235));
void TextureRuntime::Finish() {
MICROPROFILE_SCOPE(Vulkan_Finish);
scheduler.Finish();
}
@ -164,7 +166,6 @@ ImageAlloc TextureRuntime::Allocate(u32 width, u32 height, VideoCore::PixelForma
return Allocate(width, height, format, type, traits.native, traits.usage, traits.aspect);
}
MICROPROFILE_DEFINE(Vulkan_ImageAlloc, "Vulkan", "TextureRuntime Finish", MP_RGB(192, 52, 235));
ImageAlloc TextureRuntime::Allocate(u32 width, u32 height, VideoCore::PixelFormat pixel_format,
VideoCore::TextureType type, vk::Format format,
vk::ImageUsageFlags usage, vk::ImageAspectFlags aspect) {
@ -828,7 +829,6 @@ Surface::~Surface() {
}
}
MICROPROFILE_DEFINE(Vulkan_Upload, "Vulkan", "Texture Upload", MP_RGB(128, 192, 64));
void Surface::Upload(const VideoCore::BufferTextureCopy& upload, const StagingData& staging) {
MICROPROFILE_SCOPE(Vulkan_Upload);
@ -925,7 +925,6 @@ void Surface::Upload(const VideoCore::BufferTextureCopy& upload, const StagingDa
InvalidateAllWatcher();
}
MICROPROFILE_DEFINE(Vulkan_Download, "Vulkan", "Texture Download", MP_RGB(128, 192, 64));
void Surface::Download(const VideoCore::BufferTextureCopy& download, const StagingData& staging) {
MICROPROFILE_SCOPE(Vulkan_Download);