了解 ID3D11Device 和 ID3D11DeviceContext
Understanding ID3D11Device and ID3D11DeviceContext
我在理解 ID3D11Device
和 ID3D11DeviceContext
之间的区别时遇到一些问题。
ID3D11Device
代表你的GPU和ID3D11DeviceContext
是用来做函数的,来控制device
吗?
为什么需要 2 个对象?
哪个函数与设备一起使用,哪个与设备对象一起使用?
哪个对象将最终图像发送到后台缓冲区?
后台缓冲区在ID3D11RenderTargetView
对象中,不是吗?
哪些对象连接到交换链,为什么?
ID3D11Device
用于创建 资源,例如管道中的许多着色器。
ID3D11DeviceContext
用于绑定那些资源到管道,例如,许多着色器。
device->CreatePixelShader(/*arguments*/);
context->PSSetShader(/*pass shader created with 'device'*/);
But why you need then two objects?
所以您没有 1 个 "God" 对象可以完成所有事情(这是一个猜测 :)
)。
Which object send the final Image to the backbuffer.
ID3D11DeviceContext
确实如此。我猜 "Image" 你的意思是纹理,如果是,图像不会得到 "sent",它被复制到后台缓冲区,使用方法 Draw
.
The backbuffer is in the ID3D11RenderTargetView object, isn't it?
是的,以 ID3D11Resource
的形式,这将是后台缓冲区 "texture"(Draw
调用进入 "texture")。
And which objects are connect with the SwapChain and why exactly?
这有点宽泛。交换链存储后台缓冲区纹理,以及许多其他信息,例如如何翻转缓冲区,window 与之关联,...当您 Draw
某些东西时会用到它。
所以,我猜 ID3D11Resource
是 "conntected" 与交换链的,因为它们存储它使用的后台缓冲区纹理。
ID3D11Device ID3D11DeviceContext
Purpose: FACTORY STATE of pipeline
Multithreaded: YES NO
Amount basic: one one
Amount common: one many
Amount rare: many many
我在理解 ID3D11Device
和 ID3D11DeviceContext
之间的区别时遇到一些问题。
ID3D11Device
代表你的GPU和ID3D11DeviceContext
是用来做函数的,来控制device
吗?为什么需要 2 个对象?
哪个函数与设备一起使用,哪个与设备对象一起使用?
哪个对象将最终图像发送到后台缓冲区?
后台缓冲区在
ID3D11RenderTargetView
对象中,不是吗?哪些对象连接到交换链,为什么?
ID3D11Device
用于创建 资源,例如管道中的许多着色器。
ID3D11DeviceContext
用于绑定那些资源到管道,例如,许多着色器。
device->CreatePixelShader(/*arguments*/);
context->PSSetShader(/*pass shader created with 'device'*/);
But why you need then two objects?
所以您没有 1 个 "God" 对象可以完成所有事情(这是一个猜测 :)
)。
Which object send the final Image to the backbuffer.
ID3D11DeviceContext
确实如此。我猜 "Image" 你的意思是纹理,如果是,图像不会得到 "sent",它被复制到后台缓冲区,使用方法 Draw
.
The backbuffer is in the ID3D11RenderTargetView object, isn't it?
是的,以 ID3D11Resource
的形式,这将是后台缓冲区 "texture"(Draw
调用进入 "texture")。
And which objects are connect with the SwapChain and why exactly?
这有点宽泛。交换链存储后台缓冲区纹理,以及许多其他信息,例如如何翻转缓冲区,window 与之关联,...当您 Draw
某些东西时会用到它。
所以,我猜 ID3D11Resource
是 "conntected" 与交换链的,因为它们存储它使用的后台缓冲区纹理。
ID3D11Device ID3D11DeviceContext
Purpose: FACTORY STATE of pipeline
Multithreaded: YES NO
Amount basic: one one
Amount common: one many
Amount rare: many many