|
3855 | 3855 | <a href="#3854" id="3854">3854</a> |
3856 | 3856 | <a href="#3855" id="3855">3855</a> |
3857 | 3857 | <a href="#3856" id="3856">3856</a> |
3858 | | -<a href="#3857" id="3857">3857</a></pre></div><pre class="rust"><code><span class="kw">use </span>alloc::{ |
| 3858 | +<a href="#3857" id="3857">3857</a> |
| 3859 | +<a href="#3858" id="3858">3858</a> |
| 3860 | +<a href="#3859" id="3859">3859</a> |
| 3861 | +<a href="#3860" id="3860">3860</a> |
| 3862 | +<a href="#3861" id="3861">3861</a></pre></div><pre class="rust"><code><span class="kw">use </span>alloc::{ |
3859 | 3863 | borrow::Cow, |
3860 | 3864 | boxed::Box, |
3861 | 3865 | string::{String, ToString <span class="kw">as _</span>}, |
|
5043 | 5047 | } |
5044 | 5048 | }; |
5045 | 5049 |
|
5046 | | - <span class="kw">let </span>allowed_format_usages = <span class="self">self |
5047 | | - </span>.describe_format_features(resolved_format)<span class="question-mark">? |
5048 | | - </span>.allowed_usages; |
| 5050 | + <span class="kw">let </span>format_features = <span class="self">self</span>.describe_format_features(resolved_format)<span class="question-mark">?</span>; |
| 5051 | + <span class="kw">let </span>allowed_format_usages = format_features.allowed_usages; |
5049 | 5052 | <span class="kw">if </span>resolved_usage.contains(wgt::TextureUsages::RENDER_ATTACHMENT) |
5050 | 5053 | && !allowed_format_usages.contains(wgt::TextureUsages::RENDER_ATTACHMENT) |
5051 | 5054 | { |
|
5221 | 5224 |
|
5222 | 5225 | <span class="comment">// filter the usages based on the other criteria |
5223 | 5226 | </span><span class="kw">let </span>usage = { |
| 5227 | + <span class="kw">let </span>resolved_hal_usage = conv::map_texture_usage( |
| 5228 | + resolved_usage, |
| 5229 | + resolved_format.into(), |
| 5230 | + format_features.flags, |
| 5231 | + ); |
5224 | 5232 | <span class="kw">let </span>mask_copy = !(wgt::TextureUses::COPY_SRC | wgt::TextureUses::COPY_DST); |
5225 | 5233 | <span class="kw">let </span>mask_dimension = <span class="kw">match </span>resolved_dimension { |
5226 | 5234 | TextureViewDimension::Cube | TextureViewDimension::CubeArray => { |
|
5239 | 5247 | } <span class="kw">else </span>{ |
5240 | 5248 | wgt::TextureUses::RESOURCE |
5241 | 5249 | }; |
5242 | | - texture.hal_usage & mask_copy & mask_dimension & mask_mip_level |
| 5250 | + resolved_hal_usage & mask_copy & mask_dimension & mask_mip_level |
5243 | 5251 | }; |
5244 | 5252 |
|
5245 | 5253 | <span class="comment">// use the combined depth-stencil format for the view |
|
0 commit comments