From 4bc81f007fedf4157c4dcf4e8413755dcdbf99dc Mon Sep 17 00:00:00 2001 From: Billy Laws Date: Fri, 18 Nov 2022 21:43:06 +0000 Subject: [PATCH] Add some convinience helpers to compute engine regs --- .../main/cpp/skyline/soc/gm20b/engines/kepler_compute.h | 4 ++++ .../cpp/skyline/soc/gm20b/engines/kepler_compute/qmd.h | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/app/src/main/cpp/skyline/soc/gm20b/engines/kepler_compute.h b/app/src/main/cpp/skyline/soc/gm20b/engines/kepler_compute.h index 00d62b4e..649626cf 100644 --- a/app/src/main/cpp/skyline/soc/gm20b/engines/kepler_compute.h +++ b/app/src/main/cpp/skyline/soc/gm20b/engines/kepler_compute.h @@ -55,6 +55,10 @@ namespace skyline::soc::gm20b::engine { u32 qmdAddressShifted8; u32 from : 24; u8 delta; + + u64 QmdAddress() const { + return static_cast(qmdAddressShifted8) << 8; + } }; static_assert(sizeof(SendPcas) == 0x8); diff --git a/app/src/main/cpp/skyline/soc/gm20b/engines/kepler_compute/qmd.h b/app/src/main/cpp/skyline/soc/gm20b/engines/kepler_compute/qmd.h index efb79135..6f95013f 100644 --- a/app/src/main/cpp/skyline/soc/gm20b/engines/kepler_compute/qmd.h +++ b/app/src/main/cpp/skyline/soc/gm20b/engines/kepler_compute/qmd.h @@ -14,6 +14,8 @@ namespace skyline::soc::gm20b::engine::kepler_compute { * @url https://github.com/devkitPro/deko3d/blob/master/source/maxwell/compute_qmd.h */ struct QMD { + static constexpr size_t ConstantBufferCount{8}; + enum class DependentQmdType : u32 { Queue = 0, Grid = 1 @@ -229,7 +231,11 @@ namespace skyline::soc::gm20b::engine::kepler_compute { u32 reservedAddr : 6; u32 invalidate : 1; u32 size : 17; - } constantBuffer[8]; + + u64 Address() const { + return (static_cast(addrUpper) << 32) | addrLower; + } + } constantBuffer[ConstantBufferCount]; u32 shaderLocalMemoryLowSize : 24;