@@ -3,21 +3,6 @@ use anyhow::{Context, Result, bail};
33use ash:: vk;
44use std:: ffi:: { CStr , CString } ;
55
6- /// Configuration for the Ash backend
7- #[ derive( Clone ) ]
8- pub struct AshConfig {
9- /// Maximum number of descriptor sets
10- pub max_descriptor_sets : u32 ,
11- }
12-
13- impl Default for AshConfig {
14- fn default ( ) -> Self {
15- Self {
16- max_descriptor_sets : 16 ,
17- }
18- }
19- }
20-
216pub struct AshBackend {
227 instance : ash:: Instance ,
238 device : ash:: Device ,
@@ -105,8 +90,8 @@ impl AshBackend {
10590 }
10691}
10792
108- impl AshBackend {
109- pub fn new ( config : AshConfig ) -> Result < Self > {
93+ impl ComputeBackend for AshBackend {
94+ fn init ( ) -> Result < Self > {
11095 unsafe {
11196 let entry = ash:: Entry :: load ( ) . context ( "Failed to load Vulkan entry" ) ?;
11297
@@ -189,7 +174,7 @@ impl AshBackend {
189174
190175 let descriptor_pool_create_info = vk:: DescriptorPoolCreateInfo :: default ( )
191176 . pool_sizes ( & descriptor_pool_sizes)
192- . max_sets ( config . max_descriptor_sets ) ;
177+ . max_sets ( 16 ) ;
193178
194179 let descriptor_pool = device
195180 . create_descriptor_pool ( & descriptor_pool_create_info, None )
@@ -206,15 +191,7 @@ impl AshBackend {
206191 } )
207192 }
208193 }
209- }
210-
211- impl Default for AshBackend {
212- fn default ( ) -> Self {
213- Self :: new ( AshConfig :: default ( ) ) . expect ( "Failed to create AshBackend with default config" )
214- }
215- }
216194
217- impl ComputeBackend for AshBackend {
218195 fn run_compute (
219196 & self ,
220197 spirv_bytes : & [ u8 ] ,
0 commit comments