Sleeping Wombat GUI  0.100
swGUI
BufferInitData.h
Go to the documentation of this file.
1 #pragma once
2 
5 
8 
9 #include <assert.h>
10 
13 {
14  const uint8* Data;
17  rttr::type DataType;
19 
21  : DataType( rttr::type::get_by_name( "" ) ) // Set invalid type.
22  {
24  NumElements = 1;
25  ElementSize = 0;
26  Data = nullptr;
27  }
28 };
29 
30 
33 {
35 };
36 
37 
38 
41 {
44 
46  {
48  }
49 
51 };
52 
55 {
58 
60  {
62  Use4BytesIndex = false;
63  }
64 
66 };
67 
68 
69 // ================================ //
70 //
72 {
73  BufferInfo info;
75  info.ElementSize = ElementSize;
76  info.NumElements = NumElements;
77  info.DataType = DataType;
79  info.Usage = Usage;
80  info.Use4BytesIndex = false;
81 
82  // Constant buffers must be 16 bytes aligned.
83  assert( ElementSize % 16 == 0 );
84 
85  return info;
86 }
87 
88 // ================================ //
89 //
91 {
92  BufferInfo info;
94  info.ElementSize = ElementSize;
95  info.NumElements = NumElements;
96  info.DataType = DataType;
97  info.Topology = Topology;
98  info.Usage = Usage;
99  info.Use4BytesIndex = false;
100  info.VertexLayout = VertexLayout;
101 
102  return info;
103 }
104 
105 // ================================ //
106 //
108 {
109  BufferInfo info;
111  info.ElementSize = ElementSize;
112  info.NumElements = NumElements;
113  info.DataType = DataType;
114  info.Topology = Topology;
115  info.Usage = Usage;
117 
118  return info;
119 }
Definition: ResourcePtr.h:116
BufferType BufferType
Vertex, index or constant buffer.
Definition: IBuffer.h:41
uint32 NumElements
Number of elements of type BufferDescriptor::DataType.
Definition: IBuffer.h:37
ResourcePtr< ShaderInputLayout > VertexLayout
[Optional] Layout of single vertex in buffer. You can add this layout to enable additional informatio...
Definition: BufferInitData.h:42
BufferInfo CreateBufferInfo() const
Definition: BufferInitData.h:90
bool Use4BytesIndex
Definition: IBuffer.h:57
Index buffer initialization data.
Definition: BufferInitData.h:54
Pozawala GPU na zapis i odczyt.
Descriptor of buffer.
Definition: IBuffer.h:35
IndexBufferInitData()
Definition: BufferInitData.h:59
ResourceUsage Usage
Definition: BufferInitData.h:18
uint32_t uint32
Definition: TypesDefinitions.h:31
uint32 ElementSize
Definition: BufferInitData.h:16
BufferInitData()
Definition: BufferInitData.h:20
rttr::type DataType
[Optional] Type of single element in buffer.
Definition: IBuffer.h:39
rttr::type DataType
[Optional] Type of single element in buffer.
Definition: BufferInitData.h:17
ResourceUsage
Specyfikuje typ dostępu do pamięci danego zasobu.
Definition: GraphicAPIConstants.h:72
Buffer initialization data.
Definition: BufferInitData.h:12
BufferInfo CreateBufferInfo() const
Definition: BufferInitData.h:107
uint8_t uint8
Definition: TypesDefinitions.h:27
uint32 NumElements
Definition: BufferInitData.h:15
BufferInfo CreateBufferInfo() const
Definition: BufferInitData.h:71
uint32 ElementSize
Size of single element in buffer.
Definition: IBuffer.h:38
const uint8 * Data
Pointer must be valid only in time of creation.
Definition: BufferInitData.h:14
ResourceUsage Usage
Usage of resource by graphic card.
Definition: IBuffer.h:40
VertexBufferInitData()
Definition: BufferInitData.h:45
Vertex buffer initialization data.
Definition: BufferInitData.h:40
ResourcePtr< ShaderInputLayout > VertexLayout
Definition: IBuffer.h:52
PrimitiveTopology Topology
[Optional] Topology of verticies.
Definition: BufferInitData.h:43
PrimitiveTopology Topology
[Optional] Topology of verticies.
Definition: BufferInitData.h:56
bool Use4BytesIndex
Index buffer consists of 4 bytes instead of 2 bytes indicies.
Definition: BufferInitData.h:57
PrimitiveTopology Topology
Definition: IBuffer.h:46
PrimitiveTopology
Topologia wierzchołków.
Definition: GraphicAPIConstants.h:84
Constant buffer initialization data.
Definition: BufferInitData.h:32