dx12 memory management
https://msdn.microsoft.com/en-us/library/windows/desktop/dn508285(v=vs.85).aspx
Map with D3D11_MAP_WRITE_DISCARD, the runtime returns a pointer to a new region of memory instead of the old buffer data.
This allows the GPU to continue using the old data while the app places data in the new buffer.
No additional memory management is required in the app; the old buffer is reused or destroyed automatically when the GPU is finished with it.
好神奇
Note When you map a buffer with D3D11_MAP_WRITE_DISCARD, the runtime always discards the entire buffer.
You can't preserve info in unmapped areas of the buffer by specifying a nonzero offset or limited size field.
When you call Map on a static vertex buffer while the GPU is using the buffer, you get a significant performance penalty. In this situation,
Map must wait until the GPU is finished reading vertex or index data from the buffer before Map can return to the calling app, which causes a significant delay.
Calling Map and then rendering from a static buffer several times per frame also prevents the GPU from buffering rendering commands
because it must finish commands before returning the map pointer.
Without buffered commands, the GPU remains idle until after the app is finished filling the vertex buffer or index buffer and issues a rendering command.
D3D11_USAGE_IMMUTABLE is well-suited to data such as textures because such data is typically read into memory from some file format.
Therefore, when you create a texture with D3D11_USAGE_IMMUTABLE, the GPU directly reads that texture into memory.
=============
shit原先那个页面被更新了。。。
https://docs.microsoft.com/zh-cn/windows/desktop/api/d3d11/ne-d3d11-d3d11_usage
https://docs.microsoft.com/en-us/windows/desktop/api/d3d11/ne-d3d11-d3d11_map
====================
兜兜转转 又回来继续弄这个
先捋一下dx11
map是为了可以拿到这块memory的地址 来操作里面的内容
如果memory类型用static 就需要gpu等cpu用完再用 hang在那里 很慢 所以memory类型要选dynamic
这样显卡会自己处理这些事情不会hang在那里等gpu用完再用 处理的方式取决于map type
D3D11_MAP_WRITE_DISCARD --如果是write discard,这时 如果gpu在用cpu就直接开一块新的往里写,所以里面的内容是未定义的。旧内容discard了
D3D11_USAGE_DEFAULT GPU读写--默认的GPU资源
D3D11_USAGE_IMMUTABLE GPU读 CPU不能操作---不变
D3D11_USAGE_DYNAMIC CPU写 GPU读 map出来
D3D11_USAGE_STAGING GPUcopy to CPU --save GPU和CPU读写
================================
https://docs.microsoft.com/en-us/windows/desktop/direct3d12/memory-management-strategies
下面写dx12了
有三种
committed
placed
reserved
如果cpu要写资源 不会像dx11 的write discard那样driver管理资源,就等于只有NO_OVERWRITE flag需要自己管理资源
保证GPU要用的资源没有被cpu写坏 比如加fence 用uploading resorces
就是每份gpu要用的数据cpu copy一份出来操作 等于手动 write discard
我现在用的fence就让他hang在那里了,dynamic的map unmap肯定不能这样,这样太慢了 但应该是可以用的
https://docs.microsoft.com/en-us/windows/desktop/direct3d12/uploading-resources
dx12 memory management的更多相关文章
- Memory Management in Open Cascade
Open Cascade中的内存管理 Memory Management in Open Cascade eryar@163.com 一.C++中的内存管理 Memory Management in ...
- Java (JVM) Memory Model – Memory Management in Java
原文地址:http://www.journaldev.com/2856/java-jvm-memory-model-memory-management-in-java Understanding JV ...
- Objective-C Memory Management
Objective-C Memory Management Using Reference Counting 每一个从NSObject派生的对象都继承了对应的内存管理的行为.这些类的内部存在一个称为r ...
- Operating System Memory Management、Page Fault Exception、Cache Replacement Strategy Learning、LRU Algorithm
目录 . 引言 . 页表 . 结构化内存管理 . 物理内存的管理 . SLAB分配器 . 处理器高速缓存和TLB控制 . 内存管理的概念 . 内存覆盖与内存交换 . 内存连续分配管理方式 . 内存非连 ...
- Android内存管理(2)HUNTING YOUR LEAKS: MEMORY MANAGEMENT IN ANDROID PART 2
from: http://www.raizlabs.com/dev/2014/04/hunting-your-leaks-memory-management-in-android-part-2-of- ...
- Android内存管理(1)WRANGLING DALVIK: MEMORY MANAGEMENT IN ANDROID PART 1
from : http://www.raizlabs.com/dev/2014/03/wrangling-dalvik-memory-management-in-android-part-1-of-2 ...
- Understanding Memory Management(2)
Understanding Memory Management Memory management is the process of allocating new objects and remov ...
- Java Memory Management(1)
Java Memory Management, with its built-in garbage collection, is one of the language’s finest achiev ...
- ural1037 Memory Management
Memory Management Time limit: 2.0 secondMemory limit: 64 MB Background Don't you know that at school ...
随机推荐
- POJ3468(线段树区间增加,区间求和)
A Simple Problem with Integers Time Limit: 5000MS Memory Limit: 131072K Total Submissions: 81519 ...
- XGBOOST/GBDT,RandomForest/Bagging的比较
原创文章:http://blog.csdn.net/qccc_dm/article/details/63684453 首先XGBOOST,GBDT,RF都是集成算法,RF是Bagging的变体,与Ba ...
- [ 手记 ] 关于tomcat开机启动设置问题
今天尝试将tomcat设置为开机启动,大家都知道只需要将启动脚本添加到/etc/rc.local下面开机就会自动执行. /usr/local/tomcat8./bin/startup.sh >& ...
- selenium 多表单切换处理(iframe/frame)
在web应用中,前台网页的设计一般会用到iframe/frame表单嵌套页面的应用.简单的就是一个页面签嵌套多个HEML/JSP文件.selenium webdriver 只能在同一页面识别定位元素 ...
- MySQL 基础内容
创建数据库 对于表的操作需要先进入库 use 库名: -- 创建一个名为 inana_db 的数据库,数据库字符编码指定为 utf8create database inana_db character ...
- Ubuntu 16.04下开启Mysql 3306端口远程访问
原文地址:传送门 0. 前言 网上看到很多开启Mysql远程访问端口,修改的配置文件我都没有找到. 特意查看了我的Linux版本 $ sudo lsb_release -a 显示如下: Distrib ...
- logging 日志两种使用方法(转)
下面我们使用代码logging的代码来说明: 使用baseConfig()函数对 logging进行 简单的 配置: import logging; # 使用baseConfig()函数,可选参数有f ...
- 「转」基于Jmeter和Jenkins搭建性能测试框架
搭建这个性能测试框架是希望能够让每个人(开发人员.测试人员)都能快速的进行性能测试,而不需要关注性能测试环境搭建过程.因为,往往配置一个性能环境可能需要很长的时间. 1.性能测试流程 该性能测试框架工 ...
- 【转】SonarQube配置自定义的CheckStyle代码规则
原文地址:https://www.jianshu.com/p/ff1d800885ce 惯例第一步肯定是SonarQube的安装与运行配置了,但这部分不在本文主题内,网上一搜一大把,这里就不讲了,大家 ...
- Educational Codeforces Round 30 A[水题/数组排序]
A. Chores time limit per test 2 seconds memory limit per test 256 megabytes input standard input out ...