From f982c556b5d7779d2c16f91be9c7683f59939fa3 Mon Sep 17 00:00:00 2001 From: iwubcode Date: Sat, 26 Aug 2023 12:12:37 -0500 Subject: [PATCH] VideoCommon: add additional texture sampler types to ShaderAsset --- Source/Core/VideoCommon/Assets/ShaderAsset.cpp | 8 ++++++++ Source/Core/VideoCommon/Assets/ShaderAsset.h | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/Source/Core/VideoCommon/Assets/ShaderAsset.cpp b/Source/Core/VideoCommon/Assets/ShaderAsset.cpp index d09e572bab..af5dad4a93 100644 --- a/Source/Core/VideoCommon/Assets/ShaderAsset.cpp +++ b/Source/Core/VideoCommon/Assets/ShaderAsset.cpp @@ -49,6 +49,14 @@ bool ParseShaderProperties(const VideoCommon::CustomAssetLibrary::AssetID& asset { property.m_type = ShaderProperty::Type::Type_Sampler2D; } + else if (type == "samplerarrayshared_main") + { + property.m_type = ShaderProperty::Type::Type_SamplerArrayShared_Main; + } + else if (type == "samplerarrayshared_additional") + { + property.m_type = ShaderProperty::Type::Type_SamplerArrayShared_Additional; + } else { ERROR_LOG_FMT(VIDEO, diff --git a/Source/Core/VideoCommon/Assets/ShaderAsset.h b/Source/Core/VideoCommon/Assets/ShaderAsset.h index 98712f0d78..0675adff02 100644 --- a/Source/Core/VideoCommon/Assets/ShaderAsset.h +++ b/Source/Core/VideoCommon/Assets/ShaderAsset.h @@ -14,9 +14,17 @@ namespace VideoCommon { struct ShaderProperty { + // "SamplerShared" denotes that the sampler + // already exists outside of the shader source + // (ex: in the Dolphin defined pixel shader) + // "Main" is the first entry in a shared sampler array + // and "Additional" denotes a subsequent entry + // in the array enum class Type { Type_Undefined, + Type_SamplerArrayShared_Main, + Type_SamplerArrayShared_Additional, Type_Sampler2D, Type_Max = Type_Sampler2D };