Move lang_items into spirv-std (#275)

This commit is contained in:
XAMPPRocky 2020-11-26 10:12:18 +01:00 committed by GitHub
parent 5f3fd5c9d1
commit 59869ec58b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 12 additions and 35 deletions

View File

@ -49,15 +49,10 @@ spirv-std = { path = "../../crates/spirv-std" }
"#;
static SRC_PREFIX: &str = r#"#![no_std]
#![feature(lang_items, register_attr, asm)]
#![feature(register_attr, asm)]
#![register_attr(spirv)]
use core::panic::PanicInfo;
#[allow(unused_imports)]
use spirv_std::*;
#[panic_handler]
fn panic(_: &PanicInfo) -> ! {
loop {}
}
"#;
fn setup(src: &str) -> Result<PathBuf, Box<dyn Error>> {

View File

@ -1,5 +1,5 @@
#![no_std]
#![feature(register_attr, repr_simd, core_intrinsics)]
#![feature(register_attr, repr_simd, core_intrinsics, lang_items)]
#![cfg_attr(target_arch = "spirv", feature(asm))]
#![register_attr(spirv)]
// Our standard Clippy lints that we use in Embark projects, we opt out of a few that are not appropriate for the specific crate (yet)
@ -40,6 +40,16 @@
pub use glam;
pub use num_traits;
#[cfg(all(not(test), target_arch = "spirv"))]
#[panic_handler]
fn panic(_: &core::panic::PanicInfo<'_>) -> ! {
loop {}
}
#[cfg(all(not(test), target_arch = "spirv"))]
#[lang = "eh_personality"]
extern "C" fn rust_eh_personality() {}
macro_rules! pointer_addrspace_write {
(false) => {};
(true) => {

View File

@ -1,16 +1,9 @@
#![cfg_attr(target_arch = "spirv", no_std)]
#![feature(lang_items)]
#![feature(register_attr)]
#![register_attr(spirv)]
extern crate spirv_std;
#[cfg(all(not(test), target_arch = "spirv"))]
#[panic_handler]
fn panic(_: &core::panic::PanicInfo) -> ! {
loop {}
}
#[allow(unused_attributes)]
#[spirv(gl_compute)]
pub fn main_cs() {}

View File

@ -1,5 +1,4 @@
#![cfg_attr(target_arch = "spirv", no_std)]
#![feature(lang_items)]
#![feature(register_attr)]
#![register_attr(spirv)]
@ -26,13 +25,3 @@ pub fn main_vs(
1.0,
));
}
#[cfg(all(not(test), target_arch = "spirv"))]
#[panic_handler]
fn panic(_: &core::panic::PanicInfo) -> ! {
loop {}
}
#[cfg(all(not(test), target_arch = "spirv"))]
#[lang = "eh_personality"]
extern "C" fn rust_eh_personality() {}

View File

@ -179,13 +179,3 @@ pub fn main_vs(
builtin_pos.store(pos.extend(0.0).extend(1.0));
}
#[cfg(all(not(test), target_arch = "spirv"))]
#[panic_handler]
fn panic(_: &core::panic::PanicInfo) -> ! {
loop {}
}
#[cfg(all(not(test), target_arch = "spirv"))]
#[lang = "eh_personality"]
extern "C" fn rust_eh_personality() {}