yuzu-emu
/
yuzu-mainline
Archived
1
0
Fork 0

vulkan_device: Enable robust buffers

This commit is contained in:
ReinUsesLisp 2021-01-16 20:39:06 -03:00
parent 1a987054c5
commit 40ed0cb920
1 changed files with 4 additions and 2 deletions

View File

@ -379,7 +379,7 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR
robustness2 = {
.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_FEATURES_EXT,
.pNext = nullptr,
.robustBufferAccess2 = false,
.robustBufferAccess2 = true,
.robustImageAccess2 = true,
.nullDescriptor = true,
};
@ -570,6 +570,7 @@ void Device::CheckSuitability() const {
const VkPhysicalDeviceFeatures features{physical.GetFeatures()};
const std::array feature_report{
std::make_pair(features.vertexPipelineStoresAndAtomics, "vertexPipelineStoresAndAtomics"),
std::make_pair(features.robustBufferAccess, "robustBufferAccess"),
std::make_pair(features.imageCubeArray, "imageCubeArray"),
std::make_pair(features.independentBlend, "independentBlend"),
std::make_pair(features.depthClamp, "depthClamp"),
@ -738,7 +739,8 @@ std::vector<const char*> Device::LoadExtensions() {
robustness2.pNext = nullptr;
features.pNext = &robustness2;
physical.GetFeatures2KHR(features);
if (robustness2.nullDescriptor && robustness2.robustImageAccess2) {
if (robustness2.nullDescriptor && robustness2.robustBufferAccess2 &&
robustness2.robustImageAccess2) {
extensions.push_back(VK_EXT_ROBUSTNESS_2_EXTENSION_NAME);
ext_robustness2 = true;
}