|
2435 | 2435 | <a href="#2434" id="2434">2434</a> |
2436 | 2436 | <a href="#2435" id="2435">2435</a> |
2437 | 2437 | <a href="#2436" id="2436">2436</a> |
2438 | | -<a href="#2437" id="2437">2437</a> |
2439 | | -<a href="#2438" id="2438">2438</a> |
2440 | | -<a href="#2439" id="2439">2439</a> |
2441 | | -<a href="#2440" id="2440">2440</a> |
2442 | | -<a href="#2441" id="2441">2441</a> |
2443 | | -<a href="#2442" id="2442">2442</a> |
2444 | | -<a href="#2443" id="2443">2443</a> |
2445 | | -<a href="#2444" id="2444">2444</a> |
2446 | | -<a href="#2445" id="2445">2445</a> |
2447 | | -<a href="#2446" id="2446">2446</a> |
2448 | | -<a href="#2447" id="2447">2447</a> |
2449 | | -<a href="#2448" id="2448">2448</a> |
2450 | | -<a href="#2449" id="2449">2449</a> |
2451 | | -<a href="#2450" id="2450">2450</a> |
2452 | | -<a href="#2451" id="2451">2451</a> |
2453 | | -<a href="#2452" id="2452">2452</a> |
2454 | | -<a href="#2453" id="2453">2453</a> |
2455 | | -<a href="#2454" id="2454">2454</a> |
2456 | | -<a href="#2455" id="2455">2455</a> |
2457 | | -<a href="#2456" id="2456">2456</a> |
2458 | | -<a href="#2457" id="2457">2457</a> |
2459 | | -<a href="#2458" id="2458">2458</a> |
2460 | | -<a href="#2459" id="2459">2459</a> |
2461 | | -<a href="#2460" id="2460">2460</a> |
2462 | | -<a href="#2461" id="2461">2461</a> |
2463 | | -<a href="#2462" id="2462">2462</a> |
2464 | | -<a href="#2463" id="2463">2463</a> |
2465 | | -<a href="#2464" id="2464">2464</a> |
2466 | | -<a href="#2465" id="2465">2465</a> |
2467 | | -<a href="#2466" id="2466">2466</a> |
2468 | | -<a href="#2467" id="2467">2467</a> |
2469 | 2438 | </pre></div><pre class="rust"><code><span class="kw">use </span><span class="kw">super</span>::conv; |
2470 | 2439 |
|
2471 | 2440 | <span class="kw">use </span>ash::{amd, ext, google, khr, vk}; |
|
3028 | 2997 | <span class="self">self</span>.core.shader_sampled_image_array_dynamic_indexing != <span class="number">0</span>, |
3029 | 2998 | ); |
3030 | 2999 | features.set(F::SHADER_PRIMITIVE_INDEX, <span class="self">self</span>.core.geometry_shader != <span class="number">0</span>); |
3031 | | - <span class="kw">if </span><span class="self">Self</span>::all_features_supported( |
3032 | | - <span class="kw-2">&</span>features, |
3033 | | - <span class="kw-2">&</span>[ |
3034 | | - ( |
3035 | | - F::BUFFER_BINDING_ARRAY, |
3036 | | - <span class="self">self</span>.core.shader_storage_buffer_array_dynamic_indexing, |
3037 | | - ), |
3038 | | - ( |
3039 | | - F::TEXTURE_BINDING_ARRAY, |
3040 | | - <span class="self">self</span>.core.shader_storage_image_array_dynamic_indexing, |
3041 | | - ), |
3042 | | - ], |
3043 | | - ) { |
3044 | | - features.insert(F::STORAGE_RESOURCE_BINDING_ARRAY); |
3045 | | - } |
| 3000 | + features.set( |
| 3001 | + F::STORAGE_RESOURCE_BINDING_ARRAY, |
| 3002 | + (features.contains(F::BUFFER_BINDING_ARRAY) |
| 3003 | + && <span class="self">self</span>.core.shader_storage_buffer_array_dynamic_indexing != <span class="number">0</span>) |
| 3004 | + || (features.contains(F::TEXTURE_BINDING_ARRAY) |
| 3005 | + && <span class="self">self</span>.core.shader_storage_image_array_dynamic_indexing != <span class="number">0</span>), |
| 3006 | + ); |
3046 | 3007 | <span class="comment">//if self.core.shader_storage_image_array_dynamic_indexing != 0 { |
3047 | 3008 | //if self.core.shader_clip_distance != 0 { |
3048 | 3009 | //if self.core.shader_cull_distance != 0 { |
|
3073 | 3034 |
|
3074 | 3035 | <span class="kw">if let </span><span class="prelude-val">Some</span>(<span class="kw-2">ref </span>descriptor_indexing) = <span class="self">self</span>.descriptor_indexing { |
3075 | 3036 | <span class="kw">const </span>STORAGE: F = F::STORAGE_RESOURCE_BINDING_ARRAY; |
3076 | | - <span class="kw">if </span><span class="self">Self</span>::all_features_supported( |
3077 | | - <span class="kw-2">&</span>features, |
3078 | | - <span class="kw-2">&</span>[ |
3079 | | - ( |
3080 | | - F::TEXTURE_BINDING_ARRAY, |
3081 | | - descriptor_indexing.shader_sampled_image_array_non_uniform_indexing, |
3082 | | - ), |
3083 | | - ( |
3084 | | - F::BUFFER_BINDING_ARRAY | STORAGE, |
3085 | | - descriptor_indexing.shader_storage_buffer_array_non_uniform_indexing, |
3086 | | - ), |
3087 | | - ], |
3088 | | - ) { |
3089 | | - features.insert(F::SAMPLED_TEXTURE_AND_STORAGE_BUFFER_ARRAY_NON_UNIFORM_INDEXING); |
3090 | | - } |
3091 | | - <span class="kw">if </span><span class="self">Self</span>::all_features_supported( |
3092 | | - <span class="kw-2">&</span>features, |
3093 | | - <span class="kw-2">&</span>[ |
3094 | | - ( |
3095 | | - F::BUFFER_BINDING_ARRAY, |
3096 | | - descriptor_indexing.shader_uniform_buffer_array_non_uniform_indexing, |
3097 | | - ), |
3098 | | - ( |
3099 | | - F::TEXTURE_BINDING_ARRAY | STORAGE, |
3100 | | - descriptor_indexing.shader_storage_image_array_non_uniform_indexing, |
3101 | | - ), |
3102 | | - ], |
3103 | | - ) { |
3104 | | - features.insert(F::UNIFORM_BUFFER_AND_STORAGE_TEXTURE_ARRAY_NON_UNIFORM_INDEXING); |
3105 | | - } |
| 3037 | + features.set( |
| 3038 | + F::SAMPLED_TEXTURE_AND_STORAGE_BUFFER_ARRAY_NON_UNIFORM_INDEXING, |
| 3039 | + (features.contains(F::TEXTURE_BINDING_ARRAY) |
| 3040 | + && descriptor_indexing.shader_sampled_image_array_non_uniform_indexing != <span class="number">0</span>) |
| 3041 | + && (features.contains(F::BUFFER_BINDING_ARRAY | STORAGE) |
| 3042 | + && descriptor_indexing.shader_storage_buffer_array_non_uniform_indexing |
| 3043 | + != <span class="number">0</span>), |
| 3044 | + ); |
| 3045 | + features.set( |
| 3046 | + F::UNIFORM_BUFFER_AND_STORAGE_TEXTURE_ARRAY_NON_UNIFORM_INDEXING, |
| 3047 | + (features.contains(F::BUFFER_BINDING_ARRAY) |
| 3048 | + && descriptor_indexing.shader_uniform_buffer_array_non_uniform_indexing != <span class="number">0</span>) |
| 3049 | + && (features.contains(F::TEXTURE_BINDING_ARRAY | STORAGE) |
| 3050 | + && descriptor_indexing.shader_storage_image_array_non_uniform_indexing |
| 3051 | + != <span class="number">0</span>), |
| 3052 | + ); |
3106 | 3053 | <span class="kw">if </span>descriptor_indexing.descriptor_binding_partially_bound != <span class="number">0 </span>&& !intel_windows { |
3107 | 3054 | features |= F::PARTIALLY_BOUND_BINDING_ARRAY; |
3108 | 3055 | } |
|
3251 | 3198 |
|
3252 | 3199 | (features, dl_flags) |
3253 | 3200 | } |
3254 | | - |
3255 | | - <span class="kw">fn </span>all_features_supported( |
3256 | | - features: <span class="kw-2">&</span>wgt::Features, |
3257 | | - implications: <span class="kw-2">&</span>[(wgt::Features, vk::Bool32)], |
3258 | | - ) -> bool { |
3259 | | - implications |
3260 | | - .iter() |
3261 | | - .all(|<span class="kw-2">&</span>(flag, support)| !features.contains(flag) || support != <span class="number">0</span>) |
3262 | | - } |
3263 | 3201 | } |
3264 | 3202 |
|
3265 | 3203 | <span class="doccomment">/// Vulkan "properties" structures gathered about a physical device. |
|
0 commit comments