- [Core] fix issue with parsing Texture2D [GI]

This commit is contained in:
Razmoth
2023-09-19 19:06:08 +04:00
parent 8b49dd5868
commit d594f90fec
3 changed files with 7 additions and 6 deletions

View File

@@ -578,7 +578,7 @@ namespace AssetStudio
public UAVParameter[] m_UAVParams;
public SamplerParameter[] m_Samplers;
public static bool HasGlobalLocalKeywordIndices(SerializedType type) => type.Match("E99740711222CD922E9A6F92FF1EB07A") || type.Match("450A058C218DAF000647948F2F59DA6D");
public static bool HasGlobalLocalKeywordIndices(SerializedType type) => type.Match("E99740711222CD922E9A6F92FF1EB07A", "450A058C218DAF000647948F2F59DA6D");
public static bool HasInstancedStructuredBuffers(SerializedType type) => type.Match("E99740711222CD922E9A6F92FF1EB07A");
public SerializedSubProgram(ObjectReader reader)

View File

@@ -63,7 +63,8 @@ namespace AssetStudio
public ResourceReader image_data;
public StreamingInfo m_StreamData;
private static bool HasGNFTexture(ObjectReader reader) => reader.serializedType.Match("1D52BB98AA5F54C67C22C39E8B2E400F");
private static bool HasGNFTexture(SerializedType type) => type.Match("1D52BB98AA5F54C67C22C39E8B2E400F");
private static bool HasExternalMipRelativeOffset(SerializedType type) => type.Match("1D52BB98AA5F54C67C22C39E8B2E400F", "5390A985F58D5524F95DB240E8789704");
public Texture2D(ObjectReader reader) : base(reader)
{
m_Width = reader.ReadInt32();
@@ -85,7 +86,7 @@ namespace AssetStudio
if (version[0] > 2 || (version[0] == 2 && version[1] >= 6)) //2.6.0 and up
{
var m_IsReadable = reader.ReadBoolean();
if (reader.Game.Type.IsGI() && HasGNFTexture(reader))
if (reader.Game.Type.IsGI() && HasGNFTexture(reader.serializedType))
{
var m_IsGNFTexture = reader.ReadBoolean();
}
@@ -110,7 +111,7 @@ namespace AssetStudio
var m_StreamingMipmaps = reader.ReadBoolean();
}
reader.AlignStream();
if (reader.Game.Type.IsGI() && HasGNFTexture(reader))
if (reader.Game.Type.IsGI() && HasGNFTexture(reader.serializedType))
{
var m_TextureGroup = reader.ReadInt32();
}
@@ -137,7 +138,7 @@ namespace AssetStudio
var image_data_size = reader.ReadInt32();
if (image_data_size == 0 && ((version[0] == 5 && version[1] >= 3) || version[0] > 5))//5.3.0 and up
{
if (reader.Game.Type.IsGI() && HasGNFTexture(reader))
if (reader.Game.Type.IsGI() && HasExternalMipRelativeOffset(reader.serializedType))
{
var m_externalMipRelativeOffset = reader.ReadUInt32();
}