mirror of
https://github.com/love2d/love.git
synced 2026-08-17 19:23:38 +02:00
vulkan: fix some validation warnings
This commit is contained in:
@@ -1079,6 +1079,9 @@ static void findOptionalDeviceExtensions(VkPhysicalDevice physicalDevice, Option
|
|||||||
if (strcmp(extension.extensionName, VK_EXT_EXTENDED_DYNAMIC_STATE_EXTENSION_NAME) == 0) {
|
if (strcmp(extension.extensionName, VK_EXT_EXTENDED_DYNAMIC_STATE_EXTENSION_NAME) == 0) {
|
||||||
optionalDeviceFeatures.extendedDynamicState = true;
|
optionalDeviceFeatures.extendedDynamicState = true;
|
||||||
}
|
}
|
||||||
|
if (strcmp(extension.extensionName, VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME) == 0) {
|
||||||
|
optionalDeviceFeatures.physicalDeviceProperties2 = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1100,6 +1103,10 @@ void Graphics::createLogicalDevice() {
|
|||||||
|
|
||||||
findOptionalDeviceExtensions(physicalDevice, optionalDeviceFeatures);
|
findOptionalDeviceExtensions(physicalDevice, optionalDeviceFeatures);
|
||||||
|
|
||||||
|
if (optionalDeviceFeatures.extendedDynamicState && !optionalDeviceFeatures.physicalDeviceProperties2) {
|
||||||
|
optionalDeviceFeatures.extendedDynamicState = false;
|
||||||
|
}
|
||||||
|
|
||||||
VkPhysicalDeviceFeatures deviceFeatures{};
|
VkPhysicalDeviceFeatures deviceFeatures{};
|
||||||
deviceFeatures.samplerAnisotropy = VK_TRUE;
|
deviceFeatures.samplerAnisotropy = VK_TRUE;
|
||||||
deviceFeatures.fillModeNonSolid = VK_TRUE;
|
deviceFeatures.fillModeNonSolid = VK_TRUE;
|
||||||
@@ -1113,6 +1120,7 @@ void Graphics::createLogicalDevice() {
|
|||||||
std::vector<const char*> enabledExtensions(deviceExtensions.begin(), deviceExtensions.end());
|
std::vector<const char*> enabledExtensions(deviceExtensions.begin(), deviceExtensions.end());
|
||||||
|
|
||||||
if (optionalDeviceFeatures.extendedDynamicState) {
|
if (optionalDeviceFeatures.extendedDynamicState) {
|
||||||
|
enabledExtensions.push_back(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME);
|
||||||
enabledExtensions.push_back(VK_EXT_EXTENDED_DYNAMIC_STATE_EXTENSION_NAME);
|
enabledExtensions.push_back(VK_EXT_EXTENDED_DYNAMIC_STATE_EXTENSION_NAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1546,7 +1554,11 @@ VkRenderPass Graphics::createRenderPass(RenderPassConfiguration configuration) {
|
|||||||
VkAttachmentDescription colorDescription{};
|
VkAttachmentDescription colorDescription{};
|
||||||
colorDescription.format = colorFormat;
|
colorDescription.format = colorFormat;
|
||||||
colorDescription.samples = configuration.staticData.msaaSamples;
|
colorDescription.samples = configuration.staticData.msaaSamples;
|
||||||
colorDescription.loadOp = VK_ATTACHMENT_LOAD_OP_LOAD;
|
if (configuration.staticData.initialColorImageLayout != VK_IMAGE_LAYOUT_UNDEFINED) {
|
||||||
|
colorDescription.loadOp = VK_ATTACHMENT_LOAD_OP_LOAD;
|
||||||
|
} else {
|
||||||
|
colorDescription.loadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE;
|
||||||
|
}
|
||||||
colorDescription.storeOp = VK_ATTACHMENT_STORE_OP_STORE;
|
colorDescription.storeOp = VK_ATTACHMENT_STORE_OP_STORE;
|
||||||
colorDescription.stencilLoadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE;
|
colorDescription.stencilLoadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE;
|
||||||
colorDescription.stencilStoreOp = VK_ATTACHMENT_STORE_OP_DONT_CARE;
|
colorDescription.stencilStoreOp = VK_ATTACHMENT_STORE_OP_DONT_CARE;
|
||||||
|
|||||||
@@ -80,6 +80,7 @@ struct FramebufferConfigurationHasher {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct OptionalDeviceFeatures {
|
struct OptionalDeviceFeatures {
|
||||||
|
bool physicalDeviceProperties2 = false;
|
||||||
bool extendedDynamicState = false;
|
bool extendedDynamicState = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user