mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-07-09 17:17:11 +00:00
Until proper support is added, prevent crashes by decaying VB formats
* Unfortunately some formats are *only* supported through VB fixed-func inputs, and not through any other access (like texel buffer access). * As a result, it's invalid for us to just create buffer views using these formats to read from, so we will need to read-back the data to the CPU, decode and unpack to another format that is supported, and then re-upload. In some cases this might be extremely complex (e.g. 64-bit wide formats that have no easily supported fallback). * In the meantime, we just re-write the format to R8G8B8A8_UNORM. It will return the wrong data, but will at least not crash.
This commit is contained in:
@@ -1375,6 +1375,16 @@ void VulkanReplay::InitPostVSBuffers(uint32_t eventId)
|
||||
VK_WHOLE_SIZE,
|
||||
};
|
||||
|
||||
if((m_pDriver->GetFormatProperties(attrDesc.format).bufferFeatures &
|
||||
VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT) == 0)
|
||||
{
|
||||
RDCERR(
|
||||
"Format %s doesn't support texel buffers! Replacing with safe but broken format, for "
|
||||
"now. This will require a CPU readback and unpack to properly fix.",
|
||||
ToStr(attrDesc.format).c_str());
|
||||
info.format = VK_FORMAT_R8G8B8A8_UNORM;
|
||||
}
|
||||
|
||||
m_pDriver->vkCreateBufferView(dev, &info, NULL, &vbuffers[attr].view);
|
||||
|
||||
attrIsInstanced.resize(RDCMAX(attrIsInstanced.size(), size_t(attr + 1)));
|
||||
|
||||
Reference in New Issue
Block a user