mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-06 01:50:38 +00:00
Fix texture-as-buffer view format string generation
This commit is contained in:
@@ -2214,7 +2214,7 @@ QString BufferFormatter::GetTextureFormatString(const TextureDescription &tex)
|
||||
if(tex.type == TextureType::Buffer)
|
||||
return QFormatStr("%1 %2;").arg(baseType).arg(varName);
|
||||
|
||||
return QFormatStr("%1 %2[%3];").arg(baseType).arg(varName).arg(w);
|
||||
return QFormatStr("struct row\n{\n %1 %2[%3];\n};\n\nrow r[];").arg(baseType).arg(varName).arg(w);
|
||||
}
|
||||
|
||||
QString BufferFormatter::GetBufferFormatString(Packing::Rules pack, const ShaderResource &res,
|
||||
|
||||
@@ -150,6 +150,8 @@ void BufferFormatSpecifier::setAutoFormat(QString autoFormat)
|
||||
setFormat(autoFormat);
|
||||
|
||||
formatText->emptyUndoBuffer();
|
||||
|
||||
on_apply_clicked();
|
||||
}
|
||||
|
||||
void BufferFormatSpecifier::setContext(ICaptureContext *ctx)
|
||||
|
||||
@@ -4163,8 +4163,6 @@ void BufferViewer::ViewBuffer(uint64_t byteOffset, uint64_t byteSize, ResourceId
|
||||
m_PagingByteOffset = 0;
|
||||
|
||||
ui->formatSpecifier->setAutoFormat(format);
|
||||
|
||||
processFormat(format);
|
||||
}
|
||||
|
||||
BufferViewer *BufferViewer::HasCBufferView(ShaderStage stage, uint32_t slot, uint32_t idx)
|
||||
@@ -4214,8 +4212,7 @@ void BufferViewer::ViewCBuffer(const ShaderStage stage, uint32_t slot, uint32_t
|
||||
|
||||
ui->formatSpecifier->setFormat(QString());
|
||||
ui->formatSpecifier->setVisible(false);
|
||||
|
||||
processFormat(QString());
|
||||
ui->formatSpecifier->setAutoFormat(QString());
|
||||
|
||||
m_CBufferViews.push_back(this);
|
||||
}
|
||||
@@ -4239,7 +4236,7 @@ void BufferViewer::ViewTexture(ResourceId id, const Subresource &sub, const rdcs
|
||||
|
||||
m_PagingByteOffset = 0;
|
||||
|
||||
processFormat(format);
|
||||
ui->formatSpecifier->setAutoFormat(format);
|
||||
}
|
||||
|
||||
void BufferViewer::ScrollToRow(int32_t row, MeshDataStage stage)
|
||||
|
||||
Reference in New Issue
Block a user