mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-18 11:52:12 +01:00
[d3d11] Add range checking to GetConstantBuffers
This commit is contained in:
parent
2d9c229eaa
commit
ef9ad29b7f
@ -3775,14 +3775,25 @@ namespace dxvk {
|
||||
UINT* pFirstConstant,
|
||||
UINT* pNumConstants) {
|
||||
for (uint32_t i = 0; i < NumBuffers; i++) {
|
||||
if (ppConstantBuffers != nullptr)
|
||||
ppConstantBuffers[i] = Bindings[StartSlot + i].buffer.ref();
|
||||
const bool inRange = StartSlot + i < Bindings.size();
|
||||
|
||||
if (pFirstConstant != nullptr)
|
||||
pFirstConstant[i] = Bindings[StartSlot + i].constantOffset;
|
||||
if (ppConstantBuffers != nullptr) {
|
||||
ppConstantBuffers[i] = inRange
|
||||
? Bindings[StartSlot + i].buffer.ref()
|
||||
: nullptr;
|
||||
}
|
||||
|
||||
if (pNumConstants != nullptr)
|
||||
pNumConstants[i] = Bindings[StartSlot + i].constantCount;
|
||||
if (pFirstConstant != nullptr) {
|
||||
pFirstConstant[i] = inRange
|
||||
? Bindings[StartSlot + i].constantOffset
|
||||
: 0u;
|
||||
}
|
||||
|
||||
if (pNumConstants != nullptr) {
|
||||
pNumConstants[i] = inRange
|
||||
? Bindings[StartSlot + i].constantCount
|
||||
: 0u;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user