Diligent Engine  v.2.4.g
D3DViewDescConversionImpl.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 
32 
34 
35 #include "DXGITypeConversions.hpp"
36 
37 namespace Diligent
38 {
39 
40 template <typename D3D_SHADER_RESOURCE_VIEW_DESC>
41 void TextureViewDesc_to_D3D_SRV_DESC(const TextureViewDesc& SRVDesc, D3D_SHADER_RESOURCE_VIEW_DESC& d3dSRVDesc, Uint32 SampleCount)
42 {
43  memset(&d3dSRVDesc, 0, sizeof(d3dSRVDesc));
44  d3dSRVDesc.Format = TexFormatToDXGI_Format(SRVDesc.Format, BIND_SHADER_RESOURCE);
45 
46  switch (SRVDesc.TextureDim)
47  {
49  d3dSRVDesc.ViewDimension = D3D_SRV_DIMENSION_TEXTURE1D;
50  d3dSRVDesc.Texture1D.MipLevels = SRVDesc.NumMipLevels;
51  d3dSRVDesc.Texture1D.MostDetailedMip = SRVDesc.MostDetailedMip;
52  break;
53 
55  d3dSRVDesc.ViewDimension = D3D_SRV_DIMENSION_TEXTURE1DARRAY;
56  d3dSRVDesc.Texture1DArray.ArraySize = SRVDesc.NumArraySlices;
57  d3dSRVDesc.Texture1DArray.FirstArraySlice = SRVDesc.FirstArraySlice;
58  d3dSRVDesc.Texture1DArray.MipLevels = SRVDesc.NumMipLevels;
59  d3dSRVDesc.Texture1DArray.MostDetailedMip = SRVDesc.MostDetailedMip;
60  break;
61 
63  if (SampleCount > 1)
64  {
65  d3dSRVDesc.ViewDimension = D3D_SRV_DIMENSION_TEXTURE2DMS;
66  d3dSRVDesc.Texture2DMS.UnusedField_NothingToDefine = 0;
67  }
68  else
69  {
70  d3dSRVDesc.ViewDimension = D3D_SRV_DIMENSION_TEXTURE2D;
71  d3dSRVDesc.Texture2D.MipLevels = SRVDesc.NumMipLevels;
72  d3dSRVDesc.Texture2D.MostDetailedMip = SRVDesc.MostDetailedMip;
73  }
74  break;
75 
77  if (SampleCount > 1)
78  {
79  d3dSRVDesc.ViewDimension = D3D_SRV_DIMENSION_TEXTURE2DMSARRAY;
80  d3dSRVDesc.Texture2DMSArray.ArraySize = SRVDesc.NumArraySlices;
81  d3dSRVDesc.Texture2DMSArray.FirstArraySlice = SRVDesc.FirstArraySlice;
82  }
83  else
84  {
85  d3dSRVDesc.ViewDimension = D3D_SRV_DIMENSION_TEXTURE2DARRAY;
86  d3dSRVDesc.Texture2DArray.ArraySize = SRVDesc.NumArraySlices;
87  d3dSRVDesc.Texture2DArray.FirstArraySlice = SRVDesc.FirstArraySlice;
88  d3dSRVDesc.Texture2DArray.MipLevels = SRVDesc.NumMipLevels;
89  d3dSRVDesc.Texture2DArray.MostDetailedMip = SRVDesc.MostDetailedMip;
90  }
91  break;
92 
94  d3dSRVDesc.ViewDimension = D3D_SRV_DIMENSION_TEXTURE3D;
95  d3dSRVDesc.Texture3D.MipLevels = SRVDesc.NumMipLevels;
96  d3dSRVDesc.Texture3D.MostDetailedMip = SRVDesc.MostDetailedMip;
97  break;
98 
100  d3dSRVDesc.ViewDimension = D3D_SRV_DIMENSION_TEXTURECUBE;
101  d3dSRVDesc.TextureCube.MipLevels = SRVDesc.NumMipLevels;
102  d3dSRVDesc.TextureCube.MostDetailedMip = SRVDesc.MostDetailedMip;
103  break;
104 
106  d3dSRVDesc.ViewDimension = D3D_SRV_DIMENSION_TEXTURECUBEARRAY;
107  d3dSRVDesc.TextureCubeArray.MipLevels = SRVDesc.NumMipLevels;
108  d3dSRVDesc.TextureCubeArray.MostDetailedMip = SRVDesc.MostDetailedMip;
109  d3dSRVDesc.TextureCubeArray.First2DArrayFace = SRVDesc.FirstArraySlice;
110  d3dSRVDesc.TextureCubeArray.NumCubes = SRVDesc.NumArraySlices / 6;
111  break;
112 
113  default:
114  UNEXPECTED("Unexpected view type");
115  }
116 }
117 
118 template <typename D3D_RENDER_TARGET_VIEW_DESC>
119 void TextureViewDesc_to_D3D_RTV_DESC(const TextureViewDesc& RTVDesc, D3D_RENDER_TARGET_VIEW_DESC& d3dRTVDesc, Uint32 SampleCount)
120 {
121  memset(&d3dRTVDesc, 0, sizeof(d3dRTVDesc));
122  d3dRTVDesc.Format = TexFormatToDXGI_Format(RTVDesc.Format, BIND_RENDER_TARGET);
123 
124  switch (RTVDesc.TextureDim)
125  {
126  case RESOURCE_DIM_TEX_1D:
127  d3dRTVDesc.ViewDimension = D3D_RTV_DIMENSION_TEXTURE1D;
128  d3dRTVDesc.Texture1D.MipSlice = RTVDesc.MostDetailedMip;
129  break;
130 
132  d3dRTVDesc.ViewDimension = D3D_RTV_DIMENSION_TEXTURE1DARRAY;
133  d3dRTVDesc.Texture1DArray.ArraySize = RTVDesc.NumArraySlices;
134  d3dRTVDesc.Texture1DArray.FirstArraySlice = RTVDesc.FirstArraySlice;
135  d3dRTVDesc.Texture1DArray.MipSlice = RTVDesc.MostDetailedMip;
136  break;
137 
138 
139  case RESOURCE_DIM_TEX_2D:
140  if (SampleCount > 1)
141  {
142  d3dRTVDesc.ViewDimension = D3D_RTV_DIMENSION_TEXTURE2DMS;
143  d3dRTVDesc.Texture2DMS.UnusedField_NothingToDefine = 0;
144  }
145  else
146  {
147  d3dRTVDesc.ViewDimension = D3D_RTV_DIMENSION_TEXTURE2D;
148  d3dRTVDesc.Texture2D.MipSlice = RTVDesc.MostDetailedMip;
149  }
150  break;
151 
153  if (SampleCount > 1)
154  {
155  d3dRTVDesc.ViewDimension = D3D_RTV_DIMENSION_TEXTURE2DMSARRAY;
156  d3dRTVDesc.Texture2DMSArray.ArraySize = RTVDesc.NumArraySlices;
157  d3dRTVDesc.Texture2DMSArray.FirstArraySlice = RTVDesc.FirstArraySlice;
158  }
159  else
160  {
161  d3dRTVDesc.ViewDimension = D3D_RTV_DIMENSION_TEXTURE2DARRAY;
162  d3dRTVDesc.Texture2DArray.ArraySize = RTVDesc.NumArraySlices;
163  d3dRTVDesc.Texture2DArray.FirstArraySlice = RTVDesc.FirstArraySlice;
164  d3dRTVDesc.Texture2DArray.MipSlice = RTVDesc.MostDetailedMip;
165  }
166  break;
167 
168  case RESOURCE_DIM_TEX_3D:
169  d3dRTVDesc.ViewDimension = D3D_RTV_DIMENSION_TEXTURE3D;
170  d3dRTVDesc.Texture3D.FirstWSlice = RTVDesc.FirstDepthSlice;
171  d3dRTVDesc.Texture3D.WSize = RTVDesc.NumDepthSlices;
172  d3dRTVDesc.Texture3D.MipSlice = RTVDesc.MostDetailedMip;
173  break;
174 
175  default:
176  UNEXPECTED("Unexpected view type");
177  }
178 }
179 
180 template <typename D3D_DEPTH_STENCIL_VIEW_DESC>
181 void TextureViewDesc_to_D3D_DSV_DESC(const TextureViewDesc& DSVDesc, D3D_DEPTH_STENCIL_VIEW_DESC& d3dDSVDesc, Uint32 SampleCount)
182 {
183  memset(&d3dDSVDesc, 0, sizeof(d3dDSVDesc));
184  d3dDSVDesc.Format = TexFormatToDXGI_Format(DSVDesc.Format, BIND_DEPTH_STENCIL);
185 
186  switch (DSVDesc.TextureDim)
187  {
188  case RESOURCE_DIM_TEX_1D:
189  d3dDSVDesc.ViewDimension = D3D_DSV_DIMENSION_TEXTURE1D;
190  d3dDSVDesc.Texture1D.MipSlice = DSVDesc.MostDetailedMip;
191  break;
192 
194  d3dDSVDesc.ViewDimension = D3D_DSV_DIMENSION_TEXTURE1DARRAY;
195  d3dDSVDesc.Texture1DArray.ArraySize = DSVDesc.NumArraySlices;
196  d3dDSVDesc.Texture1DArray.FirstArraySlice = DSVDesc.FirstArraySlice;
197  d3dDSVDesc.Texture1DArray.MipSlice = DSVDesc.MostDetailedMip;
198  break;
199 
200 
201  case RESOURCE_DIM_TEX_2D:
202  if (SampleCount > 1)
203  {
204  d3dDSVDesc.ViewDimension = D3D_DSV_DIMENSION_TEXTURE2DMS;
205  d3dDSVDesc.Texture2DMS.UnusedField_NothingToDefine = 0;
206  }
207  else
208  {
209  d3dDSVDesc.ViewDimension = D3D_DSV_DIMENSION_TEXTURE2D;
210  d3dDSVDesc.Texture2D.MipSlice = DSVDesc.MostDetailedMip;
211  }
212  break;
213 
215  if (SampleCount > 1)
216  {
217  d3dDSVDesc.ViewDimension = D3D_DSV_DIMENSION_TEXTURE2DMSARRAY;
218  d3dDSVDesc.Texture2DMSArray.ArraySize = DSVDesc.NumArraySlices;
219  d3dDSVDesc.Texture2DMSArray.FirstArraySlice = DSVDesc.FirstArraySlice;
220  }
221  else
222  {
223  d3dDSVDesc.ViewDimension = D3D_DSV_DIMENSION_TEXTURE2DARRAY;
224  d3dDSVDesc.Texture2DArray.ArraySize = DSVDesc.NumArraySlices;
225  d3dDSVDesc.Texture2DArray.FirstArraySlice = DSVDesc.FirstArraySlice;
226  d3dDSVDesc.Texture2DArray.MipSlice = DSVDesc.MostDetailedMip;
227  }
228  break;
229 
230  case RESOURCE_DIM_TEX_3D:
231  LOG_ERROR_AND_THROW("Depth stencil views are not supported for 3D textures");
232  break;
233 
234  default:
235  UNEXPECTED("Unexpected view type");
236  }
237 }
238 
239 template <typename D3D_UNORDERED_ACCESS_VIEW_DESC>
240 void TextureViewDesc_to_D3D_UAV_DESC(const TextureViewDesc& UAVDesc, D3D_UNORDERED_ACCESS_VIEW_DESC& d3dUAVDesc)
241 {
242  memset(&d3dUAVDesc, 0, sizeof(d3dUAVDesc));
243  d3dUAVDesc.Format = TexFormatToDXGI_Format(UAVDesc.Format, BIND_UNORDERED_ACCESS);
244 
245  switch (UAVDesc.TextureDim)
246  {
247  case RESOURCE_DIM_TEX_1D:
248  d3dUAVDesc.ViewDimension = D3D_UAV_DIMENSION_TEXTURE1D;
249  d3dUAVDesc.Texture1D.MipSlice = UAVDesc.MostDetailedMip;
250  break;
251 
253  d3dUAVDesc.ViewDimension = D3D_UAV_DIMENSION_TEXTURE1DARRAY;
254  d3dUAVDesc.Texture1DArray.ArraySize = UAVDesc.NumArraySlices;
255  d3dUAVDesc.Texture1DArray.FirstArraySlice = UAVDesc.FirstArraySlice;
256  d3dUAVDesc.Texture1DArray.MipSlice = UAVDesc.MostDetailedMip;
257  break;
258 
259  case RESOURCE_DIM_TEX_2D:
260  d3dUAVDesc.ViewDimension = D3D_UAV_DIMENSION_TEXTURE2D;
261  d3dUAVDesc.Texture2D.MipSlice = UAVDesc.MostDetailedMip;
262  break;
263 
265  d3dUAVDesc.ViewDimension = D3D_UAV_DIMENSION_TEXTURE2DARRAY;
266  d3dUAVDesc.Texture2DArray.ArraySize = UAVDesc.NumArraySlices;
267  d3dUAVDesc.Texture2DArray.FirstArraySlice = UAVDesc.FirstArraySlice;
268  d3dUAVDesc.Texture2DArray.MipSlice = UAVDesc.MostDetailedMip;
269  break;
270 
271  case RESOURCE_DIM_TEX_3D:
272  d3dUAVDesc.ViewDimension = D3D_UAV_DIMENSION_TEXTURE3D;
273  d3dUAVDesc.Texture3D.FirstWSlice = UAVDesc.FirstDepthSlice;
274  d3dUAVDesc.Texture3D.WSize = UAVDesc.NumDepthSlices;
275  d3dUAVDesc.Texture3D.MipSlice = UAVDesc.MostDetailedMip;
276  break;
277 
278  default:
279  UNEXPECTED("Unexpected view type");
280  }
281 }
282 
283 template <typename D3D_UNORDERED_ACCESS_VIEW_DESC>
284 void BufferViewDesc_to_D3D_SRV_DESC(const BufferDesc& BuffDesc, const BufferViewDesc& SRVDesc, D3D_UNORDERED_ACCESS_VIEW_DESC& d3dSRVDesc)
285 {
286  VERIFY(SRVDesc.ViewType == BUFFER_VIEW_SHADER_RESOURCE, "Incorrect view type: shader resource is expected");
287 
288  memset(&d3dSRVDesc, 0, sizeof(d3dSRVDesc));
289  const auto& BuffFmt = SRVDesc.Format;
290  if (BuffDesc.Mode == BUFFER_MODE_FORMATTED || BuffDesc.Mode == BUFFER_MODE_RAW && BuffFmt.ValueType != VT_UNDEFINED)
291  d3dSRVDesc.Format = TypeToDXGI_Format(BuffFmt.ValueType, BuffFmt.NumComponents, BuffFmt.IsNormalized);
292 
293  Uint32 ElementByteStride = 0;
294  if (BuffDesc.Mode == BUFFER_MODE_FORMATTED || BuffDesc.Mode == BUFFER_MODE_STRUCTURED || BuffDesc.Mode == BUFFER_MODE_RAW && BuffFmt.ValueType != VT_UNDEFINED)
295  ElementByteStride = BuffDesc.ElementByteStride;
296  else if (BuffDesc.Mode == BUFFER_MODE_RAW && BuffFmt.ValueType == VT_UNDEFINED)
297  ElementByteStride = 4;
298 
299  if (ElementByteStride != 0)
300  {
301  DEV_CHECK_ERR((SRVDesc.ByteOffset % ElementByteStride) == 0, "Byte offest (", SRVDesc.ByteOffset, ") is not multiple of element byte stride (", ElementByteStride, ")");
302  DEV_CHECK_ERR((SRVDesc.ByteWidth % ElementByteStride) == 0, "Byte width (", SRVDesc.ByteWidth, ")is not multiple of element byte stride (", ElementByteStride, ")");
303  d3dSRVDesc.Buffer.FirstElement = SRVDesc.ByteOffset / ElementByteStride;
304  d3dSRVDesc.Buffer.NumElements = SRVDesc.ByteWidth / ElementByteStride;
305  }
306  d3dSRVDesc.ViewDimension = D3D_SRV_DIMENSION_BUFFER;
307 }
308 
309 template <typename D3D_UNORDERED_ACCESS_VIEW_DESC>
310 void BufferViewDesc_to_D3D_UAV_DESC(const BufferDesc& BuffDesc, const BufferViewDesc& UAVDesc, D3D_UNORDERED_ACCESS_VIEW_DESC& d3dUAVDesc)
311 {
312  VERIFY(UAVDesc.ViewType == BUFFER_VIEW_UNORDERED_ACCESS, "Incorrect view type: unordered access is expected");
313 
314  memset(&d3dUAVDesc, 0, sizeof(d3dUAVDesc));
315  const auto& BuffFmt = UAVDesc.Format;
316  if (BuffDesc.Mode == BUFFER_MODE_FORMATTED || BuffDesc.Mode == BUFFER_MODE_RAW && BuffFmt.ValueType != VT_UNDEFINED)
317  d3dUAVDesc.Format = TypeToDXGI_Format(BuffFmt.ValueType, BuffFmt.NumComponents, BuffFmt.IsNormalized);
318 
319  Uint32 ElementByteStride = 0;
320  if (BuffDesc.Mode == BUFFER_MODE_FORMATTED || BuffDesc.Mode == BUFFER_MODE_STRUCTURED || BuffDesc.Mode == BUFFER_MODE_RAW && BuffFmt.ValueType != VT_UNDEFINED)
321  ElementByteStride = BuffDesc.ElementByteStride;
322  else if (BuffDesc.Mode == BUFFER_MODE_RAW && BuffFmt.ValueType == VT_UNDEFINED)
323  ElementByteStride = 4;
324 
325  if (ElementByteStride != 0)
326  {
327  DEV_CHECK_ERR((UAVDesc.ByteOffset % ElementByteStride) == 0, "Byte offest (", UAVDesc.ByteOffset, ") is not multiple of element byte stride (", ElementByteStride, ")");
328  DEV_CHECK_ERR((UAVDesc.ByteWidth % ElementByteStride) == 0, "Byte width (", UAVDesc.ByteWidth, ")is not multiple of element byte stride (", ElementByteStride, ")");
329  d3dUAVDesc.Buffer.FirstElement = UAVDesc.ByteOffset / ElementByteStride;
330  d3dUAVDesc.Buffer.NumElements = UAVDesc.ByteWidth / ElementByteStride;
331  }
332 
333  if (BuffDesc.Mode == BUFFER_MODE_RAW && UAVDesc.Format.ValueType == VT_UNDEFINED)
334  {
335  d3dUAVDesc.Format = DXGI_FORMAT_R32_TYPELESS;
336  d3dUAVDesc.Buffer.Flags = D3D_BUFFER_UAV_FLAG_RAW;
337  }
338  else
339  d3dUAVDesc.Buffer.Flags = D3D_BUFFER_UAV_FLAG_NONE;
340 
341  d3dUAVDesc.ViewDimension = D3D_UAV_DIMENSION_BUFFER;
342 }
343 
344 } // namespace Diligent
Diligent::BufferViewDesc
Buffer view description.
Definition: BufferView.h:88
Diligent::RESOURCE_DIM_TEX_3D
@ RESOURCE_DIM_TEX_3D
Three-dimensional texture.
Definition: GraphicsTypes.h:264
Diligent::RESOURCE_DIM_TEX_1D
@ RESOURCE_DIM_TEX_1D
One-dimensional texture.
Definition: GraphicsTypes.h:260
Diligent::RESOURCE_DIM_TEX_1D_ARRAY
@ RESOURCE_DIM_TEX_1D_ARRAY
One-dimensional texture array.
Definition: GraphicsTypes.h:261
Diligent::TextureViewDesc::Format
TEXTURE_FORMAT Format
View format. If default value Diligent::TEX_FORMAT_UNKNOWN is provided, the view format will match th...
Definition: TextureView.h:94
Diligent::RESOURCE_DIM_TEX_2D_ARRAY
@ RESOURCE_DIM_TEX_2D_ARRAY
Two-dimensional texture array.
Definition: GraphicsTypes.h:263
Diligent::BIND_UNORDERED_ACCESS
@ BIND_UNORDERED_ACCESS
A buffer or a texture can be bound as an unordered access view.
Definition: GraphicsTypes.h:127
LOG_ERROR_AND_THROW
#define LOG_ERROR_AND_THROW(...)
Definition: Errors.hpp:101
Diligent::TextureViewDesc::MostDetailedMip
Uint32 MostDetailedMip
Most detailed mip level to use.
Definition: TextureView.h:97
D3D_RTV_DIMENSION_TEXTURE2DMS
#define D3D_RTV_DIMENSION_TEXTURE2DMS
Definition: D3D11TypeDefinitions.h:164
D3D_SRV_DIMENSION_TEXTURE2D
#define D3D_SRV_DIMENSION_TEXTURE2D
Definition: D3D12TypeDefinitions.h:155
Diligent::BufferViewDesc::Format
struct BufferFormat Format
Format of the view. This member is only used for formatted and raw buffers. To create raw view of a r...
Definition: BufferView.h:96
D3D_UAV_DIMENSION_TEXTURE1DARRAY
#define D3D_UAV_DIMENSION_TEXTURE1DARRAY
Definition: D3D11TypeDefinitions.h:182
D3D_DSV_DIMENSION_TEXTURE2DMSARRAY
#define D3D_DSV_DIMENSION_TEXTURE2DMSARRAY
Definition: D3D11TypeDefinitions.h:176
Diligent::TextureViewDesc::NumMipLevels
Uint32 NumMipLevels
Total number of mip levels for the view of the texture. Render target and depth stencil views can add...
Definition: TextureView.h:104
D3D_RTV_DIMENSION_TEXTURE2D
#define D3D_RTV_DIMENSION_TEXTURE2D
Definition: D3D11TypeDefinitions.h:162
UNEXPECTED
#define UNEXPECTED(...)
Definition: DebugUtilities.hpp:77
Diligent::TextureViewDesc_to_D3D_RTV_DESC
void TextureViewDesc_to_D3D_RTV_DESC(const TextureViewDesc &RTVDesc, D3D_RENDER_TARGET_VIEW_DESC &d3dRTVDesc, Uint32 SampleCount)
Definition: D3DViewDescConversionImpl.hpp:119
Diligent::TextureViewDesc::NumArraySlices
Uint32 NumArraySlices
For a texture array, number of array slices to address in the view. Set to 0 to address all array sli...
Definition: TextureView.h:119
D3D_SRV_DIMENSION_TEXTURECUBEARRAY
#define D3D_SRV_DIMENSION_TEXTURECUBEARRAY
Definition: D3D12TypeDefinitions.h:161
D3D_DSV_DIMENSION_TEXTURE1D
#define D3D_DSV_DIMENSION_TEXTURE1D
Definition: D3D11TypeDefinitions.h:171
D3D_SRV_DIMENSION_TEXTURE2DMSARRAY
#define D3D_SRV_DIMENSION_TEXTURE2DMSARRAY
Definition: D3D12TypeDefinitions.h:158
Diligent::BufferDesc::Mode
BUFFER_MODE Mode
Buffer mode, see Diligent::BUFFER_MODE.
Definition: Buffer.h:95
D3D_BUFFER_UAV_FLAG_NONE
#define D3D_BUFFER_UAV_FLAG_NONE
Definition: D3D11TypeDefinitions.h:189
D3D_SRV_DIMENSION_TEXTURE2DMS
#define D3D_SRV_DIMENSION_TEXTURE2DMS
Definition: D3D12TypeDefinitions.h:157
Diligent::BufferFormat::ValueType
VALUE_TYPE ValueType
Type of components. For a formatted buffer views, this value cannot be VT_UNDEFINED.
Definition: BufferView.h:47
Diligent::VT_UNDEFINED
@ VT_UNDEFINED
Undefined type.
Definition: GraphicsTypes.h:51
DEV_CHECK_ERR
#define DEV_CHECK_ERR(...)
Definition: DebugUtilities.hpp:90
Diligent::RESOURCE_DIM_TEX_CUBE_ARRAY
@ RESOURCE_DIM_TEX_CUBE_ARRAY
Cube-map array texture.
Definition: GraphicsTypes.h:266
D3D_RTV_DIMENSION_TEXTURE2DMSARRAY
#define D3D_RTV_DIMENSION_TEXTURE2DMSARRAY
Definition: D3D11TypeDefinitions.h:165
D3D_RTV_DIMENSION_TEXTURE3D
#define D3D_RTV_DIMENSION_TEXTURE3D
Definition: D3D11TypeDefinitions.h:166
Diligent::BufferViewDesc_to_D3D_UAV_DESC
void BufferViewDesc_to_D3D_UAV_DESC(const BufferDesc &BuffDesc, const BufferViewDesc &UAVDesc, D3D_UNORDERED_ACCESS_VIEW_DESC &d3dUAVDesc)
Definition: D3DViewDescConversionImpl.hpp:310
D3D_UAV_DIMENSION_TEXTURE2DARRAY
#define D3D_UAV_DIMENSION_TEXTURE2DARRAY
Definition: D3D11TypeDefinitions.h:184
Diligent::BufferDesc::ElementByteStride
Uint32 ElementByteStride
Buffer element stride, in bytes.
Definition: Buffer.h:104
Diligent::TextureViewDesc::FirstArraySlice
Uint32 FirstArraySlice
For a texture array, first array slice to address in the view.
Definition: TextureView.h:109
D3D_SRV_DIMENSION_BUFFER
#define D3D_SRV_DIMENSION_BUFFER
Definition: D3D12TypeDefinitions.h:152
Diligent::RESOURCE_DIM_TEX_CUBE
@ RESOURCE_DIM_TEX_CUBE
Cube-map texture.
Definition: GraphicsTypes.h:265
D3D_BUFFER_UAV_FLAG_RAW
#define D3D_BUFFER_UAV_FLAG_RAW
Definition: D3D11TypeDefinitions.h:188
Diligent::BUFFER_MODE_FORMATTED
@ BUFFER_MODE_FORMATTED
Formated buffer. Access to the buffer will use format conversion operations. In this mode,...
Definition: Buffer.h:56
D3D_DSV_DIMENSION_TEXTURE1DARRAY
#define D3D_DSV_DIMENSION_TEXTURE1DARRAY
Definition: D3D11TypeDefinitions.h:172
Diligent::BufferViewDesc::ByteWidth
Uint32 ByteWidth
Size in bytes of the referenced buffer region.
Definition: BufferView.h:103
Diligent::BufferViewDesc::ByteOffset
Uint32 ByteOffset
Offset in bytes from the beginnig of the buffer to the start of the buffer region referenced by the v...
Definition: BufferView.h:100
Diligent::Uint32
uint32_t Uint32
32-bit unsigned integer
Definition: BasicTypes.h:51
Diligent::TextureViewDesc_to_D3D_SRV_DESC
void TextureViewDesc_to_D3D_SRV_DESC(const TextureViewDesc &SRVDesc, D3D_SHADER_RESOURCE_VIEW_DESC &d3dSRVDesc, Uint32 SampleCount)
Definition: D3DViewDescConversionImpl.hpp:41
D3D_SRV_DIMENSION_TEXTURECUBE
#define D3D_SRV_DIMENSION_TEXTURECUBE
Definition: D3D12TypeDefinitions.h:160
Diligent::BUFFER_VIEW_SHADER_RESOURCE
@ BUFFER_VIEW_SHADER_RESOURCE
A buffer view will define a shader resource view that will be used as the source for the shader read ...
Definition: GraphicsTypes.h:310
Diligent::TextureViewDesc::TextureDim
RESOURCE_DIMENSION TextureDim
View interpretation of the original texture. For instance, one slice of a 2D texture array can be vie...
Definition: TextureView.h:90
D3D_SRV_DIMENSION_TEXTURE3D
#define D3D_SRV_DIMENSION_TEXTURE3D
Definition: D3D12TypeDefinitions.h:159
Diligent::RESOURCE_DIM_TEX_2D
@ RESOURCE_DIM_TEX_2D
Two-dimensional texture.
Definition: GraphicsTypes.h:262
D3D_DSV_DIMENSION_TEXTURE2DMS
#define D3D_DSV_DIMENSION_TEXTURE2DMS
Definition: D3D11TypeDefinitions.h:175
D3D_SRV_DIMENSION_TEXTURE2DARRAY
#define D3D_SRV_DIMENSION_TEXTURE2DARRAY
Definition: D3D12TypeDefinitions.h:156
Diligent::BufferDesc
Buffer description.
Definition: Buffer.h:74
Diligent::BUFFER_VIEW_UNORDERED_ACCESS
@ BUFFER_VIEW_UNORDERED_ACCESS
A buffer view will define an unordered access view that will be used for unordered read/write operati...
Definition: GraphicsTypes.h:314
Diligent::BIND_DEPTH_STENCIL
@ BIND_DEPTH_STENCIL
A texture can be bound as a depth-stencil target.
Definition: GraphicsTypes.h:126
Diligent::TypeToDXGI_Format
DXGI_FORMAT TypeToDXGI_Format(VALUE_TYPE ValType, Uint32 NumComponents, Bool bIsNormalized)
Definition: DXGITypeConversions.cpp:36
D3D_SRV_DIMENSION_TEXTURE1DARRAY
#define D3D_SRV_DIMENSION_TEXTURE1DARRAY
Definition: D3D12TypeDefinitions.h:154
Diligent::TexFormatToDXGI_Format
DXGI_FORMAT TexFormatToDXGI_Format(TEXTURE_FORMAT TexFormat, Uint32 BindFlags=0)
Definition: DXGITypeConversions.cpp:276
Diligent::BufferViewDesc_to_D3D_SRV_DESC
void BufferViewDesc_to_D3D_SRV_DESC(const BufferDesc &BuffDesc, const BufferViewDesc &SRVDesc, D3D_UNORDERED_ACCESS_VIEW_DESC &d3dSRVDesc)
Definition: D3DViewDescConversionImpl.hpp:284
Diligent::BufferViewDesc::ViewType
BUFFER_VIEW_TYPE ViewType
View type. See Diligent::BUFFER_VIEW_TYPE for details.
Definition: BufferView.h:91
Diligent::BUFFER_MODE_STRUCTURED
@ BUFFER_MODE_STRUCTURED
Structured buffer. In this mode, ElementByteStride member of BufferDesc defines the structure stride.
Definition: Buffer.h:60
Diligent::TextureViewDesc::FirstDepthSlice
Uint32 FirstDepthSlice
For a 3D texture, first depth slice to address the view.
Definition: TextureView.h:112
VERIFY
#define VERIFY(...)
Definition: DebugUtilities.hpp:76
Diligent::BIND_RENDER_TARGET
@ BIND_RENDER_TARGET
A texture can be bound as a render target.
Definition: GraphicsTypes.h:125
D3D_DSV_DIMENSION_TEXTURE2DARRAY
#define D3D_DSV_DIMENSION_TEXTURE2DARRAY
Definition: D3D11TypeDefinitions.h:174
D3D_DSV_DIMENSION_TEXTURE2D
#define D3D_DSV_DIMENSION_TEXTURE2D
Definition: D3D11TypeDefinitions.h:173
Diligent::BUFFER_MODE_RAW
@ BUFFER_MODE_RAW
Raw buffer. In this mode, the buffer is accessed as raw bytes. Formatted views of a raw buffer can al...
Definition: Buffer.h:67
D3D_UAV_DIMENSION_BUFFER
#define D3D_UAV_DIMENSION_BUFFER
Definition: D3D11TypeDefinitions.h:180
D3D_RTV_DIMENSION_TEXTURE1DARRAY
#define D3D_RTV_DIMENSION_TEXTURE1DARRAY
Definition: D3D11TypeDefinitions.h:161
Diligent::TextureViewDesc
Texture view description.
Definition: TextureView.h:80
D3D_UAV_DIMENSION_TEXTURE3D
#define D3D_UAV_DIMENSION_TEXTURE3D
Definition: D3D11TypeDefinitions.h:185
Diligent::TextureViewDesc_to_D3D_UAV_DESC
void TextureViewDesc_to_D3D_UAV_DESC(const TextureViewDesc &UAVDesc, D3D_UNORDERED_ACCESS_VIEW_DESC &d3dUAVDesc)
Definition: D3DViewDescConversionImpl.hpp:240
D3D_SRV_DIMENSION_TEXTURE1D
#define D3D_SRV_DIMENSION_TEXTURE1D
Definition: D3D12TypeDefinitions.h:153
D3D_RTV_DIMENSION_TEXTURE2DARRAY
#define D3D_RTV_DIMENSION_TEXTURE2DARRAY
Definition: D3D11TypeDefinitions.h:163
D3D_UAV_DIMENSION_TEXTURE2D
#define D3D_UAV_DIMENSION_TEXTURE2D
Definition: D3D11TypeDefinitions.h:183
D3D_UAV_DIMENSION_TEXTURE1D
#define D3D_UAV_DIMENSION_TEXTURE1D
Definition: D3D11TypeDefinitions.h:181
Diligent::TextureViewDesc_to_D3D_DSV_DESC
void TextureViewDesc_to_D3D_DSV_DESC(const TextureViewDesc &DSVDesc, D3D_DEPTH_STENCIL_VIEW_DESC &d3dDSVDesc, Uint32 SampleCount)
Definition: D3DViewDescConversionImpl.hpp:181
Diligent
The library uses Direct3D-style math:
Definition: AdvancedMath.hpp:37
DXGITypeConversions.hpp
Diligent::BIND_SHADER_RESOURCE
@ BIND_SHADER_RESOURCE
A buffer or a texture can be bound as a shader resource.
Definition: GraphicsTypes.h:122
D3D_RTV_DIMENSION_TEXTURE1D
#define D3D_RTV_DIMENSION_TEXTURE1D
Definition: D3D11TypeDefinitions.h:160
Diligent::TextureViewDesc::NumDepthSlices
Uint32 NumDepthSlices
For a 3D texture, number of depth slices to address in the view Set to 0 to address all depth slices.
Definition: TextureView.h:123