Use correct OpExtInstImport check

This commit is contained in:
2026-10-02 20:58:52 +01:00
parent 19b241637b
commit b7f83169e2
+12 -7
View File
@@ -7,7 +7,11 @@ use std::{
#[cfg(feature = "bevy")] #[cfg(feature = "bevy")]
use bevy_reflect::prelude::*; use bevy_reflect::prelude::*;
use glam::Vec3; use glam::Vec3;
use rspirv::{binary::Disassemble, dr::Module, spirv}; use rspirv::{
binary::Disassemble,
dr::{Module, Operand},
spirv,
};
use crate::{ use crate::{
DUMP_SPV_DIS_TO_FILE, DUMP_SPV_DIS_TO_FILE,
@@ -559,12 +563,13 @@ impl SSATape {
b.memory_model(spirv::AddressingModel::Logical, spirv::MemoryModel::GLSL450); b.memory_model(spirv::AddressingModel::Logical, spirv::MemoryModel::GLSL450);
b b
}; };
let glsl = if with_module { let glsl = b
4 .module_ref()
} else { .ext_inst_imports
b.ext_inst_import("GLSL.std.450") .iter()
}; .find(|inst| inst.operands[0].unwrap_literal_string() == "GLSL.std.450")
.map(|inst| inst.result_id.unwrap())
.unwrap_or_else(|| b.ext_inst_import("GLSL.std.450"));
let void = b.type_void(); let void = b.type_void();
let float = b.type_float(32, None); let float = b.type_float(32, None);
let bool = b.type_bool(); let bool = b.type_bool();