mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-24 15:54:00 +00:00
[spv-out] Move request_type_capabilities
outside of LocalType
lookup
This commit is contained in:
parent
a364e566cd
commit
18ceb5183c
@ -248,7 +248,7 @@ impl LocalImageType {
|
||||
/// this, by converting everything possible to a `LocalType` before inspecting
|
||||
/// it.
|
||||
///
|
||||
/// ## `Localtype` equality and SPIR-V `OpType` uniqueness
|
||||
/// ## `LocalType` equality and SPIR-V `OpType` uniqueness
|
||||
///
|
||||
/// The definition of `Eq` on `LocalType` is carefully chosen to help us follow
|
||||
/// certain SPIR-V rules. SPIR-V §2.8 requires some classes of `OpType...`
|
||||
|
@ -970,6 +970,11 @@ impl Writer {
|
||||
handle: Handle<crate::Type>,
|
||||
) -> Result<Word, Error> {
|
||||
let ty = &arena[handle];
|
||||
// If it's a type that needs SPIR-V capabilities, request them now.
|
||||
// This needs to happen regardless of the LocalType lookup succeeding,
|
||||
// because some types which map to the same LocalType have different
|
||||
// capability requirements. See https://github.com/gfx-rs/wgpu/issues/5569
|
||||
self.request_type_capabilities(&ty.inner)?;
|
||||
let id = if let Some(local) = make_local(&ty.inner) {
|
||||
// This type can be represented as a `LocalType`, so check if we've
|
||||
// already written an instruction for it. If not, do so now, with
|
||||
@ -985,10 +990,6 @@ impl Writer {
|
||||
|
||||
self.write_type_declaration_local(id, local);
|
||||
|
||||
// If it's a type that needs SPIR-V capabilities, request them now,
|
||||
// so write_type_declaration_local can stay infallible.
|
||||
self.request_type_capabilities(&ty.inner)?;
|
||||
|
||||
id
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user