2 * Copyright (c) 2007-2010 SlimDX Group
\r
4 * Permission is hereby granted, free of charge, to any person obtaining a copy
\r
5 * of this software and associated documentation files (the "Software"), to deal
\r
6 * in the Software without restriction, including without limitation the rights
\r
7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
\r
8 * copies of the Software, and to permit persons to whom the Software is
\r
9 * furnished to do so, subject to the following conditions:
\r
11 * The above copyright notice and this permission notice shall be included in
\r
12 * all copies or substantial portions of the Software.
\r
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
\r
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
\r
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
\r
17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
\r
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
\r
19 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
\r
24 #include "../math/Color4.h"
\r
28 namespace Direct3D11
\r
30 ref class BlendState;
\r
31 ref class DepthStencilState;
\r
32 ref class DepthStencilView;
\r
33 ref class RenderTargetView;
\r
34 ref class UnorderedAccessView;
\r
37 /// Defines a wrapper for output-merger related commands on the device.
\r
39 public ref class OutputMergerWrapper
\r
42 ID3D11DeviceContext* deviceContext;
\r
45 OutputMergerWrapper( ID3D11DeviceContext* device );
\r
49 /// Gets the depth-stencil state of the output-merger stage.
\r
51 property SlimDX::Direct3D11::DepthStencilState^ DepthStencilState
\r
53 void set( SlimDX::Direct3D11::DepthStencilState^ value );
\r
54 SlimDX::Direct3D11::DepthStencilState^ get();
\r
58 /// Gets or sets the depth-stencil reference value.
\r
60 property int DepthStencilReference
\r
62 void set( int value );
\r
67 /// Gets or sets the blend state of the output-merger stage.
\r
69 property SlimDX::Direct3D11::BlendState^ BlendState
\r
71 void set( SlimDX::Direct3D11::BlendState^ value );
\r
72 SlimDX::Direct3D11::BlendState^ get();
\r
76 /// Gets or sets the blend factor color.
\r
78 property Color4 BlendFactor
\r
80 void set( Color4 value );
\r
85 /// Gets or sets the blending mask.
\r
87 property int BlendSampleMask
\r
89 void set( int value );
\r
94 /// Binds a single render target to the output-merger stage.
\r
96 /// <param name="renderTargetView">A view of the render target to bind.</param>
\r
97 void SetTargets( RenderTargetView^ renderTargetView );
\r
100 /// Binds a depth-stencil buffer and a single render target to the output-merger stage.
\r
102 /// <param name="depthStencilView">A view of the depth-stencil buffer to bind.</param>
\r
103 /// <param name="renderTargetView">A view of the render target to bind.</param>
\r
104 void SetTargets( DepthStencilView^ depthStencilView, RenderTargetView^ renderTargetView );
\r
107 /// Binds a set of render targets to the output-merger stage.
\r
109 /// <param name="renderTargetViews">A set of render target views to bind.</param>
\r
110 void SetTargets( ... array<RenderTargetView^>^ renderTargetViews );
\r
113 /// Binds a depth-stencil buffer and a set of render targets to the output-merger stage.
\r
115 /// <param name="depthStencilView">A view of the depth-stencil buffer to bind.</param>
\r
116 /// <param name="renderTargetViews">A set of render target views to bind.</param>
\r
117 void SetTargets( DepthStencilView^ depthStencilView, ... array<RenderTargetView^>^ renderTargetViews );
\r
120 /// Binds a set of unordered access views and a single render target to the output-merger stage.
\r
122 /// <param name="startSlot">Index into a zero-based array to begin setting unordered access views.</param>
\r
123 /// <param name="unorderedAccessViews">A set of unordered access views to bind.</param>
\r
124 /// <param name="renderTargetView">A view of the render target to bind.</param>
\r
125 void SetTargets( RenderTargetView^ renderTargetView, int startSlot, array<UnorderedAccessView^>^ unorderedAccessViews );
\r
128 /// Binds a depth-stencil buffer, a set of unordered access views, and a single render target to the output-merger stage.
\r
130 /// <param name="depthStencilView">A view of the depth-stencil buffer to bind.</param>
\r
131 /// <param name="startSlot">Index into a zero-based array to begin setting unordered access views.</param>
\r
132 /// <param name="unorderedAccessViews">A set of unordered access views to bind.</param>
\r
133 /// <param name="renderTargetView">A view of the render target to bind.</param>
\r
134 void SetTargets( DepthStencilView^ depthStencilView, RenderTargetView^ renderTargetView, int startSlot, array<UnorderedAccessView^>^ unorderedAccessViews );
\r
137 /// Binds a set of unordered access views and a set of render targets to the output-merger stage.
\r
139 /// <param name="startSlot">Index into a zero-based array to begin setting unordered access views.</param>
\r
140 /// <param name="unorderedAccessViews">A set of unordered access views to bind.</param>
\r
141 /// <param name="renderTargetViews">A set of render target views to bind.</param>
\r
142 void SetTargets( int startSlot, array<UnorderedAccessView^>^ unorderedAccessViews, ... array<RenderTargetView^>^ renderTargetViews );
\r
145 /// Binds a depth-stencil buffer, a set of unordered access views, and a set of render targets to the output-merger stage.
\r
147 /// <param name="depthStencilView">A view of the depth-stencil buffer to bind.</param>
\r
148 /// <param name="startSlot">Index into a zero-based array to begin setting unordered access views.</param>
\r
149 /// <param name="unorderedAccessViews">A set of unordered access views to bind.</param>
\r
150 /// <param name="renderTargetViews">A set of render target views to bind.</param>
\r
151 void SetTargets( DepthStencilView^ depthStencilView, int startSlot, array<UnorderedAccessView^>^ unorderedAccessViews, ... array<RenderTargetView^>^ renderTargetViews );
\r
154 /// Binds a set of unordered access views and a single render target to the output-merger stage.
\r
156 /// <param name="startSlot">Index into a zero-based array to begin setting unordered access views.</param>
\r
157 /// <param name="unorderedAccessViews">A set of unordered access views to bind.</param>
\r
158 /// <param name="renderTargetView">A view of the render target to bind.</param>
\r
159 /// <param name="initialLengths">An array of Append/Consume buffer offsets. A value of -1 indicates the current offset should be kept. Any other values set the hidden counter for that Appendable/Consumeable UAV.</param>
\r
160 void SetTargets( RenderTargetView^ renderTargetView, int startSlot, array<UnorderedAccessView^>^ unorderedAccessViews, array<int>^ initialLengths );
\r
163 /// Binds a depth-stencil buffer, a set of unordered access views, and a single render target to the output-merger stage.
\r
165 /// <param name="depthStencilView">A view of the depth-stencil buffer to bind.</param>
\r
166 /// <param name="startSlot">Index into a zero-based array to begin setting unordered access views.</param>
\r
167 /// <param name="unorderedAccessViews">A set of unordered access views to bind.</param>
\r
168 /// <param name="renderTargetView">A view of the render target to bind.</param>
\r
169 /// <param name="initialLengths">An array of Append/Consume buffer offsets. A value of -1 indicates the current offset should be kept. Any other values set the hidden counter for that Appendable/Consumeable UAV.</param>
\r
170 void SetTargets( DepthStencilView^ depthStencilView, RenderTargetView^ renderTargetView, int startSlot, array<UnorderedAccessView^>^ unorderedAccessViews, array<int>^ initialLengths );
\r
173 /// Binds a set of unordered access views and a set of render targets to the output-merger stage.
\r
175 /// <param name="startSlot">Index into a zero-based array to begin setting unordered access views.</param>
\r
176 /// <param name="unorderedAccessViews">A set of unordered access views to bind.</param>
\r
177 /// <param name="renderTargetViews">A set of render target views to bind.</param>
\r
178 /// <param name="initialLengths">An array of Append/Consume buffer offsets. A value of -1 indicates the current offset should be kept. Any other values set the hidden counter for that Appendable/Consumeable UAV.</param>
\r
179 void SetTargets( int startSlot, array<UnorderedAccessView^>^ unorderedAccessViews, array<int>^ initialLengths, ... array<RenderTargetView^>^ renderTargetViews );
\r
182 /// Binds a depth-stencil buffer, a set of unordered access views, and a set of render targets to the output-merger stage.
\r
184 /// <param name="depthStencilView">A view of the depth-stencil buffer to bind.</param>
\r
185 /// <param name="startSlot">Index into a zero-based array to begin setting unordered access views.</param>
\r
186 /// <param name="unorderedAccessViews">A set of unordered access views to bind.</param>
\r
187 /// <param name="renderTargetViews">A set of render target views to bind.</param>
\r
188 /// <param name="initialLengths">An array of Append/Consume buffer offsets. A value of -1 indicates the current offset should be kept. Any other values set the hidden counter for that Appendable/Consumeable UAV.</param>
\r
189 void SetTargets( DepthStencilView^ depthStencilView, int startSlot, array<UnorderedAccessView^>^ unorderedAccessViews, array<int>^ initialLengths, ... array<RenderTargetView^>^ renderTargetViews );
\r
192 /// Gets the currently bound depth-stencil view.
\r
194 /// <returns>The currently bound depth-stencil view.</returns>
\r
195 DepthStencilView^ GetDepthStencilView();
\r
198 /// Gets the set of currently bound render target views.
\r
200 /// <param name="count">The number of render target views to retrieve.</param>
\r
201 /// <returns>An array of bound render target views.</returns>
\r
202 array<RenderTargetView^>^ GetRenderTargets( int count );
\r
205 /// Gets the set of currently bound unordered access views.
\r
207 /// <param name="startSlot">Zero-based index of the first unordered access view to retrieve.</param>
\r
208 /// <param name="count">The number of views to retrieve.</param>
\r
209 /// <returns>An array of bound unordered access views.</returns>
\r
210 array<UnorderedAccessView^>^ GetUnorderedAccessViews( int startSlot, int count );
\r