diff options
| author | Mai <mai.iam2048@gmail.com> | 2024-01-26 12:39:37 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-26 12:39:37 -0500 |
| commit | a5533087754b5bb7b031682ac59d231876134701 (patch) | |
| tree | 9c99266b070d3a158814f878e1893ebcf3e04c32 /Source/Core/VideoCommon/VertexManagerBase.cpp | |
| parent | 97160ddc83d71a26ef206b29e15313f3dc661ce2 (diff) | |
| parent | 3c00689bd6b9cf4046c094b04c44d0598a7e6e8f (diff) | |
Merge pull request #12443 from iwubcode/custom_pipeline_action_material_cubemap
VideoCommon: update custom pipeline action to support a variety of texture samplers, support for materials, and more!
Diffstat (limited to 'Source/Core/VideoCommon/VertexManagerBase.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/VertexManagerBase.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/Source/Core/VideoCommon/VertexManagerBase.cpp b/Source/Core/VideoCommon/VertexManagerBase.cpp index 906d88c25d..e4f6ef9921 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; } |
