ID3D11DeviceX::PlaceSwapChainView Method
Places a swap chain view. PlaceSwapChainView is an alternative to maintaining a set of views for each buffer in a swap chain under fast semantics.
Syntax
public:
void PlaceSwapChainView(
ID3D11Resource *pSwapChainBuffer,
ID3D11View *pView
)
Parameters
pSwapChainBuffer
Type: ID3D11Resource *
[in] The swap chain buffer, as a pointer to ID3D11Resource.
pView
Type: ID3D11View *
[in, out] The swap chain view, as a pointer to ID3D11View.
Return value
None.
Remarks
Fast semantics does not automatically rotate the views onto the latest back buffer at each Present. Therefore, when using fast semantics, the title is required to do either of the following approaches:
- Cycle through the title’s own views that have been created on the back buffers. This approach doesn’t use PlaceSwapChainView.
- Update each view to migrate the view from the back buffer of the previous frame to the back buffer of the new frame. PlaceSwapChainView can be used to handle this approach; PlaceSwapChainView updates the given ID3D11View to reference the given ID3D11Resource back buffer. Before calling PlaceSwapChainView, the view references a different, not-currently-active, buffer in the swap chain.
Usage Example
- Call
GetBuffer(0) to get the back buffer for frame 0.
- Call CreateRenderTargetView on the buffer.
- Call OMSetRenderTargets with the view.
- Render the frame.
- Call Present.
- Call
GetBuffer(0) to get the back buffer for frame 1.
- Call PlaceSwapChainView on the buffer and the render target view from frame 0.
- Call OMSetRenderTargets with the view.
- Render the frame.
- Call Present.
Requirements
Header: Declared in d3d11_x.h.
Library: Use d3d11_x.lib.
See also
Reference
ID3D11DeviceX Interface
ID3D11DeviceX Members