video_core: Cleanup microprofiles

* Remove upload/download targets these are covered by the rasterizer cache
This commit is contained in:
GPUCode
2023-02-15 00:27:37 +02:00
parent df6b36eb67
commit c7d315058e
4 changed files with 17 additions and 20 deletions

View File

@@ -18,6 +18,15 @@
namespace OpenGL { namespace OpenGL {
namespace {
MICROPROFILE_DEFINE(OpenGL_VAO, "OpenGL", "Vertex Array Setup", MP_RGB(255, 128, 0));
MICROPROFILE_DEFINE(OpenGL_VS, "OpenGL", "Vertex Shader Setup", MP_RGB(192, 128, 128));
MICROPROFILE_DEFINE(OpenGL_GS, "OpenGL", "Geometry Shader Setup", MP_RGB(128, 192, 128));
MICROPROFILE_DEFINE(OpenGL_Drawing, "OpenGL", "Drawing", MP_RGB(128, 128, 192));
MICROPROFILE_DEFINE(OpenGL_CacheManagement, "OpenGL", "Cache Mgmt", MP_RGB(100, 255, 100));
MICROPROFILE_DEFINE(OpenGL_Blits, "OpenGL", "Blits", MP_RGB(100, 100, 255));
using VideoCore::SurfaceType; using VideoCore::SurfaceType;
constexpr std::size_t VERTEX_BUFFER_SIZE = 16 * 1024 * 1024; constexpr std::size_t VERTEX_BUFFER_SIZE = 16 * 1024 * 1024;
@@ -25,6 +34,8 @@ constexpr std::size_t INDEX_BUFFER_SIZE = 1 * 1024 * 1024;
constexpr std::size_t UNIFORM_BUFFER_SIZE = 2 * 1024 * 1024; constexpr std::size_t UNIFORM_BUFFER_SIZE = 2 * 1024 * 1024;
constexpr std::size_t TEXTURE_BUFFER_SIZE = 1 * 1024 * 1024; constexpr std::size_t TEXTURE_BUFFER_SIZE = 1 * 1024 * 1024;
} // Anonymous namespace
RasterizerOpenGL::RasterizerOpenGL(Memory::MemorySystem& memory_, Frontend::EmuWindow& emu_window, RasterizerOpenGL::RasterizerOpenGL(Memory::MemorySystem& memory_, Frontend::EmuWindow& emu_window,
Driver& driver_) Driver& driver_)
: RasterizerAccelerated{memory_}, driver{driver_}, runtime{driver}, res_cache{memory, runtime}, : RasterizerAccelerated{memory_}, driver{driver_}, runtime{driver}, res_cache{memory, runtime},
@@ -148,7 +159,6 @@ static constexpr std::array<GLenum, 4> vs_attrib_types{
GL_FLOAT // VertexAttributeFormat::FLOAT GL_FLOAT // VertexAttributeFormat::FLOAT
}; };
MICROPROFILE_DEFINE(OpenGL_VAO, "OpenGL", "Vertex Array Setup", MP_RGB(255, 128, 0));
void RasterizerOpenGL::SetupVertexArray(u8* array_ptr, GLintptr buffer_offset, void RasterizerOpenGL::SetupVertexArray(u8* array_ptr, GLintptr buffer_offset,
GLuint vs_input_index_min, GLuint vs_input_index_max) { GLuint vs_input_index_min, GLuint vs_input_index_max) {
MICROPROFILE_SCOPE(OpenGL_VAO); MICROPROFILE_SCOPE(OpenGL_VAO);
@@ -227,13 +237,11 @@ void RasterizerOpenGL::SetupVertexArray(u8* array_ptr, GLintptr buffer_offset,
} }
} }
MICROPROFILE_DEFINE(OpenGL_VS, "OpenGL", "Vertex Shader Setup", MP_RGB(192, 128, 128));
bool RasterizerOpenGL::SetupVertexShader() { bool RasterizerOpenGL::SetupVertexShader() {
MICROPROFILE_SCOPE(OpenGL_VS); MICROPROFILE_SCOPE(OpenGL_VS);
return shader_program_manager.UseProgrammableVertexShader(regs, Pica::g_state.vs); return shader_program_manager.UseProgrammableVertexShader(regs, Pica::g_state.vs);
} }
MICROPROFILE_DEFINE(OpenGL_GS, "OpenGL", "Geometry Shader Setup", MP_RGB(128, 192, 128));
bool RasterizerOpenGL::SetupGeometryShader() { bool RasterizerOpenGL::SetupGeometryShader() {
MICROPROFILE_SCOPE(OpenGL_GS); MICROPROFILE_SCOPE(OpenGL_GS);
@@ -334,7 +342,6 @@ void RasterizerOpenGL::DrawTriangles() {
Draw(false, false); Draw(false, false);
} }
MICROPROFILE_DEFINE(OpenGL_Drawing, "OpenGL", "Drawing", MP_RGB(128, 128, 192));
bool RasterizerOpenGL::Draw(bool accelerate, bool is_indexed) { bool RasterizerOpenGL::Draw(bool accelerate, bool is_indexed) {
MICROPROFILE_SCOPE(OpenGL_Drawing); MICROPROFILE_SCOPE(OpenGL_Drawing);
@@ -619,7 +626,6 @@ void RasterizerOpenGL::NotifyFixedFunctionPicaRegisterChanged(u32 id) {
} }
} }
MICROPROFILE_DEFINE(OpenGL_CacheManagement, "OpenGL", "Cache Mgmt", MP_RGB(100, 255, 100));
void RasterizerOpenGL::FlushAll() { void RasterizerOpenGL::FlushAll() {
MICROPROFILE_SCOPE(OpenGL_CacheManagement); MICROPROFILE_SCOPE(OpenGL_CacheManagement);
res_cache.FlushAll(); res_cache.FlushAll();
@@ -645,7 +651,6 @@ void RasterizerOpenGL::ClearAll(bool flush) {
res_cache.ClearAll(flush); res_cache.ClearAll(flush);
} }
MICROPROFILE_DEFINE(OpenGL_Blits, "OpenGL", "Blits", MP_RGB(100, 100, 255));
bool RasterizerOpenGL::AccelerateDisplayTransfer(const GPU::Regs::DisplayTransferConfig& config) { bool RasterizerOpenGL::AccelerateDisplayTransfer(const GPU::Regs::DisplayTransferConfig& config) {
MICROPROFILE_SCOPE(OpenGL_Blits); MICROPROFILE_SCOPE(OpenGL_Blits);
return res_cache.AccelerateDisplayTransfer(config); return res_cache.AccelerateDisplayTransfer(config);

View File

@@ -336,10 +336,7 @@ Surface::~Surface() {
} }
} }
MICROPROFILE_DEFINE(OpenGL_Upload, "OpenGL", "Texture Upload", MP_RGB(128, 192, 64));
void Surface::Upload(const VideoCore::BufferTextureCopy& upload, const StagingData& staging) { void Surface::Upload(const VideoCore::BufferTextureCopy& upload, const StagingData& staging) {
MICROPROFILE_SCOPE(OpenGL_Upload);
// Ensure no bad interactions with GL_UNPACK_ALIGNMENT // Ensure no bad interactions with GL_UNPACK_ALIGNMENT
ASSERT(stride * GetBytesPerPixel(pixel_format) % 4 == 0); ASSERT(stride * GetBytesPerPixel(pixel_format) % 4 == 0);
@@ -369,10 +366,7 @@ void Surface::Upload(const VideoCore::BufferTextureCopy& upload, const StagingDa
} }
} }
MICROPROFILE_DEFINE(OpenGL_Download, "OpenGL", "Texture Download", MP_RGB(128, 192, 64));
void Surface::Download(const VideoCore::BufferTextureCopy& download, const StagingData& staging) { void Surface::Download(const VideoCore::BufferTextureCopy& download, const StagingData& staging) {
MICROPROFILE_SCOPE(OpenGL_Download);
// Ensure no bad interactions with GL_PACK_ALIGNMENT // Ensure no bad interactions with GL_PACK_ALIGNMENT
ASSERT(stride * GetBytesPerPixel(pixel_format) % 4 == 0); ASSERT(stride * GetBytesPerPixel(pixel_format) % 4 == 0);

View File

@@ -16,14 +16,16 @@
#include "video_core/renderer_vulkan/vk_rasterizer.h" #include "video_core/renderer_vulkan/vk_rasterizer.h"
#include "video_core/renderer_vulkan/vk_scheduler.h" #include "video_core/renderer_vulkan/vk_scheduler.h"
namespace Vulkan {
namespace {
MICROPROFILE_DEFINE(Vulkan_VS, "Vulkan", "Vertex Shader Setup", MP_RGB(192, 128, 128)); 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_GS, "Vulkan", "Geometry Shader Setup", MP_RGB(128, 192, 128));
MICROPROFILE_DEFINE(Vulkan_Drawing, "Vulkan", "Drawing", MP_RGB(128, 128, 192)); 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_CacheManagement, "Vulkan", "Cache Mgmt", MP_RGB(100, 255, 100));
MICROPROFILE_DEFINE(Vulkan_Blits, "Vulkan", "Blits", MP_RGB(100, 100, 255)); MICROPROFILE_DEFINE(Vulkan_Blits, "Vulkan", "Blits", MP_RGB(100, 100, 255));
namespace Vulkan {
using TriangleTopology = Pica::PipelineRegs::TriangleTopology; using TriangleTopology = Pica::PipelineRegs::TriangleTopology;
using VideoCore::SurfaceType; using VideoCore::SurfaceType;
@@ -65,6 +67,8 @@ struct DrawParams {
return std::min(max_size, TEXTURE_BUFFER_SIZE); return std::min(max_size, TEXTURE_BUFFER_SIZE);
} }
} // Anonymous namespace
RasterizerVulkan::RasterizerVulkan(Memory::MemorySystem& memory_, Frontend::EmuWindow& emu_window, RasterizerVulkan::RasterizerVulkan(Memory::MemorySystem& memory_, Frontend::EmuWindow& emu_window,
const Instance& instance, Scheduler& scheduler, const Instance& instance, Scheduler& scheduler,
DescriptorManager& desc_manager, TextureRuntime& runtime, DescriptorManager& desc_manager, TextureRuntime& runtime,

View File

@@ -15,8 +15,6 @@
#include <vulkan/vulkan_format_traits.hpp> #include <vulkan/vulkan_format_traits.hpp>
MICROPROFILE_DEFINE(Vulkan_ImageAlloc, "Vulkan", "Texture Allocation", MP_RGB(192, 52, 235)); 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 { namespace Vulkan {
@@ -780,8 +778,6 @@ Surface::~Surface() {
} }
void Surface::Upload(const VideoCore::BufferTextureCopy& upload, const StagingData& staging) { void Surface::Upload(const VideoCore::BufferTextureCopy& upload, const StagingData& staging) {
MICROPROFILE_SCOPE(Vulkan_Upload);
runtime.renderpass_cache.ExitRenderpass(); runtime.renderpass_cache.ExitRenderpass();
const bool is_scaled = res_scale != 1; const bool is_scaled = res_scale != 1;
@@ -874,8 +870,6 @@ void Surface::Upload(const VideoCore::BufferTextureCopy& upload, const StagingDa
} }
void Surface::Download(const VideoCore::BufferTextureCopy& download, const StagingData& staging) { void Surface::Download(const VideoCore::BufferTextureCopy& download, const StagingData& staging) {
MICROPROFILE_SCOPE(Vulkan_Download);
runtime.renderpass_cache.ExitRenderpass(); runtime.renderpass_cache.ExitRenderpass();
// For depth stencil downloads always use the compute shader fallback // For depth stencil downloads always use the compute shader fallback