summaryrefslogtreecommitdiffstats
path: root/src/video_core
diff options
context:
space:
mode:
authorameerj <52414509+ameerj@users.noreply.github.com>2021-01-07 21:56:15 +0100
committerameerj <52414509+ameerj@users.noreply.github.com>2021-02-13 19:07:56 +0100
commitb675c44e494976cf8164203fc826b54e2fac467b (patch)
tree68880d4617e87048fd1c325ed05dc26b434396cf /src/video_core
parentAddress PR feedback (diff)
downloadyuzu-b675c44e494976cf8164203fc826b54e2fac467b.tar
yuzu-b675c44e494976cf8164203fc826b54e2fac467b.tar.gz
yuzu-b675c44e494976cf8164203fc826b54e2fac467b.tar.bz2
yuzu-b675c44e494976cf8164203fc826b54e2fac467b.tar.lz
yuzu-b675c44e494976cf8164203fc826b54e2fac467b.tar.xz
yuzu-b675c44e494976cf8164203fc826b54e2fac467b.tar.zst
yuzu-b675c44e494976cf8164203fc826b54e2fac467b.zip
Diffstat (limited to 'src/video_core')
-rw-r--r--src/video_core/cdma_pusher.cpp6
-rw-r--r--src/video_core/command_classes/vic.cpp10
-rw-r--r--src/video_core/gpu.cpp3
-rw-r--r--src/video_core/gpu_thread.cpp2
4 files changed, 10 insertions, 11 deletions
diff --git a/src/video_core/cdma_pusher.cpp b/src/video_core/cdma_pusher.cpp
index e1f00c4da..a3fda1094 100644
--- a/src/video_core/cdma_pusher.cpp
+++ b/src/video_core/cdma_pusher.cpp
@@ -145,9 +145,9 @@ void CDmaPusher::ExecuteCommand(u32 state_offset, u32 data) {
}
}
-void CDmaPusher::ThiStateWrite(ThiRegisters& state, u32 offset, u32 argument) {
- u8* const state_offset = reinterpret_cast<u8*>(&state) + sizeof(u32) * offset;
- std::memcpy(state_offset, &argument, sizeof(u32));
+void CDmaPusher::ThiStateWrite(ThiRegisters& state, u32 state_offset, u32 argument) {
+ u8* const offset_ptr = reinterpret_cast<u8*>(&state) + sizeof(u32) * state_offset;
+ std::memcpy(offset_ptr, &argument, sizeof(u32));
}
} // namespace Tegra
diff --git a/src/video_core/command_classes/vic.cpp b/src/video_core/command_classes/vic.cpp
index 564f9c1e8..0a8b82f2b 100644
--- a/src/video_core/command_classes/vic.cpp
+++ b/src/video_core/command_classes/vic.cpp
@@ -134,10 +134,10 @@ void Vic::Execute() {
// Populate luma buffer
for (std::size_t y = 0; y < surface_height - 1; ++y) {
- std::size_t src = y * stride;
- std::size_t dst = y * aligned_width;
+ const std::size_t src = y * stride;
+ const std::size_t dst = y * aligned_width;
- std::size_t size = surface_width;
+ const std::size_t size = surface_width;
for (std::size_t offset = 0; offset < size; ++offset) {
luma_buffer[dst + offset] = luma_ptr[src + offset];
@@ -148,8 +148,8 @@ void Vic::Execute() {
// Populate chroma buffer from both channels with interleaving.
for (std::size_t y = 0; y < half_height; ++y) {
- std::size_t src = y * half_stride;
- std::size_t dst = y * aligned_width;
+ const std::size_t src = y * half_stride;
+ const std::size_t dst = y * aligned_width;
for (std::size_t x = 0; x < half_width; ++x) {
chroma_buffer[dst + x * 2] = chroma_b_ptr[src + x];
diff --git a/src/video_core/gpu.cpp b/src/video_core/gpu.cpp
index 3db33faf3..51c63af4a 100644
--- a/src/video_core/gpu.cpp
+++ b/src/video_core/gpu.cpp
@@ -493,8 +493,7 @@ void GPU::PushCommandBuffer(Tegra::ChCommandHeaderList& entries) {
// TODO(ameerj): RE proper async nvdec operation
// gpu_thread.SubmitCommandBuffer(std::move(entries));
- cdma_pusher->Push(std::move(entries));
- cdma_pusher->DispatchCalls();
+ cdma_pusher->ProcessEntries(std::move(entries));
}
void GPU::SwapBuffers(const Tegra::FramebufferConfig* framebuffer) {
diff --git a/src/video_core/gpu_thread.cpp b/src/video_core/gpu_thread.cpp
index 7644588e3..eb0e43c0c 100644
--- a/src/video_core/gpu_thread.cpp
+++ b/src/video_core/gpu_thread.cpp
@@ -49,7 +49,7 @@ static void RunThread(Core::System& system, VideoCore::RendererBase& renderer,
} else if (auto* command_list = std::get_if<SubmitChCommandEntries>(&next.data)) {
// NVDEC
cdma_pusher.ProcessEntries(std::move(command_list->entries));
- } else if (const auto data = std::get_if<SwapBuffersCommand>(&next.data)) {
+ } else if (const auto* data = std::get_if<SwapBuffersCommand>(&next.data)) {
renderer.SwapBuffers(data->framebuffer ? &*data->framebuffer : nullptr);
} else if (std::holds_alternative<OnCommandListEndCommand>(next.data)) {
rasterizer->ReleaseFences();