metal html
https://developer.apple.com/library/archive/documentation/3DDrawing/Conceptual/MTLBestPracticesGuide/LoadandStoreActions.htmlios
https://docs.unity3d.com/ScriptReference/Rendering.RenderBufferLoadAction.htmlapi
当前rt选 load 会致使以前一个pass的内容 从system mem copy到 当前tile memapp
当前rt 选store 会致使当前pass 内容 从tile 到system mem copyless
dont care 没有上述开销ide
和msaa相关的有ui
storeAndMultisample 后面那 个flag涉及resolve相关会生成resolve texthis
multisample content和resolvecontent都会保存url
==============3d
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也能用到这个
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 DontCare
action. 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 Clear
action. 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 Load
action. 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