From cf3ef2f88eba4f263909c43ab347c2363999afc7 Mon Sep 17 00:00:00 2001 From: Razmoth <32140579+Razmoth@users.noreply.github.com> Date: Fri, 2 Feb 2024 09:42:46 +0400 Subject: [PATCH] - [Core] fix bug with parsing `Shader` [GI] --- AssetStudio/Classes/Shader.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/AssetStudio/Classes/Shader.cs b/AssetStudio/Classes/Shader.cs index e29c5f0..f86fa67 100644 --- a/AssetStudio/Classes/Shader.cs +++ b/AssetStudio/Classes/Shader.cs @@ -587,8 +587,9 @@ namespace AssetStudio public List m_UAVParams; public List m_Samplers; - public static bool HasGlobalLocalKeywordIndices(SerializedType type) => type.Match("E99740711222CD922E9A6F92FF1EB07A", "450A058C218DAF000647948F2F59DA6D"); - public static bool HasInstancedStructuredBuffers(SerializedType type) => type.Match("E99740711222CD922E9A6F92FF1EB07A"); + public static bool HasGlobalLocalKeywordIndices(SerializedType type) => type.Match("E99740711222CD922E9A6F92FF1EB07A", "450A058C218DAF000647948F2F59DA6D", "B239746E4EC6E4D6D7BA27C84178610A"); + public static bool HasInstancedStructuredBuffers(SerializedType type) => type.Match("E99740711222CD922E9A6F92FF1EB07A", "B239746E4EC6E4D6D7BA27C84178610A"); + public static bool HasIsAdditionalBlob(SerializedType type) => type.Match("B239746E4EC6E4D6D7BA27C84178610A"); public SerializedSubProgram(ObjectReader reader) { @@ -600,6 +601,11 @@ namespace AssetStudio } m_BlobIndex = reader.ReadUInt32(); + if (HasIsAdditionalBlob(reader.serializedType)) + { + var m_IsAdditionalBlob = reader.ReadBoolean(); + reader.AlignStream(); + } m_Channels = new ParserBindChannels(reader); if ((version[0] >= 2019 && version[0] < 2021) || (version[0] == 2021 && version[1] < 2) || HasGlobalLocalKeywordIndices(reader.serializedType)) //2019 ~2021.1