From ae758f489a88b4e6be2a72a6423c6d931bdec3db Mon Sep 17 00:00:00 2001 From: iwubcode Date: Sun, 17 Dec 2023 23:37:23 -0600 Subject: VideoCommon: update custom pipeline action to support a variety of texture samplers (2D, 2D array, and cube maps) --- Source/Core/VideoCommon/VertexManagerBase.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'Source/Core/VideoCommon/VertexManagerBase.cpp') diff --git a/Source/Core/VideoCommon/VertexManagerBase.cpp b/Source/Core/VideoCommon/VertexManagerBase.cpp index 17450ae0ed..550cabbb56 100644 --- a/Source/Core/VideoCommon/VertexManagerBase.cpp +++ b/Source/Core/VideoCommon/VertexManagerBase.cpp @@ -12,6 +12,7 @@ #include "Common/EnumMap.h" #include "Common/Logging/Log.h" #include "Common/MathUtil.h" +#include "Common/SmallVector.h" #include "Core/ConfigManager.h" #include "Core/DolphinAnalytics.h" @@ -554,7 +555,7 @@ void VertexManagerBase::Flush() // Calculate ZSlope for zfreeze const auto used_textures = UsedTextures(); std::vector texture_names; - std::vector texture_units; + Common::SmallVector texture_units; if (!m_cull_all) { if (!g_ActiveConfig.bGraphicMods) @@ -599,20 +600,18 @@ void VertexManagerBase::Flush() std::optional custom_pixel_shader; std::vector custom_pixel_texture_names; std::span custom_pixel_shader_uniforms; + bool skip = false; for (size_t i = 0; i < texture_names.size(); i++) { - const std::string& texture_name = texture_names[i]; - const u32 texture_unit = texture_units[i]; - bool skip = false; - GraphicsModActionData::DrawStarted draw_started{texture_unit, &skip, &custom_pixel_shader, + GraphicsModActionData::DrawStarted draw_started{texture_units, &skip, &custom_pixel_shader, &custom_pixel_shader_uniforms}; - for (const auto& action : g_graphics_mod_manager->GetDrawStartedActions(texture_name)) + for (const auto& action : g_graphics_mod_manager->GetDrawStartedActions(texture_names[i])) { action->OnDrawStarted(&draw_started); if (custom_pixel_shader) { custom_pixel_shader_contents.shaders.push_back(*custom_pixel_shader); - custom_pixel_texture_names.push_back(texture_name); + custom_pixel_texture_names.push_back(texture_names[i]); } custom_pixel_shader = std::nullopt; } -- cgit v1.2.3