mirror of
https://gitea.windcorp.ru/Wind-Corporation/Progressia.git
synced 2025-10-14 21:13:10 +03:00
Fixed uniform buffer alignment
This commit is contained in:
@@ -29,20 +29,24 @@ bool checkDeviceExtensions(VkPhysicalDevice device,
|
||||
return toFind.empty();
|
||||
}
|
||||
|
||||
bool isDeviceSuitable(const PhysicalDeviceData &data, Vulkan &vulkan,
|
||||
bool isDeviceSuitable(const PhysicalDevice &data, Vulkan &vulkan,
|
||||
const std::vector<const char *> &deviceExtensions) {
|
||||
|
||||
if (!Queues(data.device, vulkan).isComplete()) {
|
||||
if (!data.isSuitable()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!checkDeviceExtensions(data.device, deviceExtensions)) {
|
||||
if (!Queues(data.getVk(), vulkan).isComplete()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!checkDeviceExtensions(data.getVk(), deviceExtensions)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check requires that the swap chain extension is present
|
||||
if (!SwapChain::isSwapChainSuitable(
|
||||
SwapChain::querySwapChainSupport(data.device, vulkan))) {
|
||||
SwapChain::querySwapChainSupport(data.getVk(), vulkan))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -51,8 +55,8 @@ bool isDeviceSuitable(const PhysicalDeviceData &data, Vulkan &vulkan,
|
||||
|
||||
} // namespace
|
||||
|
||||
const PhysicalDeviceData &
|
||||
pickPhysicalDevice(std::vector<PhysicalDeviceData> &choices, Vulkan &vulkan,
|
||||
const PhysicalDevice &
|
||||
pickPhysicalDevice(std::vector<PhysicalDevice> &choices, Vulkan &vulkan,
|
||||
const std::vector<const char *> &deviceExtensions) {
|
||||
|
||||
// Remove unsuitable devices
|
||||
@@ -82,18 +86,16 @@ pickPhysicalDevice(std::vector<PhysicalDeviceData> &choices, Vulkan &vulkan,
|
||||
{"Virtual GPU", +1},
|
||||
{"CPU", -1}};
|
||||
|
||||
auto type = option.properties.deviceType;
|
||||
m << "\n\t- " << opinions[type].description << " "
|
||||
<< option.properties.deviceName;
|
||||
auto type = option.getType();
|
||||
m << "\n\t- " << opinions[type].description << " " << option.getName();
|
||||
|
||||
if (opinions[pick->properties.deviceType].value <
|
||||
opinions[type].value) {
|
||||
if (opinions[pick->getType()].value < opinions[type].value) {
|
||||
pick = &option;
|
||||
}
|
||||
}
|
||||
m << "\n";
|
||||
|
||||
m << "Picked device " << pick->properties.deviceName;
|
||||
m << "Picked device " << pick->getName();
|
||||
return *pick;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user