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")]
use bevy_reflect::prelude::*;
use glam::Vec3;
use rspirv::{binary::Disassemble, dr::Module, spirv};
use rspirv::{
binary::Disassemble,
dr::{Module, Operand},
spirv,
};
use crate::{
DUMP_SPV_DIS_TO_FILE,
@@ -559,12 +563,13 @@ impl SSATape {
b.memory_model(spirv::AddressingModel::Logical, spirv::MemoryModel::GLSL450);
b
};
let glsl = if with_module {
4
} else {
b.ext_inst_import("GLSL.std.450")
};
let glsl = b
.module_ref()
.ext_inst_imports
.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 float = b.type_float(32, None);
let bool = b.type_bool();