Compare commits
21 Commits
android-84
...
android-86
Author | SHA1 | Date | |
---|---|---|---|
f26cde17b7 | |||
184ee2d890 | |||
d6b3e7f195 | |||
926e24c642 | |||
18a396b53f | |||
c62e089260 | |||
257a6aa2ba | |||
7bae22a3ca | |||
f24d956ae2 | |||
4487c165c8 | |||
e3f7e02555 | |||
7507a7f89f | |||
feebdc9779 | |||
a29e26200f | |||
00a612eaea | |||
8992a62da4 | |||
b99f94a7ff | |||
6a1ecab2dd | |||
f70bafff1a | |||
3ad7eec9de | |||
7135bdc3bd |
@ -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
|
||||
|
@ -141,10 +141,6 @@ public:
|
||||
if (nsp->IsExtractedType()) {
|
||||
return InstallError;
|
||||
}
|
||||
} else if (file_extension == "xci") {
|
||||
jconst xci =
|
||||
std::make_shared<FileSys::XCI>(m_vfs->OpenFile(filename, FileSys::Mode::Read));
|
||||
nsp = xci->GetSecurePartitionNSP();
|
||||
} else {
|
||||
return ErrorFilenameExtension;
|
||||
}
|
||||
|
@ -351,6 +351,8 @@ struct Values {
|
||||
linkage, false, "disable_shader_loop_safety_checks", Category::RendererDebug};
|
||||
Setting<bool> enable_renderdoc_hotkey{linkage, false, "renderdoc_hotkey",
|
||||
Category::RendererDebug};
|
||||
// TODO: remove this once AMDVLK supports VK_EXT_depth_bias_control
|
||||
bool renderer_amdvlk_depth_bias_workaround{};
|
||||
|
||||
// System
|
||||
SwitchableSetting<Language, true> language_index{linkage,
|
||||
|
@ -381,6 +381,10 @@ struct System::Impl {
|
||||
room_member->SendGameInfo(game_info);
|
||||
}
|
||||
|
||||
// Workarounds:
|
||||
// Activate this in Super Smash Brothers Ultimate, it only affects AMD cards using AMDVLK
|
||||
Settings::values.renderer_amdvlk_depth_bias_workaround = program_id == 0x1006A800016E000ULL;
|
||||
|
||||
status = SystemResultStatus::Success;
|
||||
return status;
|
||||
}
|
||||
@ -440,6 +444,9 @@ struct System::Impl {
|
||||
room_member->SendGameInfo(game_info);
|
||||
}
|
||||
|
||||
// Workarounds
|
||||
Settings::values.renderer_amdvlk_depth_bias_workaround = false;
|
||||
|
||||
LOG_DEBUG(Core, "Shutdown OK");
|
||||
}
|
||||
|
||||
|
@ -32,6 +32,7 @@ struct CoreTiming::Event {
|
||||
std::uintptr_t user_data;
|
||||
std::weak_ptr<EventType> type;
|
||||
s64 reschedule_time;
|
||||
heap_t::handle_type handle{};
|
||||
|
||||
// Sort by time, unless the times are the same, in which case sort by
|
||||
// the order added to the queue
|
||||
@ -122,9 +123,9 @@ void CoreTiming::ScheduleEvent(std::chrono::nanoseconds ns_into_future,
|
||||
std::scoped_lock scope{basic_lock};
|
||||
const auto next_time{absolute_time ? ns_into_future : GetGlobalTimeNs() + ns_into_future};
|
||||
|
||||
event_queue.emplace_back(
|
||||
Event{next_time.count(), event_fifo_id++, user_data, event_type, 0});
|
||||
std::push_heap(event_queue.begin(), event_queue.end(), std::greater<>());
|
||||
auto h{event_queue.emplace(
|
||||
Event{next_time.count(), event_fifo_id++, user_data, event_type, 0})};
|
||||
(*h).handle = h;
|
||||
}
|
||||
|
||||
event.Set();
|
||||
@ -138,10 +139,9 @@ void CoreTiming::ScheduleLoopingEvent(std::chrono::nanoseconds start_time,
|
||||
std::scoped_lock scope{basic_lock};
|
||||
const auto next_time{absolute_time ? start_time : GetGlobalTimeNs() + start_time};
|
||||
|
||||
event_queue.emplace_back(
|
||||
Event{next_time.count(), event_fifo_id++, user_data, event_type, resched_time.count()});
|
||||
|
||||
std::push_heap(event_queue.begin(), event_queue.end(), std::greater<>());
|
||||
auto h{event_queue.emplace(Event{next_time.count(), event_fifo_id++, user_data, event_type,
|
||||
resched_time.count()})};
|
||||
(*h).handle = h;
|
||||
}
|
||||
|
||||
event.Set();
|
||||
@ -151,15 +151,17 @@ void CoreTiming::UnscheduleEvent(const std::shared_ptr<EventType>& event_type,
|
||||
std::uintptr_t user_data, bool wait) {
|
||||
{
|
||||
std::scoped_lock lk{basic_lock};
|
||||
const auto itr =
|
||||
std::remove_if(event_queue.begin(), event_queue.end(), [&](const Event& e) {
|
||||
return e.type.lock().get() == event_type.get() && e.user_data == user_data;
|
||||
});
|
||||
|
||||
// Removing random items breaks the invariant so we have to re-establish it.
|
||||
if (itr != event_queue.end()) {
|
||||
event_queue.erase(itr, event_queue.end());
|
||||
std::make_heap(event_queue.begin(), event_queue.end(), std::greater<>());
|
||||
std::vector<heap_t::handle_type> to_remove;
|
||||
for (auto itr = event_queue.begin(); itr != event_queue.end(); itr++) {
|
||||
const Event& e = *itr;
|
||||
if (e.type.lock().get() == event_type.get() && e.user_data == user_data) {
|
||||
to_remove.push_back(itr->handle);
|
||||
}
|
||||
}
|
||||
|
||||
for (auto h : to_remove) {
|
||||
event_queue.erase(h);
|
||||
}
|
||||
}
|
||||
|
||||
@ -200,35 +202,45 @@ std::optional<s64> CoreTiming::Advance() {
|
||||
std::scoped_lock lock{advance_lock, basic_lock};
|
||||
global_timer = GetGlobalTimeNs().count();
|
||||
|
||||
while (!event_queue.empty() && event_queue.front().time <= global_timer) {
|
||||
Event evt = std::move(event_queue.front());
|
||||
std::pop_heap(event_queue.begin(), event_queue.end(), std::greater<>());
|
||||
event_queue.pop_back();
|
||||
while (!event_queue.empty() && event_queue.top().time <= global_timer) {
|
||||
const Event& evt = event_queue.top();
|
||||
|
||||
if (const auto event_type{evt.type.lock()}) {
|
||||
basic_lock.unlock();
|
||||
if (evt.reschedule_time == 0) {
|
||||
const auto evt_user_data = evt.user_data;
|
||||
const auto evt_time = evt.time;
|
||||
|
||||
const auto new_schedule_time{event_type->callback(
|
||||
evt.user_data, evt.time,
|
||||
std::chrono::nanoseconds{GetGlobalTimeNs().count() - evt.time})};
|
||||
event_queue.pop();
|
||||
|
||||
basic_lock.lock();
|
||||
basic_lock.unlock();
|
||||
|
||||
event_type->callback(
|
||||
evt_user_data, evt_time,
|
||||
std::chrono::nanoseconds{GetGlobalTimeNs().count() - evt_time});
|
||||
|
||||
basic_lock.lock();
|
||||
} else {
|
||||
basic_lock.unlock();
|
||||
|
||||
const auto new_schedule_time{event_type->callback(
|
||||
evt.user_data, evt.time,
|
||||
std::chrono::nanoseconds{GetGlobalTimeNs().count() - evt.time})};
|
||||
|
||||
basic_lock.lock();
|
||||
|
||||
if (evt.reschedule_time != 0) {
|
||||
const auto next_schedule_time{new_schedule_time.has_value()
|
||||
? new_schedule_time.value().count()
|
||||
: evt.reschedule_time};
|
||||
|
||||
// If this event was scheduled into a pause, its time now is going to be way behind.
|
||||
// Re-set this event to continue from the end of the pause.
|
||||
// If this event was scheduled into a pause, its time now is going to be way
|
||||
// behind. Re-set this event to continue from the end of the pause.
|
||||
auto next_time{evt.time + next_schedule_time};
|
||||
if (evt.time < pause_end_time) {
|
||||
next_time = pause_end_time + next_schedule_time;
|
||||
}
|
||||
|
||||
event_queue.emplace_back(
|
||||
Event{next_time, event_fifo_id++, evt.user_data, evt.type, next_schedule_time});
|
||||
std::push_heap(event_queue.begin(), event_queue.end(), std::greater<>());
|
||||
event_queue.update(evt.handle, Event{next_time, event_fifo_id++, evt.user_data,
|
||||
evt.type, next_schedule_time, evt.handle});
|
||||
}
|
||||
}
|
||||
|
||||
@ -236,7 +248,7 @@ std::optional<s64> CoreTiming::Advance() {
|
||||
}
|
||||
|
||||
if (!event_queue.empty()) {
|
||||
return event_queue.front().time;
|
||||
return event_queue.top().time;
|
||||
} else {
|
||||
return std::nullopt;
|
||||
}
|
||||
@ -274,7 +286,8 @@ void CoreTiming::ThreadLoop() {
|
||||
#endif
|
||||
}
|
||||
} else {
|
||||
// Queue is empty, wait until another event is scheduled and signals us to continue.
|
||||
// Queue is empty, wait until another event is scheduled and signals us to
|
||||
// continue.
|
||||
wait_set = true;
|
||||
event.Wait();
|
||||
}
|
||||
|
@ -11,7 +11,8 @@
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <thread>
|
||||
#include <vector>
|
||||
|
||||
#include <boost/heap/fibonacci_heap.hpp>
|
||||
|
||||
#include "common/common_types.h"
|
||||
#include "common/thread.h"
|
||||
@ -151,11 +152,10 @@ private:
|
||||
s64 timer_resolution_ns;
|
||||
#endif
|
||||
|
||||
// The queue is a min-heap using std::make_heap/push_heap/pop_heap.
|
||||
// We don't use std::priority_queue because we need to be able to serialize, unserialize and
|
||||
// erase arbitrary events (RemoveEvent()) regardless of the queue order. These aren't
|
||||
// accommodated by the standard adaptor class.
|
||||
std::vector<Event> event_queue;
|
||||
using heap_t =
|
||||
boost::heap::fibonacci_heap<CoreTiming::Event, boost::heap::compare<std::greater<>>>;
|
||||
|
||||
heap_t event_queue;
|
||||
u64 event_fifo_id = 0;
|
||||
|
||||
std::shared_ptr<EventType> ev_lost;
|
||||
|
@ -542,6 +542,7 @@ void EmulatedController::UnloadInput() {
|
||||
}
|
||||
|
||||
void EmulatedController::EnableConfiguration() {
|
||||
std::scoped_lock lock{connect_mutex, npad_mutex};
|
||||
is_configuring = true;
|
||||
tmp_is_connected = is_connected;
|
||||
tmp_npad_type = npad_type;
|
||||
@ -1556,7 +1557,7 @@ void EmulatedController::Connect(bool use_temporary_value) {
|
||||
|
||||
auto trigger_guard =
|
||||
SCOPE_GUARD({ TriggerOnChange(ControllerTriggerType::Connected, !is_configuring); });
|
||||
std::scoped_lock lock{mutex};
|
||||
std::scoped_lock lock{connect_mutex, mutex};
|
||||
if (is_configuring) {
|
||||
tmp_is_connected = true;
|
||||
return;
|
||||
@ -1572,7 +1573,7 @@ void EmulatedController::Connect(bool use_temporary_value) {
|
||||
void EmulatedController::Disconnect() {
|
||||
auto trigger_guard =
|
||||
SCOPE_GUARD({ TriggerOnChange(ControllerTriggerType::Disconnected, !is_configuring); });
|
||||
std::scoped_lock lock{mutex};
|
||||
std::scoped_lock lock{connect_mutex, mutex};
|
||||
if (is_configuring) {
|
||||
tmp_is_connected = false;
|
||||
return;
|
||||
@ -1586,7 +1587,7 @@ void EmulatedController::Disconnect() {
|
||||
}
|
||||
|
||||
bool EmulatedController::IsConnected(bool get_temporary_value) const {
|
||||
std::scoped_lock lock{mutex};
|
||||
std::scoped_lock lock{connect_mutex};
|
||||
if (get_temporary_value && is_configuring) {
|
||||
return tmp_is_connected;
|
||||
}
|
||||
@ -1599,7 +1600,7 @@ NpadIdType EmulatedController::GetNpadIdType() const {
|
||||
}
|
||||
|
||||
NpadStyleIndex EmulatedController::GetNpadStyleIndex(bool get_temporary_value) const {
|
||||
std::scoped_lock lock{mutex};
|
||||
std::scoped_lock lock{npad_mutex};
|
||||
if (get_temporary_value && is_configuring) {
|
||||
return tmp_npad_type;
|
||||
}
|
||||
@ -1609,7 +1610,7 @@ NpadStyleIndex EmulatedController::GetNpadStyleIndex(bool get_temporary_value) c
|
||||
void EmulatedController::SetNpadStyleIndex(NpadStyleIndex npad_type_) {
|
||||
auto trigger_guard =
|
||||
SCOPE_GUARD({ TriggerOnChange(ControllerTriggerType::Type, !is_configuring); });
|
||||
std::scoped_lock lock{mutex};
|
||||
std::scoped_lock lock{mutex, npad_mutex};
|
||||
|
||||
if (is_configuring) {
|
||||
if (tmp_npad_type == npad_type_) {
|
||||
|
@ -603,6 +603,8 @@ private:
|
||||
|
||||
mutable std::mutex mutex;
|
||||
mutable std::mutex callback_mutex;
|
||||
mutable std::mutex npad_mutex;
|
||||
mutable std::mutex connect_mutex;
|
||||
std::unordered_map<int, ControllerUpdateCallback> callback_list;
|
||||
int last_callback_key = 0;
|
||||
|
||||
|
@ -35,7 +35,9 @@ void KHardwareTimer::DoTask() {
|
||||
}
|
||||
|
||||
// Disable the timer interrupt while we handle this.
|
||||
this->DisableInterrupt();
|
||||
// Not necessary due to core timing already having popped this event to call it.
|
||||
// this->DisableInterrupt();
|
||||
m_wakeup_time = std::numeric_limits<s64>::max();
|
||||
|
||||
if (const s64 next_time = this->DoInterruptTaskImpl(GetTick());
|
||||
0 < next_time && next_time <= m_wakeup_time) {
|
||||
|
@ -2094,9 +2094,6 @@ void IApplicationFunctions::PrepareForJit(HLERequestContext& ctx) {
|
||||
|
||||
void LoopProcess(Nvnflinger::Nvnflinger& nvnflinger, Core::System& system) {
|
||||
auto message_queue = std::make_shared<AppletMessageQueue>(system);
|
||||
// Needed on game boot
|
||||
message_queue->PushMessage(AppletMessageQueue::AppletMessage::FocusStateChanged);
|
||||
|
||||
auto server_manager = std::make_unique<ServerManager>(system);
|
||||
|
||||
server_manager->RegisterNamedService(
|
||||
|
@ -145,6 +145,8 @@ void MiiEdit::MiiEditOutput(MiiEditResult result, s32 index) {
|
||||
.index{index},
|
||||
};
|
||||
|
||||
LOG_INFO(Input, "called, result={}, index={}", result, index);
|
||||
|
||||
std::vector<u8> out_data(sizeof(MiiEditAppletOutput));
|
||||
std::memcpy(out_data.data(), &applet_output, sizeof(MiiEditAppletOutput));
|
||||
|
||||
|
@ -329,6 +329,7 @@ public:
|
||||
{13, &IFileSystem::CleanDirectoryRecursively, "CleanDirectoryRecursively"},
|
||||
{14, &IFileSystem::GetFileTimeStampRaw, "GetFileTimeStampRaw"},
|
||||
{15, nullptr, "QueryEntry"},
|
||||
{16, &IFileSystem::GetFileSystemAttribute, "GetFileSystemAttribute"},
|
||||
};
|
||||
RegisterHandlers(functions);
|
||||
}
|
||||
@ -521,6 +522,46 @@ public:
|
||||
rb.PushRaw(vfs_timestamp);
|
||||
}
|
||||
|
||||
void GetFileSystemAttribute(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_FS, "(STUBBED) called");
|
||||
|
||||
struct FileSystemAttribute {
|
||||
u8 dir_entry_name_length_max_defined;
|
||||
u8 file_entry_name_length_max_defined;
|
||||
u8 dir_path_name_length_max_defined;
|
||||
u8 file_path_name_length_max_defined;
|
||||
INSERT_PADDING_BYTES_NOINIT(0x5);
|
||||
u8 utf16_dir_entry_name_length_max_defined;
|
||||
u8 utf16_file_entry_name_length_max_defined;
|
||||
u8 utf16_dir_path_name_length_max_defined;
|
||||
u8 utf16_file_path_name_length_max_defined;
|
||||
INSERT_PADDING_BYTES_NOINIT(0x18);
|
||||
s32 dir_entry_name_length_max;
|
||||
s32 file_entry_name_length_max;
|
||||
s32 dir_path_name_length_max;
|
||||
s32 file_path_name_length_max;
|
||||
INSERT_PADDING_WORDS_NOINIT(0x5);
|
||||
s32 utf16_dir_entry_name_length_max;
|
||||
s32 utf16_file_entry_name_length_max;
|
||||
s32 utf16_dir_path_name_length_max;
|
||||
s32 utf16_file_path_name_length_max;
|
||||
INSERT_PADDING_WORDS_NOINIT(0x18);
|
||||
INSERT_PADDING_WORDS_NOINIT(0x1);
|
||||
};
|
||||
static_assert(sizeof(FileSystemAttribute) == 0xc0,
|
||||
"FileSystemAttribute has incorrect size");
|
||||
|
||||
FileSystemAttribute savedata_attribute{};
|
||||
savedata_attribute.dir_entry_name_length_max_defined = true;
|
||||
savedata_attribute.file_entry_name_length_max_defined = true;
|
||||
savedata_attribute.dir_entry_name_length_max = 0x40;
|
||||
savedata_attribute.file_entry_name_length_max = 0x40;
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 50};
|
||||
rb.Push(ResultSuccess);
|
||||
rb.PushRaw(savedata_attribute);
|
||||
}
|
||||
|
||||
private:
|
||||
VfsDirectoryServiceWrapper backend;
|
||||
SizeGetter size;
|
||||
|
@ -168,7 +168,7 @@ Result DatabaseManager::FindIndex(s32& out_index, const Common::UUID& create_id,
|
||||
return ResultSuccess;
|
||||
}
|
||||
|
||||
for (std::size_t i = 0; i <= index; ++i) {
|
||||
for (std::size_t i = 0; i < index; ++i) {
|
||||
if (database.Get(i).IsSpecial()) {
|
||||
continue;
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ void CharInfo::SetFromStoreData(const StoreData& store_data) {
|
||||
eyebrow_aspect = store_data.GetEyebrowAspect();
|
||||
eyebrow_rotate = store_data.GetEyebrowRotate();
|
||||
eyebrow_x = store_data.GetEyebrowX();
|
||||
eyebrow_y = store_data.GetEyebrowY();
|
||||
eyebrow_y = store_data.GetEyebrowY() + 3;
|
||||
nose_type = store_data.GetNoseType();
|
||||
nose_scale = store_data.GetNoseScale();
|
||||
nose_y = store_data.GetNoseY();
|
||||
|
@ -113,7 +113,7 @@ void CoreData::BuildRandom(Age age, Gender gender, Race race) {
|
||||
.values[MiiUtil::GetRandomValue<std::size_t>(eyebrow_type_info.values_count)]);
|
||||
|
||||
const auto eyebrow_rotate_1{race == Race::Asian ? 6 : 0};
|
||||
const auto eyebrow_y{race == Race::Asian ? 9 : 10};
|
||||
const auto eyebrow_y{race == Race::Asian ? 6 : 7};
|
||||
const auto eyebrow_rotate_offset{32 - RawData::EyebrowRotateLookup[eyebrow_rotate_1] + 6};
|
||||
const auto eyebrow_rotate{
|
||||
32 - RawData::EyebrowRotateLookup[static_cast<std::size_t>(data.eyebrow_type.Value())]};
|
||||
|
@ -1374,7 +1374,7 @@ NFP::AmiiboName NfcDevice::GetAmiiboName(const NFP::AmiiboSettings& settings) co
|
||||
|
||||
// Convert from utf16 to utf8
|
||||
const auto amiibo_name_utf8 = Common::UTF16ToUTF8(settings_amiibo_name.data());
|
||||
memcpy(amiibo_name.data(), amiibo_name_utf8.data(), amiibo_name_utf8.size() - 1);
|
||||
memcpy(amiibo_name.data(), amiibo_name_utf8.data(), amiibo_name_utf8.size());
|
||||
|
||||
return amiibo_name;
|
||||
}
|
||||
|
@ -1160,7 +1160,7 @@ struct QueryCacheRuntimeImpl {
|
||||
cpu_memory_),
|
||||
primitives_needed_minus_suceeded_streamer(
|
||||
static_cast<size_t>(QueryType::StreamingPrimitivesNeededMinusSucceeded), runtime, 0u),
|
||||
hcr_setup{}, hcr_is_set{}, is_hcr_running{} {
|
||||
hcr_setup{}, hcr_is_set{}, is_hcr_running{}, maxwell3d{} {
|
||||
|
||||
hcr_setup.sType = VK_STRUCTURE_TYPE_CONDITIONAL_RENDERING_BEGIN_INFO_EXT;
|
||||
hcr_setup.pNext = nullptr;
|
||||
@ -1235,7 +1235,9 @@ void QueryCacheRuntime::Bind3DEngine(Maxwell3D* maxwell3d) {
|
||||
|
||||
template <typename Func>
|
||||
void QueryCacheRuntime::View3DRegs(Func&& func) {
|
||||
func(*impl->maxwell3d);
|
||||
if (impl->maxwell3d) {
|
||||
func(*impl->maxwell3d);
|
||||
}
|
||||
}
|
||||
|
||||
void QueryCacheRuntime::EndHostConditionalRendering() {
|
||||
|
@ -1014,15 +1014,37 @@ void RasterizerVulkan::UpdateDepthBias(Tegra::Engines::Maxwell3D::Regs& regs) {
|
||||
regs.zeta.format == Tegra::DepthFormat::X8Z24_UNORM ||
|
||||
regs.zeta.format == Tegra::DepthFormat::S8Z24_UNORM ||
|
||||
regs.zeta.format == Tegra::DepthFormat::V8Z24_UNORM;
|
||||
if (is_d24 && !device.SupportsD24DepthBuffer()) {
|
||||
bool force_unorm = ([&] {
|
||||
if (!is_d24 || device.SupportsD24DepthBuffer()) {
|
||||
return false;
|
||||
}
|
||||
if (device.IsExtDepthBiasControlSupported()) {
|
||||
return true;
|
||||
}
|
||||
if (!Settings::values.renderer_amdvlk_depth_bias_workaround) {
|
||||
return false;
|
||||
}
|
||||
// the base formulas can be obtained from here:
|
||||
// https://docs.microsoft.com/en-us/windows/win32/direct3d11/d3d10-graphics-programming-guide-output-merger-stage-depth-bias
|
||||
const double rescale_factor =
|
||||
static_cast<double>(1ULL << (32 - 24)) / (static_cast<double>(0x1.ep+127));
|
||||
units = static_cast<float>(static_cast<double>(units) * rescale_factor);
|
||||
}
|
||||
return false;
|
||||
})();
|
||||
scheduler.Record([constant = units, clamp = regs.depth_bias_clamp,
|
||||
factor = regs.slope_scale_depth_bias](vk::CommandBuffer cmdbuf) {
|
||||
factor = regs.slope_scale_depth_bias, force_unorm,
|
||||
precise = device.HasExactDepthBiasControl()](vk::CommandBuffer cmdbuf) {
|
||||
if (force_unorm) {
|
||||
VkDepthBiasRepresentationInfoEXT info{
|
||||
.sType = VK_STRUCTURE_TYPE_DEPTH_BIAS_REPRESENTATION_INFO_EXT,
|
||||
.pNext = nullptr,
|
||||
.depthBiasRepresentation =
|
||||
VK_DEPTH_BIAS_REPRESENTATION_LEAST_REPRESENTABLE_VALUE_FORCE_UNORM_EXT,
|
||||
.depthBiasExact = precise ? VK_TRUE : VK_FALSE,
|
||||
};
|
||||
cmdbuf.SetDepthBias(constant, clamp, factor, &info);
|
||||
return;
|
||||
}
|
||||
cmdbuf.SetDepthBias(constant, clamp, factor);
|
||||
});
|
||||
}
|
||||
|
@ -1059,6 +1059,13 @@ void Device::RemoveUnsuitableExtensions() {
|
||||
RemoveExtensionFeatureIfUnsuitable(extensions.custom_border_color, features.custom_border_color,
|
||||
VK_EXT_CUSTOM_BORDER_COLOR_EXTENSION_NAME);
|
||||
|
||||
// VK_EXT_depth_bias_control
|
||||
extensions.depth_bias_control =
|
||||
features.depth_bias_control.depthBiasControl &&
|
||||
features.depth_bias_control.leastRepresentableValueForceUnormRepresentation;
|
||||
RemoveExtensionFeatureIfUnsuitable(extensions.depth_bias_control, features.depth_bias_control,
|
||||
VK_EXT_DEPTH_BIAS_CONTROL_EXTENSION_NAME);
|
||||
|
||||
// VK_EXT_depth_clip_control
|
||||
extensions.depth_clip_control = features.depth_clip_control.depthClipControl;
|
||||
RemoveExtensionFeatureIfUnsuitable(extensions.depth_clip_control, features.depth_clip_control,
|
||||
|
@ -41,6 +41,7 @@ VK_DEFINE_HANDLE(VmaAllocator)
|
||||
// Define all features which may be used by the implementation and require an extension here.
|
||||
#define FOR_EACH_VK_FEATURE_EXT(FEATURE) \
|
||||
FEATURE(EXT, CustomBorderColor, CUSTOM_BORDER_COLOR, custom_border_color) \
|
||||
FEATURE(EXT, DepthBiasControl, DEPTH_BIAS_CONTROL, depth_bias_control) \
|
||||
FEATURE(EXT, DepthClipControl, DEPTH_CLIP_CONTROL, depth_clip_control) \
|
||||
FEATURE(EXT, ExtendedDynamicState, EXTENDED_DYNAMIC_STATE, extended_dynamic_state) \
|
||||
FEATURE(EXT, ExtendedDynamicState2, EXTENDED_DYNAMIC_STATE_2, extended_dynamic_state2) \
|
||||
@ -96,6 +97,7 @@ VK_DEFINE_HANDLE(VmaAllocator)
|
||||
#define FOR_EACH_VK_RECOMMENDED_EXTENSION(EXTENSION_NAME) \
|
||||
EXTENSION_NAME(VK_EXT_CONDITIONAL_RENDERING_EXTENSION_NAME) \
|
||||
EXTENSION_NAME(VK_EXT_CONSERVATIVE_RASTERIZATION_EXTENSION_NAME) \
|
||||
EXTENSION_NAME(VK_EXT_DEPTH_BIAS_CONTROL_EXTENSION_NAME) \
|
||||
EXTENSION_NAME(VK_EXT_DEPTH_RANGE_UNRESTRICTED_EXTENSION_NAME) \
|
||||
EXTENSION_NAME(VK_EXT_EXTENDED_DYNAMIC_STATE_EXTENSION_NAME) \
|
||||
EXTENSION_NAME(VK_EXT_EXTENDED_DYNAMIC_STATE_2_EXTENSION_NAME) \
|
||||
@ -147,6 +149,9 @@ VK_DEFINE_HANDLE(VmaAllocator)
|
||||
// Define features where the absence of the feature may result in a degraded experience.
|
||||
#define FOR_EACH_VK_RECOMMENDED_FEATURE(FEATURE_NAME) \
|
||||
FEATURE_NAME(custom_border_color, customBorderColors) \
|
||||
FEATURE_NAME(depth_bias_control, depthBiasControl) \
|
||||
FEATURE_NAME(depth_bias_control, leastRepresentableValueForceUnormRepresentation) \
|
||||
FEATURE_NAME(depth_bias_control, depthBiasExact) \
|
||||
FEATURE_NAME(extended_dynamic_state, extendedDynamicState) \
|
||||
FEATURE_NAME(format_a4b4g4r4, formatA4B4G4R4) \
|
||||
FEATURE_NAME(index_type_uint8, indexTypeUint8) \
|
||||
@ -464,6 +469,11 @@ public:
|
||||
return extensions.depth_clip_control;
|
||||
}
|
||||
|
||||
/// Returns true if the device supports VK_EXT_depth_bias_control.
|
||||
bool IsExtDepthBiasControlSupported() const {
|
||||
return extensions.depth_bias_control;
|
||||
}
|
||||
|
||||
/// Returns true if the device supports VK_EXT_shader_viewport_index_layer.
|
||||
bool IsExtShaderViewportIndexLayerSupported() const {
|
||||
return extensions.shader_viewport_index_layer;
|
||||
@ -624,6 +634,10 @@ public:
|
||||
return features.robustness2.nullDescriptor;
|
||||
}
|
||||
|
||||
bool HasExactDepthBiasControl() const {
|
||||
return features.depth_bias_control.depthBiasExact;
|
||||
}
|
||||
|
||||
u32 GetMaxVertexInputAttributes() const {
|
||||
return properties.properties.limits.maxVertexInputAttributes;
|
||||
}
|
||||
|
@ -113,6 +113,7 @@ void Load(VkDevice device, DeviceDispatch& dld) noexcept {
|
||||
X(vkCmdPushDescriptorSetWithTemplateKHR);
|
||||
X(vkCmdSetBlendConstants);
|
||||
X(vkCmdSetDepthBias);
|
||||
X(vkCmdSetDepthBias2EXT);
|
||||
X(vkCmdSetDepthBounds);
|
||||
X(vkCmdSetEvent);
|
||||
X(vkCmdSetScissor);
|
||||
|
@ -226,6 +226,7 @@ struct DeviceDispatch : InstanceDispatch {
|
||||
PFN_vkCmdSetBlendConstants vkCmdSetBlendConstants{};
|
||||
PFN_vkCmdSetCullModeEXT vkCmdSetCullModeEXT{};
|
||||
PFN_vkCmdSetDepthBias vkCmdSetDepthBias{};
|
||||
PFN_vkCmdSetDepthBias2EXT vkCmdSetDepthBias2EXT{};
|
||||
PFN_vkCmdSetDepthBounds vkCmdSetDepthBounds{};
|
||||
PFN_vkCmdSetDepthBoundsTestEnableEXT vkCmdSetDepthBoundsTestEnableEXT{};
|
||||
PFN_vkCmdSetDepthCompareOpEXT vkCmdSetDepthCompareOpEXT{};
|
||||
@ -1333,6 +1334,18 @@ public:
|
||||
dld->vkCmdSetDepthBias(handle, constant_factor, clamp, slope_factor);
|
||||
}
|
||||
|
||||
void SetDepthBias(float constant_factor, float clamp, float slope_factor,
|
||||
VkDepthBiasRepresentationInfoEXT* extra) const noexcept {
|
||||
VkDepthBiasInfoEXT info{
|
||||
.sType = VK_STRUCTURE_TYPE_DEPTH_BIAS_INFO_EXT,
|
||||
.pNext = extra,
|
||||
.depthBiasConstantFactor = constant_factor,
|
||||
.depthBiasClamp = clamp,
|
||||
.depthBiasSlopeFactor = slope_factor,
|
||||
};
|
||||
dld->vkCmdSetDepthBias2EXT(handle, &info);
|
||||
}
|
||||
|
||||
void SetDepthBounds(float min_depth_bounds, float max_depth_bounds) const noexcept {
|
||||
dld->vkCmdSetDepthBounds(handle, min_depth_bounds, max_depth_bounds);
|
||||
}
|
||||
|
@ -3113,10 +3113,9 @@ void GMainWindow::OnMenuInstallToNAND() {
|
||||
QFuture<InstallResult> future;
|
||||
InstallResult result;
|
||||
|
||||
if (file.endsWith(QStringLiteral("xci"), Qt::CaseInsensitive) ||
|
||||
file.endsWith(QStringLiteral("nsp"), Qt::CaseInsensitive)) {
|
||||
if (file.endsWith(QStringLiteral("nsp"), Qt::CaseInsensitive)) {
|
||||
|
||||
future = QtConcurrent::run([this, &file] { return InstallNSPXCI(file); });
|
||||
future = QtConcurrent::run([this, &file] { return InstallNSP(file); });
|
||||
|
||||
while (!future.isFinished()) {
|
||||
QCoreApplication::processEvents();
|
||||
@ -3175,7 +3174,7 @@ void GMainWindow::OnMenuInstallToNAND() {
|
||||
ui->action_Install_File_NAND->setEnabled(true);
|
||||
}
|
||||
|
||||
InstallResult GMainWindow::InstallNSPXCI(const QString& filename) {
|
||||
InstallResult GMainWindow::InstallNSP(const QString& filename) {
|
||||
const auto qt_raw_copy = [this](const FileSys::VirtualFile& src,
|
||||
const FileSys::VirtualFile& dest, std::size_t block_size) {
|
||||
if (src == nullptr || dest == nullptr) {
|
||||
@ -3209,9 +3208,7 @@ InstallResult GMainWindow::InstallNSPXCI(const QString& filename) {
|
||||
return InstallResult::Failure;
|
||||
}
|
||||
} else {
|
||||
const auto xci = std::make_shared<FileSys::XCI>(
|
||||
vfs->OpenFile(filename.toStdString(), FileSys::Mode::Read));
|
||||
nsp = xci->GetSecurePartitionNSP();
|
||||
return InstallResult::Failure;
|
||||
}
|
||||
|
||||
if (nsp->GetStatus() != Loader::ResultStatus::Success) {
|
||||
|
@ -387,7 +387,7 @@ private:
|
||||
void RemoveCacheStorage(u64 program_id);
|
||||
bool SelectRomFSDumpTarget(const FileSys::ContentProvider&, u64 program_id,
|
||||
u64* selected_title_id, u8* selected_content_record_type);
|
||||
InstallResult InstallNSPXCI(const QString& filename);
|
||||
InstallResult InstallNSP(const QString& filename);
|
||||
InstallResult InstallNCA(const QString& filename);
|
||||
void MigrateConfigFiles();
|
||||
void UpdateWindowTitle(std::string_view title_name = {}, std::string_view title_version = {},
|
||||
|
@ -12,6 +12,7 @@
|
||||
"boost-context",
|
||||
"boost-crc",
|
||||
"boost-functional",
|
||||
"boost-heap",
|
||||
"boost-icl",
|
||||
"boost-intrusive",
|
||||
"boost-mpl",
|
||||
|
Reference in New Issue
Block a user