Practical Rendering and Computation with Direct3D 11学习笔记(1.4)
来源:互联网 发布:php网上商城系统源码 编辑:程序博客网 时间:2024/06/15 22:23
1.4 Interfacing with Direct3D
本节主要介绍Direct3D11两个最主要的接口,Device和Context.
1.4.1 Device
Device和Device context 两个结构分别负责管理Direct3D11的可用功能,当资源被创建和交互的时候使用Device接口,当管线或者资源被操作的时候使用Device context接口。
ID3D11Device接口提供了许多方法来创建着色程序对象、资源、状态对象和查询对象,也提供一些检测硬件特性的可用性和许多诊断调试的方法。通常来见,我们认为Device是程序使用的各种各样资源的提供者。除此之外, ID3D11Device还封装了功能水平的概念,以便新设备使用旧特性。
1.4.2 Contexts
Device contexts被用来把资源、着色器对象和状态对象绑定到渲染管线,控制渲染执行和计算管线调用。另外为操作Device创建的资源提供方法。Device contexts可以被认为是Device创建的资源的消费者,它充当管线工作的接口。
Device contexts被执行在ID3DllDeviceContext 接口。为了帮助介绍多线程渲染支持,两个不同的风味的上下文(contexts)被提出来。一个是immediate context,另一个是deferred context,两个执行相投的Device contexts接口,他们使用有不同的语义。
Immediate Contexts或多或少的直接与管线连接。当从这个上下文调用一个方法时,它被立即提交给在一个设备Direct3D11运行时去执行。只有一个Immediate Contexts被允许,而且与设备创建的相同时间创建。这个上下文可以被看作直接与整个管线组成相交互的接口。这个上下文必须被用作主要渲染线程,而且看作GPU的主要接口。
Deferred Contexts
Deferred Contexts是第二个上下文类型,它提供了一个安全机制从区别于主渲染线程的第二个线程去记录一系列命令。这被用来产生一个在稍后时间能“played”回Immediate Contexts的命令列表对象,允许命令列表被其他的线程产生,提供了一些潜能,一个性能改进将在多核心CPU系统呈现。Direct3D 11也允许异步资源创建在多线程执行,这提供了一个能力简化多线程加载的情景。当考虑现在和将来PC硬件环境时这是一个非常重要的概念,在这种情况下我们能预料越来越多的CPU核心将出现在PC上。
- Practical Rendering and Computation with Direct3D 11学习笔记(1.4)
- Practical Rendering and Computation with Direct3D 11学习笔记(1.1-1.3)
- Practical Rendering and Computation with Direct3D 11学习笔记(2.1.1)
- Practical Rendering and Computation with Direct3D 11学习笔记(2.1.2)
- Practical Rendering and Computation with Direct3D 11学习笔记(2.2.1)
- Practical Rendering and Computation with Direct3D 11学习笔记(2.2.2)
- Practical Rendering and Computation with Direct3D 11学习笔记(2.2.3)常量缓冲区
- Practical Rendering and Computation with Direct3D 11学习笔记(2.2.2)
- Bayesian Computation with R (Jim Albert) 学习笔记I
- Rendering Textures with Alpha Channels and Color Key Transparency using a MatrixStack in Managed Direct3D
- Introduction to 3D Game Programming with DirectX 11学习笔记 6 Direct3D中的绘制(一)
- Introduction to 3D Game Programming with DirectX 11学习笔记 6 Direct3D中的绘制(二)顶点着色器
- Introduction to 3D Game Programming with DirectX 11学习笔记 6 Direct3D中的绘制(三)像素着色器
- Introduction to 3D Game Programming with DirectX 11学习笔记 6 Direct3D中的绘制(四)渲染状态
- Mastering OpenCV with Practical Computer Vision Projects 学习笔记 - Cartoonifier
- Introduction to 3D Game Programming with DirectX 11学习笔记 4.1 初识Direct3D
- Introduction to 3D Game Programming with DirectX 11学习笔记 4.2Direct3D进行初始化
- CNTK学习笔记 -- Computation Network part 2 -- Computation Nodes
- 剑指offer-两个链表的第一个公共节点
- 深入理解requestAnimationFrame
- 【数论】[codevs 2952 细胞分裂]快速幂
- 基于数字图像处理的人民币碎片拼接
- MapReduce: combiner
- Practical Rendering and Computation with Direct3D 11学习笔记(1.4)
- Java线程详解
- 对不可用for update 的数据库管理工具如何复制记录
- String, StringBuilder与StringBuffer的区别
- Swift中的可选类型 (Optionals)与Objective-C中的nullability注解
- 12C-OCP升级1z-060-007
- 进程通信[概念比较]
- select下拉框之去掉重复
- 通过Object类说明方法重载、方法重写、多态之间的关系