VideoCommon: Add names for textures and shaders

This commit is contained in:
Pokechu22 2021-12-09 14:00:08 -08:00
parent 85d2ea0dd2
commit afd02b79a5
9 changed files with 146 additions and 46 deletions

View file

@ -3,6 +3,7 @@
#include "VideoCommon/FramebufferManager.h"
#include <fmt/format.h>
#include <memory>
#include "Common/ChunkFile.h"
@ -170,9 +171,10 @@ bool FramebufferManager::CreateEFBFramebuffer()
const TextureConfig efb_depth_texture_config = GetEFBDepthTextureConfig();
// We need a second texture to swap with for changing pixel formats
m_efb_color_texture = g_renderer->CreateTexture(efb_color_texture_config);
m_efb_depth_texture = g_renderer->CreateTexture(efb_depth_texture_config);
m_efb_convert_color_texture = g_renderer->CreateTexture(efb_color_texture_config);
m_efb_color_texture = g_renderer->CreateTexture(efb_color_texture_config, "EFB color texture");
m_efb_depth_texture = g_renderer->CreateTexture(efb_depth_texture_config, "EFB depth texture");
m_efb_convert_color_texture =
g_renderer->CreateTexture(efb_color_texture_config, "EFB convert color texture");
if (!m_efb_color_texture || !m_efb_depth_texture || !m_efb_convert_color_texture)
return false;
@ -188,7 +190,8 @@ bool FramebufferManager::CreateEFBFramebuffer()
{
m_efb_resolve_color_texture = g_renderer->CreateTexture(
TextureConfig(efb_color_texture_config.width, efb_color_texture_config.height, 1,
efb_color_texture_config.layers, 1, efb_color_texture_config.format, 0));
efb_color_texture_config.layers, 1, efb_color_texture_config.format, 0),
"EFB color resolve texture");
if (!m_efb_resolve_color_texture)
return false;
}
@ -199,7 +202,8 @@ bool FramebufferManager::CreateEFBFramebuffer()
m_efb_depth_resolve_texture = g_renderer->CreateTexture(
TextureConfig(efb_depth_texture_config.width, efb_depth_texture_config.height, 1,
efb_depth_texture_config.layers, 1, GetEFBDepthCopyFormat(),
AbstractTextureFlag_RenderTarget));
AbstractTextureFlag_RenderTarget),
"EFB depth resolve texture");
if (!m_efb_depth_resolve_texture)
return false;
@ -311,9 +315,11 @@ bool FramebufferManager::CompileConversionPipelines()
{
for (u32 i = 0; i < NUM_EFB_REINTERPRET_TYPES; i++)
{
EFBReinterpretType convtype = static_cast<EFBReinterpretType>(i);
std::unique_ptr<AbstractShader> pixel_shader = g_renderer->CreateShaderFromSource(
ShaderStage::Pixel, FramebufferShaderGen::GenerateFormatConversionShader(
static_cast<EFBReinterpretType>(i), GetEFBSamples()));
ShaderStage::Pixel,
FramebufferShaderGen::GenerateFormatConversionShader(convtype, GetEFBSamples()),
fmt::format("Framebuffer conversion pixel shader {}", convtype));
if (!pixel_shader)
return false;
@ -472,7 +478,8 @@ bool FramebufferManager::CompileReadbackPipelines()
if (IsEFBMultisampled())
{
auto depth_resolve_shader = g_renderer->CreateShaderFromSource(
ShaderStage::Pixel, FramebufferShaderGen::GenerateResolveDepthPixelShader(GetEFBSamples()));
ShaderStage::Pixel, FramebufferShaderGen::GenerateResolveDepthPixelShader(GetEFBSamples()),
"Depth resolve pixel shader");
if (!depth_resolve_shader)
return false;
@ -484,7 +491,8 @@ bool FramebufferManager::CompileReadbackPipelines()
// EFB restore pipeline
auto restore_shader = g_renderer->CreateShaderFromSource(
ShaderStage::Pixel, FramebufferShaderGen::GenerateEFBRestorePixelShader());
ShaderStage::Pixel, FramebufferShaderGen::GenerateEFBRestorePixelShader(),
"EFB restore pixel shader");
if (!restore_shader)
return false;
@ -514,7 +522,7 @@ bool FramebufferManager::CreateReadbackFramebuffer()
const TextureConfig color_config(IsUsingTiledEFBCache() ? m_efb_cache_tile_size : EFB_WIDTH,
IsUsingTiledEFBCache() ? m_efb_cache_tile_size : EFB_HEIGHT, 1,
1, 1, GetEFBColorFormat(), AbstractTextureFlag_RenderTarget);
m_efb_color_cache.texture = g_renderer->CreateTexture(color_config);
m_efb_color_cache.texture = g_renderer->CreateTexture(color_config, "EFB color cache");
if (!m_efb_color_cache.texture)
return false;
@ -536,7 +544,7 @@ bool FramebufferManager::CreateReadbackFramebuffer()
IsUsingTiledEFBCache() ? m_efb_cache_tile_size : EFB_HEIGHT, 1,
1, 1, GetEFBDepthCopyFormat(),
AbstractTextureFlag_RenderTarget);
m_efb_depth_cache.texture = g_renderer->CreateTexture(depth_config);
m_efb_depth_cache.texture = g_renderer->CreateTexture(depth_config, "EFB depth cache");
if (!m_efb_depth_cache.texture)
return false;
@ -684,7 +692,8 @@ void FramebufferManager::ClearEFB(const MathUtil::Rectangle<int>& rc, bool clear
bool FramebufferManager::CompileClearPipelines()
{
auto vertex_shader = g_renderer->CreateShaderFromSource(
ShaderStage::Vertex, FramebufferShaderGen::GenerateClearVertexShader());
ShaderStage::Vertex, FramebufferShaderGen::GenerateClearVertexShader(),
"Clear vertex shader");
if (!vertex_shader)
return false;
@ -853,7 +862,8 @@ bool FramebufferManager::CompilePokePipelines()
return false;
auto poke_vertex_shader = g_renderer->CreateShaderFromSource(
ShaderStage::Vertex, FramebufferShaderGen::GenerateEFBPokeVertexShader());
ShaderStage::Vertex, FramebufferShaderGen::GenerateEFBPokeVertexShader(),
"EFB poke vertex shader");
if (!poke_vertex_shader)
return false;