mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-05-20 18:34:58 +00:00
vulkan: Disable exceptions for getImageFormatProperties and account for errors. (#906)
This commit is contained in:
parent
1ea6db6045
commit
e30255e0d2
1 changed files with 5 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
||||||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
|
#define VULKAN_HPP_NO_EXCEPTIONS
|
||||||
#include "common/assert.h"
|
#include "common/assert.h"
|
||||||
#include "video_core/renderer_vulkan/liverpool_to_vk.h"
|
#include "video_core/renderer_vulkan/liverpool_to_vk.h"
|
||||||
#include "video_core/renderer_vulkan/vk_instance.h"
|
#include "video_core/renderer_vulkan/vk_instance.h"
|
||||||
|
@ -150,6 +151,9 @@ Image::Image(const Vulkan::Instance& instance_, Vulkan::Scheduler& scheduler_,
|
||||||
const auto supported_format = instance->GetSupportedFormat(info.pixel_format);
|
const auto supported_format = instance->GetSupportedFormat(info.pixel_format);
|
||||||
const auto properties = instance->GetPhysicalDevice().getImageFormatProperties(
|
const auto properties = instance->GetPhysicalDevice().getImageFormatProperties(
|
||||||
supported_format, info.type, tiling, usage, flags);
|
supported_format, info.type, tiling, usage, flags);
|
||||||
|
const auto supported_samples = properties.result == vk::Result::eSuccess
|
||||||
|
? properties.value.sampleCounts
|
||||||
|
: vk::SampleCountFlagBits::e1;
|
||||||
|
|
||||||
const vk::ImageCreateInfo image_ci = {
|
const vk::ImageCreateInfo image_ci = {
|
||||||
.flags = flags,
|
.flags = flags,
|
||||||
|
@ -162,7 +166,7 @@ Image::Image(const Vulkan::Instance& instance_, Vulkan::Scheduler& scheduler_,
|
||||||
},
|
},
|
||||||
.mipLevels = static_cast<u32>(info.resources.levels),
|
.mipLevels = static_cast<u32>(info.resources.levels),
|
||||||
.arrayLayers = static_cast<u32>(info.resources.layers),
|
.arrayLayers = static_cast<u32>(info.resources.layers),
|
||||||
.samples = LiverpoolToVK::NumSamples(info.num_samples, properties.sampleCounts),
|
.samples = LiverpoolToVK::NumSamples(info.num_samples, supported_samples),
|
||||||
.tiling = tiling,
|
.tiling = tiling,
|
||||||
.usage = usage,
|
.usage = usage,
|
||||||
.initialLayout = vk::ImageLayout::eUndefined,
|
.initialLayout = vk::ImageLayout::eUndefined,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue