diff options
author | bunnei <bunneidev@gmail.com> | 2020-10-27 07:02:42 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-27 07:02:42 +0100 |
commit | d33399e1f46a10490b586196c6d0db0f04be4206 (patch) | |
tree | 8b2e1d98bf832049936ab931fc3a120e70bc36c2 /src/video_core/command_classes/host1x.cpp | |
parent | Merge pull request #4832 from bunnei/cpu-manager-microprofile-fix (diff) | |
parent | video_core: NVDEC Implementation (diff) | |
download | yuzu-d33399e1f46a10490b586196c6d0db0f04be4206.tar yuzu-d33399e1f46a10490b586196c6d0db0f04be4206.tar.gz yuzu-d33399e1f46a10490b586196c6d0db0f04be4206.tar.bz2 yuzu-d33399e1f46a10490b586196c6d0db0f04be4206.tar.lz yuzu-d33399e1f46a10490b586196c6d0db0f04be4206.tar.xz yuzu-d33399e1f46a10490b586196c6d0db0f04be4206.tar.zst yuzu-d33399e1f46a10490b586196c6d0db0f04be4206.zip |
Diffstat (limited to 'src/video_core/command_classes/host1x.cpp')
-rw-r--r-- | src/video_core/command_classes/host1x.cpp | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/video_core/command_classes/host1x.cpp b/src/video_core/command_classes/host1x.cpp new file mode 100644 index 000000000..a5234ee47 --- /dev/null +++ b/src/video_core/command_classes/host1x.cpp @@ -0,0 +1,39 @@ +// Copyright 2020 yuzu Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#include "common/assert.h" +#include "video_core/command_classes/host1x.h" +#include "video_core/gpu.h" + +Tegra::Host1x::Host1x(GPU& gpu_) : gpu(gpu_) {} + +Tegra::Host1x::~Host1x() = default; + +void Tegra::Host1x::StateWrite(u32 offset, u32 arguments) { + u8* const state_offset = reinterpret_cast<u8*>(&state) + offset * sizeof(u32); + std::memcpy(state_offset, &arguments, sizeof(u32)); +} + +void Tegra::Host1x::ProcessMethod(Host1x::Method method, const std::vector<u32>& arguments) { + StateWrite(static_cast<u32>(method), arguments[0]); + switch (method) { + case Method::WaitSyncpt: + Execute(arguments[0]); + break; + case Method::LoadSyncptPayload32: + syncpoint_value = arguments[0]; + break; + case Method::WaitSyncpt32: + Execute(arguments[0]); + break; + default: + UNIMPLEMENTED_MSG("Host1x method 0x{:X}", static_cast<u32>(method)); + break; + } +} + +void Tegra::Host1x::Execute(u32 data) { + // This method waits on a valid syncpoint. + // TODO: Implement when proper Async is in place +} |