diff --git a/Source/Core/VideoBackends/D3D/GeometryShaderCache.cpp b/Source/Core/VideoBackends/D3D/GeometryShaderCache.cpp index bacca56a7b..1452e617e3 100644 --- a/Source/Core/VideoBackends/D3D/GeometryShaderCache.cpp +++ b/Source/Core/VideoBackends/D3D/GeometryShaderCache.cpp @@ -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; } diff --git a/Source/Core/VideoBackends/D3D/GeometryShaderCache.h b/Source/Core/VideoBackends/D3D/GeometryShaderCache.h index e64ce151d4..f0cab99940 100644 --- a/Source/Core/VideoBackends/D3D/GeometryShaderCache.h +++ b/Source/Core/VideoBackends/D3D/GeometryShaderCache.h @@ -32,8 +32,6 @@ private: { ID3D11GeometryShader* shader; - std::string code; - GSCacheEntry() : shader(nullptr) {} void Destroy() { SAFE_RELEASE(shader); } }; diff --git a/Source/Core/VideoBackends/D3D/PixelShaderCache.cpp b/Source/Core/VideoBackends/D3D/PixelShaderCache.cpp index 144cc131c9..7e6bc036e7 100644 --- a/Source/Core/VideoBackends/D3D/PixelShaderCache.cpp +++ b/Source/Core/VideoBackends/D3D/PixelShaderCache.cpp @@ -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; } diff --git a/Source/Core/VideoBackends/D3D/PixelShaderCache.h b/Source/Core/VideoBackends/D3D/PixelShaderCache.h index 1ca764f646..0e81f3cf33 100644 --- a/Source/Core/VideoBackends/D3D/PixelShaderCache.h +++ b/Source/Core/VideoBackends/D3D/PixelShaderCache.h @@ -42,8 +42,6 @@ private: { ID3D11PixelShader* shader; - std::string code; - PSCacheEntry() : shader(nullptr) {} void Destroy() { SAFE_RELEASE(shader); } }; diff --git a/Source/Core/VideoBackends/D3D/VertexShaderCache.cpp b/Source/Core/VideoBackends/D3D/VertexShaderCache.cpp index 990eb9b284..cdcff17d02 100644 --- a/Source/Core/VideoBackends/D3D/VertexShaderCache.cpp +++ b/Source/Core/VideoBackends/D3D/VertexShaderCache.cpp @@ -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; } diff --git a/Source/Core/VideoBackends/D3D/VertexShaderCache.h b/Source/Core/VideoBackends/D3D/VertexShaderCache.h index 2f691a5172..7471d4f769 100644 --- a/Source/Core/VideoBackends/D3D/VertexShaderCache.h +++ b/Source/Core/VideoBackends/D3D/VertexShaderCache.h @@ -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) { diff --git a/Source/Core/VideoBackends/D3D12/ShaderCache.cpp b/Source/Core/VideoBackends/D3D12/ShaderCache.cpp index 13a7c99465..e1803111d3 100644 --- a/Source/Core/VideoBackends/D3D12/ShaderCache.cpp +++ b/Source/Core/VideoBackends/D3D12/ShaderCache.cpp @@ -30,14 +30,6 @@ VsBytecodeCache s_vs_bytecode_cache; // Used to keep track of blobs to release at Shutdown time. static std::vector s_shader_blob_list; -// Only used for shader debugging.. -using GsHlslCache = std::map; -using PsHlslCache = std::map; -using VsHlslCache = std::map; -static GsHlslCache s_gs_hlsl_cache; -static PsHlslCache s_ps_hlsl_cache; -static VsHlslCache s_vs_hlsl_cache; - static LinearDiskCache s_gs_disk_cache; static LinearDiskCache s_ps_disk_cache; static LinearDiskCache s_vs_disk_cache; @@ -100,10 +92,6 @@ void ShaderCache::Init() ShaderCacheInserter 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(s_ps_bytecode_cache.size())); SETSTAT(stats.numPixelShadersCreated, static_cast(s_ps_bytecode_cache.size())); SETSTAT(stats.numVertexShadersAlive, static_cast(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(gs_bytecode->GetBufferPointer()), static_cast(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(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(s_vs_bytecode_cache.size())); INCSTAT(stats.numVertexShadersCreated); - - if (g_ActiveConfig.bEnableShaderDebugging) - { - s_vs_hlsl_cache[vs_uid] = vs_code.GetBuffer(); - } } } diff --git a/Source/Core/VideoBackends/OGL/ProgramShaderCache.cpp b/Source/Core/VideoBackends/OGL/ProgramShaderCache.cpp index 4425444b8d..58bd6c2a7b 100644 --- a/Source/Core/VideoBackends/OGL/ProgramShaderCache.cpp +++ b/Source/Core/VideoBackends/OGL/ProgramShaderCache.cpp @@ -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) { diff --git a/Source/Core/VideoCommon/GeometryShaderGen.cpp b/Source/Core/VideoCommon/GeometryShaderGen.cpp index a137b7ff06..f3562254b9 100644 --- a/Source/Core/VideoCommon/GeometryShaderGen.cpp +++ b/Source/Core/VideoCommon/GeometryShaderGen.cpp @@ -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(out, ApiType, uid_data->numTexGens, uid_data->pixel_lighting, ""); diff --git a/Source/Core/VideoCommon/VideoConfig.cpp b/Source/Core/VideoCommon/VideoConfig.cpp index 753a65f9eb..c19528d7d9 100644 --- a/Source/Core/VideoCommon/VideoConfig.cpp +++ b/Source/Core/VideoCommon/VideoConfig.cpp @@ -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); diff --git a/Source/Core/VideoCommon/VideoConfig.h b/Source/Core/VideoCommon/VideoConfig.h index d39bfdd118..d78c63ba90 100644 --- a/Source/Core/VideoCommon/VideoConfig.h +++ b/Source/Core/VideoCommon/VideoConfig.h @@ -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;