Load store action in vulkan & ogles 的解决方案
metal的带宽之前的blog有讲
这篇主要是vulkan 和ogles的解决方案
https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/VkAttachmentDescription.html
typedef struct VkAttachmentDescription {
VkAttachmentDescriptionFlags flags;
VkFormat format;
VkSampleCountFlagBits samples;
VkAttachmentLoadOp loadOp;
VkAttachmentStoreOp storeOp;
VkAttachmentLoadOp stencilLoadOp;
VkAttachmentStoreOp stencilStoreOp;
VkImageLayout initialLayout;
VkImageLayout finalLayout;
} VkAttachmentDescription;
这样 load store action和programmable blending
vulkan上都有对应实现了
(vulkan还能单独操作stencil的load store。。。)
这样 这两步在unity上应该 都是跨平台支持的 不需要分平台支持了
下面就是metal2那些 feature 在vulkan上的实现。。。
这里八成是要分平台写 因为metal里面的那些关键字别的平台又没有对应。。
=======================================================================================
https://developer.arm.com/solutions/graphics/developer-guides/understanding-render-passes/how-render-passes-work
opengl下 上述方案对应的解决方案
ogles是隐式控制pass切换的
- The application calls
glBindFramebuffer()to change theGL_FRAMEBUFFERorGL_DRAW_FRAMEBUFFERtarget. - The application calls
glFramebufferTexture*()orglFramebufferRenderbuffer()to change the attachments of the currently bound draw framebuffer object when the drawing is queued. - The application calls
eglSwapBuffers()to signal the end of a frame. - The application calls
glFlush()orglFinish()to explicitly flush any queued rendering. - The application creates a
glFenceSync()for some rendering in the current render pass and then callsglClientWaitSync()to wait on the completion of that work, or an equivalent behavior with a query object
vulkan和metal是显式控制切换的
this means avoiding:
- Reading in older framebuffer values at the start of a render pass if they are going to be overdrawn.
- Writing out values at the end of each render pass which are transient and are only needed for the duration of that render pass.
这两步就是load store

