mirror of
https://github.com/EduApps-CDG/OpenDX
synced 2024-12-30 09:45:37 +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* pFirstConstant,
|
||||||
UINT* pNumConstants) {
|
UINT* pNumConstants) {
|
||||||
for (uint32_t i = 0; i < NumBuffers; i++) {
|
for (uint32_t i = 0; i < NumBuffers; i++) {
|
||||||
if (ppConstantBuffers != nullptr)
|
const bool inRange = StartSlot + i < Bindings.size();
|
||||||
ppConstantBuffers[i] = Bindings[StartSlot + i].buffer.ref();
|
|
||||||
|
if (ppConstantBuffers != nullptr) {
|
||||||
|
ppConstantBuffers[i] = inRange
|
||||||
|
? Bindings[StartSlot + i].buffer.ref()
|
||||||
|
: nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
if (pFirstConstant != nullptr)
|
if (pFirstConstant != nullptr) {
|
||||||
pFirstConstant[i] = Bindings[StartSlot + i].constantOffset;
|
pFirstConstant[i] = inRange
|
||||||
|
? Bindings[StartSlot + i].constantOffset
|
||||||
|
: 0u;
|
||||||
|
}
|
||||||
|
|
||||||
if (pNumConstants != nullptr)
|
if (pNumConstants != nullptr) {
|
||||||
pNumConstants[i] = Bindings[StartSlot + i].constantCount;
|
pNumConstants[i] = inRange
|
||||||
|
? Bindings[StartSlot + i].constantCount
|
||||||
|
: 0u;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user