1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-05 01:24:14 +01:00

[d3d11] Set zero stride when binding null vertex buffer

This commit is contained in:
Philip Rebohle 2022-02-19 13:20:36 +01:00
parent 146fbd492f
commit 8e11630370
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99

View File

@ -3124,13 +3124,21 @@ namespace dxvk {
D3D11Buffer* pBuffer,
UINT Offset,
UINT Stride) {
EmitCs([
cSlotId = Slot,
cBufferSlice = pBuffer != nullptr ? pBuffer->GetBufferSlice(Offset) : DxvkBufferSlice(),
cStride = Stride
] (DxvkContext* ctx) {
ctx->bindVertexBuffer(cSlotId, cBufferSlice, cStride);
});
if (likely(pBuffer != nullptr)) {
EmitCs([
cSlotId = Slot,
cBufferSlice = pBuffer->GetBufferSlice(Offset),
cStride = Stride
] (DxvkContext* ctx) {
ctx->bindVertexBuffer(cSlotId, cBufferSlice, cStride);
});
} else {
EmitCs([
cSlotId = Slot
] (DxvkContext* ctx) {
ctx->bindVertexBuffer(cSlotId, DxvkBufferSlice(), 0);
});
}
}