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 the GL_FRAMEBUFFER or GL_DRAW_FRAMEBUFFER target.
  • The application calls glFramebufferTexture*() or glFramebufferRenderbuffer() 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() or glFinish() to explicitly flush any queued rendering.
  • The application creates a glFenceSync() for some rendering in the current render pass and then calls glClientWaitSync() 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_CLEAR
  • VK_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_ATTACHMENTiGL_DEPTH_ATTACHMENTGL_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 的解决方案的更多相关文章

  1. msaa mrt load store action unity

    unity buildin renderpipeline 和lightweight rp 对于开了msaa的rt 的load store action设置失效 buildin的时候set render ...

  2. unity里blit的load store action设置

    做blit的 load store action时 用 setrendertarget做 之后blit 参数用 BuiltinRenderTextureType.CurrentActive https ...

  3. TBDR下msaa 在metal vulkan和ogles的解决方案

    https://developer.arm.com/solutions/graphics/developer-guides/understanding-render-passes/multi-samp ...

  4. vulkan load store and memoryless

    https://www.jendrikillner.com/article_database/ https://community.arm.com/developer/tools-software/g ...

  5. Unordered load/store queue

    A method and processor for providing full load/store queue functionality to an unordered load/store  ...

  6. Load store and memoryless

    metal https://developer.apple.com/library/archive/documentation/3DDrawing/Conceptual/MTLBestPractice ...

  7. 报错: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 ...

  8. 批量Load/Store指令的寻址方式

    批量Load/Store指令用于实现在一组寄存器和一块连续的内存单元之间传输数据.也称为多寄存器寻址方式,即一条指令可以完成多个寄存器值的传送.这种寻址方式可以用一条指令最多完成传送16个通用寄存器的 ...

  9. 出现错误: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 ...

随机推荐

  1. BootStrap Table方法使用小结

    参考链接:https://www.cnblogs.com/Amaris-Lin/p/7797920.html

  2. linux之dup和dup2函数解析

    1. 文件描述符在内核中数据结构在具体说dup/dup2之前,我认为有必要先了解一下文件描述符在内核中的形态.一个进程在此存在期间,会有一些文件被打开,从而会返回一些文件描述符,从shell中运行一个 ...

  3. docker入门1--简介、安装

      一. Docker是什么,能做什么,好处和坏处都在哪里? Docker是一个开源的应用容器引擎,用Go语言写成. Docker最主要的作用,就是将程序执行所需要的环境变量与开发的程序代码进行打包处 ...

  4. Redis 数据结构 & 原理 & 持久化

    一 概述 redis是一种高级的key-value数据库,它跟memcached类似,不过数据可以持久化,而且支持的数据类型也很丰富. Redis支持五种数据类型:string(字符串),hash(哈 ...

  5. Git在IDEA工具中快捷拉取代码

    在拥有GitLab账号之后, 进入IDEA中,点击vcs菜单-->Checkout from Version Control-->Git 随后会出现一个弹框,输入git上的项目地址点击CL ...

  6. python+selenium+chrome实现自动登录百度

    #python3.4+selenium3.5+chrome版本 63.0.3239.132+chrome驱动chromedriver.exe #实现自动登录百度 from selenium impor ...

  7. 【Python基础】06_Python中的函数

    1.函数的定义 def 函数名(): 函数封装的代码 …… 注:函数前后应该保留两个空行 2.函数的使用 直接使用函数名()调用函数块. def say_hello(): print("He ...

  8. shell习题第12题:批量创建用户

    [题目要求] 用shell脚本实现如下需求 添加user_00 -- user_09 10个用户,并且给他们设置一个随机密码,密码要求10位包含大小写字母及数字,注意要把每个用户的密码记录到一个日志文 ...

  9. WPf ObservableCollection异步调用问题

    当ObservableCollection列表被UI线程占用时,如果在异步线程中调用ObservableCollection,会弹出以下异常: private void Button1_OnClick ...

  10. H5的本地存储(localStorage)和cookie比较

    HTML5 的 web Storage 存储方式有两种:localStorage 和 sessionStorage. sessionStorage就像是会话级别的cookie,数据会随着浏览器关闭而清 ...