From d48b84d8f5d803ded3dc0072ac2aa505ad765741 Mon Sep 17 00:00:00 2001 From: baldurk Date: Tue, 15 Oct 2019 10:54:42 +0100 Subject: [PATCH] Pass buffer length to format string parse, for better default format * If we are only looking at a 4-byte buffer, don't use a uint4 default or it will fail to display anything --- qrenderdoc/Windows/BufferViewer.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/qrenderdoc/Windows/BufferViewer.cpp b/qrenderdoc/Windows/BufferViewer.cpp index cfe1b4cd8..756a7ea4c 100644 --- a/qrenderdoc/Windows/BufferViewer.cpp +++ b/qrenderdoc/Windows/BufferViewer.cpp @@ -2112,8 +2112,12 @@ void BufferViewer::OnEventChanged(uint32_t eventId) } else { + uint64_t len = m_ByteSize; + if(len == UINT64_MAX) + len = 0; + QString errors; - bufdata->vsinConfig.columns = FormatElement::ParseFormatString(m_Format, 0, true, errors); + bufdata->vsinConfig.columns = FormatElement::ParseFormatString(m_Format, len, true, errors); ClearModels(); } @@ -3260,7 +3264,11 @@ void BufferViewer::processFormat(const QString &format) BufferConfiguration bufconfig; - QList cols = FormatElement::ParseFormatString(format, 0, true, errors); + uint64_t len = m_ByteSize; + if(len == UINT64_MAX) + len = 0; + + QList cols = FormatElement::ParseFormatString(format, len, true, errors); int maxNumRows = 1;