Use BufferViewer for viewing constant buffers

* Unifying these views means that constant buffers have all the same
  reformatting and it avoids having multiple paths for what is now effectively
  the same control (a buffer can either have fixed data, repeating data, or
  both)
This commit is contained in:
baldurk
2022-05-20 14:15:30 +01:00
parent fcdcc9714b
commit 43fa3cd94b
23 changed files with 533 additions and 899 deletions
+11 -7
View File
@@ -41,7 +41,6 @@
#include "Windows/APIInspector.h"
#include "Windows/BufferViewer.h"
#include "Windows/CommentView.h"
#include "Windows/ConstantBufferPreviewer.h"
#include "Windows/DebugMessageView.h"
#include "Windows/Dialogs/CaptureDialog.h"
#include "Windows/Dialogs/CrashDialog.h"
@@ -2597,14 +2596,17 @@ IBufferViewer *CaptureContext::ViewTextureAsBuffer(ResourceId id, const Subresou
return viewer;
}
IConstantBufferPreviewer *CaptureContext::ViewConstantBuffer(ShaderStage stage, uint32_t slot,
uint32_t idx)
IBufferViewer *CaptureContext::ViewConstantBuffer(ShaderStage stage, uint32_t slot, uint32_t idx)
{
ConstantBufferPreviewer *existing = ConstantBufferPreviewer::has(stage, slot, idx);
BufferViewer *existing = BufferViewer::HasCBufferView(stage, slot, idx);
if(existing != NULL)
return existing;
return new ConstantBufferPreviewer(*this, stage, slot, idx, m_MainWindow);
BufferViewer *viewer = new BufferViewer(*this, false, m_MainWindow);
viewer->ViewCBuffer(stage, slot, idx);
return viewer;
}
IPixelHistoryView *CaptureContext::ViewPixelHistory(ResourceId texID, uint32_t x, uint32_t y,
@@ -2756,11 +2758,13 @@ void CaptureContext::AddDockWindow(QWidget *newWindow, DockReference ref, QWidge
if(ref == DockReference::TransientPopupArea)
{
if(qobject_cast<ConstantBufferPreviewer *>(newWindow))
BufferViewer *buf = qobject_cast<BufferViewer *>(newWindow);
if(buf && buf->IsCBufferView())
{
ToolWindowManager *manager = ToolWindowManager::managerOf(refWindow);
ConstantBufferPreviewer *cb = manager->findChild<ConstantBufferPreviewer *>();
BufferViewer *cb = BufferViewer::GetFirstCBufferView(buf);
if(cb)
{
manager->addToolWindow(newWindow, ToolWindowManager::AreaReference(ToolWindowManager::AddTo,