diff options
author | bunnei <bunneidev@gmail.com> | 2014-12-10 15:20:05 +0100 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2014-12-10 15:20:05 +0100 |
commit | ae3c6e82f70e84b4a2823ece9aeabf6fa1127956 (patch) | |
tree | 5305a9a909f0ed8c35aad59c81f910203f4c0aa2 /src/video_core | |
parent | Merge pull request #269 from archshift/le (diff) | |
parent | GSP: Trigger GPU interrupts at more accurate locations. (diff) | |
download | yuzu-ae3c6e82f70e84b4a2823ece9aeabf6fa1127956.tar yuzu-ae3c6e82f70e84b4a2823ece9aeabf6fa1127956.tar.gz yuzu-ae3c6e82f70e84b4a2823ece9aeabf6fa1127956.tar.bz2 yuzu-ae3c6e82f70e84b4a2823ece9aeabf6fa1127956.tar.lz yuzu-ae3c6e82f70e84b4a2823ece9aeabf6fa1127956.tar.xz yuzu-ae3c6e82f70e84b4a2823ece9aeabf6fa1127956.tar.zst yuzu-ae3c6e82f70e84b4a2823ece9aeabf6fa1127956.zip |
Diffstat (limited to 'src/video_core')
-rw-r--r-- | src/video_core/command_processor.cpp | 9 | ||||
-rw-r--r-- | src/video_core/pica.h | 10 |
2 files changed, 17 insertions, 2 deletions
diff --git a/src/video_core/command_processor.cpp b/src/video_core/command_processor.cpp index 298b04c51..431139cc2 100644 --- a/src/video_core/command_processor.cpp +++ b/src/video_core/command_processor.cpp @@ -8,6 +8,7 @@ #include "pica.h" #include "primitive_assembly.h" #include "vertex_shader.h" +#include "core/hle/service/gsp_gpu.h" #include "debug_utils/debug_utils.h" @@ -40,6 +41,11 @@ static inline void WritePicaReg(u32 id, u32 value, u32 mask) { DebugUtils::OnPicaRegWrite(id, registers[id]); switch(id) { + // Trigger IRQ + case PICA_REG_INDEX(trigger_irq): + GSP_GPU::SignalInterrupt(GSP_GPU::InterruptId::P3D); + return; + // It seems like these trigger vertex rendering case PICA_REG_INDEX(trigger_draw): case PICA_REG_INDEX(trigger_draw_indexed): @@ -272,8 +278,9 @@ static std::ptrdiff_t ExecuteCommandBlock(const u32* first_command_word) { void ProcessCommandList(const u32* list, u32 size) { u32* read_pointer = (u32*)list; + u32 list_length = size / sizeof(u32); - while (read_pointer < list + size) { + while (read_pointer < list + list_length) { read_pointer += ExecuteCommandBlock(read_pointer); } } diff --git a/src/video_core/pica.h b/src/video_core/pica.h index e7ca38978..8bac178ca 100644 --- a/src/video_core/pica.h +++ b/src/video_core/pica.h @@ -45,10 +45,16 @@ struct Regs { #define INSERT_PADDING_WORDS_HELPER2(x, y) INSERT_PADDING_WORDS_HELPER1(x, y) #define INSERT_PADDING_WORDS(num_words) u32 INSERT_PADDING_WORDS_HELPER2(pad, __LINE__)[(num_words)]; - INSERT_PADDING_WORDS(0x41); + INSERT_PADDING_WORDS(0x10); + + u32 trigger_irq; + + INSERT_PADDING_WORDS(0x30); BitField<0, 24, u32> viewport_size_x; + INSERT_PADDING_WORDS(0x1); + BitField<0, 24, u32> viewport_size_y; INSERT_PADDING_WORDS(0x9); @@ -544,6 +550,7 @@ struct Regs { map.insert({i, #name + std::string("+") + std::to_string(i-PICA_REG_INDEX(name))}); \ } while(false) + ADD_FIELD(trigger_irq); ADD_FIELD(viewport_size_x); ADD_FIELD(viewport_size_y); ADD_FIELD(viewport_depth_range); @@ -607,6 +614,7 @@ private: #ifndef _MSC_VER #define ASSERT_REG_POSITION(field_name, position) static_assert(offsetof(Regs, field_name) == position * 4, "Field "#field_name" has invalid position") +ASSERT_REG_POSITION(trigger_irq, 0x10); ASSERT_REG_POSITION(viewport_size_x, 0x41); ASSERT_REG_POSITION(viewport_size_y, 0x43); ASSERT_REG_POSITION(viewport_depth_range, 0x4d); |