Compare commits

...

17 Commits

Author SHA1 Message Date
2d33cd1c3f Android #26 2023-08-01 00:57:07 +00:00
2a9eab5e1b Merge pull request #11188 from abouvier/vma-fix
vma: enable options everywhere
2023-07-31 15:28:35 -04:00
083fb8a15f Merge pull request #11181 from Kelebek1/audrenparaminternal
Fix AudioRendererParameterInternal's size
2023-07-31 15:28:24 -04:00
06fa13a014 Merge pull request #11169 from GPUCode/desc-stuff
vk_descriptor_pool: Disallow descriptor set free
2023-07-31 09:11:19 -04:00
1ed6e3e51d Merge pull request #11173 from Morph1984/atleast_nanosecond_precision
wall_clock: Increase precision requirements
2023-07-31 09:11:11 -04:00
e2623d64de Merge pull request #11186 from lat9nq/tz-gen-once
tz_content_man: Generate the time zone binary once
2023-07-31 09:11:01 -04:00
0f37756a3a Merge pull request #11182 from Moonlacer/revert-11163-revert-10946-amdBlending
Revert the Revert! Reverts the Revert of "Blacklist EDS3 blending from new AMD drivers"
2023-07-31 09:10:48 -04:00
ed3f9bab11 vma: enable options everywhere 2023-07-31 13:01:21 +02:00
deafa92122 Formatting fix 2023-07-30 23:02:07 -05:00
c6458970ad Match log warning 2023-07-30 22:50:22 -05:00
eaf2ab5289 tz_content_man: Generate the time zone binary once
Fixes a memory leak with time zone binaries accumulating on theirselves.
2023-07-30 12:55:19 -04:00
a4a106bb25 Formatting fix 2023-07-30 04:29:51 -05:00
f4e5d07619 Address feedback and change log warning 2023-07-30 04:01:29 -05:00
70f37be9b9 Fix AudioRendererParameterInternal's size 2023-07-30 06:50:59 +01:00
36d48cef50 Revert "Revert "Blacklist EDS3 blending from new AMD drivers"" 2023-07-30 00:21:51 -05:00
bb4e676155 wall_clock: Increase precision requirements
We are providing a conversion to nanoseconds in NativeClock, which is more precise than the GPU tick.
2023-07-27 18:40:56 -04:00
8c2411da29 vk_descriptor_pool: Disallow descriptor set free 2023-07-27 18:08:56 +03:00
17 changed files with 69 additions and 37 deletions

View File

@ -1,3 +1,11 @@
| Pull Request | Commit | Title | Author | Merged? |
|----|----|----|----|----|
End of merge log. You can find the original README.md below the break.
-----
<!--
SPDX-FileCopyrightText: 2018 yuzu Emulator Project
SPDX-License-Identifier: GPL-2.0-or-later

View File

