Various fixes and utilties.

This commit is contained in:
Ben Vanik
2015-05-02 00:26:03 -07:00
parent 98e7e2727b
commit 727ffaa122
13 changed files with 74 additions and 15 deletions

View File

@@ -235,6 +235,11 @@ void GL4GraphicsSystem::PlayTrace(const uint8_t* trace_data, size_t trace_size,
});
}
void GL4GraphicsSystem::ClearCaches() {
command_processor_->CallInThread(
[&]() { command_processor_->texture_cache()->Clear(); });
}
void GL4GraphicsSystem::MarkVblank() {
static bool thread_name_set = false;
if (!thread_name_set) {

View File

@@ -46,6 +46,7 @@ class GL4GraphicsSystem : public GraphicsSystem {
void EndTracing() override;
void PlayTrace(const uint8_t* trace_data, size_t trace_size,
TracePlaybackMode playback_mode) override;
void ClearCaches() override;
private:
void MarkVblank();

View File

@@ -52,6 +52,7 @@ class GraphicsSystem {
};
virtual void PlayTrace(const uint8_t* trace_data, size_t trace_size,
TracePlaybackMode playback_mode) {}
virtual void ClearCaches() {}
protected:
GraphicsSystem();

View File

@@ -2211,10 +2211,14 @@ int trace_viewer_main(std::vector<std::wstring>& args) {
}
auto control = window->child(0);
control->on_key_char.AddListener([](poly::ui::KeyEvent& e) {
control->on_key_char.AddListener([graphics_system](poly::ui::KeyEvent& e) {
auto& io = ImGui::GetIO();
if (e.key_code() > 0 && e.key_code() < 0x10000) {
io.AddInputCharacter(e.key_code());
if (e.key_code() == 0x74 /* VK_F5 */) {
graphics_system->ClearCaches();
} else {
io.AddInputCharacter(e.key_code());
}
}
e.set_handled(true);
});

View File

@@ -257,6 +257,8 @@ inline float GpuSwap(float value, Endian endianness) {
inline uint32_t GpuToCpu(uint32_t p) { return p; }
inline uint32_t CpuToGpu(uint32_t p) { return p & 0x1FFFFFFF; }
// XE_GPU_REG_SQ_PROGRAM_CNTL
typedef union {
XEPACKEDSTRUCTANONYMOUS({