summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/VertexManagerBase.cpp
diff options
context:
space:
mode:
authorAdmiral H. Curtiss <pikachu025@gmail.com>2022-12-28 15:38:46 +0100
committerAdmiral H. Curtiss <pikachu025@gmail.com>2022-12-28 15:52:29 +0100
commit50625728e089c8868eb919244d4e6eafa4f4cf79 (patch)
treebc88f46cfe671ed8ed25cfa24fe83a9c74b83e3e /Source/Core/VideoCommon/VertexManagerBase.cpp
parent0900e68986a4fa2254fb3c459f73af4815979e45 (diff)
VideoCommon: De-globalize VertexShaderManager class.
Diffstat (limited to 'Source/Core/VideoCommon/VertexManagerBase.cpp')
-rw-r--r--Source/Core/VideoCommon/VertexManagerBase.cpp26
1 files changed, 16 insertions, 10 deletions
diff --git a/Source/Core/VideoCommon/VertexManagerBase.cpp b/Source/Core/VideoCommon/VertexManagerBase.cpp
index 1c5998862c..03eed59a88 100644
--- a/Source/Core/VideoCommon/VertexManagerBase.cpp
+++ b/Source/Core/VideoCommon/VertexManagerBase.cpp
@@ -319,8 +319,9 @@ void VertexManagerBase::UploadUniforms()
void VertexManagerBase::InvalidateConstants()
{
auto& system = Core::System::GetInstance();
+ auto& vertex_shader_manager = system.GetVertexShaderManager();
auto& pixel_shader_manager = system.GetPixelShaderManager();
- VertexShaderManager::dirty = true;
+ vertex_shader_manager.dirty = true;
GeometryShaderManager::dirty = true;
pixel_shader_manager.dirty = true;
}
@@ -486,6 +487,7 @@ void VertexManagerBase::Flush()
auto& system = Core::System::GetInstance();
auto& pixel_shader_manager = system.GetPixelShaderManager();
+ auto& vertex_shader_manager = system.GetVertexShaderManager();
CalculateBinormals(VertexLoaderManager::GetCurrentVertexFormat());
// Calculate ZSlope for zfreeze
@@ -512,7 +514,7 @@ void VertexManagerBase::Flush()
}
}
}
- VertexShaderManager::SetConstants(texture_names);
+ vertex_shader_manager.SetConstants(texture_names);
if (!bpmem.genMode.zfreeze)
{
// Must be done after VertexShaderManager::SetConstants()
@@ -634,6 +636,8 @@ void VertexManagerBase::CalculateZSlope(NativeVertexFormat* format)
// Lookup vertices of the last rendered triangle and software-transform them
// This allows us to determine the depth slope, which will be used if z-freeze
// is enabled in the following flush.
+ auto& system = Core::System::GetInstance();
+ auto& vertex_shader_manager = system.GetVertexShaderManager();
for (unsigned int i = 0; i < 3; ++i)
{
// If this vertex format has per-vertex position matrix IDs, look it up.
@@ -643,8 +647,8 @@ void VertexManagerBase::CalculateZSlope(NativeVertexFormat* format)
if (vert_decl.position.components == 2)
VertexLoaderManager::position_cache[2 - i][2] = 0;
- VertexShaderManager::TransformToClipSpace(&VertexLoaderManager::position_cache[2 - i][0],
- &out[i * 4], mtxIdx);
+ vertex_shader_manager.TransformToClipSpace(&VertexLoaderManager::position_cache[2 - i][0],
+ &out[i * 4], mtxIdx);
// Transform to Screenspace
float inv_w = 1.0f / out[3 + i * 4];
@@ -688,15 +692,17 @@ void VertexManagerBase::CalculateBinormals(NativeVertexFormat* format)
VertexLoaderManager::tangent_cache[3] = 0;
VertexLoaderManager::binormal_cache[3] = 0;
- if (VertexShaderManager::constants.cached_tangent != VertexLoaderManager::tangent_cache)
+ auto& system = Core::System::GetInstance();
+ auto& vertex_shader_manager = system.GetVertexShaderManager();
+ if (vertex_shader_manager.constants.cached_tangent != VertexLoaderManager::tangent_cache)
{
- VertexShaderManager::constants.cached_tangent = VertexLoaderManager::tangent_cache;
- VertexShaderManager::dirty = true;
+ vertex_shader_manager.constants.cached_tangent = VertexLoaderManager::tangent_cache;
+ vertex_shader_manager.dirty = true;
}
- if (VertexShaderManager::constants.cached_binormal != VertexLoaderManager::binormal_cache)
+ if (vertex_shader_manager.constants.cached_binormal != VertexLoaderManager::binormal_cache)
{
- VertexShaderManager::constants.cached_binormal = VertexLoaderManager::binormal_cache;
- VertexShaderManager::dirty = true;
+ vertex_shader_manager.constants.cached_binormal = VertexLoaderManager::binormal_cache;
+ vertex_shader_manager.dirty = true;
}
}