Events
May 19, 6 PM - May 23, 12 AM
Calling all developers, creators, and AI innovators to join us in Seattle @Microsoft Build May 19-22.
Register todayThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Binds resources to the output-merger stage.
void OMSetRenderTargetsAndUnorderedAccessViews(
[in] UINT NumRTVs,
[in, optional] ID3D11RenderTargetView * const *ppRenderTargetViews,
[in, optional] ID3D11DepthStencilView *pDepthStencilView,
[in] UINT UAVStartSlot,
[in] UINT NumUAVs,
[in, optional] ID3D11UnorderedAccessView * const *ppUnorderedAccessViews,
[in, optional] const UINT *pUAVInitialCounts
);
[in] NumRTVs
Type: UINT
Number of render targets to bind (ranges between 0 and D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT). If this parameter is nonzero, the number of entries in the array to which ppRenderTargetViews points must equal the number in this parameter. If you set NumRTVs to D3D11_KEEP_RENDER_TARGETS_AND_DEPTH_STENCIL (0xffffffff), this method does not modify the currently bound render-target views (RTVs) and also does not modify depth-stencil view (DSV).
[in, optional] ppRenderTargetViews
Type: ID3D11RenderTargetView*
Pointer to an array of ID3D11RenderTargetViews that represent the render targets to bind to the device. If this parameter is NULL and NumRTVs is 0, no render targets are bound.
[in, optional] pDepthStencilView
Type: ID3D11DepthStencilView*
Pointer to a ID3D11DepthStencilView that represents the depth-stencil view to bind to the device. If this parameter is NULL, the depth-stencil view is not bound.
[in] UAVStartSlot
Type: UINT
Index into a zero-based array to begin setting unordered-access views (ranges from 0 to D3D11_PS_CS_UAV_REGISTER_COUNT - 1).
For the Direct3D 11.1 runtime, which is available starting with Windows 8, this value can range from 0 to D3D11_1_UAV_SLOT_COUNT - 1. D3D11_1_UAV_SLOT_COUNT is defined as 64.
For pixel shaders, UAVStartSlot should be equal to the number of render-target views being bound.
[in] NumUAVs
Type: UINT
Number of unordered-access views (UAVs) in ppUnorderedAccessViews. If you set NumUAVs to D3D11_KEEP_UNORDERED_ACCESS_VIEWS (0xffffffff), this method does not modify the currently bound unordered-access views.
For the Direct3D 11.1 runtime, which is available starting with Windows 8, this value can range from 0 to D3D11_1_UAV_SLOT_COUNT - UAVStartSlot.
[in, optional] ppUnorderedAccessViews
Type: ID3D11UnorderedAccessView*
Pointer to an array of ID3D11UnorderedAccessViews that represent the unordered-access views to bind to the device. If this parameter is NULL and NumUAVs is 0, no unordered-access views are bound.
[in, optional] pUAVInitialCounts
Type: const UINT*
An array of append and consume buffer offsets. A value of -1 indicates to keep the current offset. Any other values set the hidden counter for that appendable and consumable UAV. pUAVInitialCounts is relevant only for UAVs that were created with either D3D11_BUFFER_UAV_FLAG_APPEND or D3D11_BUFFER_UAV_FLAG_COUNTER specified when the UAV was created; otherwise, the argument is ignored.
None
For pixel shaders, the render targets and unordered-access views share the same resource slots when being written out. This means that UAVs must be given an offset so that they are placed in the slots after the render target views that are being bound.
Two UAVs conflict if they share a subresource (and therefore share the same resource).
An RTV conflicts with a UAV if they share a subresource or share a bind point.
OMSetRenderTargetsAndUnorderedAccessViews operates properly in the following situations:
The following conditions must be true for OMSetRenderTargetsAndUnorderedAccessViews to succeed and for the runtime to pass the bind information to the driver:
In this situation, OMSetRenderTargetsAndUnorderedAccessViews binds only UAVs.
The following conditions must be true for OMSetRenderTargetsAndUnorderedAccessViews to succeed and for the runtime to pass the bind information to the driver:
OMSetRenderTargetsAndUnorderedAccessViews ignores ppDepthStencilView, and the current depth-stencil view remains bound.
In this situation, OMSetRenderTargetsAndUnorderedAccessViews binds only RTVs and DSV.
The following conditions must be true for OMSetRenderTargetsAndUnorderedAccessViews to succeed and for the runtime to pass the bind information to the driver:
OMSetRenderTargetsAndUnorderedAccessViews ignores UAVStartSlot.
Requirement | Value |
---|---|
Target Platform | Windows |
Header | d3d11.h |
Library | D3D11.lib |
Events
May 19, 6 PM - May 23, 12 AM
Calling all developers, creators, and AI innovators to join us in Seattle @Microsoft Build May 19-22.
Register today