4.1.1 Direct3D Overview
DX9可以部分安装,DX11 就必须全部安装,因此使用某特性时,不再需要检查是不是安装对应模块。
4.1.2 COM
使用Component-Object Model.
Component Object Model (COM) is the technology that allows DirectX to be language independent and have backwards
compatibility. Direct3D programmers don’t need to know the details of COM and how it works; they need only to know how to
acquire COM interfaces and how to release them.
4.1.3 Textures and Data Resource Formats
DXGI_FORMAT_R8G8B8A8_TYPELESS 可以用typeless,表明并不存储特定格式的值
4.1.5 Depth Buffering
深度缓冲存了一张和屏幕像素一一对应的一张纹理,每个值范围0~1,0最近,1最远
Depth Texture
注意里面如果有用到Stencil,会附加到后面
4.1.6 Texture Resource Views
一张texture在使用之前,需要bind到对应的pipeline才能使用。
eg:use a texture as a render target and as a shader resource
需要先声明flag,D3D11_BIND_RENDER_TARGET | D3D11_BIND_SHADER_RESOURCE
然后创建对应的RS ,
a render target view (ID3D11RenderTargetView) and a shader resource view (ID3D11ShaderResourceView)
然后才能bind到pipeline。
Resource views essentially do two things: they tell Direct3D how the resource will be used (i.e., what stage of the pipeline you will bind it to), and if the resource format was specified as typeless at creation time, then we must now state the type when creating a view. Thus, with typeless formats,