summaryrefslogtreecommitdiff
path: root/src/video_core/command_classes
diff options
context:
space:
mode:
authorGravatar ameerj2021-08-08 16:56:40 -0400
committerGravatar ameerj2021-08-16 14:40:53 -0400
commitcd016d3cb5191b9f4f2756e440a6aa67e577c414 (patch)
treee96e08167a350f05feb9c081950be305612d9113 /src/video_core/command_classes
parentcodec: Improve libav memory alloc and cleanup (diff)
downloadyuzu-cd016d3cb5191b9f4f2756e440a6aa67e577c414.tar.gz
yuzu-cd016d3cb5191b9f4f2756e440a6aa67e577c414.tar.xz
yuzu-cd016d3cb5191b9f4f2756e440a6aa67e577c414.zip
configure_graphics: Add GPU nvdec decoding as an option
Some system configurations may see visual regressions or lower performance using GPU decoding compared to CPU decoding. This setting provides the option for users to specify their decoding preference. Co-Authored-By: yzct12345 <87620833+yzct12345@users.noreply.github.com>
Diffstat (limited to 'src/video_core/command_classes')
-rw-r--r--src/video_core/command_classes/codecs/codec.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/video_core/command_classes/codecs/codec.cpp b/src/video_core/command_classes/codecs/codec.cpp
index 18aa40ca3..61966cbfe 100644
--- a/src/video_core/command_classes/codecs/codec.cpp
+++ b/src/video_core/command_classes/codecs/codec.cpp
@@ -5,6 +5,7 @@
5#include <fstream> 5#include <fstream>
6#include <vector> 6#include <vector>
7#include "common/assert.h" 7#include "common/assert.h"
8#include "common/settings.h"
8#include "video_core/command_classes/codecs/codec.h" 9#include "video_core/command_classes/codecs/codec.h"
9#include "video_core/command_classes/codecs/h264.h" 10#include "video_core/command_classes/codecs/h264.h"
10#include "video_core/command_classes/codecs/vp9.h" 11#include "video_core/command_classes/codecs/vp9.h"
@@ -142,8 +143,11 @@ void Codec::Initialize() {
142 } 143 }
143 }(); 144 }();
144 av_codec = avcodec_find_decoder(codec); 145 av_codec = avcodec_find_decoder(codec);
146
145 InitializeAvCodecContext(); 147 InitializeAvCodecContext();
146 InitializeGpuDecoder(); 148 if (Settings::values.nvdec_emulation.GetValue() == Settings::NvdecEmulation::GPU) {
149 InitializeGpuDecoder();
150 }
147 if (const int res = avcodec_open2(av_codec_ctx, av_codec, nullptr); res < 0) { 151 if (const int res = avcodec_open2(av_codec_ctx, av_codec, nullptr); res < 0) {
148 LOG_ERROR(Service_NVDRV, "avcodec_open2() Failed with result {}", res); 152 LOG_ERROR(Service_NVDRV, "avcodec_open2() Failed with result {}", res);
149 avcodec_free_context(&av_codec_ctx); 153 avcodec_free_context(&av_codec_ctx);