Diligent Engine  v.2.4.g
GraphicsAccessories.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 
33 #include "../../GraphicsEngine/interface/GraphicsTypes.h"
34 #include "../../GraphicsEngine/interface/Shader.h"
35 #include "../../GraphicsEngine/interface/Texture.h"
36 #include "../../GraphicsEngine/interface/Buffer.h"
37 #include "../../GraphicsEngine/interface/RenderDevice.h"
38 #include "../../../Platforms/Basic/interface/DebugUtilities.hpp"
39 #include "../../../Platforms/interface/PlatformMisc.hpp"
40 
41 namespace Diligent
42 {
43 
45 template <VALUE_TYPE ValType>
47 {};
48 
50 
54 template <> struct VALUE_TYPE2CType<VT_INT8>
55 {
56  typedef Int8 CType;
57 };
58 
60 
64 template <> struct VALUE_TYPE2CType<VT_INT16>
65 {
66  typedef Int16 CType;
67 };
68 
70 
74 template <> struct VALUE_TYPE2CType<VT_INT32>
75 {
76  typedef Int32 CType;
77 };
78 
80 
84 template <> struct VALUE_TYPE2CType<VT_UINT8>
85 {
86  typedef Uint8 CType;
87 };
88 
90 
94 template <> struct VALUE_TYPE2CType<VT_UINT16>
95 {
96  typedef Uint16 CType;
97 };
98 
100 
104 template <> struct VALUE_TYPE2CType<VT_UINT32>
105 {
106  typedef Uint32 CType;
107 };
108 
110 
116 template <> struct VALUE_TYPE2CType<VT_FLOAT16>
117 {
118  typedef Uint16 CType;
119 };
120 
122 
126 template <> struct VALUE_TYPE2CType<VT_FLOAT32>
127 {
128  typedef Float32 CType;
129 };
130 
131 
132 static const Uint32 ValueTypeToSizeMap[] =
133  // clang-format off
134 {
135  0,
136  sizeof(VALUE_TYPE2CType<VT_INT8> :: CType),
138  sizeof(VALUE_TYPE2CType<VT_INT32> :: CType),
140  sizeof(VALUE_TYPE2CType<VT_UINT16> :: CType),
142  sizeof(VALUE_TYPE2CType<VT_FLOAT16> :: CType),
144 };
145 // clang-format on
146 static_assert(VT_NUM_TYPES == VT_FLOAT32 + 1, "Not all value type sizes initialized.");
147 
150 {
151  VERIFY_EXPR(Val < _countof(ValueTypeToSizeMap));
152  return ValueTypeToSizeMap[Val];
153 }
154 
157 
159 
164 
166 
185 
187 
192 {
193  return GetDefaultTextureViewFormat(TexDesc.Format, ViewType, TexDesc.BindFlags);
194 }
195 
198 
202 
205 
209 
212 
216 
223 
227 
231 const Char* GetShaderVariableTypeLiteralName(SHADER_RESOURCE_VARIABLE_TYPE VarType, bool bGetFullName = false);
232 
236 
240 const Char* GetShaderResourceTypeLiteralName(SHADER_RESOURCE_TYPE ResourceType, bool bGetFullName = false);
241 
245 {
246  return GetTexViewTypeLiteralName(TexViewType);
247 }
248 
251 inline const Char* GetViewTypeLiteralName(BUFFER_VIEW_TYPE BuffViewType)
252 {
253  return GetBufferViewTypeLiteralName(BuffViewType);
254 }
255 
259 
263 const Char* GetFilterTypeLiteralName(FILTER_TYPE FilterType, bool bGetFullName);
264 
265 
269 
273 const Char* GetTextureAddressModeLiteralName(TEXTURE_ADDRESS_MODE AddressMode, bool bGetFullName);
274 
275 
279 
283 const Char* GetComparisonFunctionLiteralName(COMPARISON_FUNCTION ComparisonFunc, bool bGetFullName);
284 
285 
287 
290 const Char* GetStencilOpLiteralName(STENCIL_OP StencilOp);
291 
292 
294 
297 const Char* GetBlendFactorLiteralName(BLEND_FACTOR BlendFactor);
298 
299 
301 
305 
306 
308 
311 const Char* GetFillModeLiteralName(FILL_MODE FillMode);
312 
314 
317 const Char* GetCullModeLiteralName(CULL_MODE CullMode);
318 
320 const Char* GetMapTypeString(MAP_TYPE MapType);
321 
323 const Char* GetUsageString(USAGE Usage);
324 
327 
329 const Char* GetBindFlagString(Uint32 BindFlag);
330 
332 String GetBindFlagsString(Uint32 BindFlags, const char* Delimeter = "|");
333 
335 String GetCPUAccessFlagsString(Uint32 CpuAccessFlags);
336 
339 
342 
345 
348 
352 
354 template <typename TObjectDescType>
355 String GetObjectDescString(const TObjectDescType&)
356 {
357  return "";
358 }
359 
361 template <>
362 inline String GetObjectDescString(const TextureDesc& TexDesc)
363 {
364  String Str{"Tex desc: "};
365  Str += GetTextureDescString(TexDesc);
366  return Str;
367 }
368 
370 template <>
371 inline String GetObjectDescString(const BufferDesc& BuffDesc)
372 {
373  String Str{"Buff desc: "};
374  Str += GetBufferDescString(BuffDesc);
375  return Str;
376 }
377 
378 const char* GetQueryTypeString(QUERY_TYPE QueryType);
379 
380 const char* GetSurfaceTransformString(SURFACE_TRANSFORM SrfTransform);
381 
382 const char* GetPipelineTypeString(PIPELINE_TYPE PipelineType);
383 
384 const char* GetShaderCompilerTypeString(SHADER_COMPILER Compiler);
385 
386 String GetPipelineResourceFlagsString(PIPELINE_RESOURCE_FLAGS Flags, bool GetFullName = false, const char* DelimeterString = "|");
387 
389 
392 Uint32 ComputeMipLevelsCount(Uint32 Width, Uint32 Height, Uint32 Depth);
393 
394 inline bool IsComparisonFilter(FILTER_TYPE FilterType)
395 {
396  return FilterType == FILTER_TYPE_COMPARISON_POINT ||
397  FilterType == FILTER_TYPE_COMPARISON_LINEAR ||
399 }
400 
401 inline bool IsAnisotropicFilter(FILTER_TYPE FilterType)
402 {
403  return FilterType == FILTER_TYPE_ANISOTROPIC ||
404  FilterType == FILTER_TYPE_COMPARISON_ANISOTROPIC ||
405  FilterType == FILTER_TYPE_MINIMUM_ANISOTROPIC ||
406  FilterType == FILTER_TYPE_MAXIMUM_ANISOTROPIC;
407 }
408 
409 bool VerifyResourceStates(RESOURCE_STATE State, bool IsTexture);
410 
413 {
422 };
423 
425 
427 
428 
430 {
431  if (Type == SHADER_TYPE_UNKNOWN)
432  return -1;
433 
434  VERIFY(Type > SHADER_TYPE_UNKNOWN && Type <= SHADER_TYPE_LAST, "Value ", Uint32{Type}, " is not a valid SHADER_TYPE enum value");
435  VERIFY(((Uint32{Type} & (Uint32{Type} - 1)) == 0), "Only single shader stage should be provided");
436 
437  return PlatformMisc::GetLSB(Type);
438 }
439 
441 {
442  if (Stages == SHADER_TYPE_UNKNOWN)
443  return -1;
444 
445  VERIFY(Stages > SHADER_TYPE_UNKNOWN && Stages < SHADER_TYPE_LAST * 2, "Value ", Uint32{Stages}, " is not a valid SHADER_TYPE enum value");
446 
447  return PlatformMisc::GetLSB(Stages);
448 }
449 
451 {
452  if (Stages == SHADER_TYPE_UNKNOWN)
453  return -1;
454 
455  VERIFY(Stages > SHADER_TYPE_UNKNOWN && Stages < SHADER_TYPE_LAST * 2, "Value ", Uint32{Stages}, " is not a valid SHADER_TYPE enum value");
456 
457  const auto StageIndex = PlatformMisc::GetLSB(Stages);
458  Stages &= ~static_cast<SHADER_TYPE>(1u << StageIndex);
459  return StageIndex;
460 }
461 
462 
463 static_assert(SHADER_TYPE_LAST == 0x2000, "Please add the new shader type index below");
464 
465 static constexpr Int32 VSInd = 0;
466 static constexpr Int32 PSInd = 1;
467 static constexpr Int32 GSInd = 2;
468 static constexpr Int32 HSInd = 3;
469 static constexpr Int32 DSInd = 4;
470 static constexpr Int32 CSInd = 5;
471 static constexpr Int32 ASInd = 6;
472 static constexpr Int32 MSInd = 7;
473 static constexpr Int32 RGSInd = 8;
474 static constexpr Int32 RMSInd = 9;
475 static constexpr Int32 RCHSInd = 10;
476 static constexpr Int32 RAHSInd = 11;
477 static constexpr Int32 RISInd = 12;
478 static constexpr Int32 RCSInd = 13;
479 
480 static constexpr Int32 LastShaderInd = RCSInd;
481 
482 // clang-format off
483 static_assert(SHADER_TYPE_VERTEX == (1 << VSInd), "VSInd is not consistent with SHADER_TYPE_VERTEX");
484 static_assert(SHADER_TYPE_PIXEL == (1 << PSInd), "PSInd is not consistent with SHADER_TYPE_PIXEL");
485 static_assert(SHADER_TYPE_GEOMETRY == (1 << GSInd), "GSInd is not consistent with SHADER_TYPE_GEOMETRY");
486 static_assert(SHADER_TYPE_HULL == (1 << HSInd), "HSInd is not consistent with SHADER_TYPE_HULL");
487 static_assert(SHADER_TYPE_DOMAIN == (1 << DSInd), "DSInd is not consistent with SHADER_TYPE_DOMAIN");
488 static_assert(SHADER_TYPE_COMPUTE == (1 << CSInd), "CSInd is not consistent with SHADER_TYPE_COMPUTE");
489 static_assert(SHADER_TYPE_AMPLIFICATION == (1 << ASInd), "ASInd is not consistent with SHADER_TYPE_AMPLIFICATION");
490 static_assert(SHADER_TYPE_MESH == (1 << MSInd), "MSInd is not consistent with SHADER_TYPE_MESH");
491 static_assert(SHADER_TYPE_RAY_GEN == (1 << RGSInd), "RGSInd is not consistent with SHADER_TYPE_RAY_GEN");
492 static_assert(SHADER_TYPE_RAY_MISS == (1 << RMSInd), "RMSInd is not consistent with SHADER_TYPE_RAY_MISS");
493 static_assert(SHADER_TYPE_RAY_CLOSEST_HIT == (1 << RCHSInd), "RCHSInd is not consistent with SHADER_TYPE_RAY_CLOSEST_HIT");
494 static_assert(SHADER_TYPE_RAY_ANY_HIT == (1 << RAHSInd), "RAHSInd is not consistent with SHADER_TYPE_RAY_ANY_HIT");
495 static_assert(SHADER_TYPE_RAY_INTERSECTION == (1 << RISInd), "RISInd is not consistent with SHADER_TYPE_RAY_INTERSECTION");
496 static_assert(SHADER_TYPE_CALLABLE == (1 << RCSInd), "RCSInd is not consistent with SHADER_TYPE_CALLABLE");
497 
498 static_assert(SHADER_TYPE_LAST == (1 << LastShaderInd), "LastShaderInd is not consistent with SHADER_TYPE_LAST");
499 // clang-format on
500 
502 {
503  VERIFY(Index >= 0 && Index <= LastShaderInd, "Shader type index is out of range");
504  return static_cast<SHADER_TYPE>(1 << Index);
505 }
506 
507 
512 
551  Uint32 ArraySlice,
552  Uint32 MipLevel,
553  Uint32 Alignment,
554  Uint32 LocationX,
555  Uint32 LocationY,
556  Uint32 LocationZ);
557 
563  Uint32 ArraySlice,
564  Uint32 MipLevel,
565  Uint32 Alignment)
566 {
567  return GetStagingTextureLocationOffset(TexDesc, ArraySlice, MipLevel, Alignment, 0, 0, 0);
568 }
569 
570 
573 {
577 
581 
584 
588 
591 
594 
597 };
599  Uint32 MipLevel,
600  const Box& Region,
601  Uint32 RowStrideAlignment);
602 
603 
605 
613 void CopyTextureSubresource(const TextureSubResData& SrcSubres,
614  Uint32 NumRows,
615  Uint32 NumDepthSlices,
616  Uint32 RowSize,
617  void* pDstData,
618  Uint32 DstRowStride,
619  Uint32 DstDepthStride);
620 
621 
622 inline String GetShaderResourcePrintName(const char* Name, Uint32 ArraySize, Uint32 ArrayIndex)
623 {
624  VERIFY(ArrayIndex < ArraySize, "Array index is out of range");
625  String PrintName = Name;
626  if (ArraySize > 1)
627  {
628  PrintName.push_back('[');
629  PrintName.append(std::to_string(ArrayIndex));
630  PrintName.push_back(']');
631  }
632  return PrintName;
633 }
634 
635 template <typename DescType>
636 String GetShaderResourcePrintName(const DescType& ResDesc, Uint32 ArrayIndex = 0)
637 {
638  return GetShaderResourcePrintName(ResDesc.Name, ResDesc.ArraySize, ArrayIndex);
639 }
640 
641 } // namespace Diligent
Diligent::GetSurfaceTransformString
const char * GetSurfaceTransformString(SURFACE_TRANSFORM SrfTransform)
Definition: GraphicsAccessories.cpp:1119
Diligent::GetCPUAccessFlagsString
String GetCPUAccessFlagsString(Uint32 CpuAccessFlags)
Returns the string containing the CPU access flags.
Definition: GraphicsAccessories.cpp:891
Diligent::SHADER_TYPE_AMPLIFICATION
@ SHADER_TYPE_AMPLIFICATION
Amplification (task) shader.
Definition: GraphicsTypes.h:74
Diligent::Int16
int16_t Int16
16-bit signed integer
Definition: BasicTypes.h:47
Diligent::ExtractFirstShaderStageIndex
Int32 ExtractFirstShaderStageIndex(SHADER_TYPE &Stages)
Definition: GraphicsAccessories.hpp:450
Diligent::SHADER_TYPE_RAY_GEN
@ SHADER_TYPE_RAY_GEN
Ray generation shader.
Definition: GraphicsTypes.h:76
Diligent::VT_UINT32
@ VT_UINT32
Unsigned 32-bit integer.
Definition: GraphicsTypes.h:57
Diligent::Char
char Char
Definition: BasicTypes.h:64
Diligent::VT_INT8
@ VT_INT8
Signed 8-bit integer.
Definition: GraphicsTypes.h:52
Diligent::TextureDesc
struct TextureDesc TextureDesc
Definition: Texture.h:162
Diligent::GetObjectDescString
String GetObjectDescString(const TObjectDescType &)
Helper template function that converts object description into a string.
Definition: GraphicsAccessories.hpp:355
Diligent::TextureDesc::Format
TEXTURE_FORMAT Format
Texture format, see Diligent::TEXTURE_FORMAT.
Definition: Texture.h:68
Diligent::GetShaderTypeFromIndex
SHADER_TYPE GetShaderTypeFromIndex(Int32 Index)
Definition: GraphicsAccessories.hpp:501
Diligent::SHADER_TYPE_DOMAIN
@ SHADER_TYPE_DOMAIN
Domain (tessellation evaluation) shader.
Definition: GraphicsTypes.h:72
Diligent::SHADER_TYPE_LAST
@ SHADER_TYPE_LAST
Definition: GraphicsTypes.h:82
Diligent::SHADER_TYPE
SHADER_TYPE
Describes the shader type.
Definition: GraphicsTypes.h:65
Diligent::USAGE
USAGE
Resource usage.
Definition: GraphicsTypes.h:143
Diligent::GetStencilOpLiteralName
const Char * GetStencilOpLiteralName(STENCIL_OP StencilOp)
Returns the literal name of a stencil operation.
Definition: GraphicsAccessories.cpp:641
Diligent::SHADER_RESOURCE_TYPE
SHADER_RESOURCE_TYPE
Describes shader resource type.
Definition: Shader.h:356
Diligent::TEXTURE_ADDRESS_MODE
TEXTURE_ADDRESS_MODE
Texture address mode.
Definition: GraphicsTypes.h:889
Diligent::MipLevelProperties::LogicalWidth
Uint32 LogicalWidth
Definition: GraphicsAccessories.hpp:414
Diligent::VALUE_TYPE2CType
Template structure to convert VALUE_TYPE enumeration into C-type.
Definition: GraphicsAccessories.hpp:46
Flags
Uint32 Flags
Definition: DXBCUtils.cpp:71
Diligent::GetTextureDescString
String GetTextureDescString(const TextureDesc &Desc)
Returns the string containing the texture description.
Definition: GraphicsAccessories.cpp:920
Diligent::MipLevelProperties::DepthSliceSize
Uint32 DepthSliceSize
Definition: GraphicsAccessories.hpp:420
Diligent::ComputeMipLevelsCount
Uint32 ComputeMipLevelsCount(Uint32 Width)
Definition: GraphicsAccessories.cpp:1252
Diligent::GetBufferFormatString
String GetBufferFormatString(const BufferFormat &Fmt)
Returns the string containing the buffer format description.
Definition: GraphicsAccessories.cpp:992
Diligent::GetComparisonFunctionLiteralName
const Char * GetComparisonFunctionLiteralName(COMPARISON_FUNCTION ComparisonFunc, bool bGetFullName)
Returns the literal name of a comparison function. For instance, for COMPARISON_FUNC_LESS,...
Definition: GraphicsAccessories.cpp:619
Diligent::CopyTextureSubresource
void CopyTextureSubresource(const TextureSubResData &SrcSubres, Uint32 NumRows, Uint32 NumDepthSlices, Uint32 RowSize, void *pDstData, Uint32 DstRowStride, Uint32 DstDepthStride)
Copies texture subresource data on the CPU.
Definition: GraphicsAccessories.cpp:1672
Diligent::PIPELINE_TYPE
PIPELINE_TYPE
Pipeline type.
Definition: PipelineState.h:295
Diligent::Float32
float Float32
32-bit float
Definition: BasicTypes.h:43
Diligent::FILTER_TYPE
FILTER_TYPE
Filter type.
Definition: GraphicsTypes.h:864
Diligent::BufferToTextureCopyInfo::RowCount
Uint32 RowCount
The number of rows in the region. For compressed formats, this is the number of compressed-block rows...
Definition: GraphicsAccessories.hpp:587
Diligent::VALUE_TYPE2CType< VT_UINT8 >::CType
Uint8 CType
Definition: GraphicsAccessories.hpp:86
Diligent::MipLevelProperties::StorageWidth
Uint32 StorageWidth
Definition: GraphicsAccessories.hpp:416
Diligent::GetQueryTypeString
const char * GetQueryTypeString(QUERY_TYPE QueryType)
Definition: GraphicsAccessories.cpp:1100
Diligent::GetViewTypeLiteralName
const Char * GetViewTypeLiteralName(TEXTURE_VIEW_TYPE TexViewType)
Overloaded function that returns the literal name of a texture view type. see GetTexViewTypeLiteralNa...
Definition: GraphicsAccessories.hpp:244
Diligent::FILL_MODE
FILL_MODE
Fill mode.
Definition: RasterizerState.h:46
Diligent::VALUE_TYPE2CType< VT_UINT32 >::CType
Uint32 CType
Definition: GraphicsAccessories.hpp:106
Diligent::VT_INT32
@ VT_INT32
Signed 32-bit integer.
Definition: GraphicsTypes.h:54
Diligent::BufferToTextureCopyInfo::Region
Box Region
Texture region.
Definition: GraphicsAccessories.hpp:596
Diligent::SHADER_TYPE_COMPUTE
@ SHADER_TYPE_COMPUTE
Compute shader.
Definition: GraphicsTypes.h:73
Diligent::VT_NUM_TYPES
@ VT_NUM_TYPES
Helper value storing total number of types in the enumeration.
Definition: GraphicsTypes.h:60
Diligent::VendorIdToAdapterVendor
ADAPTER_VENDOR VendorIdToAdapterVendor(Uint32 VendorId)
Definition: GraphicsAccessories.cpp:1371
Diligent::Box
Box.
Definition: GraphicsTypes.h:2407
Diligent::VALUE_TYPE2CType< VT_INT32 >::CType
Int32 CType
Definition: GraphicsAccessories.hpp:76
Diligent::TEXTURE_VIEW_TYPE
TEXTURE_VIEW_TYPE
Texture view type.
Definition: GraphicsTypes.h:274
Diligent::SHADER_TYPE_RAY_ANY_HIT
@ SHADER_TYPE_RAY_ANY_HIT
Ray any hit shader.
Definition: GraphicsTypes.h:79
Diligent::BufferToTextureCopyInfo::MemorySize
Uint32 MemorySize
Total memory size required to store the pixels in the region.
Definition: GraphicsAccessories.hpp:593
Diligent::GetTexViewTypeLiteralName
const Char * GetTexViewTypeLiteralName(TEXTURE_VIEW_TYPE ViewType)
Returns the literal name of a texture view type. For instance, for a shader resource view,...
Definition: GraphicsAccessories.cpp:408
Diligent::GetBlendOperationLiteralName
const Char * GetBlendOperationLiteralName(BLEND_OPERATION BlendOp)
Returns the literal name of a blend operation.
Definition: GraphicsAccessories.cpp:700
Diligent::GetDefaultTextureViewFormat
TEXTURE_FORMAT GetDefaultTextureViewFormat(TEXTURE_FORMAT TextureFormat, TEXTURE_VIEW_TYPE ViewType, Uint32 BindFlags)
Returns the default format for a specified texture view type.
Definition: GraphicsAccessories.cpp:244
Diligent::MipLevelProperties::MipSize
Uint32 MipSize
Definition: GraphicsAccessories.hpp:421
Diligent::FILTER_TYPE_MINIMUM_ANISOTROPIC
@ FILTER_TYPE_MINIMUM_ANISOTROPIC
Minimum-anisotropic filtering (DX12 only)
Definition: GraphicsTypes.h:875
Diligent::GetValueSize
Uint32 GetValueSize(VALUE_TYPE Val)
Returns the size of the specified value type.
Definition: GraphicsAccessories.hpp:149
Diligent::GetShaderResourcePrintName
String GetShaderResourcePrintName(const char *Name, Uint32 ArraySize, Uint32 ArrayIndex)
Definition: GraphicsAccessories.hpp:622
Diligent::GetStagingTextureLocationOffset
Uint32 GetStagingTextureLocationOffset(const TextureDesc &TexDesc, Uint32 ArraySlice, Uint32 MipLevel, Uint32 Alignment, Uint32 LocationX, Uint32 LocationY, Uint32 LocationZ)
Returns an offset from the beginning of the buffer backing a staging texture to the specified locatio...
Definition: GraphicsAccessories.cpp:1559
Diligent::SHADER_TYPE_RAY_CLOSEST_HIT
@ SHADER_TYPE_RAY_CLOSEST_HIT
Ray closest hit shader.
Definition: GraphicsTypes.h:78
Diligent::MipLevelProperties
Describes the mip level properties.
Definition: GraphicsAccessories.hpp:412
Diligent::BLEND_FACTOR
BLEND_FACTOR
Blend factors.
Definition: BlendState.h:50
Diligent::IsComparisonFilter
bool IsComparisonFilter(FILTER_TYPE FilterType)
Definition: GraphicsAccessories.hpp:394
Diligent::BufferToTextureCopyInfo::DepthStride
Uint32 DepthStride
Depth stride (RowStride * RowCount)
Definition: GraphicsAccessories.hpp:590
Diligent::Int32
int32_t Int32
32-bit signed integer
Definition: BasicTypes.h:46
Diligent::FILTER_TYPE_COMPARISON_LINEAR
@ FILTER_TYPE_COMPARISON_LINEAR
Comparison-linear filtering.
Definition: GraphicsTypes.h:871
Diligent::GetValueTypeString
const Char * GetValueTypeString(VALUE_TYPE Val)
Returns the string representing the specified value type.
Definition: GraphicsAccessories.cpp:38
Diligent::Int8
int8_t Int8
8-bit signed integer
Definition: BasicTypes.h:48
Diligent::SURFACE_TRANSFORM
SURFACE_TRANSFORM
The transform applied to the image content prior to presentation.
Definition: GraphicsTypes.h:1315
Diligent::TextureDesc
Texture description.
Definition: Texture.h:47
Diligent::GetResourceStateString
String GetResourceStateString(RESOURCE_STATE State)
Definition: GraphicsAccessories.cpp:1080
Diligent::ADAPTER_VENDOR
ADAPTER_VENDOR
Graphics adapter vendor.
Definition: GraphicsTypes.h:1754
Diligent::VT_FLOAT16
@ VT_FLOAT16
Half-precision 16-bit floating point.
Definition: GraphicsTypes.h:58
Diligent::GetBlendFactorLiteralName
const Char * GetBlendFactorLiteralName(BLEND_FACTOR BlendFactor)
Returns the literal name of a blend factor.
Definition: GraphicsAccessories.cpp:666
Diligent::VT_UINT16
@ VT_UINT16
Unsigned 16-bit integer.
Definition: GraphicsTypes.h:56
Diligent::SHADER_TYPE_PIXEL
@ SHADER_TYPE_PIXEL
Pixel (fragment) shader.
Definition: GraphicsTypes.h:69
Diligent::GetFilterTypeLiteralName
const Char * GetFilterTypeLiteralName(FILTER_TYPE FilterType, bool bGetFullName)
Returns the literal name of a filter type. For instance, for FILTER_TYPE_POINT, if bGetFullName == tr...
Definition: GraphicsAccessories.cpp:574
Diligent::CULL_MODE
CULL_MODE
Cull mode.
Definition: RasterizerState.h:69
Diligent::TextureFormatAttribs
struct TextureFormatAttribs TextureFormatAttribs
Definition: GraphicsTypes.h:2542
Diligent::GetResourceStateFlagString
const Char * GetResourceStateFlagString(RESOURCE_STATE State)
Returns the string containing the buffer mode description.
Definition: GraphicsAccessories.cpp:1045
Diligent::IsAnisotropicFilter
bool IsAnisotropicFilter(FILTER_TYPE FilterType)
Definition: GraphicsAccessories.hpp:401
Diligent::IsConsistentShaderType
bool IsConsistentShaderType(SHADER_TYPE ShaderType, PIPELINE_TYPE PipelineType)
Definition: GraphicsAccessories.cpp:1388
Diligent::GetMapTypeString
const Char * GetMapTypeString(MAP_TYPE MapType)
Returns the string containing the map type.
Definition: GraphicsAccessories.cpp:761
Diligent::VALUE_TYPE
VALUE_TYPE
Value type.
Definition: GraphicsTypes.h:49
Diligent::GetBufferDescString
String GetBufferDescString(const BufferDesc &Desc)
Returns the string containing the buffer description.
Definition: GraphicsAccessories.cpp:1003
Diligent::BufferDesc
struct BufferDesc BufferDesc
Definition: Buffer.h:152
Diligent::GetShaderTypePipelineIndex
Int32 GetShaderTypePipelineIndex(SHADER_TYPE ShaderType, PIPELINE_TYPE PipelineType)
Definition: GraphicsAccessories.cpp:1422
Diligent::GetUsageString
const Char * GetUsageString(USAGE Usage)
Returns the string containing the usage.
Definition: GraphicsAccessories.cpp:776
Diligent::SHADER_TYPE_RAY_MISS
@ SHADER_TYPE_RAY_MISS
Ray miss shader.
Definition: GraphicsTypes.h:77
Type
const D3D12_PIPELINE_STATE_SUBOBJECT_TYPE Type
Definition: PipelineStateD3D12Impl.cpp:69
Diligent::Uint32
uint32_t Uint32
32-bit unsigned integer
Definition: BasicTypes.h:51
Diligent::VALUE_TYPE2CType< VT_INT32 >
VALUE_TYPE2CType<> template specialization for 32-bit integer value type.
Definition: GraphicsAccessories.hpp:74
Diligent::SHADER_TYPE_HULL
@ SHADER_TYPE_HULL
Hull (tessellation control) shader.
Definition: GraphicsTypes.h:71
Diligent::MipLevelProperties::StorageHeight
Uint32 StorageHeight
Definition: GraphicsAccessories.hpp:417
Diligent::SHADER_TYPE_UNKNOWN
@ SHADER_TYPE_UNKNOWN
Unknown shader type.
Definition: GraphicsTypes.h:67
Diligent::COMPARISON_FUNCTION
COMPARISON_FUNCTION
Comparison function.
Definition: GraphicsTypes.h:931
Diligent::SHADER_TYPE_RAY_INTERSECTION
@ SHADER_TYPE_RAY_INTERSECTION
Ray intersection shader.
Definition: GraphicsTypes.h:80
Diligent::BufferToTextureCopyInfo
Information required to perform a copy operation between a buffer and a texture.
Definition: GraphicsAccessories.hpp:572
Diligent::VerifyResourceStates
bool VerifyResourceStates(RESOURCE_STATE State, bool IsTexture)
Definition: GraphicsAccessories.cpp:1274
Diligent::GetShaderCompilerTypeString
const char * GetShaderCompilerTypeString(SHADER_COMPILER Compiler)
Definition: GraphicsAccessories.cpp:1162
Diligent::SHADER_TYPE_GEOMETRY
@ SHADER_TYPE_GEOMETRY
Geometry shader.
Definition: GraphicsTypes.h:70
Diligent::MipLevelProperties::RowSize
Uint32 RowSize
Definition: GraphicsAccessories.hpp:419
Diligent::BufferToTextureCopyInfo::RowStride
Uint32 RowStride
Row stride, in bytes. The stride is computed by aligning the RowSize, and is thus always >= RowSize.
Definition: GraphicsAccessories.hpp:580
Diligent::BufferToTextureCopyInfo::RowSize
Uint32 RowSize
Texture region row size, in bytes. For compressed formats, this is the size of one row of compressed ...
Definition: GraphicsAccessories.hpp:576
Diligent::GetFirstShaderStageIndex
Int32 GetFirstShaderStageIndex(SHADER_TYPE Stages)
Definition: GraphicsAccessories.hpp:440
Diligent::SHADER_TYPE_CALLABLE
@ SHADER_TYPE_CALLABLE
Callable shader.
Definition: GraphicsTypes.h:81
Diligent::FILTER_TYPE_ANISOTROPIC
@ FILTER_TYPE_ANISOTROPIC
Anisotropic filtering.
Definition: GraphicsTypes.h:869
Diligent::VALUE_TYPE2CType< VT_INT8 >::CType
Int8 CType
Definition: GraphicsAccessories.hpp:56
Diligent::BUFFER_MODE
BUFFER_MODE
Describes the buffer access mode.
Definition: Buffer.h:48
Diligent::TEXTURE_FORMAT
TEXTURE_FORMAT
Texture formats.
Definition: GraphicsTypes.h:328
Diligent::GetShaderTypeIndex
Int32 GetShaderTypeIndex(SHADER_TYPE Type)
Definition: GraphicsAccessories.hpp:429
Diligent::GetShaderStagesString
String GetShaderStagesString(SHADER_TYPE ShaderStages)
Definition: GraphicsAccessories.cpp:507
Diligent::GetShaderTypeFromPipelineIndex
SHADER_TYPE GetShaderTypeFromPipelineIndex(Int32 Index, PIPELINE_TYPE PipelineType)
Definition: GraphicsAccessories.cpp:1466
Diligent::BufferDesc
Buffer description.
Definition: Buffer.h:74
Diligent::GetMipLevelProperties
MipLevelProperties GetMipLevelProperties(const TextureDesc &TexDesc, Uint32 MipLevel)
Definition: GraphicsAccessories.cpp:1339
Diligent::VALUE_TYPE2CType< VT_INT8 >
VALUE_TYPE2CType<> template specialization for 8-bit integer value type.
Definition: GraphicsAccessories.hpp:54
Diligent::TextureDesc::BindFlags
BIND_FLAGS BindFlags
Bind flags, see Diligent::BIND_FLAGS for details. The following bind flags are allowed: Diligent::BI...
Definition: Texture.h:86
Diligent::STENCIL_OP
STENCIL_OP
Stencil operation.
Definition: DepthStencilState.h:48
Diligent::SHADER_TYPE_VERTEX
@ SHADER_TYPE_VERTEX
Vertex shader.
Definition: GraphicsTypes.h:68
Diligent::VALUE_TYPE2CType< VT_FLOAT16 >
VALUE_TYPE2CType<> template specialization for half-precision 16-bit floating-point value type.
Definition: GraphicsAccessories.hpp:116
Diligent::PIPELINE_RESOURCE_FLAGS
PIPELINE_RESOURCE_FLAGS
Flags that define pipeline resource properties.
Definition: PipelineResourceSignature.h:79
Diligent::GetBufferViewTypeLiteralName
const Char * GetBufferViewTypeLiteralName(BUFFER_VIEW_TYPE ViewType)
Returns the literal name of a buffer view type. For instance, for an unordered access view,...
Definition: GraphicsAccessories.cpp:443
Diligent::SHADER_COMPILER
SHADER_COMPILER
Describes the shader compiler that will be used to compile the shader source code.
Definition: Shader.h:73
Diligent::GetFillModeLiteralName
const Char * GetFillModeLiteralName(FILL_MODE FillMode)
Returns the literal name of a fill mode.
Definition: GraphicsAccessories.cpp:722
Diligent::GetPipelineResourceFlagsString
String GetPipelineResourceFlagsString(PIPELINE_RESOURCE_FLAGS Flags, bool GetFullName=false, const char *DelimeterString="|")
Definition: GraphicsAccessories.cpp:1179
Diligent::Uint16
uint16_t Uint16
16-bit unsigned integer
Definition: BasicTypes.h:52
Diligent::PipelineTypeFromShaderStages
PIPELINE_TYPE PipelineTypeFromShaderStages(SHADER_TYPE ShaderStages)
Definition: GraphicsAccessories.cpp:1528
Diligent::GetShaderVariableTypeLiteralName
const Char * GetShaderVariableTypeLiteralName(SHADER_RESOURCE_VARIABLE_TYPE VarType, bool bGetFullName=false)
Returns the literal name of a shader variable type. For instance, for SHADER_RESOURCE_VARIABLE_TYPE_S...
Definition: GraphicsAccessories.cpp:524
Diligent::VALUE_TYPE2CType< VT_FLOAT32 >::CType
Float32 CType
Definition: GraphicsAccessories.hpp:128
Diligent::QUERY_TYPE
QUERY_TYPE
Query type.
Definition: GraphicsTypes.h:1446
Diligent::GetBindFlagString
const Char * GetBindFlagString(Uint32 BindFlag)
Returns the string containing single bind flag.
Definition: GraphicsAccessories.cpp:832
Diligent::Uint8
uint8_t Uint8
8-bit unsigned integer
Definition: BasicTypes.h:53
Diligent::String
std::basic_string< Char > String
String variable.
Definition: BasicTypes.h:66
Diligent::GetPipelineTypeString
const char * GetPipelineTypeString(PIPELINE_TYPE PipelineType)
Definition: GraphicsAccessories.cpp:1145
Diligent::FILTER_TYPE_COMPARISON_ANISOTROPIC
@ FILTER_TYPE_COMPARISON_ANISOTROPIC
Comparison-anisotropic filtering.
Definition: GraphicsTypes.h:872
Diligent::GetStagingTextureSubresourceOffset
Uint32 GetStagingTextureSubresourceOffset(const TextureDesc &TexDesc, Uint32 ArraySlice, Uint32 MipLevel, Uint32 Alignment)
Returns an offset from the beginning of the buffer backing a staging texture to the given subresource...
Definition: GraphicsAccessories.hpp:562
VERIFY_EXPR
#define VERIFY_EXPR(...)
Definition: DebugUtilities.hpp:79
Diligent::BLEND_OPERATION
BLEND_OPERATION
Blending operation.
Definition: BlendState.h:138
Diligent::BufferToTextureCopyInfo::RowStrideInTexels
Uint32 RowStrideInTexels
Row stride in texels.
Definition: GraphicsAccessories.hpp:583
Diligent::GetShaderTypeLiteralName
const Char * GetShaderTypeLiteralName(SHADER_TYPE ShaderType)
Returns the literal name of a shader type. For instance, for a pixel shader, "SHADER_TYPE_PIXEL" will...
Definition: GraphicsAccessories.cpp:476
Diligent::GetShaderResourceTypeLiteralName
const Char * GetShaderResourceTypeLiteralName(SHADER_RESOURCE_TYPE ResourceType, bool bGetFullName=false)
Returns the literal name of a shader resource type. For instance, for SHADER_RESOURCE_TYPE_CONSTANT_B...
Definition: GraphicsAccessories.cpp:552
VERIFY
#define VERIFY(...)
Definition: DebugUtilities.hpp:76
Diligent::VT_FLOAT32
@ VT_FLOAT32
Full-precision 32-bit floating point.
Definition: GraphicsTypes.h:59
Diligent::VALUE_TYPE2CType< VT_UINT16 >
VALUE_TYPE2CType<> template specialization for 16-bit unsigned-integer value type.
Definition: GraphicsAccessories.hpp:94
_countof
#define _countof(_Array)
Definition: AndroidPlatformDefinitions.h:38
Diligent::VALUE_TYPE2CType< VT_INT16 >::CType
Int16 CType
Definition: GraphicsAccessories.hpp:66
Diligent::VALUE_TYPE2CType< VT_UINT16 >::CType
Uint16 CType
Definition: GraphicsAccessories.hpp:96
Diligent::FILTER_TYPE_COMPARISON_POINT
@ FILTER_TYPE_COMPARISON_POINT
Comparison-point filtering.
Definition: GraphicsTypes.h:870
Diligent::GetBufferModeString
const Char * GetBufferModeString(BUFFER_MODE Mode)
Returns the string containing the buffer mode description.
Definition: GraphicsAccessories.cpp:966
Diligent::RESOURCE_STATE
RESOURCE_STATE
Resource usage state.
Definition: GraphicsTypes.h:2814
Diligent::RESOURCE_DIMENSION
RESOURCE_DIMENSION
Describes resource dimension.
Definition: GraphicsTypes.h:256
Diligent::GetTextureAddressModeLiteralName
const Char * GetTextureAddressModeLiteralName(TEXTURE_ADDRESS_MODE AddressMode, bool bGetFullName)
Returns the literal name of a texture address mode. For instance, for TEXTURE_ADDRESS_WRAP,...
Definition: GraphicsAccessories.cpp:600
Diligent::VT_INT16
@ VT_INT16
Signed 16-bit integer.
Definition: GraphicsTypes.h:53
Diligent::VALUE_TYPE2CType< VT_FLOAT16 >::CType
Uint16 CType
Definition: GraphicsAccessories.hpp:118
Diligent::GetBufferToTextureCopyInfo
BufferToTextureCopyInfo GetBufferToTextureCopyInfo(const TextureDesc &TexDesc, Uint32 MipLevel, const Box &Region, Uint32 RowStrideAlignment)
Definition: GraphicsAccessories.cpp:1626
Diligent::BUFFER_VIEW_TYPE
BUFFER_VIEW_TYPE
Buffer view type.
Definition: GraphicsTypes.h:303
Diligent::FILTER_TYPE_MAXIMUM_ANISOTROPIC
@ FILTER_TYPE_MAXIMUM_ANISOTROPIC
Maximum-anisotropic filtering (DX12 only)
Definition: GraphicsTypes.h:878
Diligent::MAP_TYPE
MAP_TYPE
Resource mapping type.
Definition: GraphicsTypes.h:206
ShaderType
Uint16 ShaderType
Definition: DXBCUtils.cpp:70
Diligent::GetTextureFormatAttribs
const TextureFormatAttribs & GetTextureFormatAttribs(TEXTURE_FORMAT Format)
Returns invariant texture format attributes, see TextureFormatAttribs for details.
Definition: GraphicsAccessories.cpp:250
Diligent::GetCullModeLiteralName
const Char * GetCullModeLiteralName(CULL_MODE CullMode)
Returns the literal name of a cull mode.
Definition: GraphicsAccessories.cpp:741
Diligent::SHADER_TYPE_MESH
@ SHADER_TYPE_MESH
Mesh shader.
Definition: GraphicsTypes.h:75
Diligent::MipLevelProperties::Depth
Uint32 Depth
Definition: GraphicsAccessories.hpp:418
Diligent::VT_UINT8
@ VT_UINT8
Unsigned 8-bit integer.
Definition: GraphicsTypes.h:55
Diligent::GetResourceDimString
const Char * GetResourceDimString(RESOURCE_DIMENSION TexType)
Returns the string containing the texture type.
Definition: GraphicsAccessories.cpp:804
Diligent::BufferFormat
struct BufferFormat BufferFormat
Definition: BufferView.h:85
Diligent::GetBindFlagsString
String GetBindFlagsString(Uint32 BindFlags, const char *Delimeter="|")
Returns the string containing the bind flags.
Definition: GraphicsAccessories.cpp:856
Diligent::MipLevelProperties::LogicalHeight
Uint32 LogicalHeight
Definition: GraphicsAccessories.hpp:415
Diligent
The library uses Direct3D-style math:
Definition: AdvancedMath.hpp:37
Diligent::SHADER_RESOURCE_VARIABLE_TYPE
SHADER_RESOURCE_VARIABLE_TYPE
Describes the type of the shader resource variable.
Definition: ShaderResourceVariable.h:48
Diligent::TextureSubResData
Describes data for one subresource.
Definition: Texture.h:165
Diligent::GetValidPipelineResourceFlags
PIPELINE_RESOURCE_FLAGS GetValidPipelineResourceFlags(SHADER_RESOURCE_TYPE ResourceType)
Definition: GraphicsAccessories.cpp:1217