Commit 370ab18
committed
Changed functions to validate and return VK_ERROR_VALIDATION_FAILED_EXT when trying to allocate memory of size 0, create buffer with size 0, or image with one of the dimensions 0.
That's because vkCreateBuffer returns VK_SUCCESS for buffer with size = 0, so VMA then proceeded to allocation of size 0, which is a critical error, checked by an assert, but apparently some users don't enable asserts in VMA.
Added tests: function TestInvalidAllocations.1 parent 3a7249f commit 370ab18
2 files changed
+70
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1195 | 1195 | | |
1196 | 1196 | | |
1197 | 1197 | | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
| 1204 | + | |
| 1205 | + | |
| 1206 | + | |
| 1207 | + | |
| 1208 | + | |
| 1209 | + | |
| 1210 | + | |
| 1211 | + | |
| 1212 | + | |
| 1213 | + | |
| 1214 | + | |
| 1215 | + | |
| 1216 | + | |
| 1217 | + | |
| 1218 | + | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
| 1239 | + | |
| 1240 | + | |
| 1241 | + | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
1198 | 1248 | | |
1199 | 1249 | | |
1200 | 1250 | | |
| |||
1299 | 1349 | | |
1300 | 1350 | | |
1301 | 1351 | | |
| 1352 | + | |
| 1353 | + | |
1302 | 1354 | | |
1303 | 1355 | | |
1304 | 1356 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12301 | 12301 | | |
12302 | 12302 | | |
12303 | 12303 | | |
| 12304 | + | |
| 12305 | + | |
| 12306 | + | |
| 12307 | + | |
12304 | 12308 | | |
12305 | 12309 | | |
12306 | 12310 | | |
| |||
14095 | 14099 | | |
14096 | 14100 | | |
14097 | 14101 | | |
| 14102 | + | |
| 14103 | + | |
| 14104 | + | |
| 14105 | + | |
| 14106 | + | |
14098 | 14107 | | |
14099 | 14108 | | |
14100 | 14109 | | |
| |||
14234 | 14243 | | |
14235 | 14244 | | |
14236 | 14245 | | |
| 14246 | + | |
| 14247 | + | |
| 14248 | + | |
| 14249 | + | |
| 14250 | + | |
| 14251 | + | |
| 14252 | + | |
| 14253 | + | |
| 14254 | + | |
14237 | 14255 | | |
14238 | 14256 | | |
14239 | 14257 | | |
| |||
0 commit comments