mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
VideoCommon: trigger mod calls in TextureCacheBase (efb/xfb calls), VertexManagerBase (draw calls), and VertexShaderManager (projection calls)
This commit is contained in:
@ -85,7 +85,7 @@ void VertexShaderManager::Dirty()
|
||||
|
||||
// Syncs the shader constant buffers with xfmem
|
||||
// TODO: A cleaner way to control the matrices without making a mess in the parameters field
|
||||
void VertexShaderManager::SetConstants()
|
||||
void VertexShaderManager::SetConstants(const std::vector<std::string>& textures)
|
||||
{
|
||||
if (constants.missing_color_hex != g_ActiveConfig.iMissingColorValue)
|
||||
{
|
||||
@ -302,7 +302,27 @@ void VertexShaderManager::SetConstants()
|
||||
g_stats.AddScissorRect();
|
||||
}
|
||||
|
||||
if (bProjectionChanged || g_freelook_camera.GetController()->IsDirty())
|
||||
std::vector<GraphicsModAction*> projection_actions;
|
||||
if (g_ActiveConfig.bGraphicMods)
|
||||
{
|
||||
for (const auto action :
|
||||
g_renderer->GetGraphicsModManager().GetProjectionActions(xfmem.projection.type))
|
||||
{
|
||||
projection_actions.push_back(action);
|
||||
}
|
||||
|
||||
for (const auto& texture : textures)
|
||||
{
|
||||
for (const auto action : g_renderer->GetGraphicsModManager().GetProjectionTextureActions(
|
||||
xfmem.projection.type, texture))
|
||||
{
|
||||
projection_actions.push_back(action);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (bProjectionChanged || g_freelook_camera.GetController()->IsDirty() ||
|
||||
!projection_actions.empty())
|
||||
{
|
||||
bProjectionChanged = false;
|
||||
|
||||
@ -384,6 +404,11 @@ void VertexShaderManager::SetConstants()
|
||||
if (g_freelook_camera.IsActive() && xfmem.projection.type == ProjectionType::Perspective)
|
||||
corrected_matrix *= g_freelook_camera.GetView();
|
||||
|
||||
for (auto action : projection_actions)
|
||||
{
|
||||
action->OnProjection(&corrected_matrix);
|
||||
}
|
||||
|
||||
memcpy(constants.projection.data(), corrected_matrix.data.data(), 4 * sizeof(float4));
|
||||
|
||||
g_freelook_camera.GetController()->SetClean();
|
||||
|
Reference in New Issue
Block a user