Load store and memoryless
metal
https://developer.apple.com/library/archive/documentation/3DDrawing/Conceptual/MTLBestPracticesGuide/LoadandStoreActions.html
https://docs.unity3d.com/ScriptReference/Rendering.RenderBufferLoadAction.html
当前rt选 load 会导致之前一个pass的内容 从system mem copy到 当前tile mem
当前rt 选store 会导致当前pass 内容 从tile 到system mem copy
dont care 没有上述开销
和msaa相关的有
storeAndMultisample 后面那 个flag涉及resolve相关会生成resolve tex
multisample content和resolvecontent都会保存
==============
rtt的 action 设置为 clear/store 因为它之后会被采样
还要往之前rt上画的 action load/store (store以后会有对它的采样
这样 我们管线里应该尽量去掉load
用clear /store (会被采样
或者 clear/dontcare(不会做rtt被采样
======================
memoryless就是字面意思 是rendertexture的一个属性 关掉action store只有tile memory, rtt sample就会失效了
https://docs.unity3d.com/ScriptReference/RenderTextureDescriptor-memoryless.html
So basically what your script is doing (Without memoryless flag):
- ViewCamera renders scene objects into renderTexture
- Camera does storeAction to save renderTexture from tile memory to system memory
- Then renderTexture system memory copy is used as shader resource for ViewMonitor
- Lastly some other camera renders ViewMonitor (Where u probably use for testing if it works or not)
Once u enable the memoryless flag, storeAction cannot be done as renderTexture doesn't have system memory for it. So that leads that renderTexture will stay to the color it was created (Most likely gray - internally we even ignore all memoryless rendertexture setting on materials as it is not valid).
https://docs.unity3d.com/ScriptReference/RenderTexture-memorylessMode.html
https://forum.unity.com/threads/how-to-use-memoryless.491167/
所以这个memoryless对平常的管线来说 如果不是做single pass deferred rendering这种是没用的 只在tile上
或者msaa也能用到这个(这里理解起来有点绕,可以认为是4x那个不入systemmem 所以是memoryless 1x那个是另外 resolve又写入的 用multisampleResolve做到 经测试 正确)
Render texture color pixels are memoryless when RenderTexture.antiAliasing is set to 2, 4 or 8.
https://docs.unity3d.com/ScriptReference/RenderTextureMemoryless.MSAA.html
rendertexture.antialiasing是sample 数量
================
load action
If all the render target pixels are rendered to, choose the
DontCareaction. There are no costs associated with this action, and texture data is always interpreted as undefined.If the previous contents of the render target do not need to be preserved and only some of its pixels are rendered to, choose the
Clearaction. This action incurs the cost of writing a clear value to each pixel.If the previous contents of the render target need to be preserved and only some of its pixels are rendered to, choose the
Loadaction. This action incurs the cost of loading the previous contents.
所以这里选Dont care 我们把要load的rt都做掉了,扰动那些要选clear
store action
第一遍不处理msaa的情况 这里选store 因为都要被srv(之后只用tile的和msaa 只用resolve的会选其它action)
depth stencil选dont care
storage mode
因为还没有做singlepass所以也不用memoryless 如果是memoryless意味着没有gpu cpu mem 只有tile mem能省 footprint
=============對於msaa rt 有額外兩種 store action可以 處理 resolve 前後的兩張rt 的store action

srotreAndMultisampleResolve會保存兩種 5x 帶寬
MultisampleResolve 1x帶寬
store 4x帶寬
因爲要用來做srv我們應該選2 把4x那張帶寬和footprint去掉 ios推薦4xmsaa A11
====================
刚刚做到了个很了不起的事情 很开心
我可以设置 mrt 的两张msaa targets和depth target 的load action 和store action
用event cmd --after depth
中间发现个事情 mrt msaa 对应的depth target似乎就是1 sample 不是我之前以为的4
我刚刚降了2G的带宽/s 80M/fra
ios上最终要做到40M/frame
一点都不热
Load store and memoryless的更多相关文章
- vulkan load store and memoryless
https://www.jendrikillner.com/article_database/ https://community.arm.com/developer/tools-software/g ...
- msaa mrt load store action unity
unity buildin renderpipeline 和lightweight rp 对于开了msaa的rt 的load store action设置失效 buildin的时候set render ...
- Load store action in vulkan & ogles 的解决方案
metal的带宽之前的blog有讲 这篇主要是vulkan 和ogles的解决方案 https://www.khronos.org/registry/vulkan/specs/1.1-extensio ...
- 批量Load/Store指令的寻址方式
批量Load/Store指令用于实现在一组寄存器和一块连续的内存单元之间传输数据.也称为多寄存器寻址方式,即一条指令可以完成多个寄存器值的传送.这种寻址方式可以用一条指令最多完成传送16个通用寄存器的 ...
- Unordered load/store queue
A method and processor for providing full load/store queue functionality to an unordered load/store ...
- unity里blit的load store action设置
做blit的 load store action时 用 setrendertarget做 之后blit 参数用 BuiltinRenderTextureType.CurrentActive https ...
- 对Extjs中store的多种操作
Store.getCount()返回的是store中的所有数据记录,然后使用for循环遍历整个store,从而得到每条记录. 除了使用getCount()的方法外,还可以使用each()函数,如下面的 ...
- Extjs4中的store
Extjs 4引入新的数据包,其中新增了不少新类并对旧有的类作出了修整.使数据包更强大和更容易使用. 本章我们将学习一下内容: 2.1. 概述新特性 Extjs4的数据包引入了如Mod ...
- ExtJs Ext.data.Store 处理
var storeCpye = new Ext.data.GroupingStore({ proxy : new Ext.data.HttpProxy({ url : 'cxgl_cpye.app?d ...
随机推荐
- mysql的密码规则问题
今天在设置mysql某用户的密码时,出现了此报错: ERROR 1819 (HY000) Your password does not satisfy the current policy req ...
- ubuntu配置vnc服务
今晚比较闲,就用ubuntu系统搭了vnc系统,真的好用(比centos简单多了). 简单介绍下,VNC(Virtual Network Computing)服务是一款优秀的屏幕分享及远程连接服务,基 ...
- Python if __name__ == '__main__': 理解
if __name__ == '__main__':是为了区分.py文件是自己直接被执行还是被其他文件调用. 当.py文件直接被执行时,默认的是 __name__ = '__main__',因此条件成 ...
- python之并发编程(概念篇)
一.进程 1.什么是进程 进程是正在进行的一个过程或者一个任务.而负责执行任务的则是cpu. 2.进程与程序的区别 程序并不能单独运行,只有将程序装载到内存中,系统为它分配资源才能运行,而这种执行的程 ...
- ASP.NET Core 2.0 中读取 Request.Body 的正确姿势
原文:ASP.NET Core 中读取 Request.Body 的正确姿势 ASP.NET Core 中的 Request.Body 虽然是一个 Stream ,但它是一个与众不同的 Stream ...
- C# Math.Round()的银行家算法
可能很多人都跟我一样,都只知道Math.Round()是C#中用来做四舍五入,保留指定小数位的 但实际上它并不是真正的四舍五入,而是银行家算法的四舍六入五取偶 事实上这也是IEEE的规范,因此所有符合 ...
- vuex项目history模式下404问题的解决方案
在 ” etc/nginx/conf.d/ “路径下修改你的当前项目的conf文件 在location中添加,下文中加粗部分的代码,实现重写路径,以避免出现404. location / { roo ...
- SvcUtil.exe工具生成客户端代理类
1.以管理员身份运行vs下命令工具: 2.运行代码示例:C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin>svcutil http: ...
- 【opencv 源码剖析】 三、 morphOp 数学形态学滤波函数, 腐蚀和膨胀就是通过这个函数得到的
// //_kernel : 形态学滤波的核 //anchor: 锚点再滤波核的位置 //iterations: 迭代次数 static void morphOp( int op, InputArra ...
- linux基础5-vi文本处理器
三种模式下各自可以完成的操作: 一般模式:可以完成光标移动.删除单个和整行字.复制和黏贴,通过i.o.a.r这几个命令进入编辑模式 编辑模式:可以输入字符,通过esc返回一般模式 指令模式:读取文件, ...