Diligent Engine  v.2.4.g
D3DTypeConversionImpl.hpp
Go to the documentation of this file.
1 /*
2  * Copyright 2019-2021 Diligent Graphics LLC
3  * Copyright 2015-2019 Egor Yusov
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  * In no event and under no legal theory, whether in tort (including negligence),
18  * contract, or otherwise, unless required by applicable law (such as deliberate
19  * and grossly negligent acts) or agreed to in writing, shall any Contributor be
20  * liable for any damages, including any direct, indirect, special, incidental,
21  * or consequential damages of any character arising as a result of this License or
22  * out of the use or inability to use the software (including but not limited to damages
23  * for loss of goodwill, work stoppage, computer failure or malfunction, or any and
24  * all other commercial damages or losses), even if such Contributor has been advised
25  * of the possibility of such damages.
26  */
27 
28 #pragma once
29 
30 #include <array>
31 
34 
36 
37 namespace Diligent
38 {
39 
40 template <typename D3D_COMPARISON_FUNC>
42 {
43  // D3D12_COMPARISON_FUNC is equal to D3D11_COMPARISON_FUNC
44  switch (Func)
45  {
46  // clang-format off
47  case COMPARISON_FUNC_UNKNOWN: UNEXPECTED("Comparison function is not specified" ); return D3D_COMPARISON_FUNC_ALWAYS;
56  default: UNEXPECTED("Unknown comparison function" ); return D3D_COMPARISON_FUNC_ALWAYS;
57  // clang-format on
58  }
59 }
60 
61 
62 template <typename D3D_TEXTURE_ADDRESS_MODE>
64 {
65  switch (Mode)
66  {
67  // clang-format off
68  case TEXTURE_ADDRESS_UNKNOWN: UNEXPECTED("Texture address mode is not specified" ); return D3D_TEXTURE_ADDRESS_CLAMP;
74  default: UNEXPECTED("Unknown texture address mode" ); return D3D_TEXTURE_ADDRESS_CLAMP;
75  // clang-format on
76  }
77 }
78 
79 template <typename D3D_PRIM_TOPOLOGY>
80 D3D_PRIM_TOPOLOGY TopologyToD3DTopology(PRIMITIVE_TOPOLOGY Topology)
81 {
82  static bool bIsInit = false;
83  static std::array<D3D_PRIM_TOPOLOGY, PRIMITIVE_TOPOLOGY_NUM_TOPOLOGIES> d3dPrimTopology = {};
84  if (!bIsInit)
85  {
86  // clang-format off
87  d3dPrimTopology[PRIMITIVE_TOPOLOGY_UNDEFINED] = D3D_PRIMITIVE_TOPOLOGY_UNDEFINED;
88  d3dPrimTopology[PRIMITIVE_TOPOLOGY_TRIANGLE_LIST] = D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST;
89  d3dPrimTopology[PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP] = D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP;
90  d3dPrimTopology[PRIMITIVE_TOPOLOGY_POINT_LIST] = D3D_PRIMITIVE_TOPOLOGY_POINTLIST;
91  d3dPrimTopology[PRIMITIVE_TOPOLOGY_LINE_LIST] = D3D_PRIMITIVE_TOPOLOGY_LINELIST;
92  d3dPrimTopology[PRIMITIVE_TOPOLOGY_LINE_STRIP] = D3D_PRIMITIVE_TOPOLOGY_LINESTRIP;
93  d3dPrimTopology[PRIMITIVE_TOPOLOGY_1_CONTROL_POINT_PATCHLIST] = D3D_PRIMITIVE_TOPOLOGY_1_CONTROL_POINT_PATCHLIST;
94  d3dPrimTopology[PRIMITIVE_TOPOLOGY_2_CONTROL_POINT_PATCHLIST] = D3D_PRIMITIVE_TOPOLOGY_2_CONTROL_POINT_PATCHLIST;
95  d3dPrimTopology[PRIMITIVE_TOPOLOGY_3_CONTROL_POINT_PATCHLIST] = D3D_PRIMITIVE_TOPOLOGY_3_CONTROL_POINT_PATCHLIST;
96  d3dPrimTopology[PRIMITIVE_TOPOLOGY_4_CONTROL_POINT_PATCHLIST] = D3D_PRIMITIVE_TOPOLOGY_4_CONTROL_POINT_PATCHLIST;
97  d3dPrimTopology[PRIMITIVE_TOPOLOGY_5_CONTROL_POINT_PATCHLIST] = D3D_PRIMITIVE_TOPOLOGY_5_CONTROL_POINT_PATCHLIST;
98  d3dPrimTopology[PRIMITIVE_TOPOLOGY_6_CONTROL_POINT_PATCHLIST] = D3D_PRIMITIVE_TOPOLOGY_6_CONTROL_POINT_PATCHLIST;
99  d3dPrimTopology[PRIMITIVE_TOPOLOGY_7_CONTROL_POINT_PATCHLIST] = D3D_PRIMITIVE_TOPOLOGY_7_CONTROL_POINT_PATCHLIST;
100  d3dPrimTopology[PRIMITIVE_TOPOLOGY_8_CONTROL_POINT_PATCHLIST] = D3D_PRIMITIVE_TOPOLOGY_8_CONTROL_POINT_PATCHLIST;
101  d3dPrimTopology[PRIMITIVE_TOPOLOGY_9_CONTROL_POINT_PATCHLIST] = D3D_PRIMITIVE_TOPOLOGY_9_CONTROL_POINT_PATCHLIST;
102  d3dPrimTopology[PRIMITIVE_TOPOLOGY_10_CONTROL_POINT_PATCHLIST] = D3D_PRIMITIVE_TOPOLOGY_10_CONTROL_POINT_PATCHLIST;
103  d3dPrimTopology[PRIMITIVE_TOPOLOGY_11_CONTROL_POINT_PATCHLIST] = D3D_PRIMITIVE_TOPOLOGY_11_CONTROL_POINT_PATCHLIST;
104  d3dPrimTopology[PRIMITIVE_TOPOLOGY_12_CONTROL_POINT_PATCHLIST] = D3D_PRIMITIVE_TOPOLOGY_12_CONTROL_POINT_PATCHLIST;
105  d3dPrimTopology[PRIMITIVE_TOPOLOGY_13_CONTROL_POINT_PATCHLIST] = D3D_PRIMITIVE_TOPOLOGY_13_CONTROL_POINT_PATCHLIST;
106  d3dPrimTopology[PRIMITIVE_TOPOLOGY_14_CONTROL_POINT_PATCHLIST] = D3D_PRIMITIVE_TOPOLOGY_14_CONTROL_POINT_PATCHLIST;
107  d3dPrimTopology[PRIMITIVE_TOPOLOGY_15_CONTROL_POINT_PATCHLIST] = D3D_PRIMITIVE_TOPOLOGY_15_CONTROL_POINT_PATCHLIST;
108  d3dPrimTopology[PRIMITIVE_TOPOLOGY_16_CONTROL_POINT_PATCHLIST] = D3D_PRIMITIVE_TOPOLOGY_16_CONTROL_POINT_PATCHLIST;
109  d3dPrimTopology[PRIMITIVE_TOPOLOGY_17_CONTROL_POINT_PATCHLIST] = D3D_PRIMITIVE_TOPOLOGY_17_CONTROL_POINT_PATCHLIST;
110  d3dPrimTopology[PRIMITIVE_TOPOLOGY_18_CONTROL_POINT_PATCHLIST] = D3D_PRIMITIVE_TOPOLOGY_18_CONTROL_POINT_PATCHLIST;
111  d3dPrimTopology[PRIMITIVE_TOPOLOGY_19_CONTROL_POINT_PATCHLIST] = D3D_PRIMITIVE_TOPOLOGY_19_CONTROL_POINT_PATCHLIST;
112  d3dPrimTopology[PRIMITIVE_TOPOLOGY_20_CONTROL_POINT_PATCHLIST] = D3D_PRIMITIVE_TOPOLOGY_20_CONTROL_POINT_PATCHLIST;
113  d3dPrimTopology[PRIMITIVE_TOPOLOGY_21_CONTROL_POINT_PATCHLIST] = D3D_PRIMITIVE_TOPOLOGY_21_CONTROL_POINT_PATCHLIST;
114  d3dPrimTopology[PRIMITIVE_TOPOLOGY_22_CONTROL_POINT_PATCHLIST] = D3D_PRIMITIVE_TOPOLOGY_22_CONTROL_POINT_PATCHLIST;
115  d3dPrimTopology[PRIMITIVE_TOPOLOGY_23_CONTROL_POINT_PATCHLIST] = D3D_PRIMITIVE_TOPOLOGY_23_CONTROL_POINT_PATCHLIST;
116  d3dPrimTopology[PRIMITIVE_TOPOLOGY_24_CONTROL_POINT_PATCHLIST] = D3D_PRIMITIVE_TOPOLOGY_24_CONTROL_POINT_PATCHLIST;
117  d3dPrimTopology[PRIMITIVE_TOPOLOGY_25_CONTROL_POINT_PATCHLIST] = D3D_PRIMITIVE_TOPOLOGY_25_CONTROL_POINT_PATCHLIST;
118  d3dPrimTopology[PRIMITIVE_TOPOLOGY_26_CONTROL_POINT_PATCHLIST] = D3D_PRIMITIVE_TOPOLOGY_26_CONTROL_POINT_PATCHLIST;
119  d3dPrimTopology[PRIMITIVE_TOPOLOGY_27_CONTROL_POINT_PATCHLIST] = D3D_PRIMITIVE_TOPOLOGY_27_CONTROL_POINT_PATCHLIST;
120  d3dPrimTopology[PRIMITIVE_TOPOLOGY_28_CONTROL_POINT_PATCHLIST] = D3D_PRIMITIVE_TOPOLOGY_28_CONTROL_POINT_PATCHLIST;
121  d3dPrimTopology[PRIMITIVE_TOPOLOGY_29_CONTROL_POINT_PATCHLIST] = D3D_PRIMITIVE_TOPOLOGY_29_CONTROL_POINT_PATCHLIST;
122  d3dPrimTopology[PRIMITIVE_TOPOLOGY_30_CONTROL_POINT_PATCHLIST] = D3D_PRIMITIVE_TOPOLOGY_30_CONTROL_POINT_PATCHLIST;
123  d3dPrimTopology[PRIMITIVE_TOPOLOGY_31_CONTROL_POINT_PATCHLIST] = D3D_PRIMITIVE_TOPOLOGY_31_CONTROL_POINT_PATCHLIST;
124  d3dPrimTopology[PRIMITIVE_TOPOLOGY_32_CONTROL_POINT_PATCHLIST] = D3D_PRIMITIVE_TOPOLOGY_32_CONTROL_POINT_PATCHLIST;
125  // clang-format on
126  bIsInit = true;
127  }
128 
130  return d3dPrimTopology[Topology];
131 }
132 
133 
134 // ================= Rasterizer state attributes conversion functions =================
135 
136 template <typename D3D_FILL_MODE>
137 D3D_FILL_MODE FillModeToD3DFillMode(FILL_MODE FillMode)
138 {
139  // D3D12_FILL_MODE is identical tp D3D11_FILL_MODE
140  static bool bIsInit = false;
141  static std::array<D3D_FILL_MODE, FILL_MODE_NUM_MODES> d3dFillModes = {};
142  if (!bIsInit)
143  {
145  d3dFillModes[FILL_MODE_SOLID] = D3D_FILL_MODE_SOLID;
146 
147  bIsInit = true;
148  }
149  if (FILL_MODE_UNDEFINED < FillMode && FillMode < FILL_MODE_NUM_MODES)
150  {
151  auto d3dFillMode = d3dFillModes[FillMode];
152  VERIFY(d3dFillMode != 0, "Incorrect fill mode");
153  return d3dFillMode;
154  }
155  else
156  {
157  UNEXPECTED("Incorrect fill mode (", FillMode, ")");
158  return static_cast<D3D_FILL_MODE>(0);
159  }
160 }
161 
162 template <typename D3D_CULL_MODE>
163 D3D_CULL_MODE CullModeToD3DCullMode(CULL_MODE CullMode)
164 {
165  // D3D_CULL_MODE is identical to D3D11_CULL_MODE
166  static bool bIsInit = false;
167  static std::array<D3D_CULL_MODE, CULL_MODE_NUM_MODES> d3dCullModes = {};
168  if (!bIsInit)
169  {
170  d3dCullModes[CULL_MODE_NONE] = D3D_CULL_MODE_NONE;
171  d3dCullModes[CULL_MODE_FRONT] = D3D_CULL_MODE_FRONT;
172  d3dCullModes[CULL_MODE_BACK] = D3D_CULL_MODE_BACK;
173 
174  bIsInit = true;
175  }
176 
177  if (CULL_MODE_UNDEFINED < CullMode && CullMode < CULL_MODE_NUM_MODES)
178  {
179  auto d3dCullMode = d3dCullModes[CullMode];
180  VERIFY(d3dCullMode != 0, "Incorrect cull mode");
181  return d3dCullMode;
182  }
183  else
184  {
185  UNEXPECTED("Incorrect cull mode (", CullMode, ")");
186  return static_cast<D3D_CULL_MODE>(0);
187  }
188 }
189 
190 template <typename D3D_RASTERIZER_DESC, typename D3D_FILL_MODE, typename D3D_CULL_MODE>
191 void RasterizerStateDesc_To_D3D_RASTERIZER_DESC(const RasterizerStateDesc& RasterizerDesc, D3D_RASTERIZER_DESC& d3dRSDesc)
192 {
193  d3dRSDesc.FillMode = FillModeToD3DFillMode<D3D_FILL_MODE>(RasterizerDesc.FillMode);
194  d3dRSDesc.CullMode = CullModeToD3DCullMode<D3D_CULL_MODE>(RasterizerDesc.CullMode);
195  d3dRSDesc.FrontCounterClockwise = RasterizerDesc.FrontCounterClockwise ? TRUE : FALSE;
196  d3dRSDesc.DepthBias = RasterizerDesc.DepthBias;
197  d3dRSDesc.DepthBiasClamp = RasterizerDesc.DepthBiasClamp;
198  d3dRSDesc.SlopeScaledDepthBias = RasterizerDesc.SlopeScaledDepthBias;
199  d3dRSDesc.DepthClipEnable = RasterizerDesc.DepthClipEnable ? TRUE : FALSE;
200 
201  //d3d12RSDesc.ScissorEnable = RSDesc.ScissorEnable ? TRUE : FALSE;
202 
203  d3dRSDesc.AntialiasedLineEnable = RasterizerDesc.AntialiasedLineEnable ? TRUE : FALSE;
204  d3dRSDesc.MultisampleEnable = d3dRSDesc.AntialiasedLineEnable;
205 }
206 
207 
208 
209 // ================= Blend state attributes conversion functions =================
210 
211 template <typename D3D_BLEND>
213 {
214  // D3D11_BLEND and D3D12_BLEND are identical
215 
216  // Note that this code is safe for multithreaded environments since
217  // bIsInit is set to true only AFTER the entire map is initialized.
218  static bool bIsInit = false;
219  static std::array<D3D_BLEND, BLEND_FACTOR_NUM_FACTORS> D3DBlend = {};
220  if (!bIsInit)
221  {
222  // In a multithreaded environment, several threads can potentially enter
223  // this block. This is not a problem since they will just initialize the
224  // memory with the same values more than once
225 
226  // clang-format off
227  D3DBlend[BLEND_FACTOR_ZERO ] = D3D_BLEND_ZERO;
228  D3DBlend[BLEND_FACTOR_ONE ] = D3D_BLEND_ONE;
244  // clang-format on
245 
246  bIsInit = true;
247  }
249  {
250  auto d3dbf = D3DBlend[bf];
251  VERIFY(d3dbf != 0, "Incorrect blend factor");
252  return d3dbf;
253  }
254  else
255  {
256  UNEXPECTED("Incorrect blend factor (", bf, ")");
257  return static_cast<D3D_BLEND>(0);
258  }
259 }
260 
261 template <typename D3D_BLEND_OP>
263 {
264  // D3D12_BLEND_OP and D3D11_BLEND_OP are identical
265 
266  static bool bIsInit = false;
267  static std::array<D3D_BLEND_OP, BLEND_OPERATION_NUM_OPERATIONS> D3DBlendOp = {};
268  if (!bIsInit)
269  {
270  // clang-format off
271  D3DBlendOp[BLEND_OPERATION_ADD ] = D3D_BLEND_OP_ADD;
274  D3DBlendOp[BLEND_OPERATION_MIN ] = D3D_BLEND_OP_MIN;
275  D3DBlendOp[BLEND_OPERATION_MAX ] = D3D_BLEND_OP_MAX;
276  // clang-format on
277 
278  bIsInit = true;
279  }
280 
282  {
283  auto d3dbop = D3DBlendOp[BlendOp];
284  VERIFY(d3dbop != 0, "Incorrect blend operation");
285  return d3dbop;
286  }
287  else
288  {
289  UNEXPECTED("Incorrect blend operation (", BlendOp, ")");
290  return static_cast<D3D_BLEND_OP>(0);
291  }
292 }
293 
294 template <typename D3D_BLEND_DESC, typename D3D_BLEND, typename D3D_BLEND_OP>
295 void BlendStateDescToD3DBlendDesc(const BlendStateDesc& BSDesc, D3D_BLEND_DESC& d3d12BlendDesc)
296 {
297  // D3D_BLEND_DESC and D3D11_BLEND_DESC structures are identical
298  d3d12BlendDesc.AlphaToCoverageEnable = BSDesc.AlphaToCoverageEnable ? TRUE : FALSE;
299  d3d12BlendDesc.IndependentBlendEnable = BSDesc.IndependentBlendEnable ? TRUE : FALSE;
300  VERIFY(MAX_RENDER_TARGETS >= 8, "Number of render targets is expected to be at least 8");
301  for (int i = 0; i < 8; ++i)
302  {
303  const auto& SrcRTDesc = BSDesc.RenderTargets[i];
304  auto& DstRTDesc = d3d12BlendDesc.RenderTarget[i];
305  DstRTDesc.BlendEnable = SrcRTDesc.BlendEnable ? TRUE : FALSE;
306 
307  DstRTDesc.SrcBlend = BlendFactorToD3DBlend<D3D_BLEND>(SrcRTDesc.SrcBlend);
308  DstRTDesc.DestBlend = BlendFactorToD3DBlend<D3D_BLEND>(SrcRTDesc.DestBlend);
309  DstRTDesc.BlendOp = BlendOperationToD3DBlendOp<D3D_BLEND_OP>(SrcRTDesc.BlendOp);
310 
311  DstRTDesc.SrcBlendAlpha = BlendFactorToD3DBlend<D3D_BLEND>(SrcRTDesc.SrcBlendAlpha);
312  DstRTDesc.DestBlendAlpha = BlendFactorToD3DBlend<D3D_BLEND>(SrcRTDesc.DestBlendAlpha);
313  DstRTDesc.BlendOpAlpha = BlendOperationToD3DBlendOp<D3D_BLEND_OP>(SrcRTDesc.BlendOpAlpha);
314 
315  DstRTDesc.RenderTargetWriteMask =
316  ((SrcRTDesc.RenderTargetWriteMask & COLOR_MASK_RED) ? D3D_COLOR_WRITE_ENABLE_RED : 0) |
317  ((SrcRTDesc.RenderTargetWriteMask & COLOR_MASK_GREEN) ? D3D_COLOR_WRITE_ENABLE_GREEN : 0) |
318  ((SrcRTDesc.RenderTargetWriteMask & COLOR_MASK_BLUE) ? D3D_COLOR_WRITE_ENABLE_BLUE : 0) |
319  ((SrcRTDesc.RenderTargetWriteMask & COLOR_MASK_ALPHA) ? D3D_COLOR_WRITE_ENABLE_ALPHA : 0);
320  }
321 }
322 
323 
324 
325 // ====================== Depth-stencil state attributes conversion functions ======================
326 
327 template <typename D3D_STENCIL_OP>
328 D3D_STENCIL_OP StencilOpToD3DStencilOp(STENCIL_OP StencilOp)
329 {
330  static bool bIsInit = false;
331  static std::array<D3D_STENCIL_OP, STENCIL_OP_NUM_OPS> StOpToD3DStOpMap = {};
332  if (!bIsInit)
333  {
334  // clang-format off
335  StOpToD3DStOpMap[STENCIL_OP_KEEP ] = D3D_STENCIL_OP_KEEP;
336  StOpToD3DStOpMap[STENCIL_OP_ZERO ] = D3D_STENCIL_OP_ZERO;
337  StOpToD3DStOpMap[STENCIL_OP_REPLACE ] = D3D_STENCIL_OP_REPLACE;
338  StOpToD3DStOpMap[STENCIL_OP_INCR_SAT ] = D3D_STENCIL_OP_INCR_SAT;
339  StOpToD3DStOpMap[STENCIL_OP_DECR_SAT ] = D3D_STENCIL_OP_DECR_SAT;
340  StOpToD3DStOpMap[STENCIL_OP_INVERT ] = D3D_STENCIL_OP_INVERT;
341  StOpToD3DStOpMap[STENCIL_OP_INCR_WRAP] = D3D_STENCIL_OP_INCR;
342  StOpToD3DStOpMap[STENCIL_OP_DECR_WRAP] = D3D_STENCIL_OP_DECR;
343  // clang-format on
344 
345  bIsInit = true;
346  }
347 
348  if (StencilOp > STENCIL_OP_UNDEFINED && StencilOp < STENCIL_OP_NUM_OPS)
349  {
350  auto d3dStencilOp = StOpToD3DStOpMap[StencilOp];
351  VERIFY(d3dStencilOp != 0, "Unexpected stencil op");
352  return d3dStencilOp;
353  }
354  else
355  {
356  UNEXPECTED("Stencil operation (", StencilOp, ") is out of allowed range [1, ", STENCIL_OP_NUM_OPS - 1, "]");
357  return static_cast<D3D_STENCIL_OP>(0);
358  }
359 }
360 
361 template <typename D3D_DEPTH_STENCILOP_DESC, typename D3D_STENCIL_OP, typename D3D_COMPARISON_FUNC>
362 D3D_DEPTH_STENCILOP_DESC StencilOpDescToD3DStencilOpDesc(const StencilOpDesc& StOpDesc)
363 {
364  // D3D12_DEPTH_STENCILOP_DESC is identical to D3D11_DEPTH_STENCILOP_DESC
365  D3D_DEPTH_STENCILOP_DESC D3DStOpDesc;
366  D3DStOpDesc.StencilFailOp = StencilOpToD3DStencilOp<D3D_STENCIL_OP>(StOpDesc.StencilFailOp);
367  D3DStOpDesc.StencilDepthFailOp = StencilOpToD3DStencilOp<D3D_STENCIL_OP>(StOpDesc.StencilDepthFailOp);
368  D3DStOpDesc.StencilPassOp = StencilOpToD3DStencilOp<D3D_STENCIL_OP>(StOpDesc.StencilPassOp);
369  D3DStOpDesc.StencilFunc = ComparisonFuncToD3DComparisonFunc<D3D_COMPARISON_FUNC>(StOpDesc.StencilFunc);
370  return D3DStOpDesc;
371 }
372 
373 template <typename D3D_DEPTH_STENCIL_DESC, typename D3D_DEPTH_STENCILOP_DESC, typename D3D_STENCIL_OP, typename D3D_COMPARISON_FUNC>
374 void DepthStencilStateDesc_To_D3D_DEPTH_STENCIL_DESC(const DepthStencilStateDesc& DepthStencilDesc, D3D_DEPTH_STENCIL_DESC& d3dDSSDesc)
375 {
376  // D3D_DEPTH_STENCIL_DESC is identical to D3D11_DEPTH_STENCIL_DESC
377  d3dDSSDesc.DepthEnable = DepthStencilDesc.DepthEnable ? TRUE : FALSE;
378  d3dDSSDesc.DepthWriteMask = DepthStencilDesc.DepthWriteEnable ? D3D_DEPTH_WRITE_MASK_ALL : D3D_DEPTH_WRITE_MASK_ZERO;
379  d3dDSSDesc.DepthFunc = ComparisonFuncToD3DComparisonFunc<D3D_COMPARISON_FUNC>(DepthStencilDesc.DepthFunc);
380  d3dDSSDesc.StencilEnable = DepthStencilDesc.StencilEnable ? TRUE : FALSE;
381  d3dDSSDesc.StencilReadMask = DepthStencilDesc.StencilReadMask;
382  d3dDSSDesc.StencilWriteMask = DepthStencilDesc.StencilWriteMask;
383  d3dDSSDesc.FrontFace = StencilOpDescToD3DStencilOpDesc<D3D_DEPTH_STENCILOP_DESC, D3D_STENCIL_OP, D3D_COMPARISON_FUNC>(DepthStencilDesc.FrontFace);
384  d3dDSSDesc.BackFace = StencilOpDescToD3DStencilOpDesc<D3D_DEPTH_STENCILOP_DESC, D3D_STENCIL_OP, D3D_COMPARISON_FUNC>(DepthStencilDesc.BackFace);
385 }
386 
387 
388 
389 template <typename D3D_INPUT_ELEMENT_DESC>
391  std::vector<D3D_INPUT_ELEMENT_DESC, STDAllocatorRawMem<D3D_INPUT_ELEMENT_DESC>>& D3DInputElements)
392 {
393  // D3D12_INPUT_ELEMENT_DESC and D3D11_INPUT_ELEMENT_DESC are identical
394  D3DInputElements.resize(InputLayout.NumElements);
395  for (Uint32 iElem = 0; iElem < InputLayout.NumElements; ++iElem)
396  {
397  const auto& CurrElem = InputLayout.LayoutElements[iElem];
398  auto& D3DElem = D3DInputElements[iElem];
399  D3DElem.SemanticName = CurrElem.HLSLSemantic;
400  D3DElem.SemanticIndex = CurrElem.InputIndex;
401  D3DElem.AlignedByteOffset = CurrElem.RelativeOffset;
402  D3DElem.InputSlot = CurrElem.BufferSlot;
403  D3DElem.Format = TypeToDXGI_Format(CurrElem.ValueType, CurrElem.NumComponents, CurrElem.IsNormalized);
405  D3DElem.InstanceDataStepRate = (CurrElem.Frequency == INPUT_ELEMENT_FREQUENCY_PER_VERTEX) ? 0 : CurrElem.InstanceDataStepRate;
406  }
407 }
408 
409 
410 template <typename D3D_FILTER>
411 D3D_FILTER FilterTypeToD3DFilter(FILTER_TYPE MinFilter, FILTER_TYPE MagFilter, FILTER_TYPE MipFilter)
412 {
413  switch (MinFilter)
414  {
415  // Regular filters
416  case FILTER_TYPE_POINT:
417  if (MagFilter == FILTER_TYPE_POINT)
418  {
419  if (MipFilter == FILTER_TYPE_POINT)
421  else if (MipFilter == FILTER_TYPE_LINEAR)
423  }
424  else if (MagFilter == FILTER_TYPE_LINEAR)
425  {
426  if (MipFilter == FILTER_TYPE_POINT)
428  else if (MipFilter == FILTER_TYPE_LINEAR)
430  }
431  break;
432 
433  case FILTER_TYPE_LINEAR:
434  if (MagFilter == FILTER_TYPE_POINT)
435  {
436  if (MipFilter == FILTER_TYPE_POINT)
438  else if (MipFilter == FILTER_TYPE_LINEAR)
440  }
441  else if (MagFilter == FILTER_TYPE_LINEAR)
442  {
443  if (MipFilter == FILTER_TYPE_POINT)
445  else if (MipFilter == FILTER_TYPE_LINEAR)
447  }
448  break;
449 
451  VERIFY(MagFilter == FILTER_TYPE_ANISOTROPIC && MipFilter == FILTER_TYPE_ANISOTROPIC,
452  "For anistropic filtering, all filters must be anisotropic");
453  return D3D_FILTER_ANISOTROPIC;
454  break;
455 
456 
457 
458  // Comparison filters
460  if (MagFilter == FILTER_TYPE_COMPARISON_POINT)
461  {
462  if (MipFilter == FILTER_TYPE_COMPARISON_POINT)
464  else if (MipFilter == FILTER_TYPE_COMPARISON_LINEAR)
466  }
467  else if (MagFilter == FILTER_TYPE_COMPARISON_LINEAR)
468  {
469  if (MipFilter == FILTER_TYPE_COMPARISON_POINT)
471  else if (MipFilter == FILTER_TYPE_COMPARISON_LINEAR)
473  }
474  break;
475 
477  if (MagFilter == FILTER_TYPE_COMPARISON_POINT)
478  {
479  if (MipFilter == FILTER_TYPE_COMPARISON_POINT)
481  else if (MipFilter == FILTER_TYPE_COMPARISON_LINEAR)
483  }
484  else if (MagFilter == FILTER_TYPE_COMPARISON_LINEAR)
485  {
486  if (MipFilter == FILTER_TYPE_COMPARISON_POINT)
488  else if (MipFilter == FILTER_TYPE_COMPARISON_LINEAR)
490  }
491  break;
492 
495  "For comparison anistropic filtering, all filters must be anisotropic");
497  break;
498 
499 
500 
501  // Minimum filters
503  if (MagFilter == FILTER_TYPE_MINIMUM_POINT)
504  {
505  if (MipFilter == FILTER_TYPE_MINIMUM_POINT)
507  else if (MipFilter == FILTER_TYPE_MINIMUM_LINEAR)
509  }
510  else if (MagFilter == FILTER_TYPE_MINIMUM_LINEAR)
511  {
512  if (MipFilter == FILTER_TYPE_MINIMUM_POINT)
514  else if (MipFilter == FILTER_TYPE_MINIMUM_LINEAR)
516  }
517  break;
518 
520  if (MagFilter == FILTER_TYPE_MINIMUM_POINT)
521  {
522  if (MipFilter == FILTER_TYPE_MINIMUM_POINT)
524  else if (MipFilter == FILTER_TYPE_MINIMUM_LINEAR)
526  }
527  else if (MagFilter == FILTER_TYPE_MINIMUM_LINEAR)
528  {
529  if (MipFilter == FILTER_TYPE_MINIMUM_POINT)
531  else if (MipFilter == FILTER_TYPE_MINIMUM_LINEAR)
533  }
534  break;
535 
538  "For minimum anistropic filtering, all filters must be anisotropic");
540  break;
541 
542 
543 
544  // Maximum filters
546  if (MagFilter == FILTER_TYPE_MAXIMUM_POINT)
547  {
548  if (MipFilter == FILTER_TYPE_MAXIMUM_POINT)
550  else if (MipFilter == FILTER_TYPE_MAXIMUM_LINEAR)
552  }
553  else if (MagFilter == FILTER_TYPE_MAXIMUM_LINEAR)
554  {
555  if (MipFilter == FILTER_TYPE_MAXIMUM_POINT)
557  else if (MipFilter == FILTER_TYPE_MAXIMUM_LINEAR)
559  }
560  break;
561 
563  if (MagFilter == FILTER_TYPE_MAXIMUM_POINT)
564  {
565  if (MipFilter == FILTER_TYPE_MAXIMUM_POINT)
567  else if (MipFilter == FILTER_TYPE_MAXIMUM_LINEAR)
569  }
570  else if (MagFilter == FILTER_TYPE_MAXIMUM_LINEAR)
571  {
572  if (MipFilter == FILTER_TYPE_MAXIMUM_POINT)
574  else if (MipFilter == FILTER_TYPE_MAXIMUM_LINEAR)
576  }
577  break;
578 
581  "For maximum anistropic filtering, all filters must be anisotropic");
583  break;
584  }
585 
586  UNEXPECTED("Unsupported filter combination");
588 }
589 
590 } // namespace Diligent
D3D_FILL_MODE_WIREFRAME
#define D3D_FILL_MODE_WIREFRAME
Definition: D3D11TypeDefinitions.h:106
Diligent::PRIMITIVE_TOPOLOGY_25_CONTROL_POINT_PATCHLIST
@ PRIMITIVE_TOPOLOGY_25_CONTROL_POINT_PATCHLIST
Interpret the vertex data as a list of 25 control point patches. D3D counterpart: D3D_PRIMITIVE_TOPO...
Definition: GraphicsTypes.h:1112
Diligent::COMPARISON_FUNC_LESS_EQUAL
@ COMPARISON_FUNC_LESS_EQUAL
Comparison passes if the source data is less than or equal to the destination data....
Definition: GraphicsTypes.h:950
D3D_FILTER_MIN_LINEAR_MAG_MIP_POINT
#define D3D_FILTER_MIN_LINEAR_MAG_MIP_POINT
Definition: D3D11TypeDefinitions.h:38
D3D_STENCIL_OP_DECR
#define D3D_STENCIL_OP_DECR
Definition: D3D11TypeDefinitions.h:94
D3D_BLEND_OP_REV_SUBTRACT
#define D3D_BLEND_OP_REV_SUBTRACT
Definition: D3D11TypeDefinitions.h:131
Diligent::PRIMITIVE_TOPOLOGY_13_CONTROL_POINT_PATCHLIST
@ PRIMITIVE_TOPOLOGY_13_CONTROL_POINT_PATCHLIST
Interpret the vertex data as a list of 13 control point patches. D3D counterpart: D3D_PRIMITIVE_TOPO...
Definition: GraphicsTypes.h:1064
D3D_STENCIL_OP_ZERO
#define D3D_STENCIL_OP_ZERO
Definition: D3D11TypeDefinitions.h:88
Diligent::PRIMITIVE_TOPOLOGY_30_CONTROL_POINT_PATCHLIST
@ PRIMITIVE_TOPOLOGY_30_CONTROL_POINT_PATCHLIST
Interpret the vertex data as a list of 30 control point patches. D3D counterpart: D3D_PRIMITIVE_TOPO...
Definition: GraphicsTypes.h:1132
Diligent::STENCIL_OP_KEEP
@ STENCIL_OP_KEEP
Keep the existing stencil data. Direct3D counterpart: D3D11_STENCIL_OP_KEEP/D3D12_STENCIL_OP_KEEP....
Definition: DepthStencilState.h:55
Diligent::BLEND_OPERATION_REV_SUBTRACT
@ BLEND_OPERATION_REV_SUBTRACT
Subtract source color components from destination color components. Direct3D counterpart: D3D11_BLEN...
Definition: BlendState.h:153
D3D_BLEND_INV_DEST_ALPHA
#define D3D_BLEND_INV_DEST_ALPHA
Definition: D3D11TypeDefinitions.h:117
Diligent::PRIMITIVE_TOPOLOGY_14_CONTROL_POINT_PATCHLIST
@ PRIMITIVE_TOPOLOGY_14_CONTROL_POINT_PATCHLIST
Interpret the vertex data as a list of 14 control point patches. D3D counterpart: D3D_PRIMITIVE_TOPO...
Definition: GraphicsTypes.h:1068
D3D_FILTER_MIN_MAG_MIP_LINEAR
#define D3D_FILTER_MIN_MAG_MIP_LINEAR
Definition: D3D11TypeDefinitions.h:41
Diligent::PRIMITIVE_TOPOLOGY_POINT_LIST
@ PRIMITIVE_TOPOLOGY_POINT_LIST
Interpret the vertex data as a list of points. D3D counterpart: D3D_PRIMITIVE_TOPOLOGY_POINTLIST....
Definition: GraphicsTypes.h:1004
D3D_TEXTURE_ADDRESS_CLAMP
#define D3D_TEXTURE_ADDRESS_CLAMP
Definition: D3D11TypeDefinitions.h:148
D3D_TEXTURE_ADDRESS_WRAP
#define D3D_TEXTURE_ADDRESS_WRAP
Definition: D3D11TypeDefinitions.h:146
D3D_FILTER_MAXIMUM_MIN_MAG_LINEAR_MIP_POINT
#define D3D_FILTER_MAXIMUM_MIN_MAG_LINEAR_MIP_POINT
Definition: D3D11TypeDefinitions.h:71
D3D_FILTER_COMPARISON_MIN_MAG_MIP_POINT
#define D3D_FILTER_COMPARISON_MIN_MAG_MIP_POINT
Definition: D3D11TypeDefinitions.h:44
Diligent::DepthStencilStateDesc_To_D3D_DEPTH_STENCIL_DESC
void DepthStencilStateDesc_To_D3D_DEPTH_STENCIL_DESC(const DepthStencilStateDesc &DepthStencilDesc, D3D_DEPTH_STENCIL_DESC &d3dDSSDesc)
Definition: D3DTypeConversionImpl.hpp:374
Diligent::LayoutElement::HLSLSemantic
const char * HLSLSemantic
HLSL semantic. Default value ("ATTRIB") allows HLSL shaders to be converted to GLSL and used in OpenG...
Definition: InputLayout.h:69
Diligent::PRIMITIVE_TOPOLOGY_27_CONTROL_POINT_PATCHLIST
@ PRIMITIVE_TOPOLOGY_27_CONTROL_POINT_PATCHLIST
Interpret the vertex data as a list of 27 control point patches. D3D counterpart: D3D_PRIMITIVE_TOPO...
Definition: GraphicsTypes.h:1120
Diligent::BlendStateDesc::IndependentBlendEnable
Bool IndependentBlendEnable
Specifies whether to enable independent blending in simultaneous render targets. If set to False,...
Definition: BlendState.h:382
D3D_STENCIL_OP_DECR_SAT
#define D3D_STENCIL_OP_DECR_SAT
Definition: D3D11TypeDefinitions.h:91
D3D_COLOR_WRITE_ENABLE_BLUE
#define D3D_COLOR_WRITE_ENABLE_BLUE
Definition: D3D11TypeDefinitions.h:138
Diligent::TEXTURE_ADDRESS_MODE
TEXTURE_ADDRESS_MODE
Texture address mode.
Definition: GraphicsTypes.h:889
Diligent::BLEND_FACTOR_INV_BLEND_FACTOR
@ BLEND_FACTOR_INV_BLEND_FACTOR
The blend factor is one minus constant blend factor set with IDeviceContext::SetBlendFactors()....
Definition: BlendState.h:106
Diligent::BLEND_FACTOR_INV_SRC1_ALPHA
@ BLEND_FACTOR_INV_SRC1_ALPHA
The blend factor is 1-A, where A is the second alpha data output from a pixel shader....
Definition: BlendState.h:122
D3D_STENCIL_OP_INCR
#define D3D_STENCIL_OP_INCR
Definition: D3D11TypeDefinitions.h:93
D3D_FILTER_MINIMUM_MIN_POINT_MAG_MIP_LINEAR
#define D3D_FILTER_MINIMUM_MIN_POINT_MAG_MIP_LINEAR
Definition: D3D11TypeDefinitions.h:58
D3D_FILTER_COMPARISON_MIN_POINT_MAG_MIP_LINEAR
#define D3D_FILTER_COMPARISON_MIN_POINT_MAG_MIP_LINEAR
Definition: D3D11TypeDefinitions.h:47
Diligent::STENCIL_OP_UNDEFINED
@ STENCIL_OP_UNDEFINED
Undefined operation.
Definition: DepthStencilState.h:51
D3D_STENCIL_OP_INCR_SAT
#define D3D_STENCIL_OP_INCR_SAT
Definition: D3D11TypeDefinitions.h:90
Diligent::BLEND_FACTOR_NUM_FACTORS
@ BLEND_FACTOR_NUM_FACTORS
Helper value that stores the total number of blend factors in the enumeration.
Definition: BlendState.h:125
D3D_FILTER_MAXIMUM_MIN_LINEAR_MAG_MIP_POINT
#define D3D_FILTER_MAXIMUM_MIN_LINEAR_MAG_MIP_POINT
Definition: D3D11TypeDefinitions.h:69
D3D_FILTER_MIN_LINEAR_MAG_POINT_MIP_LINEAR
#define D3D_FILTER_MIN_LINEAR_MAG_POINT_MIP_LINEAR
Definition: D3D11TypeDefinitions.h:39
D3D_BLEND_INV_BLEND_FACTOR
#define D3D_BLEND_INV_BLEND_FACTOR
Definition: D3D11TypeDefinitions.h:122
Diligent::STENCIL_OP_DECR_WRAP
@ STENCIL_OP_DECR_WRAP
Decrement the current stencil value, and wrap the value to the maximum representable unsigned value w...
Definition: DepthStencilState.h:85
Diligent::BlendStateDesc::AlphaToCoverageEnable
Bool AlphaToCoverageEnable
Specifies whether to use alpha-to-coverage as a multisampling technique when setting a pixel to a ren...
Definition: BlendState.h:378
Diligent::STENCIL_OP_ZERO
@ STENCIL_OP_ZERO
Set the stencil data to 0. Direct3D counterpart: D3D11_STENCIL_OP_ZERO/D3D12_STENCIL_OP_ZERO....
Definition: DepthStencilState.h:59
Diligent::BLEND_OPERATION_NUM_OPERATIONS
@ BLEND_OPERATION_NUM_OPERATIONS
Helper value that stores the total number of blend operations in the enumeration.
Definition: BlendState.h:164
D3D_BLEND_INV_SRC1_ALPHA
#define D3D_BLEND_INV_SRC1_ALPHA
Definition: D3D11TypeDefinitions.h:126
Diligent::PRIMITIVE_TOPOLOGY_TRIANGLE_LIST
@ PRIMITIVE_TOPOLOGY_TRIANGLE_LIST
Interpret the vertex data as a list of triangles. D3D counterpart: D3D_PRIMITIVE_TOPOLOGY_TRIANGLELI...
Definition: GraphicsTypes.h:996
D3D_INPUT_CLASSIFICATION_PER_INSTANCE_DATA
#define D3D_INPUT_CLASSIFICATION_PER_INSTANCE_DATA
Definition: D3D11TypeDefinitions.h:143
D3D_COMPARISON_FUNC_GREATER_EQUAL
#define D3D_COMPARISON_FUNC_GREATER_EQUAL
Definition: D3D11TypeDefinitions.h:83
D3D_BLEND_DEST_COLOR
#define D3D_BLEND_DEST_COLOR
Definition: D3D11TypeDefinitions.h:118
Diligent::BLEND_OPERATION_UNDEFINED
@ BLEND_OPERATION_UNDEFINED
Undefined blend operation.
Definition: BlendState.h:141
Diligent::FILTER_TYPE
FILTER_TYPE
Filter type.
Definition: GraphicsTypes.h:864
Diligent::DepthStencilStateDesc::StencilEnable
Bool StencilEnable
Enable stencil opertaions. Default value: False.
Definition: DepthStencilState.h:173
UNEXPECTED
#define UNEXPECTED(...)
Definition: DebugUtilities.hpp:77
Diligent::PRIMITIVE_TOPOLOGY_21_CONTROL_POINT_PATCHLIST
@ PRIMITIVE_TOPOLOGY_21_CONTROL_POINT_PATCHLIST
Interpret the vertex data as a list of 21 control point patches. D3D counterpart: D3D_PRIMITIVE_TOPO...
Definition: GraphicsTypes.h:1096
D3D_CULL_MODE_FRONT
#define D3D_CULL_MODE_FRONT
Definition: D3D11TypeDefinitions.h:102
Diligent::PRIMITIVE_TOPOLOGY_3_CONTROL_POINT_PATCHLIST
@ PRIMITIVE_TOPOLOGY_3_CONTROL_POINT_PATCHLIST
Interpret the vertex data as a list of three control point patches. D3D counterpart: D3D_PRIMITIVE_T...
Definition: GraphicsTypes.h:1024
Diligent::StencilOpDesc::StencilDepthFailOp
STENCIL_OP StencilDepthFailOp
The stencil operation to perform when stencil testing passes and depth testing fails....
Definition: DepthStencilState.h:106
Diligent::FILL_MODE_SOLID
@ FILL_MODE_SOLID
Rasterize triangles using solid fill. Direct3D counterpart: D3D11_FILL_SOLID/D3D12_FILL_MODE_SOLID....
Definition: RasterizerState.h:57
Diligent::PRIMITIVE_TOPOLOGY_LINE_STRIP
@ PRIMITIVE_TOPOLOGY_LINE_STRIP
Interpret the vertex data as a line strip. D3D counterpart: D3D_PRIMITIVE_TOPOLOGY_LINESTRIP....
Definition: GraphicsTypes.h:1012
Diligent::PRIMITIVE_TOPOLOGY_10_CONTROL_POINT_PATCHLIST
@ PRIMITIVE_TOPOLOGY_10_CONTROL_POINT_PATCHLIST
Interpret the vertex data as a list of ten control point patches. D3D counterpart: D3D_PRIMITIVE_TOP...
Definition: GraphicsTypes.h:1052
Diligent::FILL_MODE
FILL_MODE
Fill mode.
Definition: RasterizerState.h:46
Diligent::PRIMITIVE_TOPOLOGY_LINE_LIST
@ PRIMITIVE_TOPOLOGY_LINE_LIST
Interpret the vertex data as a list of lines. D3D counterpart: D3D_PRIMITIVE_TOPOLOGY_LINELIST....
Definition: GraphicsTypes.h:1008
Diligent::PRIMITIVE_TOPOLOGY
PRIMITIVE_TOPOLOGY
Input primitive topology.
Definition: GraphicsTypes.h:989
Diligent::BLEND_FACTOR_SRC_ALPHA_SAT
@ BLEND_FACTOR_SRC_ALPHA_SAT
The blend factor is (f,f,f,1), where f = min(As, 1-Ad), As is alpha data from a pixel shader,...
Definition: BlendState.h:98
D3D_DEPTH_WRITE_MASK_ALL
#define D3D_DEPTH_WRITE_MASK_ALL
Definition: D3D11TypeDefinitions.h:97
Diligent::FillModeToD3DFillMode
D3D_FILL_MODE FillModeToD3DFillMode(FILL_MODE FillMode)
Definition: D3DTypeConversionImpl.hpp:137
Diligent::STENCIL_OP_REPLACE
@ STENCIL_OP_REPLACE
Set the stencil data to the reference value set by calling IDeviceContext::SetStencilRef()....
Definition: DepthStencilState.h:63
Diligent::PRIMITIVE_TOPOLOGY_31_CONTROL_POINT_PATCHLIST
@ PRIMITIVE_TOPOLOGY_31_CONTROL_POINT_PATCHLIST
Interpret the vertex data as a list of 31 control point patches. D3D counterpart: D3D_PRIMITIVE_TOPO...
Definition: GraphicsTypes.h:1136
D3D_BLEND_OP_ADD
#define D3D_BLEND_OP_ADD
Definition: D3D11TypeDefinitions.h:129
D3D_FILTER_COMPARISON_MIN_LINEAR_MAG_MIP_POINT
#define D3D_FILTER_COMPARISON_MIN_LINEAR_MAG_MIP_POINT
Definition: D3D11TypeDefinitions.h:48
Diligent::DepthStencilStateDesc::StencilWriteMask
Uint8 StencilWriteMask
Identify which bits of the depth-stencil buffer are accessed when writing stencil data....
Definition: DepthStencilState.h:181
Diligent::StencilOpDesc::StencilFunc
COMPARISON_FUNCTION StencilFunc
A function that compares stencil data against existing stencil data. Default value: Diligent::COMPARI...
Definition: DepthStencilState.h:114
D3D_FILTER_COMPARISON_ANISOTROPIC
#define D3D_FILTER_COMPARISON_ANISOTROPIC
Definition: D3D11TypeDefinitions.h:52
Diligent::PRIMITIVE_TOPOLOGY_24_CONTROL_POINT_PATCHLIST
@ PRIMITIVE_TOPOLOGY_24_CONTROL_POINT_PATCHLIST
Interpret the vertex data as a list of 24 control point patches. D3D counterpart: D3D_PRIMITIVE_TOPO...
Definition: GraphicsTypes.h:1108
Diligent::PRIMITIVE_TOPOLOGY_9_CONTROL_POINT_PATCHLIST
@ PRIMITIVE_TOPOLOGY_9_CONTROL_POINT_PATCHLIST
Interpret the vertex data as a list of nine control point patches. D3D counterpart: D3D_PRIMITIVE_TO...
Definition: GraphicsTypes.h:1048
D3D_BLEND_INV_SRC_ALPHA
#define D3D_BLEND_INV_SRC_ALPHA
Definition: D3D11TypeDefinitions.h:115
Diligent::STENCIL_OP_INCR_WRAP
@ STENCIL_OP_INCR_WRAP
Increment the current stencil value, and wrap the value to zero when incrementing the maximum represe...
Definition: DepthStencilState.h:80
Diligent::TopologyToD3DTopology
D3D_PRIM_TOPOLOGY TopologyToD3DTopology(PRIMITIVE_TOPOLOGY Topology)
Definition: D3DTypeConversionImpl.hpp:80
Diligent::CULL_MODE_BACK
@ CULL_MODE_BACK
Do not draw triangles that are back-facing. Front- and back-facing triangles are determined by the Ra...
Definition: RasterizerState.h:86
Diligent::COMPARISON_FUNC_LESS
@ COMPARISON_FUNC_LESS
Comparison passes if the source data is less than the destination data. Direct3D counterpart: D3D11_...
Definition: GraphicsTypes.h:942
D3D_BLEND_BLEND_FACTOR
#define D3D_BLEND_BLEND_FACTOR
Definition: D3D11TypeDefinitions.h:121
D3D_FILTER_MINIMUM_MIN_MAG_MIP_POINT
#define D3D_FILTER_MINIMUM_MIN_MAG_MIP_POINT
Definition: D3D11TypeDefinitions.h:55
Diligent::BLEND_OPERATION_ADD
@ BLEND_OPERATION_ADD
Add source and destination color components. Direct3D counterpart: D3D11_BLEND_OP_ADD/D3D12_BLEND_OP...
Definition: BlendState.h:145
D3D_FILTER_MINIMUM_MIN_LINEAR_MAG_POINT_MIP_LINEAR
#define D3D_FILTER_MINIMUM_MIN_LINEAR_MAG_POINT_MIP_LINEAR
Definition: D3D11TypeDefinitions.h:60
Diligent::PRIMITIVE_TOPOLOGY_5_CONTROL_POINT_PATCHLIST
@ PRIMITIVE_TOPOLOGY_5_CONTROL_POINT_PATCHLIST
Interpret the vertex data as a list of five control point patches. D3D counterpart: D3D_PRIMITIVE_TO...
Definition: GraphicsTypes.h:1032
Diligent::COLOR_MASK_RED
@ COLOR_MASK_RED
Allow data to be stored in the red component.
Definition: BlendState.h:178
Diligent::FILTER_TYPE_MINIMUM_ANISOTROPIC
@ FILTER_TYPE_MINIMUM_ANISOTROPIC
Minimum-anisotropic filtering (DX12 only)
Definition: GraphicsTypes.h:875
Diligent::PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP
@ PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP
Interpret the vertex data as a triangle strip. D3D counterpart: D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP...
Definition: GraphicsTypes.h:1000
Diligent::FILTER_TYPE_MAXIMUM_LINEAR
@ FILTER_TYPE_MAXIMUM_LINEAR
Maximum-linear filtering (DX12 only)
Definition: GraphicsTypes.h:877
Diligent::RasterizerStateDesc_To_D3D_RASTERIZER_DESC
void RasterizerStateDesc_To_D3D_RASTERIZER_DESC(const RasterizerStateDesc &RasterizerDesc, D3D_RASTERIZER_DESC &d3dRSDesc)
Definition: D3DTypeConversionImpl.hpp:191
Diligent::BLEND_FACTOR_INV_DEST_COLOR
@ BLEND_FACTOR_INV_DEST_COLOR
The blend factor is 1-RGB, where RGB is the data from a render target. Direct3D counterpart: D3D11_B...
Definition: BlendState.h:93
Diligent::FILTER_TYPE_MINIMUM_POINT
@ FILTER_TYPE_MINIMUM_POINT
Minimum-point filtering (DX12 only)
Definition: GraphicsTypes.h:873
Diligent::BLEND_OPERATION_MIN
@ BLEND_OPERATION_MIN
Compute the minimum of source and destination color components. Direct3D counterpart: D3D11_BLEND_OP...
Definition: BlendState.h:157
Diligent::RasterizerStateDesc
Rasterizer state description.
Definition: RasterizerState.h:96
Diligent::PRIMITIVE_TOPOLOGY_32_CONTROL_POINT_PATCHLIST
@ PRIMITIVE_TOPOLOGY_32_CONTROL_POINT_PATCHLIST
Interpret the vertex data as a list of 32 control point patches. D3D counterpart: D3D_PRIMITIVE_TOPO...
Definition: GraphicsTypes.h:1140
Diligent::StencilOpDescToD3DStencilOpDesc
D3D_DEPTH_STENCILOP_DESC StencilOpDescToD3DStencilOpDesc(const StencilOpDesc &StOpDesc)
Definition: D3DTypeConversionImpl.hpp:362
Diligent::DepthStencilStateDesc::BackFace
StencilOpDesc BackFace
Identify stencil operations for the back-facing triangles, see Diligent::StencilOpDesc.
Definition: DepthStencilState.h:187
Diligent::STDAllocator
Definition: STDAllocator.hpp:53
D3D_FILTER_COMPARISON_MIN_MAG_MIP_LINEAR
#define D3D_FILTER_COMPARISON_MIN_MAG_MIP_LINEAR
Definition: D3D11TypeDefinitions.h:51
Diligent::CULL_MODE_NUM_MODES
@ CULL_MODE_NUM_MODES
Helper value that stores the total number of cull modes in the enumeration.
Definition: RasterizerState.h:89
D3D_COMPARISON_FUNC_EQUAL
#define D3D_COMPARISON_FUNC_EQUAL
Definition: D3D11TypeDefinitions.h:79
Diligent::DepthStencilStateDesc::StencilReadMask
Uint8 StencilReadMask
Identify which bits of the depth-stencil buffer are accessed when reading stencil data....
Definition: DepthStencilState.h:177
D3D_FILTER_MAXIMUM_ANISOTROPIC
#define D3D_FILTER_MAXIMUM_ANISOTROPIC
Definition: D3D11TypeDefinitions.h:73
D3D_COLOR_WRITE_ENABLE_ALPHA
#define D3D_COLOR_WRITE_ENABLE_ALPHA
Definition: D3D11TypeDefinitions.h:139
Diligent::BLEND_FACTOR
BLEND_FACTOR
Blend factors.
Definition: BlendState.h:50
Diligent::PRIMITIVE_TOPOLOGY_23_CONTROL_POINT_PATCHLIST
@ PRIMITIVE_TOPOLOGY_23_CONTROL_POINT_PATCHLIST
Interpret the vertex data as a list of 23 control point patches. D3D counterpart: D3D_PRIMITIVE_TOPO...
Definition: GraphicsTypes.h:1104
Diligent::BLEND_FACTOR_INV_SRC1_COLOR
@ BLEND_FACTOR_INV_SRC1_COLOR
The blend factor is 1-RGB, where RGB is the second RGB data output from a pixel shader....
Definition: BlendState.h:114
Diligent::FILTER_TYPE_COMPARISON_LINEAR
@ FILTER_TYPE_COMPARISON_LINEAR
Comparison-linear filtering.
Definition: GraphicsTypes.h:871
Diligent::PRIMITIVE_TOPOLOGY_29_CONTROL_POINT_PATCHLIST
@ PRIMITIVE_TOPOLOGY_29_CONTROL_POINT_PATCHLIST
Interpret the vertex data as a list of 29 control point patches. D3D counterpart: D3D_PRIMITIVE_TOPO...
Definition: GraphicsTypes.h:1128
Diligent::PRIMITIVE_TOPOLOGY_16_CONTROL_POINT_PATCHLIST
@ PRIMITIVE_TOPOLOGY_16_CONTROL_POINT_PATCHLIST
Interpret the vertex data as a list of 16 control point patches. D3D counterpart: D3D_PRIMITIVE_TOPO...
Definition: GraphicsTypes.h:1076
D3D_FILTER_MAXIMUM_MIN_LINEAR_MAG_POINT_MIP_LINEAR
#define D3D_FILTER_MAXIMUM_MIN_LINEAR_MAG_POINT_MIP_LINEAR
Definition: D3D11TypeDefinitions.h:70
Diligent::TEXTURE_ADDRESS_MIRROR_ONCE
@ TEXTURE_ADDRESS_MIRROR_ONCE
Similar to TEXTURE_ADDRESS_MIRROR and TEXTURE_ADDRESS_CLAMP. Takes the absolute value of the texture ...
Definition: GraphicsTypes.h:917
D3D_BLEND_SRC_ALPHA
#define D3D_BLEND_SRC_ALPHA
Definition: D3D11TypeDefinitions.h:114
Diligent::StencilOpDesc
Describes stencil operations that are performed based on the results of depth test.
Definition: DepthStencilState.h:98
D3D_COLOR_WRITE_ENABLE_RED
#define D3D_COLOR_WRITE_ENABLE_RED
Definition: D3D11TypeDefinitions.h:136
Diligent::RasterizerStateDesc::SlopeScaledDepthBias
Float32 SlopeScaledDepthBias
Scalar that scales the given pixel's slope before adding to the pixel's depth. Default value: 0.
Definition: RasterizerState.h:136
Diligent::RenderTargetBlendDesc::BlendEnable
Bool BlendEnable
Enable or disable blending for this render target. Default value: False.
Definition: BlendState.h:279
Diligent::RasterizerStateDesc::AntialiasedLineEnable
Bool AntialiasedLineEnable
Specifies whether to enable line antialiasing. Default value: False.
Definition: RasterizerState.h:123
Diligent::COMPARISON_FUNC_NEVER
@ COMPARISON_FUNC_NEVER
Comparison never passes. Direct3D counterpart: D3D11_COMPARISON_NEVER/D3D12_COMPARISON_FUNC_NEVER....
Definition: GraphicsTypes.h:938
Diligent::CULL_MODE
CULL_MODE
Cull mode.
Definition: RasterizerState.h:69
Diligent::BLEND_FACTOR_UNDEFINED
@ BLEND_FACTOR_UNDEFINED
Undefined blend factor.
Definition: BlendState.h:53
Diligent::BLEND_FACTOR_SRC_ALPHA
@ BLEND_FACTOR_SRC_ALPHA
The blend factor is alpha (A) data from a pixel shader. Direct3D counterpart: D3D11_BLEND_SRC_ALPHA/...
Definition: BlendState.h:73
Diligent::InputLayoutDesc
Layout description.
Definition: InputLayout.h:203
Diligent::STENCIL_OP_NUM_OPS
@ STENCIL_OP_NUM_OPS
Helper value that stores the total number of stencil operations in the enumeration.
Definition: DepthStencilState.h:88
D3D_COMPARISON_FUNC_GREATER
#define D3D_COMPARISON_FUNC_GREATER
Definition: D3D11TypeDefinitions.h:81
Diligent::COMPARISON_FUNC_UNKNOWN
@ COMPARISON_FUNC_UNKNOWN
Unknown comparison function.
Definition: GraphicsTypes.h:934
D3D_FILTER_COMPARISON_MIN_MAG_POINT_MIP_LINEAR
#define D3D_FILTER_COMPARISON_MIN_MAG_POINT_MIP_LINEAR
Definition: D3D11TypeDefinitions.h:45
D3D_COMPARISON_FUNC_NOT_EQUAL
#define D3D_COMPARISON_FUNC_NOT_EQUAL
Definition: D3D11TypeDefinitions.h:82
Diligent::BlendStateDesc::RenderTargets
RenderTargetBlendDesc RenderTargets[DILIGENT_MAX_RENDER_TARGETS]
An array of RenderTargetBlendDesc structures that describe the blend states for render targets.
Definition: BlendState.h:386
Diligent::BLEND_OPERATION_SUBTRACT
@ BLEND_OPERATION_SUBTRACT
Subtract destination color components from source color components. Direct3D counterpart: D3D11_BLEN...
Definition: BlendState.h:149
D3D_CULL_MODE_NONE
#define D3D_CULL_MODE_NONE
Definition: D3D11TypeDefinitions.h:101
Diligent::FILL_MODE_NUM_MODES
@ FILL_MODE_NUM_MODES
Helper value that stores the total number of fill modes in the enumeration.
Definition: RasterizerState.h:60
Diligent::FILTER_TYPE_POINT
@ FILTER_TYPE_POINT
Point filtering.
Definition: GraphicsTypes.h:867
D3D_STENCIL_OP_REPLACE
#define D3D_STENCIL_OP_REPLACE
Definition: D3D11TypeDefinitions.h:89
Diligent::CULL_MODE_UNDEFINED
@ CULL_MODE_UNDEFINED
Undefined cull mode.
Definition: RasterizerState.h:72
D3D_BLEND_ONE
#define D3D_BLEND_ONE
Definition: D3D11TypeDefinitions.h:111
Diligent::CullModeToD3DCullMode
D3D_CULL_MODE CullModeToD3DCullMode(CULL_MODE CullMode)
Definition: D3DTypeConversionImpl.hpp:163
D3D_TEXTURE_ADDRESS_MIRROR
#define D3D_TEXTURE_ADDRESS_MIRROR
Definition: D3D11TypeDefinitions.h:147
D3D_FILTER_MAXIMUM_MIN_POINT_MAG_MIP_LINEAR
#define D3D_FILTER_MAXIMUM_MIN_POINT_MAG_MIP_LINEAR
Definition: D3D11TypeDefinitions.h:68
D3D_BLEND_SRC1_COLOR
#define D3D_BLEND_SRC1_COLOR
Definition: D3D11TypeDefinitions.h:123
Diligent::BLEND_FACTOR_ONE
@ BLEND_FACTOR_ONE
The blend factor is one. Direct3D counterpart: D3D11_BLEND_ONE/D3D12_BLEND_ONE. OpenGL counterpart: ...
Definition: BlendState.h:61
Diligent::DepthStencilStateDesc::DepthFunc
COMPARISON_FUNCTION DepthFunc
A function that compares depth data against existing depth data. See Diligent::COMPARISON_FUNCTION fo...
Definition: DepthStencilState.h:170
Diligent::CULL_MODE_FRONT
@ CULL_MODE_FRONT
Do not draw triangles that are front-facing. Front- and back-facing triangles are determined by the R...
Definition: RasterizerState.h:81
Diligent::StencilOpDesc::StencilFailOp
STENCIL_OP StencilFailOp
The stencil operation to perform when stencil testing fails. Default value: Diligent::STENCIL_OP_KEEP...
Definition: DepthStencilState.h:102
D3D_FILTER_MINIMUM_MIN_POINT_MAG_LINEAR_MIP_POINT
#define D3D_FILTER_MINIMUM_MIN_POINT_MAG_LINEAR_MIP_POINT
Definition: D3D11TypeDefinitions.h:57
Diligent::PRIMITIVE_TOPOLOGY_NUM_TOPOLOGIES
@ PRIMITIVE_TOPOLOGY_NUM_TOPOLOGIES
Helper value that stores the total number of topologies in the enumeration.
Definition: GraphicsTypes.h:1143
Diligent::RasterizerStateDesc::DepthBiasClamp
Float32 DepthBiasClamp
Maximum depth bias of a pixel.
Definition: RasterizerState.h:132
D3D_FILTER_MAXIMUM_MIN_MAG_MIP_LINEAR
#define D3D_FILTER_MAXIMUM_MIN_MAG_MIP_LINEAR
Definition: D3D11TypeDefinitions.h:72
Diligent::Uint32
uint32_t Uint32
32-bit unsigned integer
Definition: BasicTypes.h:51
Diligent::COMPARISON_FUNC_GREATER_EQUAL
@ COMPARISON_FUNC_GREATER_EQUAL
Comparison passes if the source data is greater than or equal to the destination data....
Definition: GraphicsTypes.h:962
Diligent::PRIMITIVE_TOPOLOGY_UNDEFINED
@ PRIMITIVE_TOPOLOGY_UNDEFINED
Undefined topology.
Definition: GraphicsTypes.h:992
Diligent::BLEND_FACTOR_ZERO
@ BLEND_FACTOR_ZERO
The blend factor is zero. Direct3D counterpart: D3D11_BLEND_ZERO/D3D12_BLEND_ZERO....
Definition: BlendState.h:57
Diligent::BLEND_FACTOR_INV_DEST_ALPHA
@ BLEND_FACTOR_INV_DEST_ALPHA
The blend factor is 1-A, where A is alpha data from a render target. Direct3D counterpart: D3D11_BLE...
Definition: BlendState.h:85
Diligent::TEXTURE_ADDRESS_MIRROR
@ TEXTURE_ADDRESS_MIRROR
Flip the texture at every integer junction. Direct3D Counterpart: D3D11_TEXTURE_ADDRESS_MIRROR/D3D1...
Definition: GraphicsTypes.h:900
D3D_BLEND_ZERO
#define D3D_BLEND_ZERO
Definition: D3D11TypeDefinitions.h:110
Diligent::INPUT_ELEMENT_FREQUENCY_PER_VERTEX
@ INPUT_ELEMENT_FREQUENCY_PER_VERTEX
Input data is per-vertex data.
Definition: InputLayout.h:53
Diligent::BLEND_FACTOR_SRC_COLOR
@ BLEND_FACTOR_SRC_COLOR
The blend factor is RGB data from a pixel shader. Direct3D counterpart: D3D11_BLEND_SRC_COLOR/D3D12_...
Definition: BlendState.h:65
Diligent::COMPARISON_FUNCTION
COMPARISON_FUNCTION
Comparison function.
Definition: GraphicsTypes.h:931
Diligent::COMPARISON_FUNC_GREATER
@ COMPARISON_FUNC_GREATER
Comparison passes if the source data is greater than the destination data. Direct3D counterpart: 3D1...
Definition: GraphicsTypes.h:954
Diligent::STENCIL_OP_INCR_SAT
@ STENCIL_OP_INCR_SAT
Increment the current stencil value, and clamp to the maximum representable unsigned value....
Definition: DepthStencilState.h:67
D3D_COMPARISON_FUNC_LESS
#define D3D_COMPARISON_FUNC_LESS
Definition: D3D11TypeDefinitions.h:78
D3D_COLOR_WRITE_ENABLE_GREEN
#define D3D_COLOR_WRITE_ENABLE_GREEN
Definition: D3D11TypeDefinitions.h:137
Diligent::PRIMITIVE_TOPOLOGY_18_CONTROL_POINT_PATCHLIST
@ PRIMITIVE_TOPOLOGY_18_CONTROL_POINT_PATCHLIST
Interpret the vertex data as a list of 18 control point patches. D3D counterpart: D3D_PRIMITIVE_TOPO...
Definition: GraphicsTypes.h:1084
Diligent::BlendFactorToD3DBlend
D3D_BLEND BlendFactorToD3DBlend(BLEND_FACTOR bf)
Definition: D3DTypeConversionImpl.hpp:212
Diligent::BLEND_FACTOR_DEST_ALPHA
@ BLEND_FACTOR_DEST_ALPHA
The blend factor is alpha (A) data from a render target. Direct3D counterpart: D3D11_BLEND_DEST_ALPH...
Definition: BlendState.h:81
D3D_TEXTURE_ADDRESS_MIRROR_ONCE
#define D3D_TEXTURE_ADDRESS_MIRROR_ONCE
Definition: D3D11TypeDefinitions.h:150
D3D_FILTER_COMPARISON_MIN_POINT_MAG_LINEAR_MIP_POINT
#define D3D_FILTER_COMPARISON_MIN_POINT_MAG_LINEAR_MIP_POINT
Definition: D3D11TypeDefinitions.h:46
D3D_FILTER_COMPARISON_MIN_LINEAR_MAG_POINT_MIP_LINEAR
#define D3D_FILTER_COMPARISON_MIN_LINEAR_MAG_POINT_MIP_LINEAR
Definition: D3D11TypeDefinitions.h:49
D3D_FILTER_MIN_MAG_POINT_MIP_LINEAR
#define D3D_FILTER_MIN_MAG_POINT_MIP_LINEAR
Definition: D3D11TypeDefinitions.h:35
D3D_FILL_MODE_SOLID
#define D3D_FILL_MODE_SOLID
Definition: D3D11TypeDefinitions.h:107
Diligent::BLEND_FACTOR_INV_SRC_ALPHA
@ BLEND_FACTOR_INV_SRC_ALPHA
The blend factor is 1-A, where A is alpha data from a pixel shader. Direct3D counterpart: D3D11_BLEN...
Definition: BlendState.h:77
Diligent::DepthStencilStateDesc::DepthWriteEnable
Bool DepthWriteEnable
Enable or disable writes to a depth buffer. Default value: True.
Definition: DepthStencilState.h:165
Diligent::BLEND_FACTOR_BLEND_FACTOR
@ BLEND_FACTOR_BLEND_FACTOR
The blend factor is the constant blend factor set with IDeviceContext::SetBlendFactors()....
Definition: BlendState.h:102
Diligent::PRIMITIVE_TOPOLOGY_17_CONTROL_POINT_PATCHLIST
@ PRIMITIVE_TOPOLOGY_17_CONTROL_POINT_PATCHLIST
Interpret the vertex data as a list of 17 control point patches. D3D counterpart: D3D_PRIMITIVE_TOPO...
Definition: GraphicsTypes.h:1080
D3D_BLEND_INV_SRC1_COLOR
#define D3D_BLEND_INV_SRC1_COLOR
Definition: D3D11TypeDefinitions.h:124
Diligent::PRIMITIVE_TOPOLOGY_20_CONTROL_POINT_PATCHLIST
@ PRIMITIVE_TOPOLOGY_20_CONTROL_POINT_PATCHLIST
Interpret the vertex data as a list of 20 control point patches. D3D counterpart: D3D_PRIMITIVE_TOPO...
Definition: GraphicsTypes.h:1092
Diligent::CULL_MODE_NONE
@ CULL_MODE_NONE
Draw all triangles. Direct3D counterpart: D3D11_CULL_NONE/D3D12_CULL_MODE_NONE. OpenGL counterpart:...
Definition: RasterizerState.h:76
D3D_COMPARISON_FUNC_LESS_EQUAL
#define D3D_COMPARISON_FUNC_LESS_EQUAL
Definition: D3D11TypeDefinitions.h:80
Diligent::FILTER_TYPE_ANISOTROPIC
@ FILTER_TYPE_ANISOTROPIC
Anisotropic filtering.
Definition: GraphicsTypes.h:869
D3D_FILTER_MIN_MAG_MIP_POINT
#define D3D_FILTER_MIN_MAG_MIP_POINT
Definition: D3D11TypeDefinitions.h:34
Diligent::TexAddressModeToD3DAddressMode
D3D_TEXTURE_ADDRESS_MODE TexAddressModeToD3DAddressMode(TEXTURE_ADDRESS_MODE Mode)
Definition: D3DTypeConversionImpl.hpp:63
Diligent::PRIMITIVE_TOPOLOGY_26_CONTROL_POINT_PATCHLIST
@ PRIMITIVE_TOPOLOGY_26_CONTROL_POINT_PATCHLIST
Interpret the vertex data as a list of 26 control point patches. D3D counterpart: D3D_PRIMITIVE_TOPO...
Definition: GraphicsTypes.h:1116
D3D_FILTER_MAXIMUM_MIN_MAG_MIP_POINT
#define D3D_FILTER_MAXIMUM_MIN_MAG_MIP_POINT
Definition: D3D11TypeDefinitions.h:65
Diligent::PRIMITIVE_TOPOLOGY_12_CONTROL_POINT_PATCHLIST
@ PRIMITIVE_TOPOLOGY_12_CONTROL_POINT_PATCHLIST
Interpret the vertex data as a list of 12 control point patches. D3D counterpart: D3D_PRIMITIVE_TOPO...
Definition: GraphicsTypes.h:1060
Diligent::STENCIL_OP_INVERT
@ STENCIL_OP_INVERT
Bitwise invert the current stencil buffer value. Direct3D counterpart: D3D11_STENCIL_OP_INVERT/D3D12...
Definition: DepthStencilState.h:75
Diligent::PRIMITIVE_TOPOLOGY_1_CONTROL_POINT_PATCHLIST
@ PRIMITIVE_TOPOLOGY_1_CONTROL_POINT_PATCHLIST
Interpret the vertex data as a list of one control point patches. D3D counterpart: D3D_PRIMITIVE_TOP...
Definition: GraphicsTypes.h:1016
D3D_FILTER_COMPARISON_MIN_MAG_LINEAR_MIP_POINT
#define D3D_FILTER_COMPARISON_MIN_MAG_LINEAR_MIP_POINT
Definition: D3D11TypeDefinitions.h:50
Diligent::COMPARISON_FUNC_NOT_EQUAL
@ COMPARISON_FUNC_NOT_EQUAL
Comparison passes if the source data is not equal to the destination data. Direct3D counterpart: D3D...
Definition: GraphicsTypes.h:958
Diligent::RasterizerStateDesc::FillMode
FILL_MODE FillMode
Determines traingle fill mode, see Diligent::FILL_MODE for details. Default value: Diligent::FILL_MOD...
Definition: RasterizerState.h:100
Diligent::PRIMITIVE_TOPOLOGY_15_CONTROL_POINT_PATCHLIST
@ PRIMITIVE_TOPOLOGY_15_CONTROL_POINT_PATCHLIST
Interpret the vertex data as a list of 15 control point patches. D3D counterpart: D3D_PRIMITIVE_TOPO...
Definition: GraphicsTypes.h:1072
Diligent::FILTER_TYPE_MAXIMUM_POINT
@ FILTER_TYPE_MAXIMUM_POINT
Maximum-point filtering (DX12 only)
Definition: GraphicsTypes.h:876
Diligent::PRIMITIVE_TOPOLOGY_7_CONTROL_POINT_PATCHLIST
@ PRIMITIVE_TOPOLOGY_7_CONTROL_POINT_PATCHLIST
Interpret the vertex data as a list of seven control point patches. D3D counterpart: D3D_PRIMITIVE_T...
Definition: GraphicsTypes.h:1040
Diligent::FILTER_TYPE_MINIMUM_LINEAR
@ FILTER_TYPE_MINIMUM_LINEAR
Minimum-linear filtering (DX12 only)
Definition: GraphicsTypes.h:874
D3D_CULL_MODE_BACK
#define D3D_CULL_MODE_BACK
Definition: D3D11TypeDefinitions.h:103
D3D_BLEND_SRC1_ALPHA
#define D3D_BLEND_SRC1_ALPHA
Definition: D3D11TypeDefinitions.h:125
Diligent::STENCIL_OP
STENCIL_OP
Stencil operation.
Definition: DepthStencilState.h:48
D3D_BLEND_SRC_COLOR
#define D3D_BLEND_SRC_COLOR
Definition: D3D11TypeDefinitions.h:112
Diligent::PRIMITIVE_TOPOLOGY_28_CONTROL_POINT_PATCHLIST
@ PRIMITIVE_TOPOLOGY_28_CONTROL_POINT_PATCHLIST
Interpret the vertex data as a list of 28 control point patches. D3D counterpart: D3D_PRIMITIVE_TOPO...
Definition: GraphicsTypes.h:1124
D3D_FILTER_MINIMUM_ANISOTROPIC
#define D3D_FILTER_MINIMUM_ANISOTROPIC
Definition: D3D11TypeDefinitions.h:63
Diligent::BLEND_FACTOR_SRC1_ALPHA
@ BLEND_FACTOR_SRC1_ALPHA
The blend factor is the second alpha (A) data output from a pixel shader. Direct3D counterpart: D3D1...
Definition: BlendState.h:118
Diligent::BLEND_FACTOR_SRC1_COLOR
@ BLEND_FACTOR_SRC1_COLOR
The blend factor is the second RGB data output from a pixel shader. Direct3D counterpart: D3D11_BLEN...
Definition: BlendState.h:110
Diligent::BLEND_OPERATION_MAX
@ BLEND_OPERATION_MAX
Compute the maximum of source and destination color components. Direct3D counterpart: D3D11_BLEND_OP...
Definition: BlendState.h:161
D3D_FILTER_MINIMUM_MIN_LINEAR_MAG_MIP_POINT
#define D3D_FILTER_MINIMUM_MIN_LINEAR_MAG_MIP_POINT
Definition: D3D11TypeDefinitions.h:59
D3D_FILTER_MAXIMUM_MIN_MAG_POINT_MIP_LINEAR
#define D3D_FILTER_MAXIMUM_MIN_MAG_POINT_MIP_LINEAR
Definition: D3D11TypeDefinitions.h:66
D3D_BLEND_OP_MIN
#define D3D_BLEND_OP_MIN
Definition: D3D11TypeDefinitions.h:132
Diligent::TEXTURE_ADDRESS_UNKNOWN
@ TEXTURE_ADDRESS_UNKNOWN
Unknown mode.
Definition: GraphicsTypes.h:892
D3D_FILTER_MINIMUM_MIN_MAG_POINT_MIP_LINEAR
#define D3D_FILTER_MINIMUM_MIN_MAG_POINT_MIP_LINEAR
Definition: D3D11TypeDefinitions.h:56
Diligent::FILL_MODE_UNDEFINED
@ FILL_MODE_UNDEFINED
Undefined fill mode.
Definition: RasterizerState.h:49
Diligent::FILL_MODE_WIREFRAME
@ FILL_MODE_WIREFRAME
Rasterize triangles using wireframe fill. Direct3D counterpart: D3D11_FILL_WIREFRAME/D3D12_FILL_MOD...
Definition: RasterizerState.h:53
Diligent::DepthStencilStateDesc::FrontFace
StencilOpDesc FrontFace
Identify stencil operations for the front-facing triangles, see Diligent::StencilOpDesc.
Definition: DepthStencilState.h:184
Diligent::TypeToDXGI_Format
DXGI_FORMAT TypeToDXGI_Format(VALUE_TYPE ValType, Uint32 NumComponents, Bool bIsNormalized)
Definition: DXGITypeConversions.cpp:36
Diligent::BlendOperationToD3DBlendOp
D3D_BLEND_OP BlendOperationToD3DBlendOp(BLEND_OPERATION BlendOp)
Definition: D3DTypeConversionImpl.hpp:262
Diligent::BLEND_FACTOR_DEST_COLOR
@ BLEND_FACTOR_DEST_COLOR
The blend factor is RGB data from a render target. Direct3D counterpart: D3D11_BLEND_DEST_COLOR/D3D1...
Definition: BlendState.h:89
D3D_FILTER_MIN_POINT_MAG_LINEAR_MIP_POINT
#define D3D_FILTER_MIN_POINT_MAG_LINEAR_MIP_POINT
Definition: D3D11TypeDefinitions.h:36
Diligent::RasterizerStateDesc::CullMode
CULL_MODE CullMode
Determines traingle cull mode, see Diligent::CULL_MODE for details. Default value: Diligent::CULL_MOD...
Definition: RasterizerState.h:104
D3D_STENCIL_OP_KEEP
#define D3D_STENCIL_OP_KEEP
Definition: D3D11TypeDefinitions.h:87
Diligent::PRIMITIVE_TOPOLOGY_22_CONTROL_POINT_PATCHLIST
@ PRIMITIVE_TOPOLOGY_22_CONTROL_POINT_PATCHLIST
Interpret the vertex data as a list of 22 control point patches. D3D counterpart: D3D_PRIMITIVE_TOPO...
Definition: GraphicsTypes.h:1100
D3D_STENCIL_OP_INVERT
#define D3D_STENCIL_OP_INVERT
Definition: D3D11TypeDefinitions.h:92
Diligent::COLOR_MASK_GREEN
@ COLOR_MASK_GREEN
Allow data to be stored in the green component.
Definition: BlendState.h:181
Diligent::RasterizerStateDesc::DepthBias
Int32 DepthBias
Constant value added to the depth of a given pixel. Default value: 0.
Definition: RasterizerState.h:127
Diligent::COMPARISON_FUNC_EQUAL
@ COMPARISON_FUNC_EQUAL
Comparison passes if the source data is equal to the destination data. Direct3D counterpart: D3D11_C...
Definition: GraphicsTypes.h:946
D3D_BLEND_DEST_ALPHA
#define D3D_BLEND_DEST_ALPHA
Definition: D3D11TypeDefinitions.h:116
Diligent::PRIMITIVE_TOPOLOGY_6_CONTROL_POINT_PATCHLIST
@ PRIMITIVE_TOPOLOGY_6_CONTROL_POINT_PATCHLIST
Interpret the vertex data as a list of six control point patches. D3D counterpart: D3D_PRIMITIVE_TOP...
Definition: GraphicsTypes.h:1036
Diligent::ComparisonFuncToD3DComparisonFunc
D3D_COMPARISON_FUNC ComparisonFuncToD3DComparisonFunc(COMPARISON_FUNCTION Func)
Definition: D3DTypeConversionImpl.hpp:41
Diligent::FILTER_TYPE_LINEAR
@ FILTER_TYPE_LINEAR
Linear filtering.
Definition: GraphicsTypes.h:868
Diligent::FILTER_TYPE_COMPARISON_ANISOTROPIC
@ FILTER_TYPE_COMPARISON_ANISOTROPIC
Comparison-anisotropic filtering.
Definition: GraphicsTypes.h:872
D3D_BLEND_OP_MAX
#define D3D_BLEND_OP_MAX
Definition: D3D11TypeDefinitions.h:133
D3D_FILTER_MIN_MAG_LINEAR_MIP_POINT
#define D3D_FILTER_MIN_MAG_LINEAR_MIP_POINT
Definition: D3D11TypeDefinitions.h:40
VERIFY_EXPR
#define VERIFY_EXPR(...)
Definition: DebugUtilities.hpp:79
Diligent::BLEND_OPERATION
BLEND_OPERATION
Blending operation.
Definition: BlendState.h:138
Diligent::TEXTURE_ADDRESS_CLAMP
@ TEXTURE_ADDRESS_CLAMP
Texture coordinates outside the range [0.0, 1.0] are set to the texture color at 0....
Definition: GraphicsTypes.h:905
D3D_BLEND_INV_DEST_COLOR
#define D3D_BLEND_INV_DEST_COLOR
Definition: D3D11TypeDefinitions.h:119
Diligent::RasterizerStateDesc::FrontCounterClockwise
Bool FrontCounterClockwise
Determines if a triangle is front- or back-facing. If this parameter is True, a triangle will be cons...
Definition: RasterizerState.h:111
Diligent::StencilOpToD3DStencilOp
D3D_STENCIL_OP StencilOpToD3DStencilOp(STENCIL_OP StencilOp)
Definition: D3DTypeConversionImpl.hpp:328
VERIFY
#define VERIFY(...)
Definition: DebugUtilities.hpp:76
D3D_BLEND_OP_SUBTRACT
#define D3D_BLEND_OP_SUBTRACT
Definition: D3D11TypeDefinitions.h:130
Diligent::InputLayoutDesc::NumElements
Uint32 NumElements
Number of layout elements.
Definition: InputLayout.h:208
Diligent::PRIMITIVE_TOPOLOGY_2_CONTROL_POINT_PATCHLIST
@ PRIMITIVE_TOPOLOGY_2_CONTROL_POINT_PATCHLIST
Interpret the vertex data as a list of two control point patches. D3D counterpart: D3D_PRIMITIVE_TOP...
Definition: GraphicsTypes.h:1020
D3D_DEPTH_WRITE_MASK_ZERO
#define D3D_DEPTH_WRITE_MASK_ZERO
Definition: D3D11TypeDefinitions.h:98
D3D_COMPARISON_FUNC_NEVER
#define D3D_COMPARISON_FUNC_NEVER
Definition: D3D11TypeDefinitions.h:77
D3D_FILTER_MINIMUM_MIN_MAG_MIP_LINEAR
#define D3D_FILTER_MINIMUM_MIN_MAG_MIP_LINEAR
Definition: D3D11TypeDefinitions.h:62
Diligent::BLEND_FACTOR_INV_SRC_COLOR
@ BLEND_FACTOR_INV_SRC_COLOR
The blend factor is 1-RGB, where RGB is the data from a pixel shader. Direct3D counterpart: D3D11_BL...
Definition: BlendState.h:69
D3D_INPUT_CLASSIFICATION_PER_VERTEX_DATA
#define D3D_INPUT_CLASSIFICATION_PER_VERTEX_DATA
Definition: D3D11TypeDefinitions.h:142
D3D_FILTER_MAXIMUM_MIN_POINT_MAG_LINEAR_MIP_POINT
#define D3D_FILTER_MAXIMUM_MIN_POINT_MAG_LINEAR_MIP_POINT
Definition: D3D11TypeDefinitions.h:67
Diligent::PRIMITIVE_TOPOLOGY_19_CONTROL_POINT_PATCHLIST
@ PRIMITIVE_TOPOLOGY_19_CONTROL_POINT_PATCHLIST
Interpret the vertex data as a list of 19 control point patches. D3D counterpart: D3D_PRIMITIVE_TOPO...
Definition: GraphicsTypes.h:1088
D3D_BLEND_INV_SRC_COLOR
#define D3D_BLEND_INV_SRC_COLOR
Definition: D3D11TypeDefinitions.h:113
Diligent::StencilOpDesc::StencilPassOp
STENCIL_OP StencilPassOp
The stencil operation to perform when stencil testing and depth testing both pass....
Definition: DepthStencilState.h:110
Diligent::FILTER_TYPE_COMPARISON_POINT
@ FILTER_TYPE_COMPARISON_POINT
Comparison-point filtering.
Definition: GraphicsTypes.h:870
Diligent::InputLayoutDesc::LayoutElements
const LayoutElement * LayoutElements
Array of layout elements.
Definition: InputLayout.h:206
Diligent::PRIMITIVE_TOPOLOGY_11_CONTROL_POINT_PATCHLIST
@ PRIMITIVE_TOPOLOGY_11_CONTROL_POINT_PATCHLIST
Interpret the vertex data as a list of 11 control point patches. D3D counterpart: D3D_PRIMITIVE_TOPO...
Definition: GraphicsTypes.h:1056
D3D_BLEND_SRC_ALPHA_SAT
#define D3D_BLEND_SRC_ALPHA_SAT
Definition: D3D11TypeDefinitions.h:120
Diligent::PRIMITIVE_TOPOLOGY_8_CONTROL_POINT_PATCHLIST
@ PRIMITIVE_TOPOLOGY_8_CONTROL_POINT_PATCHLIST
Interpret the vertex data as a list of eight control point patches. D3D counterpart: D3D_PRIMITIVE_T...
Definition: GraphicsTypes.h:1044
Diligent::COMPARISON_FUNC_ALWAYS
@ COMPARISON_FUNC_ALWAYS
Comparison always passes. Direct3D counterpart: D3D11_COMPARISON_ALWAYS/D3D12_COMPARISON_FUNC_ALWAY...
Definition: GraphicsTypes.h:966
Diligent::STENCIL_OP_DECR_SAT
@ STENCIL_OP_DECR_SAT
Decrement the current stencil value, and clamp to 0. Direct3D counterpart: D3D11_STENCIL_OP_DECR_SAT...
Definition: DepthStencilState.h:71
Diligent::DepthStencilStateDesc::DepthEnable
Bool DepthEnable
Enable depth-stencil operations. When it is set to False, depth test always passes,...
Definition: DepthStencilState.h:162
Diligent::FILTER_TYPE_MAXIMUM_ANISOTROPIC
@ FILTER_TYPE_MAXIMUM_ANISOTROPIC
Maximum-anisotropic filtering (DX12 only)
Definition: GraphicsTypes.h:878
D3D_FILTER_ANISOTROPIC
#define D3D_FILTER_ANISOTROPIC
Definition: D3D11TypeDefinitions.h:42
Diligent::RasterizerStateDesc::DepthClipEnable
Bool DepthClipEnable
Enable clipping against near and far clip planes. Default value: True.
Definition: RasterizerState.h:115
Diligent::COLOR_MASK_ALPHA
@ COLOR_MASK_ALPHA
Allow data to be stored in the alpha component.
Definition: BlendState.h:187
D3D_FILTER_MIN_POINT_MAG_MIP_LINEAR
#define D3D_FILTER_MIN_POINT_MAG_MIP_LINEAR
Definition: D3D11TypeDefinitions.h:37
Diligent::PRIMITIVE_TOPOLOGY_4_CONTROL_POINT_PATCHLIST
@ PRIMITIVE_TOPOLOGY_4_CONTROL_POINT_PATCHLIST
Interpret the vertex data as a list of four control point patches. D3D counterpart: D3D_PRIMITIVE_TO...
Definition: GraphicsTypes.h:1028
Diligent::TEXTURE_ADDRESS_WRAP
@ TEXTURE_ADDRESS_WRAP
Tile the texture at every integer junction. Direct3D Counterpart: D3D11_TEXTURE_ADDRESS_WRAP/D3D12_...
Definition: GraphicsTypes.h:896
D3D_TEXTURE_ADDRESS_BORDER
#define D3D_TEXTURE_ADDRESS_BORDER
Definition: D3D11TypeDefinitions.h:149
Diligent::TEXTURE_ADDRESS_BORDER
@ TEXTURE_ADDRESS_BORDER
Texture coordinates outside the range [0.0, 1.0] are set to the border color specified in SamplerDesc...
Definition: GraphicsTypes.h:910
Diligent::COLOR_MASK_BLUE
@ COLOR_MASK_BLUE
Allow data to be stored in the blue component.
Definition: BlendState.h:184
Diligent::DepthStencilStateDesc
Depth stencil state description.
Definition: DepthStencilState.h:157
Diligent::BlendStateDesc
Blend state description.
Definition: BlendState.h:374
Diligent
The library uses Direct3D-style math:
Definition: AdvancedMath.hpp:37
Diligent::LayoutElements_To_D3D_INPUT_ELEMENT_DESCs
void LayoutElements_To_D3D_INPUT_ELEMENT_DESCs(const InputLayoutDesc &InputLayout, std::vector< D3D_INPUT_ELEMENT_DESC, STDAllocatorRawMem< D3D_INPUT_ELEMENT_DESC >> &D3DInputElements)
Definition: D3DTypeConversionImpl.hpp:390
D3D_COMPARISON_FUNC_ALWAYS
#define D3D_COMPARISON_FUNC_ALWAYS
Definition: D3D11TypeDefinitions.h:84
Diligent::FilterTypeToD3DFilter
D3D_FILTER FilterTypeToD3DFilter(FILTER_TYPE MinFilter, FILTER_TYPE MagFilter, FILTER_TYPE MipFilter)
Definition: D3DTypeConversionImpl.hpp:411
D3D_FILTER_MINIMUM_MIN_MAG_LINEAR_MIP_POINT
#define D3D_FILTER_MINIMUM_MIN_MAG_LINEAR_MIP_POINT
Definition: D3D11TypeDefinitions.h:61
Diligent::BlendStateDescToD3DBlendDesc
void BlendStateDescToD3DBlendDesc(const BlendStateDesc &BSDesc, D3D_BLEND_DESC &d3d12BlendDesc)
Definition: D3DTypeConversionImpl.hpp:295