mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-12-12 13:08:50 +01:00
[d3d11] Fix some possible constant buffer binding bugs
This commit is contained in:
parent
2e6a2f1be3
commit
45a1587b88
@ -4233,13 +4233,13 @@ namespace dxvk {
|
||||
for (uint32_t i = 0; i < NumBuffers; i++) {
|
||||
auto newBuffer = static_cast<D3D11Buffer*>(ppConstantBuffers[i]);
|
||||
|
||||
UINT constantCount = 0;
|
||||
|
||||
if (likely(newBuffer != nullptr))
|
||||
constantCount = std::min(newBuffer->Desc()->ByteWidth / 16, UINT(D3D11_REQ_CONSTANT_BUFFER_ELEMENT_COUNT));
|
||||
uint32_t constantCount = newBuffer
|
||||
? std::min(newBuffer->Desc()->ByteWidth / 16, UINT(D3D11_REQ_CONSTANT_BUFFER_ELEMENT_COUNT))
|
||||
: 0u;
|
||||
|
||||
if (bindings.buffers[StartSlot + i].buffer != newBuffer
|
||||
|| bindings.buffers[StartSlot + i].constantBound != constantCount) {
|
||||
|| bindings.buffers[StartSlot + i].constantOffset != 0
|
||||
|| bindings.buffers[StartSlot + i].constantCount != constantCount) {
|
||||
bindings.buffers[StartSlot + i].buffer = newBuffer;
|
||||
bindings.buffers[StartSlot + i].constantOffset = 0;
|
||||
bindings.buffers[StartSlot + i].constantCount = constantCount;
|
||||
|
Loading…
Reference in New Issue
Block a user