summaryrefslogtreecommitdiffstats
path: root/src/video_core/engines/kepler_compute.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2019-05-09 19:19:22 +0200
committerGitHub <noreply@github.com>2019-05-09 19:19:22 +0200
commitc27b81cb85d11b4c31f38c15a5e8e6d7c7211df2 (patch)
treec91fe87f5a025effd3941d38653cda0920c68962 /src/video_core/engines/kepler_compute.cpp
parentMerge pull request #2440 from lioncash/dynarmic (diff)
parentRefactors and name corrections. (diff)
downloadyuzu-c27b81cb85d11b4c31f38c15a5e8e6d7c7211df2.tar
yuzu-c27b81cb85d11b4c31f38c15a5e8e6d7c7211df2.tar.gz
yuzu-c27b81cb85d11b4c31f38c15a5e8e6d7c7211df2.tar.bz2
yuzu-c27b81cb85d11b4c31f38c15a5e8e6d7c7211df2.tar.lz
yuzu-c27b81cb85d11b4c31f38c15a5e8e6d7c7211df2.tar.xz
yuzu-c27b81cb85d11b4c31f38c15a5e8e6d7c7211df2.tar.zst
yuzu-c27b81cb85d11b4c31f38c15a5e8e6d7c7211df2.zip
Diffstat (limited to 'src/video_core/engines/kepler_compute.cpp')
-rw-r--r--src/video_core/engines/kepler_compute.cpp37
1 files changed, 33 insertions, 4 deletions
diff --git a/src/video_core/engines/kepler_compute.cpp b/src/video_core/engines/kepler_compute.cpp
index b1d950460..7404a8163 100644
--- a/src/video_core/engines/kepler_compute.cpp
+++ b/src/video_core/engines/kepler_compute.cpp
@@ -4,12 +4,21 @@
#include "common/assert.h"
#include "common/logging/log.h"
+#include "core/core.h"
#include "video_core/engines/kepler_compute.h"
+#include "video_core/engines/maxwell_3d.h"
#include "video_core/memory_manager.h"
+#include "video_core/rasterizer_interface.h"
+#include "video_core/renderer_base.h"
+#include "video_core/textures/decoders.h"
namespace Tegra::Engines {
-KeplerCompute::KeplerCompute(MemoryManager& memory_manager) : memory_manager{memory_manager} {}
+KeplerCompute::KeplerCompute(Core::System& system, VideoCore::RasterizerInterface& rasterizer,
+ MemoryManager& memory_manager)
+ : system{system}, rasterizer{rasterizer}, memory_manager{memory_manager}, upload_state{
+ memory_manager,
+ regs.upload} {}
KeplerCompute::~KeplerCompute() = default;
@@ -20,14 +29,34 @@ void KeplerCompute::CallMethod(const GPU::MethodCall& method_call) {
regs.reg_array[method_call.method] = method_call.argument;
switch (method_call.method) {
+ case KEPLER_COMPUTE_REG_INDEX(exec_upload): {
+ upload_state.ProcessExec(regs.exec_upload.linear != 0);
+ break;
+ }
+ case KEPLER_COMPUTE_REG_INDEX(data_upload): {
+ const bool is_last_call = method_call.IsLastCall();
+ upload_state.ProcessData(method_call.argument, is_last_call);
+ if (is_last_call) {
+ system.GPU().Maxwell3D().dirty_flags.OnMemoryWrite();
+ }
+ break;
+ }
case KEPLER_COMPUTE_REG_INDEX(launch):
- // Abort execution since compute shaders can be used to alter game memory (e.g. CUDA
- // kernels)
- UNREACHABLE_MSG("Compute shaders are not implemented");
+ ProcessLaunch();
break;
default:
break;
}
}
+void KeplerCompute::ProcessLaunch() {
+
+ const GPUVAddr launch_desc_loc = regs.launch_desc_loc.Address();
+ memory_manager.ReadBlockUnsafe(launch_desc_loc, &launch_description,
+ LaunchParams::NUM_LAUNCH_PARAMETERS * sizeof(u32));
+
+ const GPUVAddr code_loc = regs.code_loc.Address() + launch_description.program_start;
+ LOG_WARNING(HW_GPU, "Compute Kernel Execute at Address 0x{:016x}, STUBBED", code_loc);
+}
+
} // namespace Tegra::Engines