@@ -27,24 +27,47 @@ pub enum ShaderError {
27
27
#[ error( "Shader compilation error:\n {0}" ) ]
28
28
Compilation ( String ) ,
29
29
30
- #[ cfg( any( target_os = "ios" , all( target_arch = "aarch64" , target_os = "macos" ) ) ) ]
30
+ #[ cfg( not( any(
31
+ target_arch = "wasm32" ,
32
+ all( target_arch = "x86_64" , target_os = "linux" , target_env = "gnu" ) ,
33
+ all( target_arch = "x86_64" , target_os = "macos" ) ,
34
+ all( target_arch = "aarch64" , target_os = "android" ) ,
35
+ all( target_arch = "armv7" , target_os = "androidabi" ) ,
36
+ all( target_arch = "x86_64" , target_os = "windows" , target_env = "msvc" ) ,
37
+ ) ) ) ]
31
38
/// shaderc error.
32
39
#[ error( "shaderc error: {0}" ) ]
33
40
ShaderC ( #[ from] shaderc:: Error ) ,
34
41
35
- #[ cfg( any( target_os = "ios" , all( target_arch = "aarch64" , target_os = "macos" ) ) ) ]
42
+ #[ cfg( not( any(
43
+ target_arch = "wasm32" ,
44
+ all( target_arch = "x86_64" , target_os = "linux" , target_env = "gnu" ) ,
45
+ all( target_arch = "x86_64" , target_os = "macos" ) ,
46
+ all( target_arch = "aarch64" , target_os = "android" ) ,
47
+ all( target_arch = "armv7" , target_os = "androidabi" ) ,
48
+ all( target_arch = "x86_64" , target_os = "windows" , target_env = "msvc" ) ,
49
+ ) ) ) ]
36
50
#[ error( "Error initializing shaderc Compiler" ) ]
37
51
ErrorInitializingShadercCompiler ,
38
52
39
- #[ cfg( any( target_os = "ios" , all( target_arch = "aarch64" , target_os = "macos" ) ) ) ]
53
+ #[ cfg( not( any(
54
+ target_arch = "wasm32" ,
55
+ all( target_arch = "x86_64" , target_os = "linux" , target_env = "gnu" ) ,
56
+ all( target_arch = "x86_64" , target_os = "macos" ) ,
57
+ all( target_arch = "aarch64" , target_os = "android" ) ,
58
+ all( target_arch = "armv7" , target_os = "androidabi" ) ,
59
+ all( target_arch = "x86_64" , target_os = "windows" , target_env = "msvc" ) ,
60
+ ) ) ) ]
40
61
#[ error( "Error initializing shaderc CompileOptions" ) ]
41
62
ErrorInitializingShadercCompileOptions ,
42
63
}
43
64
44
- #[ cfg( all(
45
- not( target_os = "ios" ) ,
46
- not( target_arch = "wasm32" ) ,
47
- not( all( target_arch = "aarch64" , target_os = "macos" ) )
65
+ #[ cfg( any(
66
+ all( target_arch = "x86_64" , target_os = "linux" , target_env = "gnu" ) ,
67
+ all( target_arch = "x86_64" , target_os = "macos" ) ,
68
+ all( target_arch = "aarch64" , target_os = "android" ) ,
69
+ all( target_arch = "armv7" , target_os = "androidabi" ) ,
70
+ all( target_arch = "x86_64" , target_os = "windows" , target_env = "msvc" ) ,
48
71
) ) ]
49
72
impl From < ShaderStage > for bevy_glsl_to_spirv:: ShaderType {
50
73
fn from ( s : ShaderStage ) -> bevy_glsl_to_spirv:: ShaderType {
@@ -56,10 +79,12 @@ impl From<ShaderStage> for bevy_glsl_to_spirv::ShaderType {
56
79
}
57
80
}
58
81
59
- #[ cfg( all(
60
- not( target_os = "ios" ) ,
61
- not( target_arch = "wasm32" ) ,
62
- not( all( target_arch = "aarch64" , target_os = "macos" ) )
82
+ #[ cfg( any(
83
+ all( target_arch = "x86_64" , target_os = "linux" , target_env = "gnu" ) ,
84
+ all( target_arch = "x86_64" , target_os = "macos" ) ,
85
+ all( target_arch = "aarch64" , target_os = "android" ) ,
86
+ all( target_arch = "armv7" , target_os = "androidabi" ) ,
87
+ all( target_arch = "x86_64" , target_os = "windows" , target_env = "msvc" ) ,
63
88
) ) ]
64
89
pub fn glsl_to_spirv (
65
90
glsl_source : & str ,
@@ -70,7 +95,14 @@ pub fn glsl_to_spirv(
70
95
. map_err ( ShaderError :: Compilation )
71
96
}
72
97
73
- #[ cfg( any( target_os = "ios" , all( target_arch = "aarch64" , target_os = "macos" ) ) ) ]
98
+ #[ cfg( not( any(
99
+ target_arch = "wasm32" ,
100
+ all( target_arch = "x86_64" , target_os = "linux" , target_env = "gnu" ) ,
101
+ all( target_arch = "x86_64" , target_os = "macos" ) ,
102
+ all( target_arch = "aarch64" , target_os = "android" ) ,
103
+ all( target_arch = "armv7" , target_os = "androidabi" ) ,
104
+ all( target_arch = "x86_64" , target_os = "windows" , target_env = "msvc" ) ,
105
+ ) ) ) ]
74
106
impl Into < shaderc:: ShaderKind > for ShaderStage {
75
107
fn into ( self ) -> shaderc:: ShaderKind {
76
108
match self {
@@ -81,7 +113,14 @@ impl Into<shaderc::ShaderKind> for ShaderStage {
81
113
}
82
114
}
83
115
84
- #[ cfg( any( target_os = "ios" , all( target_arch = "aarch64" , target_os = "macos" ) ) ) ]
116
+ #[ cfg( not( any(
117
+ target_arch = "wasm32" ,
118
+ all( target_arch = "x86_64" , target_os = "linux" , target_env = "gnu" ) ,
119
+ all( target_arch = "x86_64" , target_os = "macos" ) ,
120
+ all( target_arch = "aarch64" , target_os = "android" ) ,
121
+ all( target_arch = "armv7" , target_os = "androidabi" ) ,
122
+ all( target_arch = "x86_64" , target_os = "windows" , target_env = "msvc" ) ,
123
+ ) ) ) ]
85
124
pub fn glsl_to_spirv (
86
125
glsl_source : & str ,
87
126
stage : ShaderStage ,
0 commit comments