File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -248,7 +248,7 @@ impl LocalImageType {
248
248
/// this, by converting everything possible to a `LocalType` before inspecting
249
249
/// it.
250
250
///
251
- /// ## `Localtype ` equality and SPIR-V `OpType` uniqueness
251
+ /// ## `LocalType ` equality and SPIR-V `OpType` uniqueness
252
252
///
253
253
/// The definition of `Eq` on `LocalType` is carefully chosen to help us follow
254
254
/// certain SPIR-V rules. SPIR-V §2.8 requires some classes of `OpType...`
Original file line number Diff line number Diff line change @@ -970,6 +970,11 @@ impl Writer {
970
970
handle : Handle < crate :: Type > ,
971
971
) -> Result < Word , Error > {
972
972
let ty = & arena[ handle] ;
973
+ // If it's a type that needs SPIR-V capabilities, request them now.
974
+ // This needs to happen regardless of the LocalType lookup succeeding,
975
+ // because some types which map to the same LocalType have different
976
+ // capability requirements. See https://github.com/gfx-rs/wgpu/issues/5569
977
+ self . request_type_capabilities ( & ty. inner ) ?;
973
978
let id = if let Some ( local) = make_local ( & ty. inner ) {
974
979
// This type can be represented as a `LocalType`, so check if we've
975
980
// already written an instruction for it. If not, do so now, with
@@ -985,10 +990,6 @@ impl Writer {
985
990
986
991
self . write_type_declaration_local ( id, local) ;
987
992
988
- // If it's a type that needs SPIR-V capabilities, request them now,
989
- // so write_type_declaration_local can stay infallible.
990
- self . request_type_capabilities ( & ty. inner ) ?;
991
-
992
993
id
993
994
}
994
995
}
You can’t perform that action at this time.
0 commit comments