diff options
| author | Admiral H. Curtiss <pikachu025@gmail.com> | 2024-01-28 14:28:23 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-28 14:28:23 +0100 |
| commit | 4843705061cb0c98f2f2c11d9ec4e0af9a484756 (patch) | |
| tree | 2495efcff96775208e37f03c60342443c4211011 /Source/Core/VideoCommon/GraphicsModSystem/Runtime/CustomPipeline.h | |
| parent | c9715e7e7dc0b555968ced0c114c9020f595e5a0 (diff) | |
| parent | 3e3967ff942dffc89bae36d3c48007e8bfa767d2 (diff) | |
Merge pull request #12534 from iwubcode/custom-pipeline-refactor
VideoCommon: refactor the custom pipeline logic to be reusable
Diffstat (limited to 'Source/Core/VideoCommon/GraphicsModSystem/Runtime/CustomPipeline.h')
| -rw-r--r-- | Source/Core/VideoCommon/GraphicsModSystem/Runtime/CustomPipeline.h | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/Source/Core/VideoCommon/GraphicsModSystem/Runtime/CustomPipeline.h b/Source/Core/VideoCommon/GraphicsModSystem/Runtime/CustomPipeline.h new file mode 100644 index 0000000000..83bc9f84e1 --- /dev/null +++ b/Source/Core/VideoCommon/GraphicsModSystem/Runtime/CustomPipeline.h @@ -0,0 +1,48 @@ +// Copyright 2024 Dolphin Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include <memory> +#include <optional> +#include <span> +#include <string> +#include <string_view> +#include <vector> + +#include "VideoCommon/AbstractTexture.h" +#include "VideoCommon/Assets/CustomAssetLibrary.h" +#include "VideoCommon/Assets/MaterialAsset.h" +#include "VideoCommon/Assets/ShaderAsset.h" +#include "VideoCommon/Assets/TextureAsset.h" +#include "VideoCommon/ShaderGenCommon.h" + +namespace VideoCommon +{ +class CustomAssetLoader; +} + +struct CustomPipeline +{ + void UpdatePixelData(VideoCommon::CustomAssetLoader& loader, + std::shared_ptr<VideoCommon::CustomAssetLibrary> library, + std::span<const u32> texture_units, + const VideoCommon::CustomAssetLibrary::AssetID& material_to_load); + + VideoCommon::CachedAsset<VideoCommon::MaterialAsset> m_pixel_material; + VideoCommon::CachedAsset<VideoCommon::PixelShaderAsset> m_pixel_shader; + + struct CachedTextureAsset + { + VideoCommon::CachedAsset<VideoCommon::GameTextureAsset> m_cached_asset; + std::unique_ptr<AbstractTexture> m_texture; + std::string m_sampler_code; + std::string m_define_code; + }; + std::vector<std::optional<CachedTextureAsset>> m_game_textures; + + ShaderCode m_last_generated_shader_code; + ShaderCode m_last_generated_material_code; + + std::vector<u8> m_material_data; +}; |
