mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-05 17:40:39 +00:00
Rename Core to CaptureContext
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#include "Core.h"
|
||||
#include "CaptureContext.h"
|
||||
#include <QApplication>
|
||||
#include <QFileInfo>
|
||||
#include <QMessageBox>
|
||||
@@ -13,7 +13,8 @@
|
||||
#include <QX11Info>
|
||||
#endif
|
||||
|
||||
Core::Core(QString paramFilename, QString remoteHost, uint32_t remoteIdent, bool temp)
|
||||
CaptureContext::CaptureContext(QString paramFilename, QString remoteHost, uint32_t remoteIdent,
|
||||
bool temp)
|
||||
{
|
||||
m_LogLoaded = false;
|
||||
m_LoadInProgress = false;
|
||||
@@ -38,18 +39,19 @@ Core::Core(QString paramFilename, QString remoteHost, uint32_t remoteIdent, bool
|
||||
}
|
||||
}
|
||||
|
||||
Core::~Core()
|
||||
CaptureContext::~CaptureContext()
|
||||
{
|
||||
m_Renderer.CloseThread();
|
||||
delete m_MainWindow;
|
||||
}
|
||||
|
||||
void Core::LoadLogfile(QString logFile, bool temporary)
|
||||
void CaptureContext::LoadLogfile(QString logFile, bool temporary)
|
||||
{
|
||||
LoadLogfile(-1, "", logFile, temporary);
|
||||
}
|
||||
|
||||
void Core::LoadLogfile(int proxyRenderer, QString replayHost, QString logFile, bool temporary)
|
||||
void CaptureContext::LoadLogfile(int proxyRenderer, QString replayHost, QString logFile,
|
||||
bool temporary)
|
||||
{
|
||||
m_LogFile = logFile;
|
||||
|
||||
@@ -162,7 +164,7 @@ void Core::LoadLogfile(int proxyRenderer, QString replayHost, QString logFile, b
|
||||
m_LoadInProgress = false;
|
||||
}
|
||||
|
||||
void Core::SetEventID(ILogViewerForm *exclude, uint32_t eventID)
|
||||
void CaptureContext::SetEventID(ILogViewerForm *exclude, uint32_t eventID)
|
||||
{
|
||||
m_EventID = eventID;
|
||||
|
||||
@@ -183,7 +185,7 @@ void Core::SetEventID(ILogViewerForm *exclude, uint32_t eventID)
|
||||
}
|
||||
}
|
||||
|
||||
void *Core::FillWindowingData(WId widget)
|
||||
void *CaptureContext::FillWindowingData(WId widget)
|
||||
{
|
||||
#if defined(WIN32)
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#ifndef CORE_H
|
||||
#define CORE_H
|
||||
#pragma once
|
||||
|
||||
#include <QList>
|
||||
#include <QMap>
|
||||
@@ -22,11 +21,11 @@ struct ILogLoadProgressListener
|
||||
|
||||
class MainWindow;
|
||||
|
||||
class Core
|
||||
class CaptureContext
|
||||
{
|
||||
public:
|
||||
Core(QString paramFilename, QString remoteHost, uint32_t remoteIdent, bool temp);
|
||||
~Core();
|
||||
CaptureContext(QString paramFilename, QString remoteHost, uint32_t remoteIdent, bool temp);
|
||||
~CaptureContext();
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// Control functions
|
||||
@@ -229,5 +228,3 @@ public:
|
||||
return m_Size;
|
||||
}
|
||||
};
|
||||
|
||||
#endif // CORE_H
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "RenderManager.h"
|
||||
#include <QMutexLocker>
|
||||
#include "Core.h"
|
||||
#include "CaptureContext.h"
|
||||
|
||||
RenderManager::RenderManager()
|
||||
{
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#ifndef RENDERMANAGER_H
|
||||
#define RENDERMANAGER_H
|
||||
#pragma once
|
||||
|
||||
#include <QMutex>
|
||||
#include <QQueue>
|
||||
@@ -14,7 +13,7 @@ class LambdaThread;
|
||||
|
||||
// simple helper for the common case of 'we just need to run this on the render thread
|
||||
#define INVOKE_MEMFN(function) \
|
||||
m_Core->Renderer()->AsyncInvoke([this](IReplayRenderer *) { function(); });
|
||||
m_Ctx->Renderer()->AsyncInvoke([this](IReplayRenderer *) { function(); });
|
||||
|
||||
class RenderManager
|
||||
{
|
||||
@@ -65,5 +64,3 @@ private:
|
||||
LambdaThread *m_Thread;
|
||||
ReplayCreateStatus m_CreateStatus;
|
||||
};
|
||||
|
||||
#endif // RENDERMANAGER_H
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include <QFileInfo>
|
||||
#include <QRegularExpression>
|
||||
#include <QRegularExpressionMatch>
|
||||
#include "Code/Core.h"
|
||||
#include "Code/CaptureContext.h"
|
||||
#include "Windows/MainWindow.h"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
@@ -73,7 +73,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
QApplication a(argc, argv_mod);
|
||||
|
||||
Core core(filename, remoteHost, remoteIdent, temp);
|
||||
CaptureContext ctx(filename, remoteHost, remoteIdent, temp);
|
||||
|
||||
int ret = a.exec();
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "CustomPaintWidget.h"
|
||||
#include <QPainter>
|
||||
#include "Code/Core.h"
|
||||
#include "Code/CaptureContext.h"
|
||||
#include "renderdoc_replay.h"
|
||||
|
||||
CustomPaintWidget::CustomPaintWidget(QWidget *parent) : QWidget(parent)
|
||||
@@ -38,7 +38,7 @@ void CustomPaintWidget::paintEvent(QPaintEvent *e)
|
||||
{
|
||||
if(m_Output)
|
||||
{
|
||||
m_Core->Renderer()->AsyncInvoke([this](IReplayRenderer *r) { m_Output->Display(); });
|
||||
m_Ctx->Renderer()->AsyncInvoke([this](IReplayRenderer *r) { m_Output->Display(); });
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include <QWidget>
|
||||
|
||||
struct IReplayOutput;
|
||||
class Core;
|
||||
class CaptureContext;
|
||||
|
||||
class CustomPaintWidget : public QWidget
|
||||
{
|
||||
@@ -13,9 +13,9 @@ public:
|
||||
explicit CustomPaintWidget(QWidget *parent = 0);
|
||||
~CustomPaintWidget();
|
||||
|
||||
void SetOutput(Core *c, IReplayOutput *out)
|
||||
void SetOutput(CaptureContext *c, IReplayOutput *out)
|
||||
{
|
||||
m_Core = c;
|
||||
m_Ctx = c;
|
||||
m_Output = out;
|
||||
}
|
||||
signals:
|
||||
@@ -35,6 +35,6 @@ public slots:
|
||||
protected:
|
||||
void paintEvent(QPaintEvent *e);
|
||||
QPaintEngine *paintEngine() const { return NULL; }
|
||||
Core *m_Core;
|
||||
CaptureContext *m_Ctx;
|
||||
IReplayOutput *m_Output;
|
||||
};
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "ResourcePreview.h"
|
||||
#include "ui_ResourcePreview.h"
|
||||
|
||||
ResourcePreview::ResourcePreview(Core *c, IReplayOutput *output, QWidget *parent)
|
||||
ResourcePreview::ResourcePreview(CaptureContext *c, IReplayOutput *output, QWidget *parent)
|
||||
: QFrame(parent), ui(new Ui::ResourcePreview)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
@@ -9,14 +9,14 @@ class ResourcePreview;
|
||||
}
|
||||
|
||||
struct IReplayOutput;
|
||||
class Core;
|
||||
class CaptureContext;
|
||||
|
||||
class ResourcePreview : public QFrame
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit ResourcePreview(Core *c, IReplayOutput *output, QWidget *parent = 0);
|
||||
explicit ResourcePreview(CaptureContext *c, IReplayOutput *output, QWidget *parent = 0);
|
||||
~ResourcePreview();
|
||||
|
||||
void setSlotName(const QString &n);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "EventBrowser.h"
|
||||
#include <QTimer>
|
||||
#include "Code/Core.h"
|
||||
#include "Code/CaptureContext.h"
|
||||
#include "ui_EventBrowser.h"
|
||||
|
||||
enum
|
||||
@@ -15,12 +15,12 @@ enum
|
||||
COL_SELECT_EID,
|
||||
};
|
||||
|
||||
EventBrowser::EventBrowser(Core *core, QWidget *parent)
|
||||
: QFrame(parent), ui(new Ui::EventBrowser), m_Core(core)
|
||||
EventBrowser::EventBrowser(CaptureContext *ctx, QWidget *parent)
|
||||
: QFrame(parent), ui(new Ui::EventBrowser), m_Ctx(ctx)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
m_Core->AddLogViewer(this);
|
||||
m_Ctx->AddLogViewer(this);
|
||||
|
||||
ui->events->header()->resizeSection(COL_EID, 45);
|
||||
|
||||
@@ -61,7 +61,7 @@ EventBrowser::EventBrowser(Core *core, QWidget *parent)
|
||||
|
||||
EventBrowser::~EventBrowser()
|
||||
{
|
||||
m_Core->RemoveLogViewer(this);
|
||||
m_Ctx->RemoveLogViewer(this);
|
||||
delete ui;
|
||||
delete m_SizeDelegate;
|
||||
}
|
||||
@@ -70,7 +70,7 @@ void EventBrowser::OnLogfileLoaded()
|
||||
{
|
||||
QTreeWidgetItem *frame = new QTreeWidgetItem(
|
||||
(QTreeWidget *)NULL,
|
||||
QStringList{QString("Frame #%1").arg(m_Core->FrameInfo().frameNumber), "", ""});
|
||||
QStringList{QString("Frame #%1").arg(m_Ctx->FrameInfo().frameNumber), "", ""});
|
||||
|
||||
QTreeWidgetItem *framestart = new QTreeWidgetItem(frame, QStringList{"Frame Start", "0", ""});
|
||||
framestart->setData(COL_EID, Qt::UserRole, QVariant(0));
|
||||
@@ -79,7 +79,7 @@ void EventBrowser::OnLogfileLoaded()
|
||||
framestart->setData(COL_BOOKMARK, Qt::UserRole, QVariant(false));
|
||||
framestart->setData(COL_SELECT_EID, Qt::UserRole, QVariant(0));
|
||||
|
||||
uint lastEID = AddDrawcalls(frame, m_Core->CurDrawcalls());
|
||||
uint lastEID = AddDrawcalls(frame, m_Ctx->CurDrawcalls());
|
||||
frame->setData(COL_EID, Qt::UserRole, QVariant(lastEID));
|
||||
frame->setData(COL_SELECT_EID, Qt::UserRole, QVariant(lastEID));
|
||||
|
||||
@@ -87,7 +87,7 @@ void EventBrowser::OnLogfileLoaded()
|
||||
|
||||
ui->events->expandItem(frame);
|
||||
|
||||
m_Core->SetEventID(this, lastEID);
|
||||
m_Ctx->SetEventID(this, lastEID);
|
||||
}
|
||||
|
||||
void EventBrowser::OnLogfileClosed()
|
||||
@@ -197,7 +197,7 @@ void EventBrowser::on_toolButton_clicked()
|
||||
|
||||
void EventBrowser::on_timeDraws_clicked()
|
||||
{
|
||||
m_Core->Renderer()->AsyncInvoke([this](IReplayRenderer *r) {
|
||||
m_Ctx->Renderer()->AsyncInvoke([this](IReplayRenderer *r) {
|
||||
|
||||
uint32_t counters[] = {eCounter_EventGPUDuration};
|
||||
|
||||
@@ -225,7 +225,7 @@ void EventBrowser::on_events_currentItemChanged(QTreeWidgetItem *current, QTreeW
|
||||
|
||||
uint EID = current->data(COL_SELECT_EID, Qt::UserRole).toUInt();
|
||||
|
||||
m_Core->SetEventID(this, EID);
|
||||
m_Ctx->SetEventID(this, EID);
|
||||
}
|
||||
|
||||
void EventBrowser::on_HideFindJump()
|
||||
@@ -355,7 +355,7 @@ void EventBrowser::ExpandNode(QTreeWidgetItem *node)
|
||||
|
||||
bool EventBrowser::SelectEvent(uint32_t eventID)
|
||||
{
|
||||
if(!m_Core->LogLoaded())
|
||||
if(!m_Ctx->LogLoaded())
|
||||
return false;
|
||||
|
||||
QTreeWidgetItem *found = NULL;
|
||||
@@ -389,7 +389,7 @@ void EventBrowser::ClearFindIcons(QTreeWidgetItem *parent)
|
||||
|
||||
void EventBrowser::ClearFindIcons()
|
||||
{
|
||||
if(m_Core->LogLoaded())
|
||||
if(m_Ctx->LogLoaded())
|
||||
ClearFindIcons(ui->events->topLevelItem(0));
|
||||
}
|
||||
|
||||
@@ -483,7 +483,7 @@ int EventBrowser::FindEvent(QTreeWidgetItem *parent, QString filter, uint32_t af
|
||||
|
||||
int EventBrowser::FindEvent(QString filter, uint32_t after, bool forward)
|
||||
{
|
||||
if(!m_Core->LogLoaded())
|
||||
if(!m_Ctx->LogLoaded())
|
||||
return 0;
|
||||
|
||||
return FindEvent(ui->events->topLevelItem(0), filter, after, forward);
|
||||
@@ -494,7 +494,7 @@ void EventBrowser::Find(bool forward)
|
||||
if(ui->findEvent->text().isEmpty())
|
||||
return;
|
||||
|
||||
uint32_t curEID = m_Core->CurEvent();
|
||||
uint32_t curEID = m_Ctx->CurEvent();
|
||||
if(!ui->events->selectedItems().isEmpty())
|
||||
curEID = ui->events->selectedItems()[0]->data(COL_SELECT_EID, Qt::UserRole).toUInt();
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#include <QFrame>
|
||||
#include <QIcon>
|
||||
#include "Code/Core.h"
|
||||
#include "Code/CaptureContext.h"
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
@@ -19,7 +19,7 @@ private:
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit EventBrowser(Core *core, QWidget *parent = 0);
|
||||
explicit EventBrowser(CaptureContext *ctx, QWidget *parent = 0);
|
||||
~EventBrowser();
|
||||
|
||||
void OnLogfileLoaded();
|
||||
@@ -81,7 +81,7 @@ private:
|
||||
void RefreshIcon(QTreeWidgetItem *item);
|
||||
|
||||
Ui::EventBrowser *ui;
|
||||
Core *m_Core;
|
||||
CaptureContext *m_Ctx;
|
||||
};
|
||||
|
||||
#endif // EVENTBROWSER_H
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
#include "MainWindow.h"
|
||||
#include <QFileDialog>
|
||||
#include <QFileInfo>
|
||||
#include "Code/Core.h"
|
||||
#include "Code/CaptureContext.h"
|
||||
#include "Windows/AboutDialog.h"
|
||||
#include "EventBrowser.h"
|
||||
#include "TextureViewer.h"
|
||||
#include "ui_MainWindow.h"
|
||||
|
||||
MainWindow::MainWindow(Core *core) : QMainWindow(NULL), ui(new Ui::MainWindow), m_Core(core)
|
||||
MainWindow::MainWindow(CaptureContext *ctx) : QMainWindow(NULL), ui(new Ui::MainWindow), m_Ctx(ctx)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
EventBrowser *eventbrowser = new EventBrowser(core);
|
||||
EventBrowser *eventbrowser = new EventBrowser(ctx);
|
||||
|
||||
ui->toolWindowManager->addToolWindow(eventbrowser, ToolWindowManager::EmptySpace);
|
||||
|
||||
TextureViewer *textureviewer = new TextureViewer(core);
|
||||
TextureViewer *textureviewer = new TextureViewer(ctx);
|
||||
|
||||
ui->toolWindowManager->addToolWindow(
|
||||
textureviewer,
|
||||
@@ -46,7 +46,7 @@ void MainWindow::on_action_Open_Log_triggered()
|
||||
if(filename != "" && checkFile.exists() && checkFile.isFile())
|
||||
{
|
||||
LambdaThread *thread =
|
||||
new LambdaThread([filename, this]() { m_Core->LoadLogfile(filename, false); });
|
||||
new LambdaThread([filename, this]() { m_Ctx->LoadLogfile(filename, false); });
|
||||
thread->start();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace Ui
|
||||
class MainWindow;
|
||||
}
|
||||
|
||||
class Core;
|
||||
class CaptureContext;
|
||||
|
||||
class MainWindow : public QMainWindow
|
||||
{
|
||||
@@ -17,7 +17,7 @@ private:
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit MainWindow(Core *core);
|
||||
explicit MainWindow(CaptureContext *ctx);
|
||||
~MainWindow();
|
||||
|
||||
private slots:
|
||||
@@ -27,7 +27,7 @@ private slots:
|
||||
|
||||
private:
|
||||
Ui::MainWindow *ui;
|
||||
Core *m_Core;
|
||||
CaptureContext *m_Ctx;
|
||||
};
|
||||
|
||||
#endif // MAINWINDOW_H
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
#include "TextureViewer.h"
|
||||
#include <QColorDialog>
|
||||
#include "Code/Core.h"
|
||||
#include "Code/CaptureContext.h"
|
||||
#include "Widgets/ResourcePreview.h"
|
||||
#include "FlowLayout.h"
|
||||
#include "ui_TextureViewer.h"
|
||||
@@ -15,15 +15,15 @@ struct Formatter
|
||||
static QString Format(int32_t i) { return QString::number(i); }
|
||||
};
|
||||
|
||||
TextureViewer::TextureViewer(Core *core, QWidget *parent)
|
||||
: QFrame(parent), ui(new Ui::TextureViewer), m_Core(core)
|
||||
TextureViewer::TextureViewer(CaptureContext *ctx, QWidget *parent)
|
||||
: QFrame(parent), ui(new Ui::TextureViewer), m_Ctx(ctx)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
m_Core->AddLogViewer(this);
|
||||
m_Ctx->AddLogViewer(this);
|
||||
|
||||
ui->render->SetOutput(m_Core, NULL);
|
||||
ui->pixelContext->SetOutput(m_Core, NULL);
|
||||
ui->render->SetOutput(m_Ctx, NULL);
|
||||
ui->pixelContext->SetOutput(m_Ctx, NULL);
|
||||
|
||||
memset(&m_TexDisplay, 0, sizeof(m_TexDisplay));
|
||||
m_TexDisplay.sampleIdx = ~0U;
|
||||
@@ -195,7 +195,7 @@ TextureViewer::TextureViewer(Core *core, QWidget *parent)
|
||||
|
||||
TextureViewer::~TextureViewer()
|
||||
{
|
||||
m_Core->RemoveLogViewer(this);
|
||||
m_Ctx->RemoveLogViewer(this);
|
||||
delete ui;
|
||||
}
|
||||
|
||||
@@ -260,7 +260,7 @@ void TextureViewer::RT_UpdateAndDisplay()
|
||||
|
||||
void TextureViewer::UI_UpdateStatusText()
|
||||
{
|
||||
FetchTexture *texptr = m_Core->GetTexture(m_TexDisplay.texid);
|
||||
FetchTexture *texptr = m_Ctx->GetTexture(m_TexDisplay.texid);
|
||||
if(texptr == NULL)
|
||||
return;
|
||||
|
||||
@@ -315,7 +315,7 @@ void TextureViewer::UI_UpdateStatusText()
|
||||
uint mipWidth = qMax(1U, tex.width >> (int)m_TexDisplay.mip);
|
||||
uint mipHeight = qMax(1U, tex.height >> (int)m_TexDisplay.mip);
|
||||
|
||||
if(m_Core->APIProps().pipelineType == eGraphicsAPI_OpenGL)
|
||||
if(m_Ctx->APIProps().pipelineType == eGraphicsAPI_OpenGL)
|
||||
y = (int)(mipHeight - 1) - y;
|
||||
if(m_TexDisplay.FlipY)
|
||||
y = (int)(mipHeight - 1) - y;
|
||||
@@ -344,7 +344,7 @@ void TextureViewer::UI_UpdateStatusText()
|
||||
{
|
||||
x = m_PickedPoint.x() >> (int)m_TexDisplay.mip;
|
||||
y = m_PickedPoint.y() >> (int)m_TexDisplay.mip;
|
||||
if(m_Core->APIProps().pipelineType == eGraphicsAPI_OpenGL)
|
||||
if(m_Ctx->APIProps().pipelineType == eGraphicsAPI_OpenGL)
|
||||
y = (int)(mipHeight - 1) - y;
|
||||
if(m_TexDisplay.FlipY)
|
||||
y = (int)(mipHeight - 1) - y;
|
||||
@@ -418,7 +418,7 @@ void TextureViewer::UI_UpdateStatusText()
|
||||
|
||||
if(m_Output != NULL)
|
||||
{
|
||||
m_Core->Renderer()->AsyncInvoke([this](IReplayRenderer *) { m_Output->DisablePixelContext(); });
|
||||
m_Ctx->Renderer()->AsyncInvoke([this](IReplayRenderer *) { m_Output->DisablePixelContext(); });
|
||||
}
|
||||
|
||||
// PixelPicked = false;
|
||||
@@ -441,7 +441,7 @@ void TextureViewer::UI_UpdateTextureDetails()
|
||||
{
|
||||
QString status;
|
||||
|
||||
FetchTexture *texptr = m_Core->GetTexture(m_TexDisplay.texid);
|
||||
FetchTexture *texptr = m_Ctx->GetTexture(m_TexDisplay.texid);
|
||||
if(texptr == NULL)
|
||||
{
|
||||
ui->texStatusDim->setText(status);
|
||||
@@ -455,14 +455,14 @@ void TextureViewer::UI_UpdateTextureDetails()
|
||||
#if 1
|
||||
ui->renderContainer->setWindowTitle(tr(current.name.elems));
|
||||
#else
|
||||
ResourceId followID = m_Following.GetResourceId(m_Core);
|
||||
ResourceId followID = m_Following.GetResourceId(m_Ctx);
|
||||
|
||||
{
|
||||
bool found = false;
|
||||
|
||||
string name = "";
|
||||
|
||||
foreach(var t in m_Core.CurTextures)
|
||||
foreach(var t in m_Ctx.CurTextures)
|
||||
{
|
||||
if(t.ID == followID)
|
||||
{
|
||||
@@ -471,7 +471,7 @@ void TextureViewer::UI_UpdateTextureDetails()
|
||||
}
|
||||
}
|
||||
|
||||
foreach(var b in m_Core.CurBuffers)
|
||||
foreach(var b in m_Ctx.CurBuffers)
|
||||
{
|
||||
if(b.ID == followID)
|
||||
{
|
||||
@@ -548,7 +548,7 @@ void TextureViewer::UI_UpdateTextureDetails()
|
||||
|
||||
void TextureViewer::UI_OnTextureSelectionChanged(bool newdraw)
|
||||
{
|
||||
FetchTexture *texptr = m_Core->GetTexture(m_TexDisplay.texid);
|
||||
FetchTexture *texptr = m_Ctx->GetTexture(m_TexDisplay.texid);
|
||||
|
||||
// reset high-water mark
|
||||
m_HighWaterStatusLength = 0;
|
||||
@@ -602,7 +602,7 @@ void TextureViewer::UI_OnTextureSelectionChanged(bool newdraw)
|
||||
// only switch to the selected mip for outputs, and when changing drawcall
|
||||
/*
|
||||
if (!CurrentTextureIsLocked && m_Following.Type != FollowType.ReadOnly && newdraw)
|
||||
highestMip = m_Following.GetHighestMip(m_Core);
|
||||
highestMip = m_Following.GetHighestMip(m_Ctx);
|
||||
*/
|
||||
|
||||
// assuming we get a valid mip for the highest mip, only switch to it
|
||||
@@ -666,7 +666,7 @@ void TextureViewer::UI_OnTextureSelectionChanged(bool newdraw)
|
||||
// only switch to the selected mip for outputs, and when changing drawcall
|
||||
/*
|
||||
if (!CurrentTextureIsLocked && m_Following.Type != FollowType.ReadOnly && newdraw)
|
||||
firstArraySlice = m_Following.GetFirstArraySlice(m_Core);
|
||||
firstArraySlice = m_Following.GetFirstArraySlice(m_Ctx);
|
||||
*/
|
||||
|
||||
// see above with highestMip and prevHighestMip for the logic behind this
|
||||
@@ -686,7 +686,7 @@ void TextureViewer::UI_OnTextureSelectionChanged(bool newdraw)
|
||||
UI_UpdateTextureDetails();
|
||||
UI_UpdateChannels();
|
||||
|
||||
m_Core->Renderer()->AsyncInvoke([this](IReplayRenderer *) {
|
||||
m_Ctx->Renderer()->AsyncInvoke([this](IReplayRenderer *) {
|
||||
// RT_UpdateVisualRange(r);
|
||||
|
||||
RT_UpdateAndDisplay();
|
||||
@@ -700,7 +700,7 @@ void TextureViewer::UI_OnTextureSelectionChanged(bool newdraw)
|
||||
|
||||
void TextureViewer::UI_UpdateChannels()
|
||||
{
|
||||
FetchTexture *tex = m_Core->GetTexture(m_TexDisplay.texid);
|
||||
FetchTexture *tex = m_Ctx->GetTexture(m_TexDisplay.texid);
|
||||
|
||||
#define SHOW(widget) widget->setVisible(true)
|
||||
#define HIDE(widget) widget->setVisible(false)
|
||||
@@ -775,7 +775,7 @@ void TextureViewer::UI_UpdateChannels()
|
||||
}
|
||||
m_TexDisplay.CustomShader = ResourceId();
|
||||
}
|
||||
else if(ui->channels->currentIndex() == 0 || !m_Core->LogLoaded())
|
||||
else if(ui->channels->currentIndex() == 0 || !m_Ctx->LogLoaded())
|
||||
{
|
||||
// RGBA
|
||||
SHOW(ui->channelRed);
|
||||
@@ -923,7 +923,7 @@ void TextureViewer::render_mouseMove(QMouseEvent *e)
|
||||
|
||||
if(m_TexDisplay.texid != ResourceId())
|
||||
{
|
||||
FetchTexture *texptr = m_Core->GetTexture(m_TexDisplay.texid);
|
||||
FetchTexture *texptr = m_Ctx->GetTexture(m_TexDisplay.texid);
|
||||
|
||||
if(texptr != NULL)
|
||||
{
|
||||
@@ -993,7 +993,7 @@ void TextureViewer::render_resize(QResizeEvent *e)
|
||||
|
||||
float TextureViewer::CurMaxScrollX()
|
||||
{
|
||||
FetchTexture *texptr = m_Core->GetTexture(m_TexDisplay.texid);
|
||||
FetchTexture *texptr = m_Ctx->GetTexture(m_TexDisplay.texid);
|
||||
|
||||
QSizeF size(1.0f, 1.0f);
|
||||
|
||||
@@ -1005,7 +1005,7 @@ float TextureViewer::CurMaxScrollX()
|
||||
|
||||
float TextureViewer::CurMaxScrollY()
|
||||
{
|
||||
FetchTexture *texptr = m_Core->GetTexture(m_TexDisplay.texid);
|
||||
FetchTexture *texptr = m_Ctx->GetTexture(m_TexDisplay.texid);
|
||||
|
||||
QSizeF size(1.0f, 1.0f);
|
||||
|
||||
@@ -1042,7 +1042,7 @@ void TextureViewer::setScrollPosition(const QPoint &pos)
|
||||
|
||||
void TextureViewer::UI_CalcScrollbars()
|
||||
{
|
||||
FetchTexture *texptr = m_Core->GetTexture(m_TexDisplay.texid);
|
||||
FetchTexture *texptr = m_Ctx->GetTexture(m_TexDisplay.texid);
|
||||
|
||||
QSizeF size(1.0f, 1.0f);
|
||||
|
||||
@@ -1107,13 +1107,13 @@ void TextureViewer::OnLogfileLoaded()
|
||||
WId renderID = ui->render->winId();
|
||||
WId contextID = ui->pixelContext->winId();
|
||||
|
||||
m_Core->Renderer()->BlockInvoke([renderID, contextID, this](IReplayRenderer *r) {
|
||||
m_Output = r->CreateOutput(m_Core->m_CurWinSystem, m_Core->FillWindowingData(renderID),
|
||||
m_Ctx->Renderer()->BlockInvoke([renderID, contextID, this](IReplayRenderer *r) {
|
||||
m_Output = r->CreateOutput(m_Ctx->m_CurWinSystem, m_Ctx->FillWindowingData(renderID),
|
||||
eOutputType_TexDisplay);
|
||||
|
||||
m_Output->SetPixelContext(m_Core->m_CurWinSystem, m_Core->FillWindowingData(contextID));
|
||||
m_Output->SetPixelContext(m_Ctx->m_CurWinSystem, m_Ctx->FillWindowingData(contextID));
|
||||
|
||||
ui->render->SetOutput(m_Core, m_Output);
|
||||
ui->render->SetOutput(m_Ctx, m_Output);
|
||||
|
||||
OutputConfig c = {eOutputType_TexDisplay};
|
||||
m_Output->SetOutputConfig(c);
|
||||
@@ -1123,7 +1123,7 @@ void TextureViewer::OnLogfileLoaded()
|
||||
void TextureViewer::OnLogfileClosed()
|
||||
{
|
||||
m_Output = NULL;
|
||||
ui->render->SetOutput(m_Core, NULL);
|
||||
ui->render->SetOutput(m_Ctx, NULL);
|
||||
|
||||
UI_UpdateTextureDetails();
|
||||
}
|
||||
@@ -1139,23 +1139,23 @@ void TextureViewer::OnEventSelected(uint32_t eventID)
|
||||
|
||||
// hack to select texture until we have thumbnails & following
|
||||
TextureDisplay &d = m_TexDisplay;
|
||||
if(m_Core->APIProps().pipelineType == eGraphicsAPI_D3D11)
|
||||
if(m_Ctx->APIProps().pipelineType == eGraphicsAPI_D3D11)
|
||||
{
|
||||
d.texid = m_Core->CurD3D11PipelineState.m_OM.RenderTargets[0].Resource;
|
||||
d.texid = m_Ctx->CurD3D11PipelineState.m_OM.RenderTargets[0].Resource;
|
||||
|
||||
if(d.texid == ResourceId())
|
||||
d.texid = m_Core->CurD3D11PipelineState.m_OM.DepthTarget.Resource;
|
||||
d.texid = m_Ctx->CurD3D11PipelineState.m_OM.DepthTarget.Resource;
|
||||
}
|
||||
else if(m_Core->APIProps().pipelineType == eGraphicsAPI_OpenGL)
|
||||
else if(m_Ctx->APIProps().pipelineType == eGraphicsAPI_OpenGL)
|
||||
{
|
||||
d.texid = m_Core->CurGLPipelineState.m_FB.m_DrawFBO.Color[0].Obj;
|
||||
d.texid = m_Ctx->CurGLPipelineState.m_FB.m_DrawFBO.Color[0].Obj;
|
||||
|
||||
if(d.texid == ResourceId())
|
||||
d.texid = m_Core->CurGLPipelineState.m_FB.m_DrawFBO.Depth.Obj;
|
||||
d.texid = m_Ctx->CurGLPipelineState.m_FB.m_DrawFBO.Depth.Obj;
|
||||
}
|
||||
else
|
||||
{
|
||||
const VulkanPipelineState &pipe = m_Core->CurVulkanPipelineState;
|
||||
const VulkanPipelineState &pipe = m_Ctx->CurVulkanPipelineState;
|
||||
if(pipe.Pass.renderpass.colorAttachments.count > 0)
|
||||
d.texid = pipe.Pass.framebuffer.attachments[pipe.Pass.renderpass.colorAttachments[0]].img;
|
||||
|
||||
@@ -1164,7 +1164,7 @@ void TextureViewer::OnEventSelected(uint32_t eventID)
|
||||
|
||||
if(d.texid == ResourceId())
|
||||
{
|
||||
const FetchDrawcall *draw = m_Core->CurDrawcall();
|
||||
const FetchDrawcall *draw = m_Ctx->CurDrawcall();
|
||||
if(draw)
|
||||
d.texid = draw->copyDestination;
|
||||
}
|
||||
@@ -1175,7 +1175,7 @@ void TextureViewer::OnEventSelected(uint32_t eventID)
|
||||
|
||||
float TextureViewer::GetFitScale()
|
||||
{
|
||||
FetchTexture *texptr = m_Core->GetTexture(m_TexDisplay.texid);
|
||||
FetchTexture *texptr = m_Ctx->GetTexture(m_TexDisplay.texid);
|
||||
|
||||
if(texptr == NULL)
|
||||
return 1.0f;
|
||||
@@ -1353,7 +1353,7 @@ void TextureViewer::on_checkerBack_clicked()
|
||||
|
||||
void TextureViewer::on_mipLevel_currentIndexChanged(int index)
|
||||
{
|
||||
FetchTexture *texptr = m_Core->GetTexture(m_TexDisplay.texid);
|
||||
FetchTexture *texptr = m_Ctx->GetTexture(m_TexDisplay.texid);
|
||||
if(texptr == NULL)
|
||||
return;
|
||||
|
||||
@@ -1396,7 +1396,7 @@ void TextureViewer::on_mipLevel_currentIndexChanged(int index)
|
||||
|
||||
if(m_Output != NULL && m_PickedPoint.x() >= 0 && m_PickedPoint.y() >= 0)
|
||||
{
|
||||
m_Core->Renderer()->AsyncInvoke([this](IReplayRenderer *) {
|
||||
m_Ctx->Renderer()->AsyncInvoke([this](IReplayRenderer *) {
|
||||
if(m_Output != NULL)
|
||||
RT_PickPixelsAndUpdate();
|
||||
});
|
||||
@@ -1407,7 +1407,7 @@ void TextureViewer::on_mipLevel_currentIndexChanged(int index)
|
||||
|
||||
void TextureViewer::on_sliceFace_currentIndexChanged(int index)
|
||||
{
|
||||
FetchTexture *texptr = m_Core->GetTexture(m_TexDisplay.texid);
|
||||
FetchTexture *texptr = m_Ctx->GetTexture(m_TexDisplay.texid);
|
||||
if(texptr == NULL)
|
||||
return;
|
||||
|
||||
@@ -1421,7 +1421,7 @@ void TextureViewer::on_sliceFace_currentIndexChanged(int index)
|
||||
|
||||
if(m_Output != NULL && m_PickedPoint.x() >= 0 && m_PickedPoint.y() >= 0)
|
||||
{
|
||||
m_Core->Renderer()->AsyncInvoke([this](IReplayRenderer *) {
|
||||
m_Ctx->Renderer()->AsyncInvoke([this](IReplayRenderer *) {
|
||||
if(m_Output != NULL)
|
||||
RT_PickPixelsAndUpdate();
|
||||
});
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#include <QFrame>
|
||||
#include <QMouseEvent>
|
||||
#include "Code/Core.h"
|
||||
#include "Code/CaptureContext.h"
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
@@ -16,7 +16,7 @@ private:
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit TextureViewer(Core *core, QWidget *parent = 0);
|
||||
explicit TextureViewer(CaptureContext *ctx, QWidget *parent = 0);
|
||||
~TextureViewer();
|
||||
|
||||
void OnLogfileLoaded();
|
||||
@@ -99,7 +99,7 @@ private:
|
||||
int m_PrevHighestMip = -1;
|
||||
|
||||
Ui::TextureViewer *ui;
|
||||
Core *m_Core = NULL;
|
||||
CaptureContext *m_Ctx = NULL;
|
||||
IReplayOutput *m_Output = NULL;
|
||||
|
||||
TextureDisplay m_TexDisplay;
|
||||
|
||||
@@ -277,7 +277,7 @@
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="generated\moc_AboutDialog.cpp" />
|
||||
<ClCompile Include="generated\moc_Core.cpp" />
|
||||
<ClCompile Include="generated\moc_CaptureContext.cpp" />
|
||||
<ClCompile Include="generated\moc_CustomPaintWidget.cpp" />
|
||||
<ClCompile Include="generated\moc_EventBrowser.cpp" />
|
||||
<ClCompile Include="generated\moc_RDLabel.cpp" />
|
||||
@@ -294,7 +294,7 @@
|
||||
<ClCompile Include="Widgets\ResourcePreview.cpp" />
|
||||
<ClCompile Include="Widgets\ThumbnailStrip.cpp" />
|
||||
<ClCompile Include="Windows\AboutDialog.cpp" />
|
||||
<ClCompile Include="Code\Core.cpp" />
|
||||
<ClCompile Include="Code\CaptureContext.cpp" />
|
||||
<ClCompile Include="Widgets\CustomPaintWidget.cpp" />
|
||||
<ClCompile Include="Windows\EventBrowser.cpp" />
|
||||
<ClCompile Include="3rdparty\flowlayout\FlowLayout.cpp">
|
||||
@@ -326,7 +326,7 @@
|
||||
<ClInclude Include="Widgets\ResourcePreview.h" />
|
||||
<ClInclude Include="Widgets\ThumbnailStrip.h" />
|
||||
<ClInclude Include="Windows\AboutDialog.h" />
|
||||
<ClInclude Include="Code\Core.h" />
|
||||
<ClInclude Include="Code\CaptureContext.h" />
|
||||
<ClInclude Include="Widgets\CustomPaintWidget.h" />
|
||||
<ClInclude Include="Windows\EventBrowser.h" />
|
||||
<ClInclude Include="3rdparty\flowlayout\FlowLayout.h" />
|
||||
|
||||
@@ -67,9 +67,6 @@
|
||||
<ClCompile Include="generated\moc_AboutDialog.cpp">
|
||||
<Filter>Generated Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="generated\moc_Core.cpp">
|
||||
<Filter>Generated Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="generated\moc_CustomPaintWidget.cpp">
|
||||
<Filter>Generated Files</Filter>
|
||||
</ClCompile>
|
||||
@@ -85,9 +82,6 @@
|
||||
<ClCompile Include="3rdparty\flowlayout\FlowLayout.cpp">
|
||||
<Filter>3rdparty\FlowLayout</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Code\Core.cpp">
|
||||
<Filter>Code</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Code\main.cpp">
|
||||
<Filter>Code</Filter>
|
||||
</ClCompile>
|
||||
@@ -130,6 +124,12 @@
|
||||
<ClCompile Include="generated\moc_ThumbnailStrip.cpp">
|
||||
<Filter>Generated Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Code\CaptureContext.cpp">
|
||||
<Filter>Code</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="generated\moc_CaptureContext.cpp">
|
||||
<Filter>Generated Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="3rdparty\flowlayout\FlowLayout.h">
|
||||
@@ -141,9 +141,6 @@
|
||||
<ClInclude Include="Windows\AboutDialog.h">
|
||||
<Filter>Windows\Dialogs</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Code\Core.h">
|
||||
<Filter>Code</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Widgets\CustomPaintWidget.h">
|
||||
<Filter>Widgets</Filter>
|
||||
</ClInclude>
|
||||
@@ -183,6 +180,9 @@
|
||||
<ClInclude Include="generated\ui_ThumbnailStrip.h">
|
||||
<Filter>Generated Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Code\CaptureContext.h">
|
||||
<Filter>Code</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="resources.qrc">
|
||||
|
||||
Reference in New Issue
Block a user