当前位置:网站首页>Idea of capturing mobile terminal variant combination
Idea of capturing mobile terminal variant combination
2022-06-28 17:16:00 【UWA】
1) The idea of grabbing the variant combination of mobile phones
2) How to clear File.ReadAllBytes Resulting memory leak
3)atlas.GetSprite(name) Memory leak
4)Unity After version update Odin Plug in serialization error
This is the first 303 piece UWA Push of technical knowledge sharing . Today we continue to select and develop a number of 、 Optimization related issues , Suggested reading time 10 minute , If you read it carefully, you will get something .
UWA Question answering community :answer.uwa4d.com
UWA QQ Group 2:793972859( The original group is full )
Shader
Q: Questions about variant collection ,PC The end editor comes with its own collection , But after all, the running time is Editor Environmental Science , It is far from the real mobile environment .Warmup Only the combinations in the list will be preloaded , Not Shader All combinations of packages . So if the collected variant is not a real environment , It will only be wasted CPU And GPU memory , When the real rendering is performed, it is found that the combination submitted before is required by the non mobile end , Need to re Warmup.
also , If the quality is divided , For example, fine pictures turn on dynamic shadows , Smooth model off . This produces two sets of combinations . Theoretically, it should be divided into two SVC, and PC Yes, you can only save a list of all variants .
Sum up , I think the solution is to run the mobile phone in real time , Capture the usage data of the mobile phone , To divide into different lists , This should be the most authentic .
In order to realize this idea , You need to be able to find out how to get the submitted variant data , Known to be available in profiler-CPU-Timeline Mode of Shader.CreateGPUProgram Inside meta_data You can get it in there .

adopt CS Source code analysis to NativeProfilerTimeline This control is drawing Timeline The core of the class .NativeProfilerTimeline.GetEntryInstanceInfo This function can get the corresponding meta_data.
But this class is C++ It's written at the bottom ,C# It's just Draw To submit the drawing .GetEntryAtPosition Go to the mouse position to get Entry, Code cannot be reflected to EntryIndex. Now we are in a dead end .
Do you have any solutions or new ideas ? It's best to get a list of variations on your phone .
A: Can be in Graphics Check this on the panel Log Shader Compilation:
Under the editor Console Connect the real machine , So you can trigger Shader.CreateGPUProgram See the corresponding Log:
Autoconnected Player Compiled shader: Unlit/TestShader, pass: , stage: all, keywords FOG_EXP2
Thank you Zong Huixuan @UWA The Q & a community provides answers , Welcome to community communication :
Unity After version update Odin Serialization problem -- UWA Question and answer | Game developer interactive Q & a community | Tiger Technology
Memory
Q: Recently, the project has been playing for a long time , Memory keeps exploding . During the inspection , I found that one was used in the game File.ReadAllBytes Method to read several 5~10MB Unequal binary data , After loading, the data has been copied null, however Mono Still growing , call GC Can not be released .

Theoretically, this array has not been referenced by the business layer . however , use Memory Profiler see , The memory is still . Please consult , Does anyone know how to clear it ?
Unity edition 2019.4.9

A1: Buffers don't have to... Every time new One .
thank [email protected] The Q & a community provides answers
A2: If it is Mono Version of APK, You can try IL2CPP. If IL2CPP The version does not have this problem , Should be to encounter Mono Of Bug 了 , Allocate more heap memory at one time , There is a probability that the allocated heap memory cannot be reclaimed .
thank [email protected] The Q & a community provides answers
A3:Boehm GC Caused by its own defects , You can search for BlackList, If there is source code , There are many ways to avoid or minor modifications ; If there is no source code, you can try :
1. Reduce... In the dictionary Struct When Key;
2. Remove small files , rewrite File The interface of , Reuse memory .
thank [email protected] The Q & a community provides answers , Welcome to community communication :
Unity After version update Odin Serialization problem -- UWA Question and answer | Game developer interactive Q & a community | Tiger Technology
Script
Q:Unity edition 2019.4.23, Found in frequent calls atlas.GetSprite(name) Memory leaks when , Increase or decrease , Until it collapses ! Has anyone ever encountered this problem ? Is there any good solution ?
A1: If you don't consider the engine itself Bug Under the circumstances , Most memory leaks are caused by references that are not handled properly . Some places may still use these resources , It's just not relevant , As a result, this part of resources cannot be recycled . Therefore, you can focus on checking these functions first .
Thanks to Liao Wuxing @UWA The Q & a community provides answers
A2:
//
// Abstract :
// Clone the first Sprite in this atlas that matches the name packed in this atlas
// and return it.
//
// Parameters :
// name:
// The name of the Sprite.
public Sprite GetSprite(string name);According to this passage Clone, That is to say, every call GetSprite, Will perform a clone operation , And will not automatically release .
Then you need to use the management script to create a buffer pool , Repetitive Sprite Get it directly from the pool . And release from the script when releasing .
Dictionary<string, Sprite> mSpritePool = new Dictionary<string, Sprite>(); public Sprite GetSprite(string key, SpriteAtlas source) { Sprite result = null; if(!mSpritePool.TryGetValue(key, out result)) { result = source.GetSprite(key); if (result != null) { mSpritePool.Add(key, result); } } return result; }You can also do SpriteAtlas Storage of key value pairs of objects , Easy access and release .
thank [email protected] The Q & a community provides answers , Welcome to community communication :
Unity After version update Odin Serialization problem -- UWA Question and answer | Game developer interactive Q & a community | Tiger Technology
Script
Q:Unity After version update Odin serialize , After version update , from 2020.3.21 Update to 2021.3.41 This problem occurred after .

