mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-12-10 05:38:49 +00:00
vulkan: Enable VULKAN_HPP_NO_EXCEPTIONS broadly. (#995)
* vulkan: Enable VULKAN_HPP_NO_EXCEPTIONS broadly. * vulkan: Use structured bindings for result where possible.
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#define VULKAN_HPP_NO_EXCEPTIONS
|
||||
#include <ranges>
|
||||
#include "common/assert.h"
|
||||
#include "video_core/renderer_vulkan/liverpool_to_vk.h"
|
||||
|
||||
@@ -175,7 +175,10 @@ ImageView::ImageView(const Vulkan::Instance& instance, const ImageViewInfo& info
|
||||
.layerCount = info.range.extent.layers,
|
||||
},
|
||||
};
|
||||
image_view = instance.GetDevice().createImageViewUnique(image_view_ci);
|
||||
auto [view_result, view] = instance.GetDevice().createImageViewUnique(image_view_ci);
|
||||
ASSERT_MSG(view_result == vk::Result::eSuccess, "Failed to create image view: {}",
|
||||
vk::to_string(view_result));
|
||||
image_view = std::move(view);
|
||||
}
|
||||
|
||||
ImageView::~ImageView() = default;
|
||||
|
||||
@@ -24,7 +24,10 @@ Sampler::Sampler(const Vulkan::Instance& instance, const AmdGpu::Sampler& sample
|
||||
.borderColor = LiverpoolToVK::BorderColor(sampler.border_color_type),
|
||||
.unnormalizedCoordinates = bool(sampler.force_unnormalized),
|
||||
};
|
||||
handle = instance.GetDevice().createSamplerUnique(sampler_ci);
|
||||
auto [sampler_result, smplr] = instance.GetDevice().createSamplerUnique(sampler_ci);
|
||||
ASSERT_MSG(sampler_result == vk::Result::eSuccess, "Failed to create sampler: {}",
|
||||
vk::to_string(sampler_result));
|
||||
handle = std::move(smplr);
|
||||
}
|
||||
|
||||
Sampler::~Sampler() = default;
|
||||
|
||||
@@ -298,8 +298,10 @@ TileManager::TileManager(const Vulkan::Instance& instance, Vulkan::Scheduler& sc
|
||||
.bindingCount = static_cast<u32>(bindings.size()),
|
||||
.pBindings = bindings.data(),
|
||||
};
|
||||
static auto desc_layout =
|
||||
static auto [desc_layout_result, desc_layout] =
|
||||
instance.GetDevice().createDescriptorSetLayoutUnique(desc_layout_ci);
|
||||
ASSERT_MSG(desc_layout_result == vk::Result::eSuccess,
|
||||
"Failed to create descriptor set layout: {}", vk::to_string(desc_layout_result));
|
||||
|
||||
const vk::PushConstantRange push_constants = {
|
||||
.stageFlags = vk::ShaderStageFlagBits::eCompute,
|
||||
@@ -314,7 +316,10 @@ TileManager::TileManager(const Vulkan::Instance& instance, Vulkan::Scheduler& sc
|
||||
.pushConstantRangeCount = 1,
|
||||
.pPushConstantRanges = &push_constants,
|
||||
};
|
||||
ctx.pl_layout = instance.GetDevice().createPipelineLayoutUnique(layout_info);
|
||||
auto [layout_result, layout] = instance.GetDevice().createPipelineLayoutUnique(layout_info);
|
||||
ASSERT_MSG(layout_result == vk::Result::eSuccess, "Failed to create pipeline layout: {}",
|
||||
vk::to_string(layout_result));
|
||||
ctx.pl_layout = std::move(layout);
|
||||
|
||||
const vk::ComputePipelineCreateInfo compute_pipeline_ci = {
|
||||
.stage = shader_ci,
|
||||
|
||||
Reference in New Issue
Block a user