17
17
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
18
18
// THE SOFTWARE.
19
19
20
- #include " dynamicbufferringvk .h"
20
+ #include " cmp_dynamicbufferringvk .h"
21
21
#include " misc.h"
22
22
23
23
// --------------------------------------------------------------------------------------
24
24
//
25
25
// OnCreate
26
26
//
27
27
// --------------------------------------------------------------------------------------
28
- void DynamicBufferRingVK::OnCreate (DeviceVK* pDevice, std::uint32_t numberOfBackBuffers, std::uint32_t memTotalSize) {
28
+ void CMP_DynamicBufferRingVK::OnCreate (CMP_DeviceVK* pDevice, std::uint32_t numberOfBackBuffers, std::uint32_t memTotalSize)
29
+ {
29
30
VkResult res;
30
31
m_pDevice = pDevice;
31
32
@@ -78,7 +79,8 @@ void DynamicBufferRingVK::OnCreate(DeviceVK* pDevice, std::uint32_t numberOfBack
78
79
// OnDestroy
79
80
//
80
81
// --------------------------------------------------------------------------------------
81
- void DynamicBufferRingVK::OnDestroy () {
82
+ void CMP_DynamicBufferRingVK::OnDestroy ()
83
+ {
82
84
vkUnmapMemory (m_pDevice->GetDevice (), m_deviceMemory);
83
85
vkFreeMemory (m_pDevice->GetDevice (), m_deviceMemory, NULL );
84
86
vkDestroyBuffer (m_pDevice->GetDevice (), m_buffer, NULL );
@@ -90,7 +92,8 @@ void DynamicBufferRingVK::OnDestroy() {
90
92
// AllocConstantBuffer
91
93
//
92
94
// --------------------------------------------------------------------------------------
93
- bool DynamicBufferRingVK::AllocConstantBuffer (std::uint32_t size, void **pData, VkDescriptorBufferInfo *pOut) {
95
+ bool CMP_DynamicBufferRingVK::AllocConstantBuffer (std::uint32_t size, void ** pData, VkDescriptorBufferInfo* pOut)
96
+ {
94
97
size = (std::uint32_t )Align (size, 256 );
95
98
96
99
std::uint32_t memOffset;
@@ -111,11 +114,13 @@ bool DynamicBufferRingVK::AllocConstantBuffer(std::uint32_t size, void **pData,
111
114
// AllocVertexBuffer
112
115
//
113
116
// --------------------------------------------------------------------------------------
114
- bool DynamicBufferRingVK::AllocVertexBuffer (std::uint32_t numbeOfVertices, UINT strideInBytes, void **pData, VkDescriptorBufferInfo *pOut) {
117
+ bool CMP_DynamicBufferRingVK::AllocVertexBuffer (std::uint32_t numbeOfVertices, UINT strideInBytes, void ** pData, VkDescriptorBufferInfo* pOut)
118
+ {
115
119
return AllocConstantBuffer (numbeOfVertices * strideInBytes, pData, pOut);
116
120
}
117
121
118
- bool DynamicBufferRingVK::AllocIndexBuffer (std::uint32_t numbeOfIndices, UINT strideInBytes, void **pData, VkDescriptorBufferInfo *pOut) {
122
+ bool CMP_DynamicBufferRingVK::AllocIndexBuffer (std::uint32_t numbeOfIndices, UINT strideInBytes, void ** pData, VkDescriptorBufferInfo* pOut)
123
+ {
119
124
return AllocConstantBuffer (numbeOfIndices * strideInBytes, pData, pOut);
120
125
}
121
126
@@ -124,11 +129,13 @@ bool DynamicBufferRingVK::AllocIndexBuffer(std::uint32_t numbeOfIndices, UINT st
124
129
// OnBeginFrame
125
130
//
126
131
// --------------------------------------------------------------------------------------
127
- void DynamicBufferRingVK::OnBeginFrame () {
132
+ void CMP_DynamicBufferRingVK::OnBeginFrame ()
133
+ {
128
134
m_mem.OnBeginFrame ();
129
135
}
130
136
131
- VkDescriptorBufferInfo DynamicBufferRingVK::GetMainBuffer (std::uint32_t size) {
137
+ VkDescriptorBufferInfo CMP_DynamicBufferRingVK::GetMainBuffer (std::uint32_t size)
138
+ {
132
139
VkDescriptorBufferInfo out;
133
140
134
141
out.buffer = m_buffer;
0 commit comments