@@ -19,7 +19,7 @@ use bevy_render::{
19
19
render_graph:: { Node , NodeRunError , RenderGraph , RenderGraphContext , SlotInfo , SlotType } ,
20
20
render_phase:: TrackedRenderPass ,
21
21
render_resource:: * ,
22
- renderer:: { RenderContext , RenderDevice } ,
22
+ renderer:: { GPUContext , GPUDevice } ,
23
23
texture:: { CachedTexture , TextureCache } ,
24
24
view:: ViewTarget ,
25
25
RenderApp , RenderStage ,
@@ -200,7 +200,7 @@ impl Node for BloomNode {
200
200
fn run (
201
201
& self ,
202
202
graph : & mut RenderGraphContext ,
203
- render_context : & mut RenderContext ,
203
+ gpu_context : & mut GPUContext ,
204
204
world : & World ,
205
205
) -> Result < ( ) , NodeRunError > {
206
206
#[ cfg( feature = "trace" ) ]
@@ -232,7 +232,7 @@ impl Node for BloomNode {
232
232
{
233
233
let view = & BloomTextures :: texture_view ( & textures. texture_a , 0 ) ;
234
234
let mut prefilter_pass =
235
- TrackedRenderPass :: new ( render_context . command_encoder . begin_render_pass (
235
+ TrackedRenderPass :: new ( gpu_context . command_encoder . begin_render_pass (
236
236
& RenderPassDescriptor {
237
237
label : Some ( "bloom_prefilter_pass" ) ,
238
238
color_attachments : & [ Some ( RenderPassColorAttachment {
@@ -258,7 +258,7 @@ impl Node for BloomNode {
258
258
for mip in 1 ..textures. mip_count {
259
259
let view = & BloomTextures :: texture_view ( & textures. texture_a , mip) ;
260
260
let mut downsampling_pass =
261
- TrackedRenderPass :: new ( render_context . command_encoder . begin_render_pass (
261
+ TrackedRenderPass :: new ( gpu_context . command_encoder . begin_render_pass (
262
262
& RenderPassDescriptor {
263
263
label : Some ( "bloom_downsampling_pass" ) ,
264
264
color_attachments : & [ Some ( RenderPassColorAttachment {
@@ -284,7 +284,7 @@ impl Node for BloomNode {
284
284
for mip in ( 1 ..textures. mip_count ) . rev ( ) {
285
285
let view = & BloomTextures :: texture_view ( & textures. texture_b , mip - 1 ) ;
286
286
let mut upsampling_pass =
287
- TrackedRenderPass :: new ( render_context . command_encoder . begin_render_pass (
287
+ TrackedRenderPass :: new ( gpu_context . command_encoder . begin_render_pass (
288
288
& RenderPassDescriptor {
289
289
label : Some ( "bloom_upsampling_pass" ) ,
290
290
color_attachments : & [ Some ( RenderPassColorAttachment {
@@ -309,7 +309,7 @@ impl Node for BloomNode {
309
309
310
310
{
311
311
let mut upsampling_final_pass =
312
- TrackedRenderPass :: new ( render_context . command_encoder . begin_render_pass (
312
+ TrackedRenderPass :: new ( gpu_context . command_encoder . begin_render_pass (
313
313
& RenderPassDescriptor {
314
314
label : Some ( "bloom_upsampling_final_pass" ) ,
315
315
color_attachments : & [ Some ( view_target. get_unsampled_color_attachment (
@@ -350,9 +350,9 @@ struct BloomPipelines {
350
350
351
351
impl FromWorld for BloomPipelines {
352
352
fn from_world ( world : & mut World ) -> Self {
353
- let render_device = world. resource :: < RenderDevice > ( ) ;
353
+ let gpu_device = world. resource :: < GPUDevice > ( ) ;
354
354
355
- let sampler = render_device . create_sampler ( & SamplerDescriptor {
355
+ let sampler = gpu_device . create_sampler ( & SamplerDescriptor {
356
356
min_filter : FilterMode :: Linear ,
357
357
mag_filter : FilterMode :: Linear ,
358
358
address_mode_u : AddressMode :: ClampToEdge ,
@@ -361,7 +361,7 @@ impl FromWorld for BloomPipelines {
361
361
} ) ;
362
362
363
363
let downsampling_bind_group_layout =
364
- render_device . create_bind_group_layout ( & BindGroupLayoutDescriptor {
364
+ gpu_device . create_bind_group_layout ( & BindGroupLayoutDescriptor {
365
365
label : Some ( "bloom_downsampling_bind_group_layout" ) ,
366
366
entries : & [
367
367
// Upsampled input texture (downsampled for final upsample)
@@ -397,7 +397,7 @@ impl FromWorld for BloomPipelines {
397
397
} ) ;
398
398
399
399
let upsampling_bind_group_layout =
400
- render_device . create_bind_group_layout ( & BindGroupLayoutDescriptor {
400
+ gpu_device . create_bind_group_layout ( & BindGroupLayoutDescriptor {
401
401
label : Some ( "bloom_upsampling_bind_group_layout" ) ,
402
402
entries : & [
403
403
// Downsampled input texture
@@ -563,7 +563,7 @@ impl BloomTextures {
563
563
fn prepare_bloom_textures (
564
564
mut commands : Commands ,
565
565
mut texture_cache : ResMut < TextureCache > ,
566
- render_device : Res < RenderDevice > ,
566
+ gpu_device : Res < GPUDevice > ,
567
567
views : Query < ( Entity , & ExtractedCamera ) , With < BloomUniform > > ,
568
568
) {
569
569
let mut texture_as = HashMap :: default ( ) ;
@@ -594,13 +594,13 @@ fn prepare_bloom_textures(
594
594
texture_descriptor. label = Some ( "bloom_texture_a" ) ;
595
595
let texture_a = texture_as
596
596
. entry ( camera. target . clone ( ) )
597
- . or_insert_with ( || texture_cache. get ( & render_device , texture_descriptor. clone ( ) ) )
597
+ . or_insert_with ( || texture_cache. get ( & gpu_device , texture_descriptor. clone ( ) ) )
598
598
. clone ( ) ;
599
599
600
600
texture_descriptor. label = Some ( "bloom_texture_b" ) ;
601
601
let texture_b = texture_bs
602
602
. entry ( camera. target . clone ( ) )
603
- . or_insert_with ( || texture_cache. get ( & render_device , texture_descriptor) )
603
+ . or_insert_with ( || texture_cache. get ( & gpu_device , texture_descriptor) )
604
604
. clone ( ) ;
605
605
606
606
commands. entity ( entity) . insert ( BloomTextures {
@@ -633,14 +633,14 @@ struct BloomBindGroups {
633
633
634
634
fn queue_bloom_bind_groups (
635
635
mut commands : Commands ,
636
- render_device : Res < RenderDevice > ,
636
+ gpu_device : Res < GPUDevice > ,
637
637
pipelines : Res < BloomPipelines > ,
638
638
uniforms : Res < ComponentUniforms < BloomUniform > > ,
639
639
views : Query < ( Entity , & ViewTarget , & BloomTextures ) > ,
640
640
) {
641
641
if let Some ( uniforms) = uniforms. binding ( ) {
642
642
for ( entity, view_target, textures) in & views {
643
- let prefilter_bind_group = render_device . create_bind_group ( & BindGroupDescriptor {
643
+ let prefilter_bind_group = gpu_device . create_bind_group ( & BindGroupDescriptor {
644
644
label : Some ( "bloom_prefilter_bind_group" ) ,
645
645
layout : & pipelines. downsampling_bind_group_layout ,
646
646
entries : & [
@@ -663,7 +663,7 @@ fn queue_bloom_bind_groups(
663
663
664
664
let mut downsampling_bind_groups = Vec :: with_capacity ( bind_group_count) ;
665
665
for mip in 1 ..textures. mip_count {
666
- let bind_group = render_device . create_bind_group ( & BindGroupDescriptor {
666
+ let bind_group = gpu_device . create_bind_group ( & BindGroupDescriptor {
667
667
label : Some ( "bloom_downsampling_bind_group" ) ,
668
668
layout : & pipelines. downsampling_bind_group_layout ,
669
669
entries : & [
@@ -700,7 +700,7 @@ fn queue_bloom_bind_groups(
700
700
mip,
701
701
) ;
702
702
703
- let bind_group = render_device . create_bind_group ( & BindGroupDescriptor {
703
+ let bind_group = gpu_device . create_bind_group ( & BindGroupDescriptor {
704
704
label : Some ( "bloom_upsampling_bind_group" ) ,
705
705
layout : & pipelines. upsampling_bind_group_layout ,
706
706
entries : & [
@@ -726,28 +726,27 @@ fn queue_bloom_bind_groups(
726
726
upsampling_bind_groups. push ( bind_group) ;
727
727
}
728
728
729
- let upsampling_final_bind_group =
730
- render_device. create_bind_group ( & BindGroupDescriptor {
731
- label : Some ( "bloom_upsampling_final_bind_group" ) ,
732
- layout : & pipelines. downsampling_bind_group_layout ,
733
- entries : & [
734
- BindGroupEntry {
735
- binding : 0 ,
736
- resource : BindingResource :: TextureView ( & BloomTextures :: texture_view (
737
- & textures. texture_b ,
738
- 0 ,
739
- ) ) ,
740
- } ,
741
- BindGroupEntry {
742
- binding : 1 ,
743
- resource : BindingResource :: Sampler ( & pipelines. sampler ) ,
744
- } ,
745
- BindGroupEntry {
746
- binding : 2 ,
747
- resource : uniforms. clone ( ) ,
748
- } ,
749
- ] ,
750
- } ) ;
729
+ let upsampling_final_bind_group = gpu_device. create_bind_group ( & BindGroupDescriptor {
730
+ label : Some ( "bloom_upsampling_final_bind_group" ) ,
731
+ layout : & pipelines. downsampling_bind_group_layout ,
732
+ entries : & [
733
+ BindGroupEntry {
734
+ binding : 0 ,
735
+ resource : BindingResource :: TextureView ( & BloomTextures :: texture_view (
736
+ & textures. texture_b ,
737
+ 0 ,
738
+ ) ) ,
739
+ } ,
740
+ BindGroupEntry {
741
+ binding : 1 ,
742
+ resource : BindingResource :: Sampler ( & pipelines. sampler ) ,
743
+ } ,
744
+ BindGroupEntry {
745
+ binding : 2 ,
746
+ resource : uniforms. clone ( ) ,
747
+ } ,
748
+ ] ,
749
+ } ) ;
751
750
752
751
commands. entity ( entity) . insert ( BloomBindGroups {
753
752
prefilter_bind_group,
0 commit comments