|
|
|
@ -13,7 +13,8 @@
|
|
|
|
|
|
|
|
|
|
#include "common/assert.h"
|
|
|
|
|
#include "core/settings.h"
|
|
|
|
|
#include "video_core/renderer_vulkan/vk_device.h"
|
|
|
|
|
#include "video_core/vulkan_common/nsight_aftermath_tracker.h"
|
|
|
|
|
#include "video_core/vulkan_common/vulkan_device.h"
|
|
|
|
|
#include "video_core/vulkan_common/vulkan_wrapper.h"
|
|
|
|
|
|
|
|
|
|
namespace Vulkan {
|
|
|
|
@ -412,7 +413,7 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR
|
|
|
|
|
|
|
|
|
|
VkDeviceDiagnosticsConfigCreateInfoNV diagnostics_nv;
|
|
|
|
|
if (nv_device_diagnostics_config) {
|
|
|
|
|
nsight_aftermath_tracker.Initialize();
|
|
|
|
|
nsight_aftermath_tracker = std::make_unique<NsightAftermathTracker>();
|
|
|
|
|
|
|
|
|
|
diagnostics_nv = {
|
|
|
|
|
.sType = VK_STRUCTURE_TYPE_DEVICE_DIAGNOSTICS_CONFIG_CREATE_INFO_NV,
|
|
|
|
@ -491,7 +492,9 @@ void Device::ReportLoss() const {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Device::SaveShader(const std::vector<u32>& spirv) const {
|
|
|
|
|
nsight_aftermath_tracker.SaveShader(spirv);
|
|
|
|
|
if (nsight_aftermath_tracker) {
|
|
|
|
|
nsight_aftermath_tracker->SaveShader(spirv);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool Device::IsOptimalAstcSupported(const VkPhysicalDeviceFeatures& features) const {
|
|
|
|
@ -772,7 +775,7 @@ void Device::SetupFamilies(VkSurfaceKHR surface) {
|
|
|
|
|
std::optional<u32> graphics;
|
|
|
|
|
std::optional<u32> present;
|
|
|
|
|
for (u32 index = 0; index < static_cast<u32>(queue_family_properties.size()); ++index) {
|
|
|
|
|
if (graphics && present) {
|
|
|
|
|
if (graphics && (present || !surface)) {
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
const VkQueueFamilyProperties& queue_family = queue_family_properties[index];
|
|
|
|
@ -782,7 +785,7 @@ void Device::SetupFamilies(VkSurfaceKHR surface) {
|
|
|
|
|
if (queue_family.queueFlags & VK_QUEUE_GRAPHICS_BIT) {
|
|
|
|
|
graphics = index;
|
|
|
|
|
}
|
|
|
|
|
if (physical.GetSurfaceSupportKHR(index, surface)) {
|
|
|
|
|
if (surface && physical.GetSurfaceSupportKHR(index, surface)) {
|
|
|
|
|
present = index;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -790,7 +793,7 @@ void Device::SetupFamilies(VkSurfaceKHR surface) {
|
|
|
|
|
LOG_ERROR(Render_Vulkan, "Device lacks a graphics queue");
|
|
|
|
|
throw vk::Exception(VK_ERROR_FEATURE_NOT_PRESENT);
|
|
|
|
|
}
|
|
|
|
|
if (!present) {
|
|
|
|
|
if (surface && !present) {
|
|
|
|
|
LOG_ERROR(Render_Vulkan, "Device lacks a present queue");
|
|
|
|
|
throw vk::Exception(VK_ERROR_FEATURE_NOT_PRESENT);
|
|
|
|
|
}
|