1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-31 23:52:20 +01:00

[d3d11] Fix rectangle check in ClearView

It is legal to pass a potentially invalid pointer if NumRects is 0.
Fixes validation errors in TopSpin 2k25.
This commit is contained in:
Philip Rebohle 2024-12-09 17:43:02 +01:00
parent b1ad43145b
commit 45da7d6678

View File

@ -730,9 +730,9 @@ namespace dxvk {
// Clear all the rectangles that are specified
for (uint32_t i = 0; i < NumRects || i < 1; i++) {
if (pRect) {
if (NumRects) {
if (pRect[i].left >= pRect[i].right
|| pRect[i].top >= pRect[i].bottom)
|| pRect[i].top >= pRect[i].bottom)
continue;
}
@ -740,7 +740,7 @@ namespace dxvk {
VkDeviceSize offset = 0;
VkDeviceSize length = bufView->info().size / formatInfo->elementSize;
if (pRect) {
if (NumRects) {
offset = pRect[i].left;
length = pRect[i].right - pRect[i].left;
}
@ -763,7 +763,7 @@ namespace dxvk {
VkOffset3D offset = { 0, 0, 0 };
VkExtent3D extent = imgView->mipLevelExtent(0);
if (pRect) {
if (NumRects) {
offset = { pRect[i].left, pRect[i].top, 0 };
extent = {
uint32_t(pRect[i].right - pRect[i].left),