diff options
author | tylermurphy534 <tylermurphy534@gmail.com> | 2022-09-25 23:08:03 -0400 |
---|---|---|
committer | tylermurphy534 <tylermurphy534@gmail.com> | 2022-09-25 23:08:03 -0400 |
commit | ee3a4d6073421fd9e17e832dc9d10e151e6029ea (patch) | |
tree | b0228ffe9af69f53e7cff238a1ead44244cf4dea /engine/xe_device.cpp | |
parent | 3D Chunks rendering (diff) | |
download | minecraftvulkan-ee3a4d6073421fd9e17e832dc9d10e151e6029ea.tar.gz minecraftvulkan-ee3a4d6073421fd9e17e832dc9d10e151e6029ea.tar.bz2 minecraftvulkan-ee3a4d6073421fd9e17e832dc9d10e151e6029ea.zip |
remove color vertex data, mipmapping
Diffstat (limited to 'engine/xe_device.cpp')
-rwxr-xr-x | engine/xe_device.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/engine/xe_device.cpp b/engine/xe_device.cpp index d6d0713..f602e18 100755 --- a/engine/xe_device.cpp +++ b/engine/xe_device.cpp @@ -121,6 +121,7 @@ void Device::pickPhysicalDevice() { for (const auto &device : devices) { if (isDeviceSuitable(device)) { physicalDevice = device; + msaaSamples = getMaxUsableSampleCount(); break; } } @@ -133,6 +134,21 @@ void Device::pickPhysicalDevice() { std::cout << "Physical device: " << properties.deviceName << std::endl; } +VkSampleCountFlagBits Device::getMaxUsableSampleCount() { + VkPhysicalDeviceProperties physicalDeviceProperties; + vkGetPhysicalDeviceProperties(physicalDevice, &physicalDeviceProperties); + + VkSampleCountFlags counts = physicalDeviceProperties.limits.framebufferColorSampleCounts & physicalDeviceProperties.limits.framebufferDepthSampleCounts; + if (counts & VK_SAMPLE_COUNT_64_BIT) { return VK_SAMPLE_COUNT_64_BIT; } + if (counts & VK_SAMPLE_COUNT_32_BIT) { return VK_SAMPLE_COUNT_32_BIT; } + if (counts & VK_SAMPLE_COUNT_16_BIT) { return VK_SAMPLE_COUNT_16_BIT; } + if (counts & VK_SAMPLE_COUNT_8_BIT) { return VK_SAMPLE_COUNT_8_BIT; } + if (counts & VK_SAMPLE_COUNT_4_BIT) { return VK_SAMPLE_COUNT_4_BIT; } + if (counts & VK_SAMPLE_COUNT_2_BIT) { return VK_SAMPLE_COUNT_2_BIT; } + + return VK_SAMPLE_COUNT_1_BIT; +} + void Device::createLogicalDevice() { QueueFamilyIndices indices = findQueueFamilies(physicalDevice); |