early-access version 4123
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project
|
||||
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "common/assert.h"
|
||||
@@ -40,7 +40,8 @@ void Decoder::Decode() {
|
||||
auto frame_copy = frame;
|
||||
|
||||
if (!frame.get()) {
|
||||
LOG_ERROR(HW_GPU, "Failed to decode interlaced frame for top 0x{:X} bottom 0x{:X}",
|
||||
LOG_ERROR(HW_GPU,
|
||||
"Nvdec {} dailed to decode interlaced frame for top 0x{:X} bottom 0x{:X}", id,
|
||||
luma_top, luma_bottom);
|
||||
}
|
||||
|
||||
@@ -55,7 +56,8 @@ void Decoder::Decode() {
|
||||
auto [luma_offset, chroma_offset] = GetProgressiveOffsets();
|
||||
|
||||
if (!frame.get()) {
|
||||
LOG_ERROR(HW_GPU, "Failed to decode progressive frame for luma 0x{:X}", luma_offset);
|
||||
LOG_ERROR(HW_GPU, "Nvdec {} failed to decode progressive frame for luma 0x{:X}", id,
|
||||
luma_offset);
|
||||
}
|
||||
|
||||
if (UsingDecodeOrder()) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project
|
||||
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// SPDX-FileCopyrightText: Ryujinx Team and Contributors
|
||||
// SPDX-License-Identifier: MIT
|
||||
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include <array>
|
||||
#include <bit>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// SPDX-FileCopyrightText: Ryujinx Team and Contributors
|
||||
// SPDX-License-Identifier: MIT
|
||||
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
@@ -66,12 +66,18 @@ public:
|
||||
void PushPresentOrder(s32 fd, u64 offset, std::shared_ptr<FFmpeg::Frame>&& frame) {
|
||||
std::scoped_lock l{m_mutex};
|
||||
auto map = m_presentation_order.find(fd);
|
||||
if (map == m_presentation_order.end()) {
|
||||
return;
|
||||
}
|
||||
map->second.emplace_back(offset, std::move(frame));
|
||||
}
|
||||
|
||||
void PushDecodeOrder(s32 fd, u64 offset, std::shared_ptr<FFmpeg::Frame>&& frame) {
|
||||
std::scoped_lock l{m_mutex};
|
||||
auto map = m_decode_order.find(fd);
|
||||
if (map == m_decode_order.end()) {
|
||||
return;
|
||||
}
|
||||
map->second.insert_or_assign(offset, std::move(frame));
|
||||
}
|
||||
|
||||
@@ -82,12 +88,12 @@ public:
|
||||
|
||||
std::scoped_lock l{m_mutex};
|
||||
auto present_map = m_presentation_order.find(fd);
|
||||
if (present_map->second.size() > 0) {
|
||||
if (present_map != m_presentation_order.end() && present_map->second.size() > 0) {
|
||||
return GetPresentOrderLocked(fd);
|
||||
}
|
||||
|
||||
auto decode_map = m_decode_order.find(fd);
|
||||
if (decode_map->second.size() > 0) {
|
||||
if (decode_map != m_decode_order.end() && decode_map->second.size() > 0) {
|
||||
return GetDecodeOrderLocked(fd, offset);
|
||||
}
|
||||
|
||||
@@ -97,7 +103,7 @@ public:
|
||||
private:
|
||||
std::shared_ptr<FFmpeg::Frame> GetPresentOrderLocked(s32 fd) {
|
||||
auto map = m_presentation_order.find(fd);
|
||||
if (map->second.size() == 0) {
|
||||
if (map == m_presentation_order.end() || map->second.size() == 0) {
|
||||
return {};
|
||||
}
|
||||
auto frame = std::move(map->second.front().second);
|
||||
@@ -107,6 +113,9 @@ private:
|
||||
|
||||
std::shared_ptr<FFmpeg::Frame> GetDecodeOrderLocked(s32 fd, u64 offset) {
|
||||
auto map = m_decode_order.find(fd);
|
||||
if (map == m_decode_order.end() || map->second.size() == 0) {
|
||||
return {};
|
||||
}
|
||||
auto it = map->second.find(offset);
|
||||
if (it == map->second.end()) {
|
||||
return {};
|
||||
|
||||
@@ -24,7 +24,6 @@ Nvdec::Nvdec(Host1x& host1x_, s32 id_, u32 syncpt, FrameQueue& frame_queue_)
|
||||
|
||||
Nvdec::~Nvdec() {
|
||||
LOG_INFO(HW_GPU, "Destroying nvdec {}", id);
|
||||
frame_queue.Close(id);
|
||||
}
|
||||
|
||||
void Nvdec::ProcessMethod(u32 method, u32 argument) {
|
||||
|
||||
@@ -100,10 +100,11 @@ Vic::Vic(Host1x& host1x_, s32 id_, u32 syncpt, FrameQueue& frame_queue_)
|
||||
|
||||
Vic::~Vic() {
|
||||
LOG_INFO(HW_GPU, "Destroying vic {}", id);
|
||||
frame_queue.Close(id);
|
||||
}
|
||||
|
||||
void Vic::ProcessMethod(u32 method, u32 arg) {
|
||||
LOG_TRACE(HW_GPU, "Vic method 0x{:X}", static_cast<u32>(method));
|
||||
LOG_TRACE(HW_GPU, "Vic {} method 0x{:X}", id, static_cast<u32>(method));
|
||||
regs.reg_array[method] = arg;
|
||||
|
||||
switch (static_cast<Method>(method * sizeof(u32))) {
|
||||
@@ -140,7 +141,7 @@ void Vic::Execute() {
|
||||
|
||||
auto frame = frame_queue.GetFrame(nvdec_id, luma_offset);
|
||||
if (!frame.get()) {
|
||||
LOG_ERROR(HW_GPU, "Vic failed to get frame with offset 0x{:X}", luma_offset);
|
||||
LOG_ERROR(HW_GPU, "Vic {} failed to get frame with offset 0x{:X}", id, luma_offset);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user