diff options
| author | Jan Trencansky <jan.trencansky@protonmail.com> | 2026-11-26 16:55:04 -0500 |
|---|---|---|
| committer | Jan Trencansky <jan.trencansky@protonmail.com> | 2026-11-26 16:55:04 -0500 |
| commit | df92abca8ee2a8f9093efea7fcaa4dadc3ddaebc (patch) | |
| tree | 97ef8f95544fe263049d3f7360823f16100de209 /runtime/test/bindless_sizing_test.cpp | |
| parent | 49a0b69fcdb80db1f2a44ce7ca0ab8dfdec1e403 (diff) | |
| parent | e5a7c8942678b323f655939c81f5d8855d20c248 (diff) | |
Merge main e5a7c8942 into shadow-aliased-guard (#1867)
One conflict, runtime/README.md: this branch rewrote the LEONIDA_SHADOW_ALIAS_MS
row, main (#2163) added the LEONIDA_SHADOW_KEEP row after it. Both rows kept;
the keep row's "aliased" now reads "aliased while they can't be guarded at every
address", since aliased pages are no longer copied without a sign of a write.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'runtime/test/bindless_sizing_test.cpp')
| -rw-r--r-- | runtime/test/bindless_sizing_test.cpp | 54 |
1 files changed, 46 insertions, 8 deletions
diff --git a/runtime/test/bindless_sizing_test.cpp b/runtime/test/bindless_sizing_test.cpp index b7d501aab..b83294852 100644 --- a/runtime/test/bindless_sizing_test.cpp +++ b/runtime/test/bindless_sizing_test.cpp | |||
| @@ -133,18 +133,18 @@ int main() { | |||
| 133 | const Device d = uniform(1048576, 1048576); | 133 | const Device d = uniform(1048576, 1048576); |
| 134 | BindlessFeatures f = with_ms(update_after_bind); | 134 | BindlessFeatures f = with_ms(update_after_bind); |
| 135 | EXPECT(bindless::size_bindings(f, d.limits, d.v11, d.v12)); | 135 | EXPECT(bindless::size_bindings(f, d.limits, d.v11, d.v12)); |
| 136 | EXPECT(count(f, D::dim_2d) == bindless::max_2d_images); | 136 | EXPECT(count(f, D::dim_2d) == bindless::max_images); |
| 137 | EXPECT(f.counts[bindless::sampler_binding] == 4000 - bindless::reserved_samplers); | 137 | EXPECT(f.counts[bindless::sampler_binding] == 4000 - bindless::reserved_samplers); |
| 138 | EXPECT(f.counts[bindless::sampler_binding] > 2048); // a full sampler heap and the fallback | 138 | EXPECT(f.counts[bindless::sampler_binding] > 2048); // a full sampler heap and the fallback |
| 139 | EXPECT(storage(f, D::dim_2d) == bindless::max_storage_indices); | 139 | EXPECT(storage(f, D::dim_2d) == bindless::max_storage_indices); |
| 140 | // The other dimensions grow too (a title's cube maps, texture arrays and 1D lookups outnumber the defaults); | 140 | // The other dimensions grow as far as 2D (a title's textures are of whichever dimension it chose); their |
| 141 | // their storage arrays hold as many indices as the 2D one. The storage-only 1D array keeps its 256. | 141 | // storage arrays hold as many indices as the 2D one. The storage-only 1D array keeps its 256. |
| 142 | EXPECT(count(f, D::dim_2d_array) == bindless::max_2d_array_images && | 142 | EXPECT(count(f, D::dim_2d_array) == bindless::max_images && count(f, D::dim_3d) == bindless::max_images && |
| 143 | count(f, D::dim_3d) == bindless::max_3d_images && count(f, D::dim_1d) == bindless::max_1d_images); | 143 | count(f, D::dim_1d) == bindless::max_images); |
| 144 | EXPECT(storage(f, D::dim_2d_array) == bindless::max_storage_indices && | 144 | EXPECT(storage(f, D::dim_2d_array) == bindless::max_storage_indices && |
| 145 | storage(f, D::dim_3d) == bindless::max_storage_indices && | 145 | storage(f, D::dim_3d) == bindless::max_storage_indices && |
| 146 | storage(f, D::dim_1d) == bindless::max_storage_indices); | 146 | storage(f, D::dim_1d) == bindless::max_storage_indices); |
| 147 | EXPECT(storage(f, D::dim_1d_array) == 256 && totals(f).all == 153697); | 147 | EXPECT(storage(f, D::dim_1d_array) == 256 && totals(f).all == 325729); |
| 148 | EXPECT(f.ms_samples[0] == VK_SAMPLE_COUNT_4_BIT && f.ms_samples[2] == VK_SAMPLE_COUNT_4_BIT); | 148 | EXPECT(f.ms_samples[0] == VK_SAMPLE_COUNT_4_BIT && f.ms_samples[2] == VK_SAMPLE_COUNT_4_BIT); |
| 149 | EXPECT(storage_consistent(f)); | 149 | EXPECT(storage_consistent(f)); |
| 150 | if (update_after_bind) | 150 | if (update_after_bind) |
| @@ -152,6 +152,44 @@ int main() { | |||
| 152 | count(f, D::dim_2d), f.counts[bindless::sampler_binding], storage(f, D::dim_2d), totals(f).all); | 152 | count(f, D::dim_2d), f.counts[bindless::sampler_binding], storage(f, D::dim_2d), totals(f).all); |
| 153 | } | 153 | } |
| 154 | 154 | ||
| 155 | // RADV (Mesa 26.3, a Raphael iGPU and an RX 7900 XTX alike) and llvmpipe: their update-after-bind limits hold | ||
| 156 | // every sampled dimension at the full size. A world run kept 4090 live 1D textures, filling the 4096 1D indices | ||
| 157 | // the set used to stop at whatever the device held; now 1D, 3D and 2D-array images get as many as 2D. | ||
| 158 | { | ||
| 159 | Device radv = uniform(8388606, 8388606); | ||
| 160 | radv.limits.maxPerStageResources = radv.v12.maxPerStageUpdateAfterBindResources = 8388606; | ||
| 161 | radv.v12.maxUpdateAfterBindDescriptorsInAllPools = 67108863; | ||
| 162 | radv.v11.maxPerSetDescriptors = 22369621; | ||
| 163 | radv.limits.maxSamplerAllocationCount = 4294967295u; | ||
| 164 | Device lvp = uniform(1015808, 1015808); | ||
| 165 | lvp.limits.maxPerStageResources = lvp.v12.maxPerStageUpdateAfterBindResources = 1015808; | ||
| 166 | lvp.v11.maxPerSetDescriptors = 1015808; | ||
| 167 | lvp.limits.maxSamplerAllocationCount = 32768; | ||
| 168 | for (const Device* d : {&radv, &lvp}) { | ||
| 169 | BindlessFeatures f = with_ms(true); | ||
| 170 | EXPECT(bindless::size_bindings(f, d->limits, d->v11, d->v12)); | ||
| 171 | for (const D dimension : {D::dim_2d, D::dim_2d_array, D::dim_3d, D::dim_1d}) { | ||
| 172 | EXPECT(count(f, dimension) == bindless::max_images); | ||
| 173 | EXPECT(count(f, dimension) > 4096 + 1); // more than 4096 live images and the fallback | ||
| 174 | } | ||
| 175 | EXPECT(storage_consistent(f)); | ||
| 176 | } | ||
| 177 | } | ||
| 178 | |||
| 179 | // A device whose limits stop growth short of max_images: the 2D-array, 3D and 1D arrays share what is left alike, | ||
| 180 | // whichever is grown first. | ||
| 181 | { | ||
| 182 | Device d = uniform(1048576, 1048576); | ||
| 183 | d.v12.maxPerStageDescriptorUpdateAfterBindSampledImages = 65536 + 3 * 20000 + 6 * 256 + bindless::growth_headroom; | ||
| 184 | BindlessFeatures f = with_ms(true); | ||
| 185 | EXPECT(bindless::size_bindings(f, d.limits, d.v11, d.v12)); | ||
| 186 | EXPECT(count(f, D::dim_2d) == bindless::max_images); | ||
| 187 | EXPECT(count(f, D::dim_2d_array) == count(f, D::dim_3d) && count(f, D::dim_3d) == count(f, D::dim_1d)); | ||
| 188 | EXPECT(count(f, D::dim_1d) > 4096 && count(f, D::dim_1d) <= 20000); | ||
| 189 | EXPECT(totals(f).sampled + bindless::growth_headroom <= d.v12.maxPerStageDescriptorUpdateAfterBindSampledImages); | ||
| 190 | EXPECT(storage_consistent(f)); | ||
| 191 | } | ||
| 192 | |||
| 155 | // At today's sizes exactly (5632 sampled images, 1024 samplers, 4352 storage images): no MS pairs. | 193 | // At today's sizes exactly (5632 sampled images, 1024 samplers, 4352 storage images): no MS pairs. |
| 156 | { | 194 | { |
| 157 | Device d = uniform(1048576, 1048576); | 195 | Device d = uniform(1048576, 1048576); |
| @@ -191,7 +229,7 @@ int main() { | |||
| 191 | BindlessFeatures uab = with_ms(true), plain = with_ms(false); | 229 | BindlessFeatures uab = with_ms(true), plain = with_ms(false); |
| 192 | EXPECT(bindless::size_bindings(uab, d.limits, d.v11, d.v12)); | 230 | EXPECT(bindless::size_bindings(uab, d.limits, d.v11, d.v12)); |
| 193 | EXPECT(bindless::size_bindings(plain, d.limits, d.v11, d.v12)); | 231 | EXPECT(bindless::size_bindings(plain, d.limits, d.v11, d.v12)); |
| 194 | EXPECT(count(uab, D::dim_2d) == bindless::max_2d_images); | 232 | EXPECT(count(uab, D::dim_2d) == bindless::max_images); |
| 195 | const Totals t = totals(plain); | 233 | const Totals t = totals(plain); |
| 196 | EXPECT(count(plain, D::dim_2d) > 4096 && count(plain, D::dim_2d) < 16384); | 234 | EXPECT(count(plain, D::dim_2d) > 4096 && count(plain, D::dim_2d) < 16384); |
| 197 | EXPECT(t.sampled + bindless::growth_headroom <= 16384 && t.storage + bindless::growth_headroom <= 16384); | 235 | EXPECT(t.sampled + bindless::growth_headroom <= 16384 && t.storage + bindless::growth_headroom <= 16384); |
| @@ -232,7 +270,7 @@ int main() { | |||
| 232 | BindlessFeatures f = with_ms(true); | 270 | BindlessFeatures f = with_ms(true); |
| 233 | EXPECT(bindless::size_bindings(f, d.limits, d.v11, d.v12, all_supported)); | 271 | EXPECT(bindless::size_bindings(f, d.limits, d.v11, d.v12, all_supported)); |
| 234 | EXPECT(asked > 0 && asked_within == 0 && missing_storage == 0); | 272 | EXPECT(asked > 0 && asked_within == 0 && missing_storage == 0); |
| 235 | EXPECT(count(f, D::dim_2d) == bindless::max_2d_images && | 273 | EXPECT(count(f, D::dim_2d) == bindless::max_images && |
| 236 | f.counts[bindless::sampler_binding] == 4000 - bindless::reserved_samplers); | 274 | f.counts[bindless::sampler_binding] == 4000 - bindless::reserved_samplers); |
| 237 | EXPECT(storage(f, D::dim_2d) == bindless::max_storage_indices && storage_consistent(f)); | 275 | EXPECT(storage(f, D::dim_2d) == bindless::max_storage_indices && storage_consistent(f)); |
| 238 | 276 | ||