From 652e77c2f97323289f86d276c06398e6d3e36535 Mon Sep 17 00:00:00 2001 From: baldurk Date: Fri, 10 May 2019 23:51:08 +0100 Subject: [PATCH] Always create proxy buffers on D3D11 as just VB and IB * We don't use proxy buffers for anything else so it's safe to ignore other creation flags. This way we don't get problems with more flexible APIs like vulkan allowing buffer usage combinations that are illegal on D3D11. --- renderdoc/driver/d3d11/d3d11_replay.cpp | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/renderdoc/driver/d3d11/d3d11_replay.cpp b/renderdoc/driver/d3d11/d3d11_replay.cpp index 9763d67c3..6bd6ceac7 100644 --- a/renderdoc/driver/d3d11/d3d11_replay.cpp +++ b/renderdoc/driver/d3d11/d3d11_replay.cpp @@ -3531,25 +3531,9 @@ ResourceId D3D11Replay::CreateProxyBuffer(const BufferDescription &templateBuf) desc.CPUAccessFlags = 0; desc.MiscFlags = 0; desc.Usage = D3D11_USAGE_DEFAULT; - desc.BindFlags = D3D11_BIND_VERTEX_BUFFER; + desc.BindFlags = D3D11_BIND_VERTEX_BUFFER | D3D11_BIND_INDEX_BUFFER; desc.StructureByteStride = 0; - if(templateBuf.creationFlags & BufferCategory::Indirect) - { - desc.BindFlags = D3D11_BIND_SHADER_RESOURCE; - desc.MiscFlags |= D3D11_RESOURCE_MISC_DRAWINDIRECT_ARGS; - } - if(templateBuf.creationFlags & BufferCategory::Index) - desc.BindFlags = D3D11_BIND_INDEX_BUFFER; - // D3D11_BIND_CONSTANT_BUFFER size must be <= 65536 on some drivers. - if(desc.ByteWidth <= D3D11_REQ_CONSTANT_BUFFER_ELEMENT_COUNT * 16) - { - if(templateBuf.creationFlags & BufferCategory::Constants) - desc.BindFlags = D3D11_BIND_CONSTANT_BUFFER; - } - if(templateBuf.creationFlags & BufferCategory::ReadWrite) - desc.BindFlags = D3D11_BIND_UNORDERED_ACCESS | D3D11_BIND_SHADER_RESOURCE; - HRESULT hr = m_pDevice->CreateBuffer(&desc, NULL, &throwaway); if(FAILED(hr)) {