Sleeping Wombat GUI  0.100
swGUI
DX11ConstantsMapper.h
Go to the documentation of this file.
1 #pragma once
2 
4 #include "DX11APIObjects.h"
5 
6 
7 extern D3D11_USAGE DX11ResourceUsage[ 4 ];
8 extern DXGI_FORMAT DX11ResourceFormat[ 133 ];
9 extern D3D_PRIMITIVE_TOPOLOGY DX11PrimitiveTopology[ 9 ];
10 extern D3D11_BIND_FLAG DX11ResourceBinding[ 10 ];
11 extern D3D11_RTV_DIMENSION DX11TextureType[ 9 ];
12 extern DXGI_FORMAT DX11DepthStencilFormat[ 4 ];
13 
14 
15 extern D3D11_DSV_DIMENSION DX11TextureTypeToDSV[ 9 ];
16 extern D3D11_SRV_DIMENSION DX11TextureTypeToSRV[ 9 ];
17 extern DXGI_FORMAT DX11DepthStencilTypeless[ 4 ];
18 extern DXGI_FORMAT DX11DepthOnly[ 4 ];
19 extern DXGI_FORMAT DX11StencilOnly[ 4 ];
20 extern D3D11_FILL_MODE DX11FillMode[ 2 ];
21 extern D3D11_CULL_MODE DX11CullMode[ 3 ];
22 
23 extern D3D11_BLEND DX11BlendFactor[ 12 ];
24 extern D3D11_BLEND_OP DX11BlendOperation[ 5 ];
25 
29 {
30 private:
31 public:
32  DX11ConstantsMapper() = default;
33  ~DX11ConstantsMapper() = default;
34 
35 
36  static inline D3D11_USAGE Get( ResourceUsage usage ) { return DX11ResourceUsage[ (int)usage ]; }
37  static inline DXGI_FORMAT Get( ResourceFormat format ) { return DX11ResourceFormat[ (int)format ]; }
38  static inline D3D_PRIMITIVE_TOPOLOGY Get( PrimitiveTopology topology ) { return DX11PrimitiveTopology[ (int)topology ]; }
39  static inline D3D11_BIND_FLAG Get( ResourceBinding binding ) { return DX11ResourceBinding[ (int)binding ]; }
40  static inline D3D11_RTV_DIMENSION Get( TextureType texType ) { return DX11TextureType[ (int)texType ]; }
41  static inline DXGI_FORMAT Get( DepthStencilFormat format ) { return DX11DepthStencilFormat[ (int)format ]; }
42  static inline D3D11_FILL_MODE Get( FillMode mode ) { return DX11FillMode[ (int)mode ]; }
43  static inline D3D11_CULL_MODE Get( CullMode mode ) { return DX11CullMode[ (int)mode ]; }
44  static inline D3D11_BLEND Get( BlendFactor factor ) { return DX11BlendFactor[ (int)factor ]; }
45  static inline D3D11_BLEND_OP Get( BlendOperation op ) { return DX11BlendOperation[ (int)op ]; }
46 
47  static ResourceFormat ConvertBack ( DXGI_FORMAT );
48 
49  static inline D3D11_SRV_DIMENSION ConvertSRV ( TextureType texType ) { return DX11TextureTypeToSRV[ (int)texType ]; }
50  static inline D3D11_DSV_DIMENSION ConvertDSV ( TextureType texType ) { return DX11TextureTypeToDSV[ (int)texType ]; }
51  static inline DXGI_FORMAT ConvertTypeless ( DepthStencilFormat format ) { return DX11DepthStencilTypeless[ (int)format ]; }
52  static inline DXGI_FORMAT ConvertDepthOnly ( DepthStencilFormat format ) { return DX11DepthOnly[ (int)format ]; }
53  static inline DXGI_FORMAT ConvertStencilOnly ( DepthStencilFormat format ) { return DX11StencilOnly[ (int)format ]; }
54 
55  static size_t BitsPerPixel ( DXGI_FORMAT fmt );
56  static inline size_t BytesPerPixel ( DXGI_FORMAT fmt ) { return BitsPerPixel( fmt ) / 8; }
57 };
58 
static DXGI_FORMAT ConvertTypeless(DepthStencilFormat format)
Definition: DX11ConstantsMapper.h:51
DepthStencilFormat
Typy dostępne dla bufora głębokości.
Definition: GraphicAPIConstants.h:141
DXGI_FORMAT DX11DepthStencilFormat[4]
Definition: DX11ConstantsMapper.cpp:112
static size_t BytesPerPixel(DXGI_FORMAT fmt)
Definition: DX11ConstantsMapper.h:56
ResourceFormat
Specyfikuje format tekstury bądź innego zasobu.
Definition: GraphicAPIConstants.h:153
static D3D_PRIMITIVE_TOPOLOGY Get(PrimitiveTopology topology)
Definition: DX11ConstantsMapper.h:38
static D3D11_BIND_FLAG Get(ResourceBinding binding)
Definition: DX11ConstantsMapper.h:39
TextureType
Definiuje typ tekstury.
Definition: GraphicAPIConstants.h:123
static D3D11_BLEND Get(BlendFactor factor)
Definition: DX11ConstantsMapper.h:44
D3D11_FILL_MODE DX11FillMode[2]
Definition: DX11ConstantsMapper.cpp:145
D3D11_USAGE DX11ResourceUsage[4]
Definition: DX11ConstantsMapper.cpp:27
static ResourceFormat ConvertBack(DXGI_FORMAT)
Przeprowadza odwrotną konwersję z natywnego formatu DirectXa do ResourceFormat.
Definition: DX11ConstantsMapper.cpp:328
static D3D11_CULL_MODE Get(CullMode mode)
Definition: DX11ConstantsMapper.h:43
static D3D11_BLEND_OP Get(BlendOperation op)
Definition: DX11ConstantsMapper.h:45
static DXGI_FORMAT ConvertDepthOnly(DepthStencilFormat format)
Definition: DX11ConstantsMapper.h:52
DXGI_FORMAT DX11StencilOnly[4]
Definition: DX11ConstantsMapper.cpp:136
D3D11_DSV_DIMENSION DX11TextureTypeToDSV[9]
Definition: DX11ConstantsMapper.cpp:64
D3D11_CULL_MODE DX11CullMode[3]
Definition: DX11ConstantsMapper.cpp:151
CullMode
Polygon culling mode.
Definition: GraphicAPIConstants.h:50
DX11ConstantsMapper()=default
ResourceUsage
Specyfikuje typ dostępu do pamięci danego zasobu.
Definition: GraphicAPIConstants.h:72
static D3D11_USAGE Get(ResourceUsage usage)
Definition: DX11ConstantsMapper.h:36
static size_t BitsPerPixel(DXGI_FORMAT fmt)
Zwraca liczbę bitów na pixel danego formatu.
Definition: DX11ConstantsMapper.cpp:355
static D3D11_DSV_DIMENSION ConvertDSV(TextureType texType)
Definition: DX11ConstantsMapper.h:50
BlendFactor
Blend factor for blending equation.
Definition: GraphicAPIConstants.h:28
DXGI_FORMAT DX11DepthStencilTypeless[4]
Definition: DX11ConstantsMapper.cpp:120
DXGI_FORMAT DX11ResourceFormat[133]
Definition: DX11ConstantsMapper.cpp:183
FillMode
Polygon fill mode.
Definition: GraphicAPIConstants.h:61
D3D11_RTV_DIMENSION DX11TextureType[9]
Definition: DX11ConstantsMapper.cpp:51
static D3D11_FILL_MODE Get(FillMode mode)
Definition: DX11ConstantsMapper.h:42
static DXGI_FORMAT Get(DepthStencilFormat format)
Definition: DX11ConstantsMapper.h:41
static D3D11_RTV_DIMENSION Get(TextureType texType)
Definition: DX11ConstantsMapper.h:40
static DXGI_FORMAT Get(ResourceFormat format)
Definition: DX11ConstantsMapper.h:37
DXGI_FORMAT DX11DepthOnly[4]
Definition: DX11ConstantsMapper.cpp:128
static DXGI_FORMAT ConvertStencilOnly(DepthStencilFormat format)
Definition: DX11ConstantsMapper.h:53
D3D11_BIND_FLAG DX11ResourceBinding[10]
Definition: DX11ConstantsMapper.cpp:94
D3D_PRIMITIVE_TOPOLOGY DX11PrimitiveTopology[9]
Definition: DX11ConstantsMapper.cpp:37
ResourceBinding
Określa jak będzie używany dany zasób w potoku karty graficznej.
Definition: GraphicAPIConstants.h:103
Zawiera deklarację klasy DX11APIObjects i DX11AuxiliaryObjects służących do inicjowania i przechowywa...
D3D11_BLEND DX11BlendFactor[12]
Definition: DX11ConstantsMapper.cpp:158
D3D11_SRV_DIMENSION DX11TextureTypeToSRV[9]
Definition: DX11ConstantsMapper.cpp:77
~DX11ConstantsMapper()=default
BlendOperation
Blending operation.
Definition: GraphicAPIConstants.h:14
D3D11_BLEND_OP DX11BlendOperation[5]
Definition: DX11ConstantsMapper.cpp:174
PrimitiveTopology
Topologia wierzchołków.
Definition: GraphicAPIConstants.h:84
Klasa służy do mapowania stałych z wartości silnikowych do DirectX 11.
Definition: DX11ConstantsMapper.h:28
static D3D11_SRV_DIMENSION ConvertSRV(TextureType texType)
Definition: DX11ConstantsMapper.h:49