@@ -80,7 +80,7 @@ impl<GL: GLTypes> LayerGrandManager<GL> {
8080
8181 pub fn create_layer_manager < F , M > ( & self , factory : F ) -> Result < LayerManager , Error >
8282 where
83- F : ' static + Send + FnOnce ( & mut dyn GLContexts < GL > ) -> Result < M , Error > ,
83+ F : ' static + Send + FnOnce ( & GL :: Device , & mut dyn GLContexts < GL > ) -> Result < M , Error > ,
8484 M : ' static + LayerManagerAPI < GL > ,
8585 {
8686 self . 0
@@ -172,7 +172,13 @@ impl Drop for LayerManager {
172172
173173#[ allow( clippy:: type_complexity) ]
174174pub struct LayerManagerFactory < GL : GLTypes > (
175- Box < dyn Send + FnOnce ( & mut dyn GLContexts < GL > ) -> Result < Box < dyn LayerManagerAPI < GL > > , Error > > ,
175+ Box <
176+ dyn Send
177+ + FnOnce (
178+ & GL :: Device ,
179+ & mut dyn GLContexts < GL > ,
180+ ) -> Result < Box < dyn LayerManagerAPI < GL > > , Error > ,
181+ > ,
176182) ;
177183
178184impl < GL : GLTypes > Debug for LayerManagerFactory < GL > {
@@ -184,17 +190,20 @@ impl<GL: GLTypes> Debug for LayerManagerFactory<GL> {
184190impl < GL : GLTypes > LayerManagerFactory < GL > {
185191 pub fn new < F , M > ( factory : F ) -> LayerManagerFactory < GL >
186192 where
187- F : ' static + Send + FnOnce ( & mut dyn GLContexts < GL > ) -> Result < M , Error > ,
193+ F : ' static + Send + FnOnce ( & GL :: Device , & mut dyn GLContexts < GL > ) -> Result < M , Error > ,
188194 M : ' static + LayerManagerAPI < GL > ,
189195 {
190- LayerManagerFactory ( Box :: new ( move |contexts| Ok ( Box :: new ( factory ( contexts) ?) ) ) )
196+ LayerManagerFactory ( Box :: new ( move |device, contexts| {
197+ Ok ( Box :: new ( factory ( device, contexts) ?) )
198+ } ) )
191199 }
192200
193201 pub fn build (
194202 self ,
203+ device : & GL :: Device ,
195204 contexts : & mut dyn GLContexts < GL > ,
196205 ) -> Result < Box < dyn LayerManagerAPI < GL > > , Error > {
197- ( self . 0 ) ( contexts)
206+ ( self . 0 ) ( device , contexts)
198207 }
199208}
200209
0 commit comments