@@ -173,7 +173,7 @@ impl ShaderDefVal {
173
173
174
174
impl ShaderCache {
175
175
fn new ( render_device : & RenderDevice , render_adapter : & RenderAdapter ) -> Self {
176
- let ( capabilities, subgroup_stages ) = get_capabilities (
176
+ let capabilities = get_capabilities (
177
177
render_device. features ( ) ,
178
178
render_adapter. get_downlevel_capabilities ( ) . flags ,
179
179
) ;
@@ -183,7 +183,7 @@ impl ShaderCache {
183
183
#[ cfg( not( debug_assertions) ) ]
184
184
let composer = naga_oil:: compose:: Composer :: non_validating ( ) ;
185
185
186
- let composer = composer. with_capabilities ( capabilities, subgroup_stages ) ;
186
+ let composer = composer. with_capabilities ( capabilities) ;
187
187
188
188
Self {
189
189
composer,
@@ -742,6 +742,7 @@ impl PipelineCache {
742
742
let compilation_options = PipelineCompilationOptions {
743
743
constants : & std:: collections:: HashMap :: new ( ) ,
744
744
zero_initialize_workgroup_memory : false ,
745
+ vertex_pulling_transform : Default :: default ( ) ,
745
746
} ;
746
747
747
748
let descriptor = RawRenderPipelineDescriptor {
@@ -767,6 +768,7 @@ impl PipelineCache {
767
768
// TODO: Should this be the same as the vertex compilation options?
768
769
compilation_options,
769
770
} ) ,
771
+ cache : None ,
770
772
} ;
771
773
772
774
Ok ( Pipeline :: RenderPipeline (
@@ -822,7 +824,9 @@ impl PipelineCache {
822
824
compilation_options : PipelineCompilationOptions {
823
825
constants : & std:: collections:: HashMap :: new ( ) ,
824
826
zero_initialize_workgroup_memory : false ,
827
+ vertex_pulling_transform : Default :: default ( ) ,
825
828
} ,
829
+ cache : None ,
826
830
} ;
827
831
828
832
Ok ( Pipeline :: ComputePipeline (
@@ -992,14 +996,9 @@ pub enum PipelineCacheError {
992
996
993
997
// TODO: This needs to be kept up to date with the capabilities in the `create_validator` function in wgpu-core
994
998
// https://github.com/gfx-rs/wgpu/blob/trunk/wgpu-core/src/device/mod.rs#L449
995
- // We use a modified version of the `create_validator` function because `naga_oil`'s composer stores the capabilities
996
- // and subgroup shader stages instead of a `Validator`.
997
- // We also can't use that function because `wgpu-core` isn't included in WebGPU builds.
998
- /// Get the device capabilities and subgroup support for use in `naga_oil`.
999
- fn get_capabilities (
1000
- features : Features ,
1001
- downlevel : DownlevelFlags ,
1002
- ) -> ( Capabilities , naga:: valid:: ShaderStages ) {
999
+ // We can't use the `wgpu-core` function to detect the device's capabilities because `wgpu-core` isn't included in WebGPU builds.
1000
+ /// Get the device's capabilities for use in `naga_oil`.
1001
+ fn get_capabilities ( features : Features , downlevel : DownlevelFlags ) -> Capabilities {
1003
1002
let mut capabilities = Capabilities :: empty ( ) ;
1004
1003
capabilities. set (
1005
1004
Capabilities :: PUSH_CONSTANT ,
@@ -1042,6 +1041,16 @@ fn get_capabilities(
1042
1041
Capabilities :: SHADER_INT64 ,
1043
1042
features. contains ( Features :: SHADER_INT64 ) ,
1044
1043
) ;
1044
+ capabilities. set (
1045
+ Capabilities :: SHADER_INT64_ATOMIC_MIN_MAX ,
1046
+ features. intersects (
1047
+ Features :: SHADER_INT64_ATOMIC_MIN_MAX | Features :: SHADER_INT64_ATOMIC_ALL_OPS ,
1048
+ ) ,
1049
+ ) ;
1050
+ capabilities. set (
1051
+ Capabilities :: SHADER_INT64_ATOMIC_ALL_OPS ,
1052
+ features. contains ( Features :: SHADER_INT64_ATOMIC_ALL_OPS ) ,
1053
+ ) ;
1045
1054
capabilities. set (
1046
1055
Capabilities :: MULTISAMPLED_SHADING ,
1047
1056
downlevel. contains ( DownlevelFlags :: MULTISAMPLED_SHADING ) ,
@@ -1062,16 +1071,10 @@ fn get_capabilities(
1062
1071
Capabilities :: SUBGROUP_BARRIER ,
1063
1072
features. intersects ( Features :: SUBGROUP_BARRIER ) ,
1064
1073
) ;
1065
-
1066
- let mut subgroup_stages = naga:: valid:: ShaderStages :: empty ( ) ;
1067
- subgroup_stages. set (
1068
- naga:: valid:: ShaderStages :: COMPUTE | naga:: valid:: ShaderStages :: FRAGMENT ,
1069
- features. contains ( Features :: SUBGROUP ) ,
1070
- ) ;
1071
- subgroup_stages. set (
1072
- naga:: valid:: ShaderStages :: VERTEX ,
1074
+ capabilities. set (
1075
+ Capabilities :: SUBGROUP_VERTEX_STAGE ,
1073
1076
features. contains ( Features :: SUBGROUP_VERTEX ) ,
1074
1077
) ;
1075
1078
1076
- ( capabilities, subgroup_stages )
1079
+ capabilities
1077
1080
}
0 commit comments