diff options
| author | 2020-11-23 15:01:40 -0500 | |
|---|---|---|
| committer | 2021-02-13 13:07:56 -0500 | |
| commit | 09722cb4a7cafbce7201254c9132156e947d9eca (patch) | |
| tree | 3ee8db6dc32e4549185bb4d314c5ec5497d6bc64 /src | |
| parent | streamline cdma_pusher/command_classes (diff) | |
| download | yuzu-09722cb4a7cafbce7201254c9132156e947d9eca.tar.gz yuzu-09722cb4a7cafbce7201254c9132156e947d9eca.tar.xz yuzu-09722cb4a7cafbce7201254c9132156e947d9eca.zip | |
streamline cdma_pusher/command_classes
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/command_classes/vic.cpp | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/src/video_core/command_classes/vic.cpp b/src/video_core/command_classes/vic.cpp index 73680d057..564f9c1e8 100644 --- a/src/video_core/command_classes/vic.cpp +++ b/src/video_core/command_classes/vic.cpp | |||
| @@ -19,20 +19,13 @@ namespace Tegra { | |||
| 19 | 19 | ||
| 20 | Vic::Vic(GPU& gpu_, std::shared_ptr<Nvdec> nvdec_processor_) | 20 | Vic::Vic(GPU& gpu_, std::shared_ptr<Nvdec> nvdec_processor_) |
| 21 | : gpu(gpu_), | 21 | : gpu(gpu_), |
| 22 | nvdec_processor(std::move(nvdec_processor_)), converted_frame_buffer{nullptr, av_free} | 22 | nvdec_processor(std::move(nvdec_processor_)), converted_frame_buffer{nullptr, av_free} {} |
| 23 | 23 | ||
| 24 | {} | ||
| 25 | Vic::~Vic() = default; | 24 | Vic::~Vic() = default; |
| 26 | 25 | ||
| 27 | void Vic::VicStateWrite(u32 offset, u32 arguments) { | 26 | void Vic::ProcessMethod(Method method, u32 argument) { |
| 28 | u8* const state_offset = reinterpret_cast<u8*>(&vic_state) + offset * sizeof(u32); | 27 | LOG_DEBUG(HW_GPU, "Vic method 0x{:X}", static_cast<u32>(method)); |
| 29 | std::memcpy(state_offset, &arguments, sizeof(u32)); | 28 | const u64 arg = static_cast<u64>(argument) << 8; |
| 30 | } | ||
| 31 | |||
| 32 | void Vic::ProcessMethod(Method method, const std::vector<u32>& arguments) { | ||
| 33 | LOG_DEBUG(HW_GPU, "Vic method 0x{:X}", method); | ||
| 34 | VicStateWrite(static_cast<u32>(method), arguments[0]); | ||
| 35 | const u64 arg = static_cast<u64>(arguments[0]) << 8; | ||
| 36 | switch (method) { | 29 | switch (method) { |
| 37 | case Method::Execute: | 30 | case Method::Execute: |
| 38 | Execute(); | 31 | Execute(); |
| @@ -56,8 +49,7 @@ void Vic::ProcessMethod(Method method, const std::vector<u32>& arguments) { | |||
| 56 | 49 | ||
| 57 | void Vic::Execute() { | 50 | void Vic::Execute() { |
| 58 | if (output_surface_luma_address == 0) { | 51 | if (output_surface_luma_address == 0) { |
| 59 | LOG_ERROR(Service_NVDRV, "VIC Luma address not set. Received 0x{:X}", | 52 | LOG_ERROR(Service_NVDRV, "VIC Luma address not set."); |
| 60 | vic_state.output_surface.luma_offset); | ||
| 61 | return; | 53 | return; |
| 62 | } | 54 | } |
| 63 | const VicConfig config{gpu.MemoryManager().Read<u64>(config_struct_address + 0x20)}; | 55 | const VicConfig config{gpu.MemoryManager().Read<u64>(config_struct_address + 0x20)}; |