fn meld_in_texture()

in native/src/work_asset/meld.rs [147:165]


fn meld_in_texture(
    base: &mut WorkAsset,
    other: &WorkAsset,
    other_ix: Index<Texture>,
) -> Index<Texture> {
    let other_ix = other_ix.value();
    let key = &other.texture_keys()[other_ix];
    if let Some(ix) = base.texture_ix(key) {
        return Index::new(ix as u32);
    }
    let mut new_object = other.textures()[other_ix].clone();

    // meld logic
    new_object.source = meld_in_image(base, other, new_object.source);
    new_object.sampler = new_object.sampler.map(|s| meld_in_sampler(base, other, s));
    // end meld logic

    Index::new(base.push_texture(new_object, key) as u32)
}