Hi,
I'm finding that creating 15000 d3d buffers is taking around 15 seconds (on a respectable PC set-up). So I was wondering if I must be doing something stupid? I know 15000 is a lot but don't see how this could take anywhere near this long. It feels like maybe I've got into a CPU/GPU sync issue but I don't see how.
The buffers are for CPU-write-only and GPU-read-only and I'm creating them thus:
D3D11_BUFFER_DESC bufferDesc;
ZeroMemory(&bufferDesc, sizeof(bufferDesc));
bufferDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
bufferDesc.Usage = D3D11_USAGE_DYNAMIC;
bufferDesc.BindFlags = D3D11_BIND_SHADER_RESOURCE;
bufferDesc.ByteWidth = 36864;
bufferDesc.StructureByteStride = 288;
bufferDesc.MiscFlags = D3D11_RESOURCE_MISC_BUFFER_STRUCTURED;
HRESULT hr = GxpKernel::Get()->m_pd3dDevice->CreateBuffer(&bufferDesc, NULL, &m_pD3D11Buffer);
I could refactor the code to use less buffers but it's a bit of a fiddly issue so it would take a while, and the PC version of our game is not our release version so I don't want to spend too long on it (performance here is not a problem at all for the target console).
So I'm hoping I'm missing something? Or does it really just take that long?
Cheers,
Joe
I'm finding that creating 15000 d3d buffers is taking around 15 seconds (on a respectable PC set-up). So I was wondering if I must be doing something stupid? I know 15000 is a lot but don't see how this could take anywhere near this long. It feels like maybe I've got into a CPU/GPU sync issue but I don't see how.
The buffers are for CPU-write-only and GPU-read-only and I'm creating them thus:
D3D11_BUFFER_DESC bufferDesc;
ZeroMemory(&bufferDesc, sizeof(bufferDesc));
bufferDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
bufferDesc.Usage = D3D11_USAGE_DYNAMIC;
bufferDesc.BindFlags = D3D11_BIND_SHADER_RESOURCE;
bufferDesc.ByteWidth = 36864;
bufferDesc.StructureByteStride = 288;
bufferDesc.MiscFlags = D3D11_RESOURCE_MISC_BUFFER_STRUCTURED;
HRESULT hr = GxpKernel::Get()->m_pd3dDevice->CreateBuffer(&bufferDesc, NULL, &m_pD3D11Buffer);
I could refactor the code to use less buffers but it's a bit of a fiddly issue so it would take a while, and the PC version of our game is not our release version so I don't want to spend too long on it (performance here is not a problem at all for the target console).
So I'm hoping I'm missing something? Or does it really just take that long?
Cheers,
Joe