- [Core] fix issue with parsing Texture2D [GI]
This commit is contained in:
@@ -578,7 +578,7 @@ namespace AssetStudio
|
|||||||
public UAVParameter[] m_UAVParams;
|
public UAVParameter[] m_UAVParams;
|
||||||
public SamplerParameter[] m_Samplers;
|
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 static bool HasInstancedStructuredBuffers(SerializedType type) => type.Match("E99740711222CD922E9A6F92FF1EB07A");
|
||||||
|
|
||||||
public SerializedSubProgram(ObjectReader reader)
|
public SerializedSubProgram(ObjectReader reader)
|
||||||
|
|||||||
@@ -63,7 +63,8 @@ namespace AssetStudio
|
|||||||
public ResourceReader image_data;
|
public ResourceReader image_data;
|
||||||
public StreamingInfo m_StreamData;
|
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)
|
public Texture2D(ObjectReader reader) : base(reader)
|
||||||
{
|
{
|
||||||
m_Width = reader.ReadInt32();
|
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
|
if (version[0] > 2 || (version[0] == 2 && version[1] >= 6)) //2.6.0 and up
|
||||||
{
|
{
|
||||||
var m_IsReadable = reader.ReadBoolean();
|
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();
|
var m_IsGNFTexture = reader.ReadBoolean();
|
||||||
}
|
}
|
||||||
@@ -110,7 +111,7 @@ namespace AssetStudio
|
|||||||
var m_StreamingMipmaps = reader.ReadBoolean();
|
var m_StreamingMipmaps = reader.ReadBoolean();
|
||||||
}
|
}
|
||||||
reader.AlignStream();
|
reader.AlignStream();
|
||||||
if (reader.Game.Type.IsGI() && HasGNFTexture(reader))
|
if (reader.Game.Type.IsGI() && HasGNFTexture(reader.serializedType))
|
||||||
{
|
{
|
||||||
var m_TextureGroup = reader.ReadInt32();
|
var m_TextureGroup = reader.ReadInt32();
|
||||||
}
|
}
|
||||||
@@ -137,7 +138,7 @@ namespace AssetStudio
|
|||||||
var image_data_size = reader.ReadInt32();
|
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 (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();
|
var m_externalMipRelativeOffset = reader.ReadUInt32();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ namespace AssetStudio
|
|||||||
public string m_NameSpace;
|
public string m_NameSpace;
|
||||||
public string m_AsmName;
|
public string m_AsmName;
|
||||||
|
|
||||||
public bool Match(string hash) => Convert.ToHexString(m_OldTypeHash) == hash;
|
public bool Match(params string[] hashes) => hashes.Any(x => x == Convert.ToHexString(m_OldTypeHash));
|
||||||
public override string ToString()
|
public override string ToString()
|
||||||
{
|
{
|
||||||
var sb = new StringBuilder();
|
var sb = new StringBuilder();
|
||||||
|
|||||||
Reference in New Issue
Block a user