mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-12-13 16: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++) {
|
for (uint32_t i = 0; i < NumBuffers; i++) {
|
||||||
auto newBuffer = static_cast<D3D11Buffer*>(ppConstantBuffers[i]);
|
auto newBuffer = static_cast<D3D11Buffer*>(ppConstantBuffers[i]);
|
||||||
|
|
||||||
UINT constantCount = 0;
|
uint32_t constantCount = newBuffer
|
||||||
|
? std::min(newBuffer->Desc()->ByteWidth / 16, UINT(D3D11_REQ_CONSTANT_BUFFER_ELEMENT_COUNT))
|
||||||
if (likely(newBuffer != nullptr))
|
: 0u;
|
||||||
constantCount = std::min(newBuffer->Desc()->ByteWidth / 16, UINT(D3D11_REQ_CONSTANT_BUFFER_ELEMENT_COUNT));
|
|
||||||
|
|
||||||
if (bindings.buffers[StartSlot + i].buffer != newBuffer
|
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].buffer = newBuffer;
|
||||||
bindings.buffers[StartSlot + i].constantOffset = 0;
|
bindings.buffers[StartSlot + i].constantOffset = 0;
|
||||||
bindings.buffers[StartSlot + i].constantCount = constantCount;
|
bindings.buffers[StartSlot + i].constantCount = constantCount;
|
||||||
|
Loading…
Reference in New Issue
Block a user