public void DeserializeInlineShaderMap(FMaterialResourceProxyReader Ar)
        {
            var cooked = Ar.ReadBoolean();
            //check(cooked)
            var valid = Ar.ReadBoolean();
            //check(valid)
            var loadedShaderMap = new FMaterialShaderMap();

            loadedShaderMap.Deserialize(Ar);
        }
Beispiel #2
0
        public void DeserializeInlineShaderMap(FMaterialResourceProxyReader Ar)
        {
            var bCooked = Ar.ReadBoolean();

            if (!bCooked)
            {
                return;
            }

            var bValid = Ar.ReadBoolean();

            if (bValid)
            {
                LoadedShaderMap = new FMaterialShaderMap();
                LoadedShaderMap.Deserialize(Ar);
            }
            else
            {
                Log.Warning("Loading a material resource '{0}' with an invalid ShaderMap!", Ar.Name);
            }
        }
Beispiel #3
0
        public void Deserialize(FMaterialResourceProxyReader Ar)
        {
            var bUseNewFormat = Ar.Versions["ShaderMap.UseNewCookedFormat"];

            ImageResult = new FMemoryImageResult(Ar);

            var bShareCode = Ar.ReadBoolean();

            if (bUseNewFormat)
            {
                var ShaderPlatform = Ar.Read <EShaderPlatform>();
            }

            if (bShareCode)
            {
                ResourceHash = new FSHAHash(Ar);
            }
            else
            {
                Code = new FShaderMapResourceCode(Ar);
            }
        }
        public void Deserialize(FMaterialResourceProxyReader Ar)
        {
            #region FMemoryImageResult::LoadFromArchive, MemoryImage.cpp
            if (GIsHybridUE5)
            {
                var layoutParameters = Ar.Read <FPlatformTypeLayoutParameters>();
            }

            var frozenSize   = Ar.Read <int>();
            var frozenObject = Ar.ReadBytes(frozenSize);

            if (GIsHybridUE5)
            {
                //var bFrozenObjectIsValid = pointerTable.LoadFromArchive(Ar, layoutParameters, frozenObject);
                FShaderMapPointerTable_LoadFromArchive(Ar);
            }

            var numVTables      = Ar.Read <uint>();
            var numScriptNames  = Ar.Read <uint>();
            var numMinimalNames = Ar.Read <uint>();

            for (var i = 0; i < numVTables; i++)
            {
                var typeNameHash = Ar.Read <ulong>();
                var numPatches   = Ar.Read <uint>();

                for (var patchIndex = 0; patchIndex < numPatches; ++patchIndex)
                {
                    var vTableOffset = Ar.Read <uint>();
                    var offset       = Ar.Read <uint>();
                }
            }

            for (var i = 0; i < numScriptNames; i++)
            {
                var name       = Ar.ReadFName();
                var numPatches = Ar.Read <uint>();

                for (var patchIndex = 0; patchIndex < numPatches; ++patchIndex)
                {
                    var offset = Ar.Read <uint>();
                }
            }

            for (var i = 0; i < numMinimalNames; i++)
            {
                var name       = Ar.ReadFName();
                var numPatches = Ar.Read <uint>();

                for (var patchIndex = 0; patchIndex < numPatches; ++patchIndex)
                {
                    var offset = Ar.Read <uint>();
                }
            }

            #endregion

            if (!GIsHybridUE5)
            {
                FShaderMapPointerTable_LoadFromArchive(Ar);
            }

            var bShareCode = Ar.ReadBoolean();
            if (GIsHybridUE5)
            {
                var shaderPlatform = Ar.Read <byte>();
            }

            if (bShareCode)
            {
                var resourceHash = new FSHAHash(Ar);
            }
            else
            {
                throw new NotImplementedException();
            }
        }