summaryrefslogtreecommitdiffstats
path: root/src/video_core/command_classes
diff options
context:
space:
mode:
authorameerj <52414509+ameerj@users.noreply.github.com>2021-10-07 17:06:57 +0200
committerameerj <52414509+ameerj@users.noreply.github.com>2021-10-07 17:06:57 +0200
commit899fdb9c44b0d7c59c30c44963369c92bdc83d23 (patch)
tree7ea185d3b6eed14a2e15cc3e969472dc4278b3b3 /src/video_core/command_classes
parentMerge pull request #7118 from ameerj/vc-gpu-impl (diff)
downloadyuzu-899fdb9c44b0d7c59c30c44963369c92bdc83d23.tar
yuzu-899fdb9c44b0d7c59c30c44963369c92bdc83d23.tar.gz
yuzu-899fdb9c44b0d7c59c30c44963369c92bdc83d23.tar.bz2
yuzu-899fdb9c44b0d7c59c30c44963369c92bdc83d23.tar.lz
yuzu-899fdb9c44b0d7c59c30c44963369c92bdc83d23.tar.xz
yuzu-899fdb9c44b0d7c59c30c44963369c92bdc83d23.tar.zst
yuzu-899fdb9c44b0d7c59c30c44963369c92bdc83d23.zip
Diffstat (limited to 'src/video_core/command_classes')
-rw-r--r--src/video_core/command_classes/vic.cpp17
-rw-r--r--src/video_core/command_classes/vic.h1
2 files changed, 15 insertions, 3 deletions
diff --git a/src/video_core/command_classes/vic.cpp b/src/video_core/command_classes/vic.cpp
index 0ee07f398..d77eb0c85 100644
--- a/src/video_core/command_classes/vic.cpp
+++ b/src/video_core/command_classes/vic.cpp
@@ -68,13 +68,24 @@ void Vic::Execute() {
const auto pixel_format = static_cast<VideoPixelFormat>(config.pixel_format.Value());
switch (pixel_format) {
case VideoPixelFormat::BGRA8:
+ case VideoPixelFormat::RGBX8:
case VideoPixelFormat::RGBA8: {
LOG_TRACE(Service_NVDRV, "Writing RGB Frame");
if (scaler_ctx == nullptr || frame->width != scaler_width ||
frame->height != scaler_height) {
- const AVPixelFormat target_format =
- (pixel_format == VideoPixelFormat::RGBA8) ? AV_PIX_FMT_RGBA : AV_PIX_FMT_BGRA;
+ const AVPixelFormat target_format = [pixel_format]() {
+ switch (pixel_format) {
+ case VideoPixelFormat::BGRA8:
+ return AV_PIX_FMT_BGRA;
+ case VideoPixelFormat::RGBX8:
+ return AV_PIX_FMT_RGB0;
+ case VideoPixelFormat::RGBA8:
+ return AV_PIX_FMT_RGBA;
+ default:
+ return AV_PIX_FMT_RGBA;
+ }
+ }();
sws_freeContext(scaler_ctx);
scaler_ctx = nullptr;
@@ -190,7 +201,7 @@ void Vic::Execute() {
break;
}
default:
- UNIMPLEMENTED_MSG("Unknown video pixel format {}", config.pixel_format.Value());
+ UNIMPLEMENTED_MSG("Unknown video pixel format {:X}", config.pixel_format.Value());
break;
}
}
diff --git a/src/video_core/command_classes/vic.h b/src/video_core/command_classes/vic.h
index 74246e08c..ea10c2f0f 100644
--- a/src/video_core/command_classes/vic.h
+++ b/src/video_core/command_classes/vic.h
@@ -38,6 +38,7 @@ private:
enum class VideoPixelFormat : u64_le {
RGBA8 = 0x1f,
BGRA8 = 0x20,
+ RGBX8 = 0x23,
Yuv420 = 0x44,
};