summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/Null/ShaderCache.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core/VideoBackends/Null/ShaderCache.cpp')
-rw-r--r--Source/Core/VideoBackends/Null/ShaderCache.cpp77
1 files changed, 0 insertions, 77 deletions
diff --git a/Source/Core/VideoBackends/Null/ShaderCache.cpp b/Source/Core/VideoBackends/Null/ShaderCache.cpp
deleted file mode 100644
index 0a5ef30595..0000000000
--- a/Source/Core/VideoBackends/Null/ShaderCache.cpp
+++ /dev/null
@@ -1,77 +0,0 @@
-// Copyright 2015 Dolphin Emulator Project
-// Licensed under GPLv2+
-// Refer to the license.txt file included.
-
-#include "VideoBackends/Null/ShaderCache.h"
-
-#include "VideoCommon/Debugger.h"
-#include "VideoCommon/Statistics.h"
-#include "VideoCommon/VideoCommon.h"
-
-namespace Null
-{
-template <typename Uid>
-ShaderCache<Uid>::ShaderCache()
-{
- Clear();
-
- SETSTAT(stats.numPixelShadersCreated, 0);
- SETSTAT(stats.numPixelShadersAlive, 0);
-}
-
-template <typename Uid>
-ShaderCache<Uid>::~ShaderCache()
-{
- Clear();
-}
-
-template <typename Uid>
-void ShaderCache<Uid>::Clear()
-{
- m_shaders.clear();
- m_last_entry = nullptr;
-}
-
-template <typename Uid>
-bool ShaderCache<Uid>::SetShader(PrimitiveType primitive_type)
-{
- Uid uid = GetUid(primitive_type, APIType::OpenGL);
-
- // Check if the shader is already set
- if (m_last_entry)
- {
- if (uid == m_last_uid)
- {
- return true;
- }
- }
-
- m_last_uid = uid;
-
- // Check if the shader is already in the cache
- auto iter = m_shaders.find(uid);
- if (iter != m_shaders.end())
- {
- const std::string& entry = iter->second;
- m_last_entry = &entry;
-
- GFX_DEBUGGER_PAUSE_AT(NEXT_PIXEL_SHADER_CHANGE, true);
- return true;
- }
-
- // Need to compile a new shader
- ShaderCode code = GenerateCode(APIType::OpenGL, uid);
- m_shaders.emplace(uid, code.GetBuffer());
-
- GFX_DEBUGGER_PAUSE_AT(NEXT_PIXEL_SHADER_CHANGE, true);
- return true;
-}
-
-template class ShaderCache<VertexShaderUid>;
-template class ShaderCache<GeometryShaderUid>;
-template class ShaderCache<PixelShaderUid>;
-
-std::unique_ptr<VertexShaderCache> VertexShaderCache::s_instance;
-std::unique_ptr<GeometryShaderCache> GeometryShaderCache::s_instance;
-std::unique_ptr<PixelShaderCache> PixelShaderCache::s_instance;
-}