4
4
#include " RenderTarget.h"
5
5
#include " Util.h"
6
6
7
+ #include < glm/mat4x4.hpp>
8
+
7
9
#include < array>
8
10
#include < sstream>
9
11
@@ -226,14 +228,14 @@ Headset::Headset(const Context* context) : context(context)
226
228
227
229
const VkMemoryPropertyFlags memoryProperties = VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT;
228
230
const VkMemoryPropertyFlags typeFilter = memoryRequirements.memoryTypeBits ;
229
- uint32_t memoryTypeIndex = 0u ;
231
+ uint32_t suitableMemoryTypeIndex = 0u ;
230
232
bool memoryTypeFound = false ;
231
- for (uint32_t i = 0u ; i < supportedMemoryProperties.memoryTypeCount ; ++i )
233
+ for (uint32_t memoryTypeIndex = 0u ; memoryTypeIndex < supportedMemoryProperties.memoryTypeCount ; ++memoryTypeIndex )
232
234
{
233
- const VkMemoryPropertyFlags propertyFlags = supportedMemoryProperties.memoryTypes [i ].propertyFlags ;
234
- if (typeFilter & (1 << i ) && (propertyFlags & memoryProperties) == memoryProperties)
235
+ const VkMemoryPropertyFlags propertyFlags = supportedMemoryProperties.memoryTypes [memoryTypeIndex ].propertyFlags ;
236
+ if (typeFilter & (1 << memoryTypeIndex ) && (propertyFlags & memoryProperties) == memoryProperties)
235
237
{
236
- memoryTypeIndex = i ;
238
+ suitableMemoryTypeIndex = memoryTypeIndex ;
237
239
memoryTypeFound = true ;
238
240
break ;
239
241
}
@@ -248,7 +250,7 @@ Headset::Headset(const Context* context) : context(context)
248
250
249
251
VkMemoryAllocateInfo memoryAllocateInfo{ VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO };
250
252
memoryAllocateInfo.allocationSize = memoryRequirements.size ;
251
- memoryAllocateInfo.memoryTypeIndex = memoryTypeIndex ;
253
+ memoryAllocateInfo.memoryTypeIndex = suitableMemoryTypeIndex ;
252
254
if (vkAllocateMemory (device, &memoryAllocateInfo, nullptr , &depthMemory) != VK_SUCCESS)
253
255
{
254
256
std::stringstream s;
0 commit comments