Esempio n. 1
0
void GPUCommandListWidget::SetCommandInfo(const QModelIndex& index) {
    QWidget* new_info_widget = nullptr;

    const unsigned int command_id =
        list_widget->model()->data(index, GPUCommandListModel::CommandIdRole).toUInt();
    if (COMMAND_IN_RANGE(command_id, texturing.texture0) ||
        COMMAND_IN_RANGE(command_id, texturing.texture1) ||
        COMMAND_IN_RANGE(command_id, texturing.texture2)) {

        unsigned texture_index;
        if (COMMAND_IN_RANGE(command_id, texturing.texture0)) {
            texture_index = 0;
        } else if (COMMAND_IN_RANGE(command_id, texturing.texture1)) {
            texture_index = 1;
        } else {
            texture_index = 2;
        }

        const auto texture = Pica::g_state.regs.texturing.GetTextures()[texture_index];
        const auto config = texture.config;
        const auto format = texture.format;

        const auto info = Pica::Texture::TextureInfo::FromPicaRegister(config, format);
        const u8* src = Memory::GetPhysicalPointer(config.GetPhysicalAddress());
        new_info_widget = new TextureInfoWidget(src, info);
    }
    if (command_info_widget) {
        delete command_info_widget;
        command_info_widget = nullptr;
    }
    if (new_info_widget) {
        widget()->layout()->addWidget(new_info_widget);
        command_info_widget = new_info_widget;
    }
}
Esempio n. 2
0
void GPUCommandListWidget::SetCommandInfo(const QModelIndex& index) {
    QWidget* new_info_widget;

    const unsigned int command_id = list_widget->model()->data(index, GPUCommandListModel::CommandIdRole).toUInt();
    if (COMMAND_IN_RANGE(command_id, texture0) ||
        COMMAND_IN_RANGE(command_id, texture1) ||
        COMMAND_IN_RANGE(command_id, texture2)) {

        unsigned index;
        if (COMMAND_IN_RANGE(command_id, texture0)) {
            index = 0;
        } else if (COMMAND_IN_RANGE(command_id, texture1)) {
            index = 1;
        } else {
            index = 2;
        }
        auto config = Pica::registers.GetTextures()[index].config;
        auto format = Pica::registers.GetTextures()[index].format;

        auto info = Pica::DebugUtils::TextureInfo::FromPicaRegister(config, format);
        u8* src = Memory::GetPhysicalPointer(config.GetPhysicalAddress());
        new_info_widget = new TextureInfoWidget(src, info);
    } else {
        new_info_widget = new QWidget;
    }

    widget()->layout()->removeWidget(command_info_widget);
    delete command_info_widget;
    widget()->layout()->addWidget(new_info_widget);
    command_info_widget = new_info_widget;
}
Esempio n. 3
0
void GPUCommandListWidget::OnCommandDoubleClicked(const QModelIndex& index) {
    const int command_id = list_widget->model()->data(index, GPUCommandListModel::CommandIdRole).toInt();
    if (COMMAND_IN_RANGE(command_id, texture0)) {
        auto info = Pica::DebugUtils::TextureInfo::FromPicaRegister(Pica::registers.texture0,
                                                                    Pica::registers.texture0_format);

        // TODO: Instead, emit a signal here to be caught by the main window widget.
        auto main_window = static_cast<QMainWindow*>(parent());
        main_window->tabifyDockWidget(this, new TextureInfoDockWidget(info, main_window));
    }
}
Esempio n. 4
0
void GPUCommandListWidget::OnCommandDoubleClicked(const QModelIndex& index) {
    const unsigned int command_id = list_widget->model()->data(index, GPUCommandListModel::CommandIdRole).toUInt();
    if (COMMAND_IN_RANGE(command_id, texture0) ||
        COMMAND_IN_RANGE(command_id, texture1) ||
        COMMAND_IN_RANGE(command_id, texture2)) {

        unsigned index;
        if (COMMAND_IN_RANGE(command_id, texture0)) {
            index = 0;
        } else if (COMMAND_IN_RANGE(command_id, texture1)) {
            index = 1;
        } else {
            index = 2;
        }
        auto config = Pica::registers.GetTextures()[index].config;
        auto format = Pica::registers.GetTextures()[index].format;
        auto info = Pica::DebugUtils::TextureInfo::FromPicaRegister(config, format);

        // TODO: Instead, emit a signal here to be caught by the main window widget.
        auto main_window = static_cast<QMainWindow*>(parent());
        main_window->tabifyDockWidget(this, new TextureInfoDockWidget(info, main_window));
    }
}
Esempio n. 5
0
void GPUCommandListWidget::SetCommandInfo(const QModelIndex& index) {
    QWidget* new_info_widget;

    const int command_id = list_widget->model()->data(index, GPUCommandListModel::CommandIdRole).toInt();
    if (COMMAND_IN_RANGE(command_id, texture0)) {
        u8* src = Memory::GetPointer(Pica::registers.texture0.GetPhysicalAddress());
        auto info = Pica::DebugUtils::TextureInfo::FromPicaRegister(Pica::registers.texture0,
                                                                    Pica::registers.texture0_format);
        new_info_widget = new TextureInfoWidget(src, info);
    } else {
        new_info_widget = new QWidget;
    }

    widget()->layout()->removeWidget(command_info_widget);
    delete command_info_widget;
    widget()->layout()->addWidget(new_info_widget);
    command_info_widget = new_info_widget;
}
Esempio n. 6
0
void GPUCommandListWidget::OnCommandDoubleClicked(const QModelIndex& index) {
    const unsigned int command_id =
        list_widget->model()->data(index, GPUCommandListModel::CommandIdRole).toUInt();
    if (COMMAND_IN_RANGE(command_id, texturing.texture0) ||
        COMMAND_IN_RANGE(command_id, texturing.texture1) ||
        COMMAND_IN_RANGE(command_id, texturing.texture2)) {

        unsigned texture_index;
        if (COMMAND_IN_RANGE(command_id, texturing.texture0)) {
            texture_index = 0;
        } else if (COMMAND_IN_RANGE(command_id, texturing.texture1)) {
            texture_index = 1;
        } else if (COMMAND_IN_RANGE(command_id, texturing.texture2)) {
            texture_index = 2;
        } else {
            UNREACHABLE_MSG("Unknown texture command");
        }

        // TODO: Open a surface debugger
    }
}
Esempio n. 7
0
void GPUCommandListWidget::OnCommandDoubleClicked(const QModelIndex& index) {
    const unsigned int command_id =
        list_widget->model()->data(index, GPUCommandListModel::CommandIdRole).toUInt();
    if (COMMAND_IN_RANGE(command_id, texture0) || COMMAND_IN_RANGE(command_id, texture1) ||
        COMMAND_IN_RANGE(command_id, texture2)) {

        unsigned index;
        if (COMMAND_IN_RANGE(command_id, texture0)) {
            index = 0;
        } else if (COMMAND_IN_RANGE(command_id, texture1)) {
            index = 1;
        } else if (COMMAND_IN_RANGE(command_id, texture2)) {
            index = 2;
        } else {
            UNREACHABLE_MSG("Unknown texture command");
        }
        auto config = Pica::g_state.regs.GetTextures()[index].config;
        auto format = Pica::g_state.regs.GetTextures()[index].format;
        auto info = Pica::DebugUtils::TextureInfo::FromPicaRegister(config, format);

        // TODO: Open a surface debugger
    }
}