diff --git a/qrenderdoc/Windows/BufferViewer.cpp b/qrenderdoc/Windows/BufferViewer.cpp index 41d2025a3..7718bea98 100644 --- a/qrenderdoc/Windows/BufferViewer.cpp +++ b/qrenderdoc/Windows/BufferViewer.cpp @@ -3641,6 +3641,14 @@ void BufferViewer::ClearModels() void BufferViewer::CalcColumnWidth(int maxNumRows) { + // while the calculated column widths aren't actually isn't quite based on maxNumRows, it can only + // be affected by a style change so that is good enough for us to cache it and save time + // recalculating this repeatedly. + if(m_ColumnWidthRowCount == maxNumRows) + return; + + m_ColumnWidthRowCount = maxNumRows; + ResourceFormat floatFmt; floatFmt.compByteWidth = 4; floatFmt.compType = CompType::Float; diff --git a/qrenderdoc/Windows/BufferViewer.h b/qrenderdoc/Windows/BufferViewer.h index e84db8844..29ee9a63f 100644 --- a/qrenderdoc/Windows/BufferViewer.h +++ b/qrenderdoc/Windows/BufferViewer.h @@ -208,6 +208,7 @@ private: RDTableView *m_CurView = NULL; int m_ContextColumn = -1; + int m_ColumnWidthRowCount = -1; int m_IdxColWidth; int m_DataColWidth; int m_DataRowHeight;