Fix out of bounds writes during spirv debugging

Previously it would allow writes to width/height/depth
This commit is contained in:
Jake Turner
2025-09-24 15:46:06 +01:00
parent da03329b12
commit 8203032ec3
+2 -2
View File
@@ -405,7 +405,7 @@ public:
for(int i = 0; i < 4; i++)
coords[i] = uintComp(coord, i);
if(coords[0] > data.width || coords[1] > data.height || coords[2] > data.depth)
if(coords[0] >= data.width || coords[1] >= data.height || coords[2] >= data.depth)
{
if(!IsDeviceThread())
return rdcspv::DeviceOpResult::NeedsDevice;
@@ -548,7 +548,7 @@ public:
for(int i = 0; i < 4; i++)
coords[i] = uintComp(coord, i);
if(coords[0] > data.width || coords[1] > data.height || coords[2] > data.depth)
if(coords[0] >= data.width || coords[1] >= data.height || coords[2] >= data.depth)
{
if(!IsDeviceThread())
return rdcspv::DeviceOpResult::NeedsDevice;