A:Odin The warehouse has a similar problem , stay 3.0.13.0 Version fixed , Try upgrading the plug-in version :
sirenix / Odin Inspector / issues / #843 - Error with SerializedMonoBehaviour on domain Backup (Unity 2021.2.16f1) — Bitbucket
Thank you Yufei @UWA The Q & a community provides answers , Welcome to community communication :
Unity After version update Odin Serialization problem -- UWA Question and answer | Game developer interactive Q & a community | Tiger Technology
The cover map comes from the Internet
Today's sharing is here . Of course , There is no end to life but to know . In the long development cycle , The problems you see may be just the tip of the iceberg , We are already in UWA The Q & a website has more technical topics waiting for you to explore and share together . You are welcome to join us , Maybe your method can solve other people's urgent needs ; And he's a mountain “ stone ”, Can also attack you “ jade ”.
Official website :www.uwa4d.com
Official technology blog :blog.uwa4d.com
Official Q & a community :answer.uwa4d.com
UWA School :edu.uwa4d.com
Official technology QQ Group :793972859( The original group is full )
边栏推荐
- From five capabilities to "1+5+n", Huawei makes the transformation of government and enterprises more stable
- NoSQL之Redis配置与优化(你不在南京的日子我替你吹了秦淮河的晚风)
- 【刷题日记】和为 K 的子数组
- Which securities company is better and safer to choose for opening an exchange fund account by mobile phone
- Does rapid software delivery really need to be at the cost of security?
- "Jay bear" plummeted by 96.6%. Why is NFT with star goods cold?
- Inspur network wins step by step
- [tcapulusdb knowledge base] modify business modify cluster
- Langqing and Langchao, an ecological model from OEM to value symbiosis
- 【TcaplusDB知识库】WebClient用户如何读取和修改数据
猜你喜欢

Rsync remote synchronization (sunset is especially gentle, and the world is romantic)
Super detailed steps for MySQL master-slave switching
![[official cooperation between Shang Silicon Valley and Tencent cloud] video release of Silicon Valley classroom project](/img/06/b786166317f2d66e1c61133f427630.jpg)
[official cooperation between Shang Silicon Valley and Tencent cloud] video release of Silicon Valley classroom project

MySQL高可用之MHA(一不小心和我的青春擦肩而過)

MySQL高可用之MHA(一不小心和我的青春擦肩而过)

本地部署Confluence遇到的问题:MySQL数据库编码、隔离级别、验证码不显示

清华大佬耗时3天总结出的'常见网络协议汇总'

中国SSD行业企业势力全景图

Q: how bad can a programmer be?

MySQL中的日志管理 日志備份與恢複
随机推荐
本地部署Confluence遇到的问题:MySQL数据库编码、隔离级别、验证码不显示
55. maximum sum of continuous subarrays
Panorama of enterprise power in China SSD industry
Inspur network wins step by step
这个简单的小功能,半年为我们产研团队省下213个小时
VirtualBox中克隆了一个虚拟系统出现IP问题
硕士学位论文写作探索学习
How to open a futures account? Where is it safer to open a futures account?
Potplayer plays Baidu cloud disk video
Summary and Thinking on interface test automation
基于DataWorks的时效仿真平台|得物技术
【TcaplusDB知识库】WebClient用户如何读取和修改数据
Js中的Bom
NoSQL之Redis配置与优化(你不在南京的日子我替你吹了秦淮河的晚风)
提升可观测性 - 业务指标监控实践
Differences between shared hosts and WordPress hosts
How to do a good job of gateway high availability protection in the big promotion scenario
Flex布局
老司机总结的12条 SQL 优化方案(非常实用)
ZABBIX monitoring of traditional operation and maintenance (you get up early, I get up early, and we will get together sooner or later)

