ctx - max sample usage
This commit is contained in:
@@ -87,5 +87,7 @@ namespace Oatmeal {
|
||||
void pickPhysicalDevice();
|
||||
bool isPhysicalDeviceSupported(vk::raii::PhysicalDevice device);
|
||||
uint32_t scorePhysicalDevice(vk::raii::PhysicalDevice device);
|
||||
vk::SampleCountFlagBits getMaxUsableSampleCount();
|
||||
void createLogicalDevice();
|
||||
};
|
||||
} // namespace Oatmeal
|
||||
|
||||
27
oatmeal/src/ctx_attachments.cpp
Normal file
27
oatmeal/src/ctx_attachments.cpp
Normal file
@@ -0,0 +1,27 @@
|
||||
#include "ctx.h"
|
||||
#include "vulkan/vulkan.hpp"
|
||||
|
||||
namespace Oatmeal {
|
||||
|
||||
vk::SampleCountFlagBits ctx::getMaxUsableSampleCount() {
|
||||
vk::PhysicalDeviceProperties physicalDeviceProperties = m_physicalDevice.getProperties();
|
||||
|
||||
vk::SampleCountFlags count = physicalDeviceProperties.limits.framebufferColorSampleCounts &
|
||||
physicalDeviceProperties.limits.framebufferDepthSampleCounts;
|
||||
|
||||
if (count & vk::SampleCountFlagBits::e16) {
|
||||
return vk::SampleCountFlagBits::e16;
|
||||
}
|
||||
if (count & vk::SampleCountFlagBits::e8) {
|
||||
return vk::SampleCountFlagBits::e8;
|
||||
}
|
||||
if (count & vk::SampleCountFlagBits::e4) {
|
||||
return vk::SampleCountFlagBits::e4;
|
||||
}
|
||||
if (count & vk::SampleCountFlagBits::e2) {
|
||||
return vk::SampleCountFlagBits::e2;
|
||||
}
|
||||
|
||||
return vk::SampleCountFlagBits::e1;
|
||||
}
|
||||
} // namespace Oatmeal
|
||||
Reference in New Issue
Block a user