Remove the rest of ShaderDebugging.

Without UID checking, it's basically a no-op that disables shader cache
and stores the shader source code (without ever reading it back).
This commit is contained in:
Scott Mansell 2016-02-28 10:01:25 +13:00
parent ebe5fd0b36
commit 2f134c5c36
11 changed files with 2 additions and 91 deletions

View File

@ -164,9 +164,6 @@ void GeometryShaderCache::Init()
GeometryShaderCacheInserter inserter;
g_gs_disk_cache.OpenAndRead(cache_filename, inserter);
if (g_Config.bEnableShaderDebugging)
Clear();
last_entry = nullptr;
}
@ -243,11 +240,6 @@ bool GeometryShaderCache::SetShader(u32 primitive_type)
bool success = InsertByteCode(uid, pbytecode->Data(), pbytecode->Size());
pbytecode->Release();
if (g_ActiveConfig.bEnableShaderDebugging && success)
{
GeometryShaders[uid].code = code.GetBuffer();
}
return success;
}

View File

@ -32,8 +32,6 @@ private:
{
ID3D11GeometryShader* shader;
std::string code;
GSCacheEntry() : shader(nullptr) {}
void Destroy() { SAFE_RELEASE(shader); }
};

View File

@ -504,9 +504,6 @@ void PixelShaderCache::Init()
PixelShaderCacheInserter inserter;
g_ps_disk_cache.OpenAndRead(cache_filename, inserter);
if (g_Config.bEnableShaderDebugging)
Clear();
last_entry = nullptr;
}
@ -596,11 +593,6 @@ bool PixelShaderCache::SetShader(DSTALPHA_MODE dstAlphaMode)
bool success = InsertByteCode(uid, pbytecode->Data(), pbytecode->Size());
pbytecode->Release();
if (g_ActiveConfig.bEnableShaderDebugging && success)
{
PixelShaders[uid].code = code.GetBuffer();
}
GFX_DEBUGGER_PAUSE_AT(NEXT_PIXEL_SHADER_CHANGE, true);
return success;
}

View File

@ -42,8 +42,6 @@ private:
{
ID3D11PixelShader* shader;
std::string code;
PSCacheEntry() : shader(nullptr) {}
void Destroy() { SAFE_RELEASE(shader); }
};

View File

@ -165,9 +165,6 @@ void VertexShaderCache::Init()
VertexShaderCacheInserter inserter;
g_vs_disk_cache.OpenAndRead(cache_filename, inserter);
if (g_Config.bEnableShaderDebugging)
Clear();
last_entry = nullptr;
}
@ -235,11 +232,6 @@ bool VertexShaderCache::SetShader()
bool success = InsertByteCode(uid, pbytecode);
pbytecode->Release();
if (g_ActiveConfig.bEnableShaderDebugging && success)
{
vshaders[uid].code = code.GetBuffer();
}
GFX_DEBUGGER_PAUSE_AT(NEXT_VERTEX_SHADER_CHANGE, true);
return success;
}

View File

@ -38,8 +38,6 @@ private:
ID3D11VertexShader* shader;
D3DBlob* bytecode; // needed to initialize the input layout
std::string code;
VSCacheEntry() : shader(nullptr), bytecode(nullptr) {}
void SetByteCode(D3DBlob* blob)
{

View File

@ -30,14 +30,6 @@ VsBytecodeCache s_vs_bytecode_cache;
// Used to keep track of blobs to release at Shutdown time.
static std::vector<ID3DBlob*> s_shader_blob_list;
// Only used for shader debugging..
using GsHlslCache = std::map<GeometryShaderUid, std::string>;
using PsHlslCache = std::map<PixelShaderUid, std::string>;
using VsHlslCache = std::map<VertexShaderUid, std::string>;
static GsHlslCache s_gs_hlsl_cache;
static PsHlslCache s_ps_hlsl_cache;
static VsHlslCache s_vs_hlsl_cache;
static LinearDiskCache<GeometryShaderUid, u8> s_gs_disk_cache;
static LinearDiskCache<PixelShaderUid, u8> s_ps_disk_cache;
static LinearDiskCache<VertexShaderUid, u8> s_vs_disk_cache;
@ -100,10 +92,6 @@ void ShaderCache::Init()
ShaderCacheInserter<VertexShaderUid, VsBytecodeCache, &s_vs_bytecode_cache> vs_inserter;
s_vs_disk_cache.OpenAndRead(vs_cache_filename, vs_inserter);
// Clear out cache when debugging shaders to ensure stale ones don't stick around..
if (g_Config.bEnableShaderDebugging)
Clear();
SETSTAT(stats.numPixelShadersAlive, static_cast<int>(s_ps_bytecode_cache.size()));
SETSTAT(stats.numPixelShadersCreated, static_cast<int>(s_ps_bytecode_cache.size()));
SETSTAT(stats.numVertexShadersAlive, static_cast<int>(s_vs_bytecode_cache.size()));
@ -141,13 +129,6 @@ void ShaderCache::Shutdown()
s_ps_disk_cache.Close();
s_vs_disk_cache.Sync();
s_vs_disk_cache.Close();
if (g_Config.bEnableShaderDebugging)
{
s_gs_hlsl_cache.clear();
s_ps_hlsl_cache.clear();
s_vs_hlsl_cache.clear();
}
}
void ShaderCache::LoadAndSetActiveShaders(DSTALPHA_MODE ps_dst_alpha_mode, u32 gs_primitive_type)
@ -234,11 +215,6 @@ void ShaderCache::HandleGSUIDChange(GeometryShaderUid gs_uid, u32 gs_primitive_t
s_last_geometry_shader_bytecode = InsertByteCode(gs_uid, &s_gs_bytecode_cache, gs_bytecode);
s_gs_disk_cache.Append(gs_uid, reinterpret_cast<u8*>(gs_bytecode->GetBufferPointer()),
static_cast<u32>(gs_bytecode->GetBufferSize()));
if (g_ActiveConfig.bEnableShaderDebugging)
{
s_gs_hlsl_cache[gs_uid] = gs_code.GetBuffer();
}
}
}
@ -269,11 +245,6 @@ void ShaderCache::HandlePSUIDChange(PixelShaderUid ps_uid, DSTALPHA_MODE ps_dst_
SETSTAT(stats.numPixelShadersAlive, static_cast<int>(s_ps_bytecode_cache.size()));
INCSTAT(stats.numPixelShadersCreated);
if (g_ActiveConfig.bEnableShaderDebugging)
{
s_ps_hlsl_cache[ps_uid] = ps_code.GetBuffer();
}
}
}
@ -304,11 +275,6 @@ void ShaderCache::HandleVSUIDChange(VertexShaderUid vs_uid)
SETSTAT(stats.numVertexShadersAlive, static_cast<int>(s_vs_bytecode_cache.size()));
INCSTAT(stats.numVertexShadersCreated);
if (g_ActiveConfig.bEnableShaderDebugging)
{
s_vs_hlsl_cache[vs_uid] = vs_code.GetBuffer();
}
}
}

