diff --git a/Source/Core/Core/System.cpp b/Source/Core/Core/System.cpp index 65fc9d283b..ba47b9e9c2 100644 --- a/Source/Core/Core/System.cpp +++ b/Source/Core/Core/System.cpp @@ -20,6 +20,7 @@ #include "Core/HW/VideoInterface.h" #include "VideoCommon/CommandProcessor.h" #include "VideoCommon/Fifo.h" +#include "VideoCommon/GeometryShaderManager.h" #include "VideoCommon/PixelEngine.h" #include "VideoCommon/PixelShaderManager.h" #include "VideoCommon/VertexShaderManager.h" @@ -40,6 +41,7 @@ struct System::Impl DVDThread::DVDThreadState m_dvd_thread_state; ExpansionInterface::ExpansionInterfaceState m_expansion_interface_state; Fifo::FifoManager m_fifo; + GeometryShaderManager m_geometry_shader_manager; Memory::MemoryManager m_memory; MemoryInterface::MemoryInterfaceState m_memory_interface_state; PixelEngine::PixelEngineManager m_pixel_engine; @@ -133,6 +135,11 @@ Fifo::FifoManager& System::GetFifo() const return m_impl->m_fifo; } +GeometryShaderManager& System::GetGeometryShaderManager() const +{ + return m_impl->m_geometry_shader_manager; +} + Memory::MemoryManager& System::GetMemory() const { return m_impl->m_memory; diff --git a/Source/Core/Core/System.h b/Source/Core/Core/System.h index d5615142b4..fe8b9ca36e 100644 --- a/Source/Core/Core/System.h +++ b/Source/Core/Core/System.h @@ -5,6 +5,7 @@ #include +class GeometryShaderManager; class PixelShaderManager; class SoundStream; struct Sram; @@ -105,6 +106,7 @@ public: DVDThread::DVDThreadState& GetDVDThreadState() const; ExpansionInterface::ExpansionInterfaceState& GetExpansionInterfaceState() const; Fifo::FifoManager& GetFifo() const; + GeometryShaderManager& GetGeometryShaderManager() const; Memory::MemoryManager& GetMemory() const; MemoryInterface::MemoryInterfaceState& GetMemoryInterfaceState() const; PixelEngine::PixelEngineManager& GetPixelEngine() const; diff --git a/Source/Core/VideoBackends/D3D/D3DVertexManager.cpp b/Source/Core/VideoBackends/D3D/D3DVertexManager.cpp index 5b5cf5c941..ce41e90e31 100644 --- a/Source/Core/VideoBackends/D3D/D3DVertexManager.cpp +++ b/Source/Core/VideoBackends/D3D/D3DVertexManager.cpp @@ -272,11 +272,12 @@ void VertexManager::UploadUniforms() vertex_shader_manager.dirty = false; } - if (GeometryShaderManager::dirty) + auto& geometry_shader_manager = system.GetGeometryShaderManager(); + if (geometry_shader_manager.dirty) { - UpdateConstantBuffer(m_geometry_constant_buffer.Get(), &GeometryShaderManager::constants, + UpdateConstantBuffer(m_geometry_constant_buffer.Get(), &geometry_shader_manager.constants, sizeof(GeometryShaderConstants)); - GeometryShaderManager::dirty = false; + geometry_shader_manager.dirty = false; } auto& pixel_shader_manager = system.GetPixelShaderManager(); diff --git a/Source/Core/VideoBackends/D3D12/D3D12VertexManager.cpp b/Source/Core/VideoBackends/D3D12/D3D12VertexManager.cpp index 510955a201..3ea1008413 100644 --- a/Source/Core/VideoBackends/D3D12/D3D12VertexManager.cpp +++ b/Source/Core/VideoBackends/D3D12/D3D12VertexManager.cpp @@ -161,15 +161,18 @@ void VertexManager::UpdateVertexShaderConstants() void VertexManager::UpdateGeometryShaderConstants() { - if (!GeometryShaderManager::dirty || !ReserveConstantStorage()) + auto& system = Core::System::GetInstance(); + auto& geometry_shader_manager = system.GetGeometryShaderManager(); + + if (!geometry_shader_manager.dirty || !ReserveConstantStorage()) return; Renderer::GetInstance()->SetConstantBuffer(2, m_uniform_stream_buffer.GetCurrentGPUPointer()); - std::memcpy(m_uniform_stream_buffer.GetCurrentHostPointer(), &GeometryShaderManager::constants, + std::memcpy(m_uniform_stream_buffer.GetCurrentHostPointer(), &geometry_shader_manager.constants, sizeof(GeometryShaderConstants)); m_uniform_stream_buffer.CommitMemory(sizeof(GeometryShaderConstants)); ADDSTAT(g_stats.this_frame.bytes_uniform_streamed, sizeof(GeometryShaderConstants)); - GeometryShaderManager::dirty = false; + geometry_shader_manager.dirty = false; } void VertexManager::UpdatePixelShaderConstants() @@ -241,6 +244,7 @@ void VertexManager::UploadAllConstants() auto& system = Core::System::GetInstance(); auto& pixel_shader_manager = system.GetPixelShaderManager(); auto& vertex_shader_manager = system.GetVertexShaderManager(); + auto& geometry_shader_manager = system.GetGeometryShaderManager(); // Copy the actual data in std::memcpy(m_uniform_stream_buffer.GetCurrentHostPointer() + pixel_constants_offset, @@ -248,7 +252,7 @@ void VertexManager::UploadAllConstants() std::memcpy(m_uniform_stream_buffer.GetCurrentHostPointer() + vertex_constants_offset, &vertex_shader_manager.constants, sizeof(VertexShaderConstants)); std::memcpy(m_uniform_stream_buffer.GetCurrentHostPointer() + geometry_constants_offset, - &GeometryShaderManager::constants, sizeof(GeometryShaderConstants)); + &geometry_shader_manager.constants, sizeof(GeometryShaderConstants)); // Finally, flush buffer memory after copying m_uniform_stream_buffer.CommitMemory(allocation_size); @@ -256,7 +260,7 @@ void VertexManager::UploadAllConstants() // Clear dirty flags vertex_shader_manager.dirty = false; - GeometryShaderManager::dirty = false; + geometry_shader_manager.dirty = false; pixel_shader_manager.dirty = false; } diff --git a/Source/Core/VideoBackends/Metal/MTLStateTracker.mm b/Source/Core/VideoBackends/Metal/MTLStateTracker.mm index c5405246b4..4e24cd737d 100644 --- a/Source/Core/VideoBackends/Metal/MTLStateTracker.mm +++ b/Source/Core/VideoBackends/Metal/MTLStateTracker.mm @@ -848,7 +848,9 @@ void Metal::StateTracker::PrepareRender() if (!m_flags.has_gx_gs_uniform && pipe->UsesVertexBuffer(2)) { m_flags.has_gx_gs_uniform = true; - [m_current_render_encoder setVertexBytes:&GeometryShaderManager::constants + auto& system = Core::System::GetInstance(); + auto& geometry_shader_manager = system.GetGeometryShaderManager(); + [m_current_render_encoder setVertexBytes:&geometry_shader_manager.constants length:sizeof(GeometryShaderConstants) atIndex:2]; ADDSTAT(g_stats.this_frame.bytes_uniform_streamed, sizeof(GeometryShaderConstants)); diff --git a/Source/Core/VideoBackends/Metal/MTLVertexManager.mm b/Source/Core/VideoBackends/Metal/MTLVertexManager.mm index 69ec48552b..91f1d42eec 100644 --- a/Source/Core/VideoBackends/Metal/MTLVertexManager.mm +++ b/Source/Core/VideoBackends/Metal/MTLVertexManager.mm @@ -92,11 +92,12 @@ void Metal::VertexManager::CommitBuffer(u32 num_vertices, u32 vertex_stride, u32 void Metal::VertexManager::UploadUniforms() { auto& system = Core::System::GetInstance(); - auto& pixel_shader_manager = system.GetPixelShaderManager(); auto& vertex_shader_manager = system.GetVertexShaderManager(); - g_state_tracker->InvalidateUniforms(vertex_shader_manager.dirty, GeometryShaderManager::dirty, + auto& geometry_shader_manager = system.GetGeometryShaderManager(); + auto& pixel_shader_manager = system.GetPixelShaderManager(); + g_state_tracker->InvalidateUniforms(vertex_shader_manager.dirty, geometry_shader_manager.dirty, pixel_shader_manager.dirty); vertex_shader_manager.dirty = false; - GeometryShaderManager::dirty = false; + geometry_shader_manager.dirty = false; pixel_shader_manager.dirty = false; } diff --git a/Source/Core/VideoBackends/OGL/ProgramShaderCache.cpp b/Source/Core/VideoBackends/OGL/ProgramShaderCache.cpp index 7566611041..b4635c36ec 100644 --- a/Source/Core/VideoBackends/OGL/ProgramShaderCache.cpp +++ b/Source/Core/VideoBackends/OGL/ProgramShaderCache.cpp @@ -224,7 +224,8 @@ void ProgramShaderCache::UploadConstants() auto& system = Core::System::GetInstance(); auto& pixel_shader_manager = system.GetPixelShaderManager(); auto& vertex_shader_manager = system.GetVertexShaderManager(); - if (pixel_shader_manager.dirty || vertex_shader_manager.dirty || GeometryShaderManager::dirty) + auto& geometry_shader_manager = system.GetGeometryShaderManager(); + if (pixel_shader_manager.dirty || vertex_shader_manager.dirty || geometry_shader_manager.dirty) { auto buffer = s_buffer->Map(s_ubo_buffer_size, s_ubo_align); @@ -235,7 +236,7 @@ void ProgramShaderCache::UploadConstants() memcpy(buffer.first + Common::AlignUp(sizeof(PixelShaderConstants), s_ubo_align) + Common::AlignUp(sizeof(VertexShaderConstants), s_ubo_align), - &GeometryShaderManager::constants, sizeof(GeometryShaderConstants)); + &geometry_shader_manager.constants, sizeof(GeometryShaderConstants)); s_buffer->Unmap(s_ubo_buffer_size); glBindBufferRange(GL_UNIFORM_BUFFER, 1, s_buffer->m_buffer, buffer.second, @@ -250,7 +251,7 @@ void ProgramShaderCache::UploadConstants() pixel_shader_manager.dirty = false; vertex_shader_manager.dirty = false; - GeometryShaderManager::dirty = false; + geometry_shader_manager.dirty = false; ADDSTAT(g_stats.this_frame.bytes_uniform_streamed, s_ubo_buffer_size); } diff --git a/Source/Core/VideoBackends/Vulkan/VKVertexManager.cpp b/Source/Core/VideoBackends/Vulkan/VKVertexManager.cpp index 86b2e361ef..025fa2be29 100644 --- a/Source/Core/VideoBackends/Vulkan/VKVertexManager.cpp +++ b/Source/Core/VideoBackends/Vulkan/VKVertexManager.cpp @@ -222,17 +222,20 @@ void VertexManager::UpdateVertexShaderConstants() void VertexManager::UpdateGeometryShaderConstants() { - if (!GeometryShaderManager::dirty || !ReserveConstantStorage()) + auto& system = Core::System::GetInstance(); + auto& geometry_shader_manager = system.GetGeometryShaderManager(); + + if (!geometry_shader_manager.dirty || !ReserveConstantStorage()) return; StateTracker::GetInstance()->SetGXUniformBuffer( UBO_DESCRIPTOR_SET_BINDING_GS, m_uniform_stream_buffer->GetBuffer(), m_uniform_stream_buffer->GetCurrentOffset(), sizeof(GeometryShaderConstants)); - std::memcpy(m_uniform_stream_buffer->GetCurrentHostPointer(), &GeometryShaderManager::constants, + std::memcpy(m_uniform_stream_buffer->GetCurrentHostPointer(), &geometry_shader_manager.constants, sizeof(GeometryShaderConstants)); m_uniform_stream_buffer->CommitMemory(sizeof(GeometryShaderConstants)); ADDSTAT(g_stats.this_frame.bytes_uniform_streamed, sizeof(GeometryShaderConstants)); - GeometryShaderManager::dirty = false; + geometry_shader_manager.dirty = false; } void VertexManager::UpdatePixelShaderConstants() @@ -293,6 +296,7 @@ void VertexManager::UploadAllConstants() auto& system = Core::System::GetInstance(); auto& pixel_shader_manager = system.GetPixelShaderManager(); auto& vertex_shader_manager = system.GetVertexShaderManager(); + auto& geometry_shader_manager = system.GetGeometryShaderManager(); // Update bindings StateTracker::GetInstance()->SetGXUniformBuffer( @@ -314,7 +318,7 @@ void VertexManager::UploadAllConstants() std::memcpy(m_uniform_stream_buffer->GetCurrentHostPointer() + vertex_constants_offset, &vertex_shader_manager.constants, sizeof(VertexShaderConstants)); std::memcpy(m_uniform_stream_buffer->GetCurrentHostPointer() + geometry_constants_offset, - &GeometryShaderManager::constants, sizeof(GeometryShaderConstants)); + &geometry_shader_manager.constants, sizeof(GeometryShaderConstants)); // Finally, flush buffer memory after copying m_uniform_stream_buffer->CommitMemory(allocation_size); @@ -322,7 +326,7 @@ void VertexManager::UploadAllConstants() // Clear dirty flags vertex_shader_manager.dirty = false; - GeometryShaderManager::dirty = false; + geometry_shader_manager.dirty = false; pixel_shader_manager.dirty = false; } diff --git a/Source/Core/VideoCommon/BPStructs.cpp b/Source/Core/VideoCommon/BPStructs.cpp index 376249fab9..075e2243bf 100644 --- a/Source/Core/VideoCommon/BPStructs.cpp +++ b/Source/Core/VideoCommon/BPStructs.cpp @@ -55,7 +55,8 @@ void BPInit() } static void BPWritten(PixelShaderManager& pixel_shader_manager, - VertexShaderManager& vertex_shader_manager, const BPCmd& bp, + VertexShaderManager& vertex_shader_manager, + GeometryShaderManager& geometry_shader_manager, const BPCmd& bp, int cycles_into_future) { /* @@ -138,10 +139,10 @@ static void BPWritten(PixelShaderManager& pixel_shader_manager, case BPMEM_SCISSORBR: // Scissor Rectable Bottom, Right case BPMEM_SCISSOROFFSET: // Scissor Offset vertex_shader_manager.SetViewportChanged(); - GeometryShaderManager::SetViewportChanged(); + geometry_shader_manager.SetViewportChanged(); return; case BPMEM_LINEPTWIDTH: // Line Width - GeometryShaderManager::SetLinePtWidthChanged(); + geometry_shader_manager.SetLinePtWidthChanged(); return; case BPMEM_ZMODE: // Depth Control PRIM_LOG("zmode: test={}, func={}, upd={}", bpmem.zmode.testenable, bpmem.zmode.func, @@ -674,7 +675,7 @@ static void BPWritten(PixelShaderManager& pixel_shader_manager, if (bp.changes) { pixel_shader_manager.SetTexCoordChanged((bp.address - BPMEM_SU_SSIZE) >> 1); - GeometryShaderManager::SetTexCoordChanged((bp.address - BPMEM_SU_SSIZE) >> 1); + geometry_shader_manager.SetTexCoordChanged((bp.address - BPMEM_SU_SSIZE) >> 1); } return; } @@ -763,8 +764,8 @@ void LoadBPReg(u8 reg, u32 value, int cycles_into_future) if (reg != BPMEM_BP_MASK) bpmem.bpMask = 0xFFFFFF; - BPWritten(system.GetPixelShaderManager(), system.GetVertexShaderManager(), bp, - cycles_into_future); + BPWritten(system.GetPixelShaderManager(), system.GetVertexShaderManager(), + system.GetGeometryShaderManager(), bp, cycles_into_future); } void LoadBPRegPreprocess(u8 reg, u32 value, int cycles_into_future) diff --git a/Source/Core/VideoCommon/GeometryShaderManager.cpp b/Source/Core/VideoCommon/GeometryShaderManager.cpp index 459df67868..183b16acab 100644 --- a/Source/Core/VideoCommon/GeometryShaderManager.cpp +++ b/Source/Core/VideoCommon/GeometryShaderManager.cpp @@ -12,13 +12,7 @@ #include "VideoCommon/VideoConfig.h" #include "VideoCommon/XFMemory.h" -static const int LINE_PT_TEX_OFFSETS[8] = {0, 16, 8, 4, 2, 1, 1, 1}; - -GeometryShaderConstants GeometryShaderManager::constants; -bool GeometryShaderManager::dirty; - -static bool s_projection_changed; -static bool s_viewport_changed; +static constexpr int LINE_PT_TEX_OFFSETS[8] = {0, 16, 8, 4, 2, 1, 1, 1}; void GeometryShaderManager::Init() { @@ -35,7 +29,7 @@ void GeometryShaderManager::Dirty() { // This function is called after a savestate is loaded. // Any constants that can changed based on settings should be re-calculated - s_projection_changed = true; + m_projection_changed = true; // Uses EFB scale config SetLinePtWidthChanged(); @@ -43,20 +37,20 @@ void GeometryShaderManager::Dirty() dirty = true; } -static void SetVSExpand(VSExpand expand) +void GeometryShaderManager::SetVSExpand(VSExpand expand) { - if (GeometryShaderManager::constants.vs_expand != expand) + if (constants.vs_expand != expand) { - GeometryShaderManager::constants.vs_expand = expand; - GeometryShaderManager::dirty = true; + constants.vs_expand = expand; + dirty = true; } } void GeometryShaderManager::SetConstants(PrimitiveType prim) { - if (s_projection_changed && g_ActiveConfig.stereo_mode != StereoMode::Off) + if (m_projection_changed && g_ActiveConfig.stereo_mode != StereoMode::Off) { - s_projection_changed = false; + m_projection_changed = false; if (xfmem.projection.type == ProjectionType::Perspective) { @@ -86,9 +80,9 @@ void GeometryShaderManager::SetConstants(PrimitiveType prim) SetVSExpand(VSExpand::None); } - if (s_viewport_changed) + if (m_viewport_changed) { - s_viewport_changed = false; + m_viewport_changed = false; constants.lineptparams[0] = 2.0f * xfmem.viewport.wd; constants.lineptparams[1] = -2.0f * xfmem.viewport.ht; @@ -99,12 +93,12 @@ void GeometryShaderManager::SetConstants(PrimitiveType prim) void GeometryShaderManager::SetViewportChanged() { - s_viewport_changed = true; + m_viewport_changed = true; } void GeometryShaderManager::SetProjectionChanged() { - s_projection_changed = true; + m_projection_changed = true; } void GeometryShaderManager::SetLinePtWidthChanged() @@ -129,8 +123,8 @@ void GeometryShaderManager::SetTexCoordChanged(u8 texmapid) void GeometryShaderManager::DoState(PointerWrap& p) { - p.Do(s_projection_changed); - p.Do(s_viewport_changed); + p.Do(m_projection_changed); + p.Do(m_viewport_changed); p.Do(constants); diff --git a/Source/Core/VideoCommon/GeometryShaderManager.h b/Source/Core/VideoCommon/GeometryShaderManager.h index 2b449b9089..de2abddd23 100644 --- a/Source/Core/VideoCommon/GeometryShaderManager.h +++ b/Source/Core/VideoCommon/GeometryShaderManager.h @@ -13,16 +13,22 @@ enum class PrimitiveType : u32; class GeometryShaderManager { public: - static void Init(); - static void Dirty(); - static void DoState(PointerWrap& p); + void Init(); + void Dirty(); + void DoState(PointerWrap& p); - static void SetConstants(PrimitiveType prim); - static void SetViewportChanged(); - static void SetProjectionChanged(); - static void SetLinePtWidthChanged(); - static void SetTexCoordChanged(u8 texmapid); + void SetConstants(PrimitiveType prim); + void SetViewportChanged(); + void SetProjectionChanged(); + void SetLinePtWidthChanged(); + void SetTexCoordChanged(u8 texmapid); - static GeometryShaderConstants constants; - static bool dirty; + GeometryShaderConstants constants{}; + bool dirty = false; + +private: + void SetVSExpand(VSExpand expand); + + bool m_projection_changed = false; + bool m_viewport_changed = false; }; diff --git a/Source/Core/VideoCommon/VertexManagerBase.cpp b/Source/Core/VideoCommon/VertexManagerBase.cpp index 03eed59a88..88d7c47fba 100644 --- a/Source/Core/VideoCommon/VertexManagerBase.cpp +++ b/Source/Core/VideoCommon/VertexManagerBase.cpp @@ -320,9 +320,10 @@ void VertexManagerBase::InvalidateConstants() { auto& system = Core::System::GetInstance(); auto& vertex_shader_manager = system.GetVertexShaderManager(); + auto& geometry_shader_manager = system.GetGeometryShaderManager(); auto& pixel_shader_manager = system.GetPixelShaderManager(); vertex_shader_manager.dirty = true; - GeometryShaderManager::dirty = true; + geometry_shader_manager.dirty = true; pixel_shader_manager.dirty = true; } @@ -487,6 +488,7 @@ void VertexManagerBase::Flush() auto& system = Core::System::GetInstance(); auto& pixel_shader_manager = system.GetPixelShaderManager(); + auto& geometry_shader_manager = system.GetGeometryShaderManager(); auto& vertex_shader_manager = system.GetVertexShaderManager(); CalculateBinormals(VertexLoaderManager::GetCurrentVertexFormat()); @@ -566,7 +568,7 @@ void VertexManagerBase::Flush() g_texture_cache->BindTextures(used_textures); // Now we can upload uniforms, as nothing else will override them. - GeometryShaderManager::SetConstants(m_current_primitive_type); + geometry_shader_manager.SetConstants(m_current_primitive_type); pixel_shader_manager.SetConstants(); UploadUniforms(); diff --git a/Source/Core/VideoCommon/VideoBackendBase.cpp b/Source/Core/VideoCommon/VideoBackendBase.cpp index 568a12052d..8baa6f0be7 100644 --- a/Source/Core/VideoCommon/VideoBackendBase.cpp +++ b/Source/Core/VideoCommon/VideoBackendBase.cpp @@ -329,7 +329,7 @@ void VideoBackendBase::InitializeShared() BPInit(); VertexLoaderManager::Init(); system.GetVertexShaderManager().Init(); - GeometryShaderManager::Init(); + system.GetGeometryShaderManager().Init(); system.GetPixelShaderManager().Init(); TMEM::Init(); diff --git a/Source/Core/VideoCommon/VideoState.cpp b/Source/Core/VideoCommon/VideoState.cpp index 23db63a65a..34b4d6332d 100644 --- a/Source/Core/VideoCommon/VideoState.cpp +++ b/Source/Core/VideoCommon/VideoState.cpp @@ -79,7 +79,7 @@ void VideoCommon_DoState(PointerWrap& p) system.GetVertexShaderManager().DoState(p); p.DoMarker("VertexShaderManager"); - GeometryShaderManager::DoState(p); + system.GetGeometryShaderManager().DoState(p); p.DoMarker("GeometryShaderManager"); g_vertex_manager->DoState(p); diff --git a/Source/Core/VideoCommon/XFStructs.cpp b/Source/Core/VideoCommon/XFStructs.cpp index 32d5085b76..a7738cc3eb 100644 --- a/Source/Core/VideoCommon/XFStructs.cpp +++ b/Source/Core/VideoCommon/XFStructs.cpp @@ -28,7 +28,8 @@ static void XFMemWritten(VertexShaderManager& vertex_shader_manager, u32 transfe vertex_shader_manager.InvalidateXFRange(baseAddress, baseAddress + transferSize); } -static void XFRegWritten(VertexShaderManager& vertex_shader_manager, u32 address, u32 value) +static void XFRegWritten(Core::System& system, VertexShaderManager& vertex_shader_manager, + u32 address, u32 value) { if (address >= XFMEM_REGISTERS_START && address < XFMEM_REGISTERS_END) { @@ -119,14 +120,11 @@ static void XFRegWritten(VertexShaderManager& vertex_shader_manager, u32 address case XFMEM_SETVIEWPORT + 3: case XFMEM_SETVIEWPORT + 4: case XFMEM_SETVIEWPORT + 5: - { - auto& system = Core::System::GetInstance(); g_vertex_manager->Flush(); vertex_shader_manager.SetViewportChanged(); system.GetPixelShaderManager().SetViewportChanged(); - GeometryShaderManager::SetViewportChanged(); + system.GetGeometryShaderManager().SetViewportChanged(); break; - } case XFMEM_SETPROJECTION: case XFMEM_SETPROJECTION + 1: @@ -137,7 +135,7 @@ static void XFRegWritten(VertexShaderManager& vertex_shader_manager, u32 address case XFMEM_SETPROJECTION + 6: g_vertex_manager->Flush(); vertex_shader_manager.SetProjectionChanged(); - GeometryShaderManager::SetProjectionChanged(); + system.GetGeometryShaderManager().SetProjectionChanged(); break; case XFMEM_SETNUMTEXGENS: // GXSetNumTexGens @@ -249,7 +247,7 @@ void LoadXFReg(u16 base_address, u8 transfer_size, const u8* data) { const u32 value = Common::swap32(data); - XFRegWritten(vertex_shader_manager, address, value); + XFRegWritten(system, vertex_shader_manager, address, value); ((u32*)&xfmem)[address] = value; data += 4;