summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/VertexManagerBase.cpp
diff options
context:
space:
mode:
authoriwubcode <iwubcode@users.noreply.github.com>2023-12-17 23:37:23 -0600
committeriwubcode <iwubcode@users.noreply.github.com>2023-12-19 21:51:42 -0600
commitae758f489a88b4e6be2a72a6423c6d931bdec3db (patch)
tree283edebf11048de7fdeb6b4f540bc46bace60ce5 /Source/Core/VideoCommon/VertexManagerBase.cpp
parentacd76918d7c8537e898ba2425cbcd982bccffea9 (diff)
VideoCommon: update custom pipeline action to support a variety of texture samplers (2D, 2D array, and cube maps)
Diffstat (limited to 'Source/Core/VideoCommon/VertexManagerBase.cpp')
-rw-r--r--Source/Core/VideoCommon/VertexManagerBase.cpp13
1 files changed, 6 insertions, 7 deletions
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<std::string> texture_names;
- std::vector<u32> texture_units;
+ Common::SmallVector<u32, 8> texture_units;
if (!m_cull_all)
{
if (!g_ActiveConfig.bGraphicMods)
@@ -599,20 +600,18 @@ void VertexManagerBase::Flush()
std::optional<CustomPixelShader> custom_pixel_shader;
std::vector<std::string> custom_pixel_texture_names;
std::span<u8> 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;
}