This repository was archived by the owner on Jan 29, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +9
-12
lines changed Expand file tree Collapse file tree 1 file changed +9
-12
lines changed Original file line number Diff line number Diff line change @@ -329,12 +329,7 @@ impl Options {
329
329
& self ,
330
330
ep : & crate :: EntryPoint ,
331
331
) -> Result < ResolvedBinding , EntryPointError > {
332
- let slot = self
333
- . per_entry_point_map
334
- . as_ref ( )
335
- . and_then ( |map| map. get ( & ep. name ) )
336
- . and_then ( |r| r. push_constant_buffer )
337
- . or_else ( || self . per_stage_map [ ep. stage ] . push_constant_buffer ) ;
332
+ let slot = self . get_ep_resources ( ep) . push_constant_buffer ;
338
333
match slot {
339
334
Some ( slot) => Ok ( ResolvedBinding :: Resource ( BindTarget {
340
335
buffer : Some ( slot) ,
@@ -356,12 +351,7 @@ impl Options {
356
351
& self ,
357
352
ep : & crate :: EntryPoint ,
358
353
) -> Result < ResolvedBinding , EntryPointError > {
359
- let slot = self
360
- . per_entry_point_map
361
- . as_ref ( )
362
- . and_then ( |map| map. get ( & ep. name ) )
363
- . and_then ( |r| r. sizes_buffer )
364
- . or_else ( || self . per_stage_map [ ep. stage ] . sizes_buffer ) ;
354
+ let slot = self . get_ep_resources ( ep) . sizes_buffer ;
365
355
match slot {
366
356
Some ( slot) => Ok ( ResolvedBinding :: Resource ( BindTarget {
367
357
buffer : Some ( slot) ,
@@ -378,6 +368,13 @@ impl Options {
378
368
None => Err ( EntryPointError :: MissingSizesBuffer ) ,
379
369
}
380
370
}
371
+
372
+ fn get_ep_resources ( & self , ep : & crate :: EntryPoint ) -> & PerStageResources {
373
+ self . per_entry_point_map
374
+ . as_ref ( )
375
+ . and_then ( |map| map. get ( & ep. name ) )
376
+ . unwrap_or_else ( || & self . per_stage_map [ ep. stage ] )
377
+ }
381
378
}
382
379
383
380
impl ResolvedBinding {
You can’t perform that action at this time.
0 commit comments