Explorar el Código

Properly select index for allocating memory

undefined
Brian Ho hace 7 años
padre
commit
0e8ec58344
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. 2
    2
      triangle.cc

+ 2
- 2
triangle.cc Ver fichero

VkMemoryPropertyFlags memory_property_flags) { VkMemoryPropertyFlags memory_property_flags) {
for (uint32_t i = 0; i < device_memory_properties.memoryTypeCount; i++) { for (uint32_t i = 0; i < device_memory_properties.memoryTypeCount; i++) {
// We don't care about performance, so just choose the first mappable memory type. // We don't care about performance, so just choose the first mappable memory type.
if ((valid_image_memory_types % (1 << i)) &&
if ((valid_image_memory_types & (1 << i)) &&
((device_memory_properties.memoryTypes[i].propertyFlags & memory_property_flags) == ((device_memory_properties.memoryTypes[i].propertyFlags & memory_property_flags) ==
memory_property_flags)) { memory_property_flags)) {
return i; return i;


inline VkDeviceMemory AllocateAndBindRenderMemory(VkPhysicalDevice physical_device, inline VkDeviceMemory AllocateAndBindRenderMemory(VkPhysicalDevice physical_device,
VkDevice device, VkImage image) { VkDevice device, VkImage image) {
return AllocateAndBindMemory(physical_device, device, image, VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT);
return AllocateAndBindMemory(physical_device, device, image, VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT);
} }


inline VkDeviceMemory AllocateAndBindScanoutMemory(VkPhysicalDevice physical_device, inline VkDeviceMemory AllocateAndBindScanoutMemory(VkPhysicalDevice physical_device,

Cargando…
Cancelar
Guardar