mali gpu
避免tile memory和ddr之间的traffic
这部分的traffic都是带宽 带宽除此之外还包括texture sample
https://developer.arm.com/solutions/graphics/developer-guides/understanding-render-passes/efficient-render-passes
1.避免切出去再切回来
2.尽量合并 共用renderpass
OGLES:
Load
glClear()glClearBuffer*()glInvalidateFramebuffer()
Caution: Only the start of tile clear is free. Calling glClear() or glClearBuffer*() after the first draw call in a render pass is not free, and this results in a per-fragment clear shader.
For Vulkan, set the loadOp for each attachment to either of:
VK_ATTACHMENT_LOAD_OP_CLEARVK_ATTACHMENT_LOAD_OP_DONT_CARE
Caution: If you call VkCmdClear*() commands to clear an attachment, or manually use a shader to write a constant color, it results in a per-fragment clear shader. To benefit from the fast fixed-function tile initialization, it is much more efficient to use the render pass loadOp operations.
不影响最终结果的情况下 mali里面invalidate operation 优于 a clear operation.
Store
用这个 glInvalidateFramebuffer
OpenGL ES, you can notify the driver that an attachment is transient by marking the content as invalid using a call to glInvalidateFramebuffer() as the last draw call in the render pass.
Note: If you write applications using OpenGL ES 2.0, you must use glDiscardFramebufferExt() from the [EXT_discard_framebuffer][EXT_dfb] extension.
depth能用这个么。。。GL_COLOR_ATTACHMENTi, GL_DEPTH_ATTACHMENT, GL_STENCIL_ATTACHMENT, and/or GL_DEPTH_STENCIL_ATTACHMENT....可以 处理depth
这样解决方案就ok了
For Vulkan, set the storeOp for each transient attachment to VK_ATTACHMENT_STORE_OP_DONT_CARE. For more efficiency, the application can even avoid allocating physical backing memory for transient attachments by allocating the backing memory using VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT and constructing the VkImagewith VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT.
这块是metal里 memoryless在vulkan上的解决方案
depthstencil在vulkan metal上的建议是 别包一起 我们确实遇到这个问题了 就一个mask却把depth一起开了 这种状况是要避免的
-----------------
EXT_discard_framebuffer
这个unity有支持
===================
看了下unity代码 load store action它在ogles里也是支持的
那之后测下msaa下 是否生效就可以了
metal下msaa是不生效的 有bug要修
https://www.cnblogs.com/minggoddess/p/11447389.html
Load store action in vulkan & ogles 的解决方案的更多相关文章
- msaa mrt load store action unity
unity buildin renderpipeline 和lightweight rp 对于开了msaa的rt 的load store action设置失效 buildin的时候set render ...
- unity里blit的load store action设置
做blit的 load store action时 用 setrendertarget做 之后blit 参数用 BuiltinRenderTextureType.CurrentActive https ...
- TBDR下msaa 在metal vulkan和ogles的解决方案
https://developer.arm.com/solutions/graphics/developer-guides/understanding-render-passes/multi-samp ...
- vulkan load store and memoryless
https://www.jendrikillner.com/article_database/ https://community.arm.com/developer/tools-software/g ...
- Unordered load/store queue
A method and processor for providing full load/store queue functionality to an unordered load/store ...
- Load store and memoryless
metal https://developer.apple.com/library/archive/documentation/3DDrawing/Conceptual/MTLBestPractice ...
- 报错:Unable to load configuration. - action - file:/E:/apache-tomcat-8.0.37/webapps/20161102-struts2-3/WEB-INF/classes/struts.xml:11:73
第一种报错: 严重: Exception starting filter struts2Unable to load configuration. - action - file:/E:/apache ...
- 批量Load/Store指令的寻址方式
批量Load/Store指令用于实现在一组寄存器和一块连续的内存单元之间传输数据.也称为多寄存器寻址方式,即一条指令可以完成多个寄存器值的传送.这种寻址方式可以用一条指令最多完成传送16个通用寄存器的 ...
- 出现错误:Unable to load configuration. - action - file:/E:/Java/Tomcat7.0/apache-tomcat-7.0.68-windows-x64/apache-tomcat-7.0.68/webapps/SSH2Integrate/WEB-INF/classes/struts.xml:8:43
严重: Exception starting filter struts2 Unable to load configuration. - action - file:/E:/Java/Tomcat7 ...
随机推荐
- 39.创建多进程及进程通讯 -- Queue--Pipe--Event
创建多进程 windows:进程.线程 linux:进程.线程(做了进程通信的多进程实现的线程) 进程之间内存彼此独立,不管是父子进程还是单个独立进程 multiprocessing:Process ...
- UWP笔记-消息弹窗自动淡出
为了让用户有个更好的UI交互,可以增加自动淡出的消息弹窗,例如:网易云音乐UWP,切换播放模式时,出现的类似消息提示. 右键项目,添加用户控件 UserControlDemo.xaml: <Us ...
- C语言--单层循环结构
一.PTA实验作业 题目1:最佳情侣身高 1.实验代码 int N, i; float height; char sex; printf("输入用户个数:\n"); scanf(& ...
- Java操作Excle(基于Poi)
有一次有个同事问我会不会有java操作Excle,回答当然是不会了!感觉被嘲讽了,于是开始寻找度娘,找到个小例子,结果越写越有意思,最后就成就了这个工具类. import java.io.Buffer ...
- 什么是DataV数据可视化
DataV数据可视化是使用可视化大屏的方式来分析并展示庞杂数据的产品.DataV旨让更多的人看到数据可视化的魅力,帮助非专业的工程师通过图形化的界面轻松搭建专业水准的可视化应用,满足您会议展览.业务监 ...
- windows10下无U盘安装ubuntu18 使用EasyUEFI(一点点体会)
一.看BIOS 先看看自己电脑的是哪种启动模式 win+R 输入 msinfo32 查看自己电脑是哪种 (UEFI还是Legacy BIOS启动模式) 查看完之后 如果是UEFI的话 go on ...
- C# U盘扫描
无意中看到的一个例程,保留一份. 以供后用. using System; using System.Collections.Generic; using System.ComponentM ...
- typora的基本使用技巧汇总
typora的基本使用技巧汇总 链接: https://www.jianshu.com/p/380005c8f104
- vue开发环境配置跨域,一步到位
本文要实现的是:使用vue-cli搭建的项目在开发时配置跨域,上线后不做任何任何修改,接口也可以访问,前端跨域解决方案 production:产品 生产环境 development:开发 开发环境 1 ...
- Linux下一种高效多定时器实现
Linux下一种高效多定时器实现 作者:LouisozZ 日期:2018.08.29 运行环境说明 由于在 Linux 系统下一个进程只能设置一个时钟定时器,所以当应用需要有多个定时器来共同管理程序运 ...