summaryrefslogtreecommitdiff
path: root/src/video_core/gpu_thread.h
diff options
context:
space:
mode:
authorGravatar ameerj2020-10-26 23:07:36 -0400
committerGravatar ameerj2020-10-26 23:07:36 -0400
commiteb67a45ca82bc01ac843c853fd3c17f2a90e0250 (patch)
tree11e78a1b728ef0a608fae43d966b613eb4e6d58a /src/video_core/gpu_thread.h
parentMerge pull request #4827 from lioncash/trunc (diff)
downloadyuzu-eb67a45ca82bc01ac843c853fd3c17f2a90e0250.tar.gz
yuzu-eb67a45ca82bc01ac843c853fd3c17f2a90e0250.tar.xz
yuzu-eb67a45ca82bc01ac843c853fd3c17f2a90e0250.zip
video_core: NVDEC Implementation
This commit aims to implement the NVDEC (Nvidia Decoder) functionality, with video frame decoding being handled by the FFmpeg library. The process begins with Ioctl commands being sent to the NVDEC and VIC (Video Image Composer) emulated devices. These allocate the necessary GPU buffers for the frame data, along with providing information on the incoming video data. A Submit command then signals the GPU to process and decode the frame data. To decode the frame, the respective codec's header must be manually composed from the information provided by NVDEC, then sent with the raw frame data to the ffmpeg library. Currently, H264 and VP9 are supported, with VP9 having some minor artifacting issues related mainly to the reference frame composition in its uncompressed header. Async GPU is not properly implemented at the moment. Co-Authored-By: David <25727384+ogniK5377@users.noreply.github.com>
Diffstat (limited to 'src/video_core/gpu_thread.h')
-rw-r--r--src/video_core/gpu_thread.h19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/video_core/gpu_thread.h b/src/video_core/gpu_thread.h
index 5a28335d6..32a34e3a7 100644
--- a/src/video_core/gpu_thread.h
+++ b/src/video_core/gpu_thread.h
@@ -37,6 +37,14 @@ struct SubmitListCommand final {
37 Tegra::CommandList entries; 37 Tegra::CommandList entries;
38}; 38};
39 39
40/// Command to signal to the GPU thread that a cdma command list is ready for processing
41struct SubmitChCommandEntries final {
42 explicit SubmitChCommandEntries(Tegra::ChCommandHeaderList&& entries)
43 : entries{std::move(entries)} {}
44
45 Tegra::ChCommandHeaderList entries;
46};
47
40/// Command to signal to the GPU thread that a swap buffers is pending 48/// Command to signal to the GPU thread that a swap buffers is pending
41struct SwapBuffersCommand final { 49struct SwapBuffersCommand final {
42 explicit SwapBuffersCommand(std::optional<const Tegra::FramebufferConfig> framebuffer) 50 explicit SwapBuffersCommand(std::optional<const Tegra::FramebufferConfig> framebuffer)
@@ -77,9 +85,9 @@ struct OnCommandListEndCommand final {};
77struct GPUTickCommand final {}; 85struct GPUTickCommand final {};
78 86
79using CommandData = 87using CommandData =
80 std::variant<EndProcessingCommand, SubmitListCommand, SwapBuffersCommand, FlushRegionCommand, 88 std::variant<EndProcessingCommand, SubmitListCommand, SubmitChCommandEntries,
81 InvalidateRegionCommand, FlushAndInvalidateRegionCommand, OnCommandListEndCommand, 89 SwapBuffersCommand, FlushRegionCommand, InvalidateRegionCommand,
82 GPUTickCommand>; 90 FlushAndInvalidateRegionCommand, OnCommandListEndCommand, GPUTickCommand>;
83 91
84struct CommandDataContainer { 92struct CommandDataContainer {
85 CommandDataContainer() = default; 93 CommandDataContainer() = default;
@@ -109,11 +117,14 @@ public:
109 117
110 /// Creates and starts the GPU thread. 118 /// Creates and starts the GPU thread.
111 void StartThread(VideoCore::RendererBase& renderer, Core::Frontend::GraphicsContext& context, 119 void StartThread(VideoCore::RendererBase& renderer, Core::Frontend::GraphicsContext& context,
112 Tegra::DmaPusher& dma_pusher); 120 Tegra::DmaPusher& dma_pusher, Tegra::CDmaPusher& cdma_pusher);
113 121
114 /// Push GPU command entries to be processed 122 /// Push GPU command entries to be processed
115 void SubmitList(Tegra::CommandList&& entries); 123 void SubmitList(Tegra::CommandList&& entries);
116 124
125 /// Push GPU CDMA command buffer entries to be processed
126 void SubmitCommandBuffer(Tegra::ChCommandHeaderList&& entries);
127
117 /// Swap buffers (render frame) 128 /// Swap buffers (render frame)
118 void SwapBuffers(const Tegra::FramebufferConfig* framebuffer); 129 void SwapBuffers(const Tegra::FramebufferConfig* framebuffer);
119 130