diff options
| author | Admiral H. Curtiss <pikachu025@gmail.com> | 2022-12-28 15:38:46 +0100 |
|---|---|---|
| committer | Admiral H. Curtiss <pikachu025@gmail.com> | 2022-12-28 15:52:29 +0100 |
| commit | 50625728e089c8868eb919244d4e6eafa4f4cf79 (patch) | |
| tree | bc88f46cfe671ed8ed25cfa24fe83a9c74b83e3e /Source/Core/VideoCommon/VertexManagerBase.cpp | |
| parent | 0900e68986a4fa2254fb3c459f73af4815979e45 (diff) | |
VideoCommon: De-globalize VertexShaderManager class.
Diffstat (limited to 'Source/Core/VideoCommon/VertexManagerBase.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/VertexManagerBase.cpp | 26 |
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; } } |
