mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-26 04:32:35 +01:00
Qt: remove unused rsx debugger code
This commit is contained in:
parent
41e7d2aa0a
commit
223d1473b0
@ -1,4 +1,4 @@
|
||||
|
||||
|
||||
#include "rsx_debugger.h"
|
||||
#include "qt_utils.h"
|
||||
|
||||
@ -131,10 +131,6 @@ rsx_debugger::rsx_debugger(std::shared_ptr<gui_settings> gui_settings, QWidget*
|
||||
m_list_commands = l_addRSXTab(m_list_commands, tr("RSX Commands"), 4);
|
||||
m_list_captured_frame = l_addRSXTab(m_list_captured_frame, tr("Captured Frame"), 1);
|
||||
m_list_captured_draw_calls = l_addRSXTab(m_list_captured_draw_calls, tr("Captured Draw Calls"), 1);
|
||||
m_list_flags = l_addRSXTab(m_list_flags, tr("Flags"), 2);
|
||||
m_list_lightning = l_addRSXTab(m_list_lightning, tr("Lightning"), 2);
|
||||
m_list_texture = l_addRSXTab(m_list_texture, tr("Texture"), 9);
|
||||
m_list_settings = l_addRSXTab(m_list_settings, tr("Settings"), 2);
|
||||
|
||||
// Tabs: List Columns
|
||||
m_list_commands->viewport()->installEventFilter(this);
|
||||
@ -150,22 +146,6 @@ rsx_debugger::rsx_debugger(std::shared_ptr<gui_settings> gui_settings, QWidget*
|
||||
m_list_captured_draw_calls->setHorizontalHeaderLabels(QStringList() << tr("Draw calls"));
|
||||
m_list_captured_draw_calls->setColumnWidth(0, 720);
|
||||
|
||||
m_list_flags->setHorizontalHeaderLabels(QStringList() << tr("Name") << tr("Value"));
|
||||
m_list_flags->setColumnWidth(0, 170);
|
||||
m_list_flags->setColumnWidth(1, 270);
|
||||
|
||||
m_list_lightning->setHorizontalHeaderLabels(QStringList() << tr("Name") << tr("Value"));
|
||||
m_list_lightning->setColumnWidth(0, 170);
|
||||
m_list_lightning->setColumnWidth(1, 270);
|
||||
|
||||
m_list_texture->setHorizontalHeaderLabels(QStringList() << tr("Index") << tr("Address") << tr("Cubemap")
|
||||
<< tr("Dimension") << tr("Enabled") << tr("Format") << tr("Mipmap") << tr("Pitch") << tr("Size"));
|
||||
for (int i = 0; i<m_list_texture->columnCount(); i++) m_list_lightning->setColumnWidth(i, 80);
|
||||
|
||||
m_list_settings->setHorizontalHeaderLabels(QStringList() << tr("Name") << tr("Value"));
|
||||
m_list_settings->setColumnWidth(0, 170);
|
||||
m_list_settings->setColumnWidth(1, 270);
|
||||
|
||||
// Tools: Tools = Controls + Notebook Tabs
|
||||
QVBoxLayout* vbox_tools = new QVBoxLayout();
|
||||
vbox_tools->addLayout(hbox_controls);
|
||||
@ -256,13 +236,6 @@ rsx_debugger::rsx_debugger(std::shared_ptr<gui_settings> gui_settings, QWidget*
|
||||
m_addr = m_addr_line->text().toULong(&ok, 16);
|
||||
UpdateInformation();
|
||||
});
|
||||
connect(m_list_flags, &QTableWidget::itemClicked, this, &rsx_debugger::SetFlags);
|
||||
connect(m_list_texture, &QTableWidget::itemClicked, [=]
|
||||
{
|
||||
int index = m_list_texture->currentRow();
|
||||
if (index >= 0) m_cur_texture = index;
|
||||
UpdateInformation();
|
||||
});
|
||||
connect(m_list_captured_draw_calls, &QTableWidget::itemClicked, this, &rsx_debugger::OnClickDrawCalls);
|
||||
|
||||
// Restore header states
|
||||
@ -622,10 +595,6 @@ void rsx_debugger::UpdateInformation()
|
||||
m_addr_line->setText(QString("%1").arg(m_addr, 8, 16, QChar('0'))); // get 8 digits in input line
|
||||
GetMemory();
|
||||
GetBuffers();
|
||||
GetFlags();
|
||||
GetLightning();
|
||||
GetTexture();
|
||||
GetSettings();
|
||||
}
|
||||
|
||||
void rsx_debugger::GetMemory()
|
||||
@ -754,246 +723,6 @@ void rsx_debugger::GetBuffers()
|
||||
m_buffer_tex->showImage(QImage(buffer, m_text_width, m_text_height, QImage::Format_RGB32));*/
|
||||
}
|
||||
|
||||
void rsx_debugger::GetFlags()
|
||||
{
|
||||
const auto render = rsx::get_current_renderer();
|
||||
if (!render)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
m_list_flags->clearContents();
|
||||
int i=0;
|
||||
|
||||
#define LIST_FLAGS_ADD(name, value) \
|
||||
m_list_flags->setItem(i, 0, new QTableWidgetItem(qstr(name))); m_list_flags->setItem(i, 1, new QTableWidgetItem(qstr(value ? "Enabled" : "Disabled"))); i++;
|
||||
/*
|
||||
LIST_FLAGS_ADD("Alpha test", render->m_set_alpha_test);
|
||||
LIST_FLAGS_ADD("Blend", render->m_set_blend);
|
||||
LIST_FLAGS_ADD("Scissor", render->m_set_scissor_horizontal && render->m_set_scissor_vertical);
|
||||
LIST_FLAGS_ADD("Cull face", render->m_set_cull_face);
|
||||
LIST_FLAGS_ADD("Depth bounds test", render->m_set_depth_bounds_test);
|
||||
LIST_FLAGS_ADD("Depth test", render->m_set_depth_test);
|
||||
LIST_FLAGS_ADD("Dither", render->m_set_dither);
|
||||
LIST_FLAGS_ADD("Line smooth", render->m_set_line_smooth);
|
||||
LIST_FLAGS_ADD("Logic op", render->m_set_logic_op);
|
||||
LIST_FLAGS_ADD("Poly smooth", render->m_set_poly_smooth);
|
||||
LIST_FLAGS_ADD("Poly offset fill", render->m_set_poly_offset_fill);
|
||||
LIST_FLAGS_ADD("Poly offset line", render->m_set_poly_offset_line);
|
||||
LIST_FLAGS_ADD("Poly offset point", render->m_set_poly_offset_point);
|
||||
LIST_FLAGS_ADD("Stencil test", render->m_set_stencil_test);
|
||||
LIST_FLAGS_ADD("Primitive restart", render->m_set_restart_index);
|
||||
LIST_FLAGS_ADD("Two sided lighting", render->m_set_two_side_light_enable);
|
||||
LIST_FLAGS_ADD("Point Sprite", render->m_set_point_sprite_control);
|
||||
LIST_FLAGS_ADD("Lighting ", render->m_set_specular);
|
||||
*/
|
||||
|
||||
#undef LIST_FLAGS_ADD
|
||||
}
|
||||
|
||||
void rsx_debugger::GetLightning()
|
||||
{
|
||||
const auto render = rsx::get_current_renderer();
|
||||
if (!render)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
m_list_lightning->clearContents();
|
||||
int i=0;
|
||||
|
||||
#define LIST_LIGHTNING_ADD(name, value) \
|
||||
m_list_lightning->setItem(i, 0, new QTableWidgetItem(qstr(name))); m_list_lightning->setItem(i, 1, new QTableWidgetItem(qstr(value))); i++;
|
||||
|
||||
//LIST_LIGHTNING_ADD("Shade model", (render->m_shade_mode == 0x1D00) ? "Flat" : "Smooth");
|
||||
|
||||
#undef LIST_LIGHTNING_ADD
|
||||
}
|
||||
|
||||
void rsx_debugger::GetTexture()
|
||||
{
|
||||
const auto render = rsx::get_current_renderer();
|
||||
if (!render)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
m_list_texture->clearContents();
|
||||
m_list_texture->setRowCount(rsx::limits::fragment_textures_count);
|
||||
|
||||
for(uint i=0; i<rsx::limits::fragment_textures_count; ++i)
|
||||
{
|
||||
/* if(render->textures[i].enabled())
|
||||
{
|
||||
m_list_texture->setItem(i, 0, new QTableWidgetItem(qstr(fmt::format("%d", i)));
|
||||
u8 location = render->textures[i].location();
|
||||
if(location > 1)
|
||||
{
|
||||
m_list_texture->setItem(i, 1,
|
||||
new QTableWidgetItem(qstr(fmt::format("Bad address (offset=0x%x, location=%d)", render->textures[i].offset(), location))));
|
||||
}
|
||||
else
|
||||
{
|
||||
m_list_texture->setItem(i, 1,
|
||||
new QTableWidgetItem(qstr(fmt::format("0x%x", rsx::get_address(render->textures[i].offset(), location)))));
|
||||
}
|
||||
|
||||
m_list_texture->setItem(i, 2, new QTableWidgetItem(render->textures[i].cubemap() ? "True" : "False"));
|
||||
m_list_texture->setItem(i, 3, new QTableWidgetItem(qstr(fmt::format("%dD", render->textures[i].dimension()))));
|
||||
m_list_texture->setItem(i, 4, new QTableWidgetItem(render->textures[i].enabled() ? "True" : "False"));
|
||||
m_list_texture->setItem(i, 5, new QTableWidgetItem(qstr(fmt::format("0x%x", render->textures[i].format()))));
|
||||
m_list_texture->setItem(i, 6, new QTableWidgetItem(qstr(fmt::format("0x%x", render->textures[i].mipmap()))));
|
||||
m_list_texture->setItem(i, 7, new QTableWidgetItem(qstr(fmt::format("0x%x", render->textures[i].pitch()))));
|
||||
m_list_texture->setItem(i, 8, new QTableWidgetItem(qstr(fmt::format("%dx%d",
|
||||
render->textures[i].width(),
|
||||
render->textures[i].height()))));
|
||||
|
||||
m_list_texture->SetItemBackgroundColour(i, QColor(m_cur_texture == i ? QColor::yellow : QColor::white));
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
void rsx_debugger::GetSettings()
|
||||
{
|
||||
const auto render = rsx::get_current_renderer();
|
||||
if (!render)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
m_list_settings->clearContents();
|
||||
int i=0;
|
||||
|
||||
#define LIST_SETTINGS_ADD(name, value) \
|
||||
m_list_settings->setItem(i, 0, new QTableWidgetItem(qstr(name))); m_list_settings->setItem(i, 1, new QTableWidgetItem(qstr(value))); i++;
|
||||
/*
|
||||
LIST_SETTINGS_ADD("Alpha func", !(render->m_set_alpha_func) ? "(none)" : fmt::format("0x%x (%s)",
|
||||
render->m_alpha_func,
|
||||
ParseGCMEnum(render->m_alpha_func, CELL_GCM_ENUM)));
|
||||
LIST_SETTINGS_ADD("Blend color", !(render->m_set_blend_color) ? "(none)" : fmt::format("R:%d, G:%d, B:%d, A:%d",
|
||||
render->m_blend_color_r,
|
||||
render->m_blend_color_g,
|
||||
render->m_blend_color_b,
|
||||
render->m_blend_color_a));
|
||||
LIST_SETTINGS_ADD("Clipping", fmt::format("Min:%f, Max:%f", render->m_clip_min, render->m_clip_max));
|
||||
LIST_SETTINGS_ADD("Color mask", !(render->m_set_color_mask) ? "(none)" : fmt::format("R:%d, G:%d, B:%d, A:%d",
|
||||
render->m_color_mask_r,
|
||||
render->m_color_mask_g,
|
||||
render->m_color_mask_b,
|
||||
render->m_color_mask_a));
|
||||
LIST_SETTINGS_ADD("Context DMA Color A", fmt::format("0x%x", render->m_context_dma_color_a));
|
||||
LIST_SETTINGS_ADD("Context DMA Color B", fmt::format("0x%x", render->m_context_dma_color_b));
|
||||
LIST_SETTINGS_ADD("Context DMA Color C", fmt::format("0x%x", render->m_context_dma_color_c));
|
||||
LIST_SETTINGS_ADD("Context DMA Color D", fmt::format("0x%x", render->m_context_dma_color_d));
|
||||
LIST_SETTINGS_ADD("Context DMA Zeta", fmt::format("0x%x", render->m_context_dma_z));
|
||||
LIST_SETTINGS_ADD("Depth bounds", fmt::format("Min:%f, Max:%f", render->m_depth_bounds_min, render->m_depth_bounds_max));
|
||||
LIST_SETTINGS_ADD("Depth func", !(render->m_set_depth_func) ? "(none)" : fmt::format("0x%x (%s)",
|
||||
render->m_depth_func,
|
||||
ParseGCMEnum(render->m_depth_func, CELL_GCM_ENUM)));
|
||||
LIST_SETTINGS_ADD("Draw mode", fmt::format("%d (%s)",
|
||||
render->m_draw_mode,
|
||||
ParseGCMEnum(render->m_draw_mode, CELL_GCM_PRIMITIVE_ENUM)));
|
||||
LIST_SETTINGS_ADD("Scissor", fmt::format("X:%d, Y:%d, W:%d, H:%d",
|
||||
render->m_scissor_x,
|
||||
render->m_scissor_y,
|
||||
render->m_scissor_w,
|
||||
render->m_scissor_h));
|
||||
LIST_SETTINGS_ADD("Stencil func", !(render->m_set_stencil_func) ? "(none)" : fmt::format("0x%x (%s)",
|
||||
render->m_stencil_func,
|
||||
ParseGCMEnum(render->m_stencil_func, CELL_GCM_ENUM)));
|
||||
LIST_SETTINGS_ADD("Surface Pitch A", fmt::format("0x%x", render->m_surface_pitch_a));
|
||||
LIST_SETTINGS_ADD("Surface Pitch B", fmt::format("0x%x", render->m_surface_pitch_b));
|
||||
LIST_SETTINGS_ADD("Surface Pitch C", fmt::format("0x%x", render->m_surface_pitch_c));
|
||||
LIST_SETTINGS_ADD("Surface Pitch D", fmt::format("0x%x", render->m_surface_pitch_d));
|
||||
LIST_SETTINGS_ADD("Surface Pitch Z", fmt::format("0x%x", render->m_surface_pitch_z));
|
||||
LIST_SETTINGS_ADD("Surface Offset A", fmt::format("0x%x", render->m_surface_offset_a));
|
||||
LIST_SETTINGS_ADD("Surface Offset B", fmt::format("0x%x", render->m_surface_offset_b));
|
||||
LIST_SETTINGS_ADD("Surface Offset C", fmt::format("0x%x", render->m_surface_offset_c));
|
||||
LIST_SETTINGS_ADD("Surface Offset D", fmt::format("0x%x", render->m_surface_offset_d));
|
||||
LIST_SETTINGS_ADD("Surface Offset Z", fmt::format("0x%x", render->m_surface_offset_z));
|
||||
LIST_SETTINGS_ADD("Viewport", fmt::format("X:%d, Y:%d, W:%d, H:%d",
|
||||
render->m_viewport_x,
|
||||
render->m_viewport_y,
|
||||
render->m_viewport_w,
|
||||
render->m_viewport_h));
|
||||
*/
|
||||
#undef LIST_SETTINGS_ADD
|
||||
}
|
||||
|
||||
void rsx_debugger::SetFlags()
|
||||
{
|
||||
/*
|
||||
int index = m_list_flags->currentRow();
|
||||
if (!RSXReady()) return;
|
||||
GSRender& render = Emu.GetGSManager().GetRender();
|
||||
switch(index)
|
||||
{
|
||||
case 0: render->m_set_alpha_test ^= true; break;
|
||||
case 1: render->m_set_blend ^= true; break;
|
||||
case 2: render->m_set_cull_face ^= true; break;
|
||||
case 3: render->m_set_depth_bounds_test ^= true; break;
|
||||
case 4: render->m_set_depth_test ^= true; break;
|
||||
case 5: render->m_set_dither ^= true; break;
|
||||
case 6: render->m_set_line_smooth ^= true; break;
|
||||
case 7: render->m_set_logic_op ^= true; break;
|
||||
case 8: render->m_set_poly_smooth ^= true; break;
|
||||
case 9: render->m_set_poly_offset_fill ^= true; break;
|
||||
case 10: render->m_set_poly_offset_line ^= true; break;
|
||||
case 11: render->m_set_poly_offset_point ^= true; break;
|
||||
case 12: render->m_set_stencil_test ^= true; break;
|
||||
case 13: render->m_set_point_sprite_control ^= true; break;
|
||||
case 14: render->m_set_restart_index ^= true; break;
|
||||
case 15: render->m_set_specular ^= true; break;
|
||||
case 16: render->m_set_scissor_horizontal ^= true; break;
|
||||
case 17: render->m_set_scissor_vertical ^= true; break;
|
||||
}
|
||||
*/
|
||||
|
||||
UpdateInformation();
|
||||
}
|
||||
|
||||
void rsx_debugger::SetPrograms()
|
||||
{
|
||||
const auto render = rsx::get_current_renderer();
|
||||
if (!render)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
return;
|
||||
//rsx_debuggerProgram& program = m_debug_programs[event.m_itemIndex];
|
||||
|
||||
//// Program Editor
|
||||
//QString title = qstr(fmt::format("Program ID: %d (VP:%d, FP:%d)", program.id, program.vp_id, program.fp_id));
|
||||
//QDialog d_editor(this, title, QSize(800,500));
|
||||
|
||||
//QHBoxLayout* hbox_panel = new QHBoxLayout();
|
||||
//QHBoxLayout* hbox_vp_box = new QHBoxLayout(&d_editor, tr("Vertex Program"));
|
||||
//QHBoxLayout* hbox_fp_box = new QHBoxLayout(&d_editor, tr("Fragment Program"));
|
||||
//QLabel or QTextEdit* t_vp_edit = new QTextEdit(&d_editor, program.vp_shader);
|
||||
//QLabel or QTextEdit* t_fp_edit = new QTextEdit(&d_editor, program.fp_shader);
|
||||
//t_vp_edit->setFont(mono);
|
||||
//t_fp_edit->setFont(mono);
|
||||
//hbox_vp_box->addWidget(t_vp_edit, 1, wxEXPAND);
|
||||
//hbox_fp_box->addWidget(t_fp_edit, 1, wxEXPAND);
|
||||
//hbox_panel->addLayout(hbox_vp_box, 1, wxEXPAND);
|
||||
//hbox_panel->addLayout(hbox_fp_box, 1, wxEXPAND);
|
||||
//d_editor.setLayout(hbox_panel);
|
||||
|
||||
//// Show editor and open Save Dialog when closing
|
||||
//if (d_editor.ShowModal())
|
||||
//{
|
||||
// wxMessageDialog d_save(&d_editor, "Save changes and compile shaders?", title, wxYES_NO|wxCENTRE);
|
||||
// if(d_save.ShowModal() == wxID_YES)
|
||||
// {
|
||||
// program.modified = true;
|
||||
// program.vp_shader = t_vp_edit->GetValue();
|
||||
// program.fp_shader = t_fp_edit->GetValue();
|
||||
// }
|
||||
//}
|
||||
//UpdateInformation();
|
||||
}
|
||||
|
||||
const char* rsx_debugger::ParseGCMEnum(u32 value, u32 type)
|
||||
{
|
||||
switch(type)
|
||||
|
@ -1,12 +1,10 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
#include "Emu/Memory/vm.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/IdManager.h"
|
||||
#include "Emu/RSX/GSRender.h"
|
||||
#include "Emu/RSX/GCM.h"
|
||||
|
||||
#include "memory_viewer_panel.h"
|
||||
#include "table_item_delegate.h"
|
||||
@ -54,10 +52,6 @@ class rsx_debugger : public QDialog
|
||||
QTableWidget* m_list_commands;
|
||||
QTableWidget* m_list_captured_frame;
|
||||
QTableWidget* m_list_captured_draw_calls;
|
||||
QTableWidget* m_list_flags;
|
||||
QTableWidget* m_list_lightning;
|
||||
QTableWidget* m_list_texture;
|
||||
QTableWidget* m_list_settings;
|
||||
QListWidget* m_list_index_buffer;
|
||||
QTabWidget* m_tw_rsx;
|
||||
|
||||
@ -84,10 +78,6 @@ public:
|
||||
virtual void UpdateInformation();
|
||||
virtual void GetMemory();
|
||||
virtual void GetBuffers();
|
||||
virtual void GetFlags();
|
||||
virtual void GetLightning();
|
||||
virtual void GetTexture();
|
||||
virtual void GetSettings();
|
||||
|
||||
const char* ParseGCMEnum(u32 value, u32 type);
|
||||
QString DisAsmCommand(u32 cmd, u32 count, u32 ioAddr);
|
||||
@ -96,8 +86,6 @@ public:
|
||||
|
||||
public Q_SLOTS:
|
||||
virtual void OnClickDrawCalls();
|
||||
virtual void SetFlags();
|
||||
virtual void SetPrograms();
|
||||
|
||||
protected:
|
||||
virtual void closeEvent(QCloseEvent* event) override;
|
||||
|
Loading…
Reference in New Issue
Block a user