View File

@ -213,13 +213,6 @@ SHADER* ProgramShaderCache::SetShader(DSTALPHA_MODE dstAlphaMode, u32 primitive_
!uid.guid.GetUidData()->IsPassthrough())
gcode = GenerateGeometryShaderCode(API_OPENGL, uid.guid.GetUidData());
if (g_ActiveConfig.bEnableShaderDebugging)
{
newentry.shader.strvprog = vcode.GetBuffer();
newentry.shader.strpprog = pcode.GetBuffer();
newentry.shader.strgprog = gcode.GetBuffer();
}
#if defined(_DEBUG) || defined(DEBUGFAST)
if (g_ActiveConfig.iLog & CONF_SAVESHADERS)
{
@ -421,7 +414,7 @@ void ProgramShaderCache::Init()
s_buffer = StreamBuffer::Create(GL_UNIFORM_BUFFER, UBO_LENGTH);
// Read our shader cache, only if supported
if (g_ogl_config.bSupportsGLSLCache && !g_Config.bEnableShaderDebugging)
if (g_ogl_config.bSupportsGLSLCache)
{
GLint Supported;
glGetIntegerv(GL_NUM_PROGRAM_BINARY_FORMATS, &Supported);
@ -455,7 +448,7 @@ void ProgramShaderCache::Init()
void ProgramShaderCache::Shutdown()
{
// store all shaders in cache on disk
if (g_ogl_config.bSupportsGLSLCache && !g_Config.bEnableShaderDebugging)
if (g_ogl_config.bSupportsGLSLCache)
{
for (auto& entry : pshaders)
{

View File

@ -85,7 +85,6 @@ ShaderCode GenerateGeometryShaderCode(API_TYPE ApiType, const geometry_shader_ui
"\tint4 " I_TEXOFFSET ";\n"
"};\n");
out.Write("struct VS_OUTPUT {\n");
GenerateVSOutputMembers<ShaderCode>(out, ApiType, uid_data->numTexGens, uid_data->pixel_lighting,
"");

View File

@ -79,7 +79,6 @@ void VideoConfig::Load(const std::string& ini_file)
settings->Get("TexFmtOverlayCenter", &bTexFmtOverlayCenter, 0);
settings->Get("WireFrame", &bWireFrame, 0);
settings->Get("DisableFog", &bDisableFog, 0);
settings->Get("EnableShaderDebugging", &bEnableShaderDebugging, false);
settings->Get("BorderlessFullscreen", &bBorderlessFullscreen, false);
settings->Get("SWZComploc", &bZComploc, true);
@ -120,18 +119,6 @@ void VideoConfig::Load(const std::string& ini_file)
interface->Get("UsePanicHandlers", &bTmp, true);
SetEnableAlert(bTmp);
// Shader Debugging causes a huge slowdown and it's easy to forget about it
// since it's not exposed in the settings dialog. It's only used by
// developers, so displaying an obnoxious message avoids some confusion and
// is not too annoying/confusing for users.
//
// XXX(delroth): This is kind of a bad place to put this, but the current
// VideoCommon is a mess and we don't have a central initialization
// function to do these kind of checks. Instead, the init code is
// triplicated for each video backend.
if (bEnableShaderDebugging)
OSD::AddMessage("Warning: Shader Debugging is enabled, performance will suffer heavily", 15000);
VerifyValidity();
}
@ -299,7 +286,6 @@ void VideoConfig::Save(const std::string& ini_file)
settings->Set("TexFmtOverlayCenter", bTexFmtOverlayCenter);
settings->Set("Wireframe", bWireFrame);
settings->Set("DisableFog", bDisableFog);
settings->Set("EnableShaderDebugging", bEnableShaderDebugging);
settings->Set("BorderlessFullscreen", bBorderlessFullscreen);
settings->Set("SWZComploc", bZComploc);

View File

@ -132,9 +132,6 @@ struct VideoConfig final
// D3D only config, mostly to be merged into the above
int iAdapter;
// Debugging
bool bEnableShaderDebugging;
// VideoSW Debugging
int drawStart;
int drawEnd;