@ -32,16 +32,16 @@ struct AudioRendererParameterInternal {
/* 0x14 */ u32 sinks;
/* 0x18 */ u32 effects;
/* 0x1C */ u32 perf_frames;
/* 0x20 */ u16 voice_drop_enabled;
/* 0x20 */ u8 voice_drop_enabled;
/* 0x21 */ u8 unk_21;
/* 0x22 */ u8 rendering_device;
/* 0x23 */ ExecutionMode execution_mode;
/* 0x24 */ u32 splitter_infos;
/* 0x28 */ s32 splitter_destinations;
/* 0x2C */ u32 external_context_size;
/* 0x30 */ u32 revision;
/* 0x34 */ char unk34[0x4];
};
static_assert(sizeof(AudioRendererParameterInternal) == 0x38,
static_assert(sizeof(AudioRendererParameterInternal) == 0x34,
"AudioRendererParameterInternal has the wrong size!");
/**

View File

@ -56,12 +56,12 @@ std::unique_ptr<WallClock> CreateOptimalClock() {
#ifdef ARCHITECTURE_x86_64
const auto& caps = GetCPUCaps();
if (caps.invariant_tsc && caps.tsc_frequency >= WallClock::GPUTickFreq) {
if (caps.invariant_tsc && caps.tsc_frequency >= std::nano::den) {
return std::make_unique<X64::NativeClock>(caps.tsc_frequency);
} else {
// Fallback to StandardWallClock if the hardware TSC
// - Is not invariant
// - Is not more precise than GPUTickFreq
// - Is not more precise than 1 GHz (1ns resolution)
return std::make_unique<StandardWallClock>();
}
#else

View File

@ -3,6 +3,7 @@
#include <chrono>
#include <sstream>
#include <utility>
#include "common/logging/log.h"
#include "common/settings.h"
@ -46,14 +47,14 @@ static FileSys::VirtualDir GetTimeZoneBinary(Core::System& system) {
return FileSys::ExtractRomFS(romfs);
}
static std::vector<std::string> BuildLocationNameCache(Core::System& system) {
const FileSys::VirtualDir extracted_romfs{GetTimeZoneBinary(system)};
if (!extracted_romfs) {
static std::vector<std::string> BuildLocationNameCache(
const FileSys::VirtualDir& time_zone_binary) {
if (!time_zone_binary) {
LOG_ERROR(Service_Time, "Failed to extract RomFS for {:016X}!", time_zone_binary_titleid);
return {};
}
const FileSys::VirtualFile binary_list{extracted_romfs->GetFile("binaryList.txt")};
const FileSys::VirtualFile binary_list{time_zone_binary->GetFile("binaryList.txt")};
if (!binary_list) {
LOG_ERROR(Service_Time, "{:016X} has no file binaryList.txt!", time_zone_binary_titleid);
return {};
@ -73,7 +74,8 @@ static std::vector<std::string> BuildLocationNameCache(Core::System& system) {
}
TimeZoneContentManager::TimeZoneContentManager(Core::System& system_)
: system{system_}, location_name_cache{BuildLocationNameCache(system)} {}
: system{system_}, time_zone_binary{GetTimeZoneBinary(system)},
location_name_cache{BuildLocationNameCache(time_zone_binary)} {}
void TimeZoneContentManager::Initialize(TimeManager& time_manager) {
const auto timezone_setting = Settings::GetTimeZoneString();
@ -111,13 +113,12 @@ Result TimeZoneContentManager::GetTimeZoneInfoFile(const std::string& location_n
return ERROR_TIME_NOT_FOUND;
}
const FileSys::VirtualDir extracted_romfs{GetTimeZoneBinary(system)};
if (!extracted_romfs) {
if (!time_zone_binary) {
LOG_ERROR(Service_Time, "Failed to extract RomFS for {:016X}!", time_zone_binary_titleid);
return ERROR_TIME_NOT_FOUND;
}
const FileSys::VirtualDir zoneinfo_dir{extracted_romfs->GetSubdirectory("zoneinfo")};
const FileSys::VirtualDir zoneinfo_dir{time_zone_binary->GetSubdirectory("zoneinfo")};
if (!zoneinfo_dir) {
LOG_ERROR(Service_Time, "{:016X} has no directory zoneinfo!", time_zone_binary_titleid);
return ERROR_TIME_NOT_FOUND;

View File

@ -6,6 +6,7 @@
#include <string>
#include <vector>
#include "core/file_sys/vfs_types.h"
#include "core/hle/service/time/time_zone_manager.h"
namespace Core {
@ -41,6 +42,7 @@ private:
Core::System& system;
TimeZoneManager time_zone_manager;
const FileSys::VirtualDir time_zone_binary;
const std::vector<std::string> location_name_cache;
};

View File

@ -275,6 +275,8 @@ add_library(video_core STATIC
vulkan_common/nsight_aftermath_tracker.cpp
vulkan_common/nsight_aftermath_tracker.h
vulkan_common/vma.cpp
vulkan_common/vma.h
vulkan_common/vulkan.h
)
create_target_directory_groups(video_core)

View File

@ -566,7 +566,7 @@ void BlitScreen::CreateDescriptorPool() {
const VkDescriptorPoolCreateInfo ci{
.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO,
.pNext = nullptr,
.flags = VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT,
.flags = 0,
.maxSets = static_cast<u32>(image_count),
.poolSizeCount = static_cast<u32>(pool_sizes.size()),
.pPoolSizes = pool_sizes.data(),
@ -576,7 +576,7 @@ void BlitScreen::CreateDescriptorPool() {
const VkDescriptorPoolCreateInfo ci_aa{
.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO,
.pNext = nullptr,
.flags = VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT,
.flags = 0,
.maxSets = static_cast<u32>(image_count),
.poolSizeCount = static_cast<u32>(pool_sizes_aa.size()),
.pPoolSizes = pool_sizes_aa.data(),

View File

@ -77,7 +77,7 @@ static void AllocatePool(const Device& device, DescriptorBank& bank) {
bank.pools.push_back(device.GetLogical().CreateDescriptorPool({
.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO,
.pNext = nullptr,
.flags = VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT,
.flags = 0,
.maxSets = sets_per_pool,
.poolSizeCount = static_cast<u32>(pool_cursor),
.pPoolSizes = std::data(pool_sizes),

View File

@ -150,7 +150,7 @@ void FSR::CreateDescriptorPool() {
const VkDescriptorPoolCreateInfo ci{
.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO,
.pNext = nullptr,
.flags = VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT,
.flags = 0,
.maxSets = static_cast<u32>(image_count * 2),
.poolSizeCount = static_cast<u32>(pool_sizes.size()),
.pPoolSizes = pool_sizes.data(),

View File

@ -62,7 +62,7 @@ void TurboMode::Run(std::stop_token stop_token) {
auto descriptor_pool = dld.CreateDescriptorPool(VkDescriptorPoolCreateInfo{
.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO,
.pNext = nullptr,
.flags = VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT,
.flags = 0,
.maxSets = 1,
.poolSizeCount = 1,
.pPoolSizes = &pool_size,

View File

@ -2,7 +2,5 @@
// SPDX-License-Identifier: GPL-2.0-or-later
#define VMA_IMPLEMENTATION
#define VMA_STATIC_VULKAN_FUNCTIONS 0
#define VMA_DYNAMIC_VULKAN_FUNCTIONS 1
#include <vk_mem_alloc.h>
#include "video_core/vulkan_common/vma.h"

View File

@ -0,0 +1,11 @@
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include "video_core/vulkan_common/vulkan.h"
#define VMA_STATIC_VULKAN_FUNCTIONS 0
#define VMA_DYNAMIC_VULKAN_FUNCTIONS 1
#include <vk_mem_alloc.h>

View File

@ -0,0 +1,13 @@
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#define VK_NO_PROTOTYPES
#ifdef _WIN32
#define VK_USE_PLATFORM_WIN32_KHR
#elif defined(__APPLE__)
#define VK_USE_PLATFORM_METAL_EXT
#endif
#include <vulkan/vulkan.h>

View File

@ -15,6 +15,7 @@
#include "common/polyfill_ranges.h"
#include "common/settings.h"
#include "video_core/vulkan_common/nsight_aftermath_tracker.h"
#include "video_core/vulkan_common/vma.h"
#include "video_core/vulkan_common/vulkan_device.h"
#include "video_core/vulkan_common/vulkan_wrapper.h"
@ -22,8 +23,6 @@
#include <adrenotools/bcenabler.h>
#endif
#include <vk_mem_alloc.h>
namespace Vulkan {
using namespace Common::Literals;
namespace {
@ -554,6 +553,14 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR
}
sets_per_pool = 64;
if (extensions.extended_dynamic_state3 && is_amd_driver &&
!features.shader_float16_int8.shaderFloat16 &&
properties.properties.driverVersion >= VK_MAKE_API_VERSION(0, 2, 0, 258)) {
LOG_WARNING(Render_Vulkan, "AMD GCN4 has broken extendedDynamicState3ColorBlendEquation");
features.extended_dynamic_state3.extendedDynamicState3ColorBlendEnable = false;
features.extended_dynamic_state3.extendedDynamicState3ColorBlendEquation = false;
dynamic_state3_blending = false;
}
if (is_amd_driver) {
// AMD drivers need a higher amount of Sets per Pool in certain circumstances like in XC2.
sets_per_pool = 96;

View File

@ -11,12 +11,11 @@
#include "common/common_types.h"
#include "common/logging/log.h"
#include "common/polyfill_ranges.h"
#include "video_core/vulkan_common/vma.h"
#include "video_core/vulkan_common/vulkan_device.h"
#include "video_core/vulkan_common/vulkan_memory_allocator.h"
#include "video_core/vulkan_common/vulkan_wrapper.h"
#include <vk_mem_alloc.h>
namespace Vulkan {
namespace {
struct Range {

View File

@ -9,11 +9,9 @@
#include "common/common_types.h"
#include "common/logging/log.h"
#include "video_core/vulkan_common/vma.h"
#include "video_core/vulkan_common/vulkan_wrapper.h"
#include <vk_mem_alloc.h>
namespace Vulkan::vk {
namespace {

View File

@ -12,13 +12,8 @@
#include <utility>
#include <vector>
#define VK_NO_PROTOTYPES
#ifdef _WIN32
#define VK_USE_PLATFORM_WIN32_KHR
#elif defined(__APPLE__)
#define VK_USE_PLATFORM_METAL_EXT
#endif
#include <vulkan/vulkan.h>
#include "common/common_types.h"
#include "video_core/vulkan_common/vulkan.h"
// Sanitize macros
#ifdef CreateEvent
@ -28,8 +23,6 @@
#undef CreateSemaphore
#endif
#include "common/common_types.h"
#ifdef _MSC_VER
#pragma warning(disable : 26812) // Disable prefer enum class over enum
#endif