Skip to content

Commit 753da19

Browse files
committed
renamed type names Render{Device, Queue, Adapter, AdapterInfo, Instance, Context} to GPU{Device, Queue, Adapter, AdapterInfo, Instance, Context}
renamed variable names render_{device, queue, adapter, adapter_info, instance, context} to gpu_{device, queue, adapter, adapter_info, instance, context}
1 parent ca85f6c commit 753da19

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+469
-516
lines changed

crates/bevy_core_pipeline/src/bloom/mod.rs

Lines changed: 38 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use bevy_render::{
1919
render_graph::{Node, NodeRunError, RenderGraph, RenderGraphContext, SlotInfo, SlotType},
2020
render_phase::TrackedRenderPass,
2121
render_resource::*,
22-
renderer::{RenderContext, RenderDevice},
22+
renderer::{GPUContext, GPUDevice},
2323
texture::{CachedTexture, TextureCache},
2424
view::ViewTarget,
2525
RenderApp, RenderStage,
@@ -200,7 +200,7 @@ impl Node for BloomNode {
200200
fn run(
201201
&self,
202202
graph: &mut RenderGraphContext,
203-
render_context: &mut RenderContext,
203+
gpu_context: &mut GPUContext,
204204
world: &World,
205205
) -> Result<(), NodeRunError> {
206206
#[cfg(feature = "trace")]
@@ -232,7 +232,7 @@ impl Node for BloomNode {
232232
{
233233
let view = &BloomTextures::texture_view(&textures.texture_a, 0);
234234
let mut prefilter_pass =
235-
TrackedRenderPass::new(render_context.command_encoder.begin_render_pass(
235+
TrackedRenderPass::new(gpu_context.command_encoder.begin_render_pass(
236236
&RenderPassDescriptor {
237237
label: Some("bloom_prefilter_pass"),
238238
color_attachments: &[Some(RenderPassColorAttachment {
@@ -258,7 +258,7 @@ impl Node for BloomNode {
258258
for mip in 1..textures.mip_count {
259259
let view = &BloomTextures::texture_view(&textures.texture_a, mip);
260260
let mut downsampling_pass =
261-
TrackedRenderPass::new(render_context.command_encoder.begin_render_pass(
261+
TrackedRenderPass::new(gpu_context.command_encoder.begin_render_pass(
262262
&RenderPassDescriptor {
263263
label: Some("bloom_downsampling_pass"),
264264
color_attachments: &[Some(RenderPassColorAttachment {
@@ -284,7 +284,7 @@ impl Node for BloomNode {
284284
for mip in (1..textures.mip_count).rev() {
285285
let view = &BloomTextures::texture_view(&textures.texture_b, mip - 1);
286286
let mut upsampling_pass =
287-
TrackedRenderPass::new(render_context.command_encoder.begin_render_pass(
287+
TrackedRenderPass::new(gpu_context.command_encoder.begin_render_pass(
288288
&RenderPassDescriptor {
289289
label: Some("bloom_upsampling_pass"),
290290
color_attachments: &[Some(RenderPassColorAttachment {
@@ -309,7 +309,7 @@ impl Node for BloomNode {
309309

310310
{
311311
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(
313313
&RenderPassDescriptor {
314314
label: Some("bloom_upsampling_final_pass"),
315315
color_attachments: &[Some(view_target.get_unsampled_color_attachment(
@@ -350,9 +350,9 @@ struct BloomPipelines {
350350

351351
impl FromWorld for BloomPipelines {
352352
fn from_world(world: &mut World) -> Self {
353-
let render_device = world.resource::<RenderDevice>();
353+
let gpu_device = world.resource::<GPUDevice>();
354354

355-
let sampler = render_device.create_sampler(&SamplerDescriptor {
355+
let sampler = gpu_device.create_sampler(&SamplerDescriptor {
356356
min_filter: FilterMode::Linear,
357357
mag_filter: FilterMode::Linear,
358358
address_mode_u: AddressMode::ClampToEdge,
@@ -361,7 +361,7 @@ impl FromWorld for BloomPipelines {
361361
});
362362

363363
let downsampling_bind_group_layout =
364-
render_device.create_bind_group_layout(&BindGroupLayoutDescriptor {
364+
gpu_device.create_bind_group_layout(&BindGroupLayoutDescriptor {
365365
label: Some("bloom_downsampling_bind_group_layout"),
366366
entries: &[
367367
// Upsampled input texture (downsampled for final upsample)
@@ -397,7 +397,7 @@ impl FromWorld for BloomPipelines {
397397
});
398398

399399
let upsampling_bind_group_layout =
400-
render_device.create_bind_group_layout(&BindGroupLayoutDescriptor {
400+
gpu_device.create_bind_group_layout(&BindGroupLayoutDescriptor {
401401
label: Some("bloom_upsampling_bind_group_layout"),
402402
entries: &[
403403
// Downsampled input texture
@@ -563,7 +563,7 @@ impl BloomTextures {
563563
fn prepare_bloom_textures(
564564
mut commands: Commands,
565565
mut texture_cache: ResMut<TextureCache>,
566-
render_device: Res<RenderDevice>,
566+
gpu_device: Res<GPUDevice>,
567567
views: Query<(Entity, &ExtractedCamera), With<BloomUniform>>,
568568
) {
569569
let mut texture_as = HashMap::default();
@@ -594,13 +594,13 @@ fn prepare_bloom_textures(
594594
texture_descriptor.label = Some("bloom_texture_a");
595595
let texture_a = texture_as
596596
.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()))
598598
.clone();
599599

600600
texture_descriptor.label = Some("bloom_texture_b");
601601
let texture_b = texture_bs
602602
.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))
604604
.clone();
605605

606606
commands.entity(entity).insert(BloomTextures {
@@ -633,14 +633,14 @@ struct BloomBindGroups {
633633

634634
fn queue_bloom_bind_groups(
635635
mut commands: Commands,
636-
render_device: Res<RenderDevice>,
636+
gpu_device: Res<GPUDevice>,
637637
pipelines: Res<BloomPipelines>,
638638
uniforms: Res<ComponentUniforms<BloomUniform>>,
639639
views: Query<(Entity, &ViewTarget, &BloomTextures)>,
640640
) {
641641
if let Some(uniforms) = uniforms.binding() {
642642
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 {
644644
label: Some("bloom_prefilter_bind_group"),
645645
layout: &pipelines.downsampling_bind_group_layout,
646646
entries: &[
@@ -663,7 +663,7 @@ fn queue_bloom_bind_groups(
663663

664664
let mut downsampling_bind_groups = Vec::with_capacity(bind_group_count);
665665
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 {
667667
label: Some("bloom_downsampling_bind_group"),
668668
layout: &pipelines.downsampling_bind_group_layout,
669669
entries: &[
@@ -700,7 +700,7 @@ fn queue_bloom_bind_groups(
700700
mip,
701701
);
702702

703-
let bind_group = render_device.create_bind_group(&BindGroupDescriptor {
703+
let bind_group = gpu_device.create_bind_group(&BindGroupDescriptor {
704704
label: Some("bloom_upsampling_bind_group"),
705705
layout: &pipelines.upsampling_bind_group_layout,
706706
entries: &[
@@ -726,28 +726,27 @@ fn queue_bloom_bind_groups(
726726
upsampling_bind_groups.push(bind_group);
727727
}
728728

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+
});
751750

752751
commands.entity(entity).insert(BloomBindGroups {
753752
prefilter_bind_group,

crates/bevy_core_pipeline/src/core_2d/main_pass_2d_node.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use bevy_render::{
88
render_graph::{Node, NodeRunError, RenderGraphContext, SlotInfo, SlotType},
99
render_phase::RenderPhase,
1010
render_resource::{LoadOp, Operations, RenderPassDescriptor},
11-
renderer::RenderContext,
11+
renderer::GPUContext,
1212
view::{ExtractedView, ViewTarget},
1313
};
1414
#[cfg(feature = "trace")]
@@ -48,7 +48,7 @@ impl Node for MainPass2dNode {
4848
fn run(
4949
&self,
5050
graph: &mut RenderGraphContext,
51-
render_context: &mut RenderContext,
51+
gpu_context: &mut GPUContext,
5252
world: &World,
5353
) -> Result<(), NodeRunError> {
5454
let view_entity = graph.get_input_entity(Self::IN_VIEW)?;
@@ -79,7 +79,7 @@ impl Node for MainPass2dNode {
7979

8080
transparent_phase.render(
8181
world,
82-
render_context,
82+
gpu_context,
8383
view_entity,
8484
camera.viewport.as_ref(),
8585
pass_descriptor,
@@ -101,7 +101,7 @@ impl Node for MainPass2dNode {
101101
depth_stencil_attachment: None,
102102
};
103103

104-
render_context
104+
gpu_context
105105
.command_encoder
106106
.begin_render_pass(&pass_descriptor);
107107
}

crates/bevy_core_pipeline/src/core_3d/main_pass_3d_node.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use bevy_render::{
88
render_graph::{Node, NodeRunError, RenderGraphContext, SlotInfo, SlotType},
99
render_phase::RenderPhase,
1010
render_resource::{LoadOp, Operations, RenderPassDepthStencilAttachment, RenderPassDescriptor},
11-
renderer::RenderContext,
11+
renderer::GPUContext,
1212
view::{ExtractedView, ViewDepthTexture, ViewTarget},
1313
};
1414
#[cfg(feature = "trace")]
@@ -51,7 +51,7 @@ impl Node for MainPass3dNode {
5151
fn run(
5252
&self,
5353
graph: &mut RenderGraphContext,
54-
render_context: &mut RenderContext,
54+
gpu_context: &mut GPUContext,
5555
world: &World,
5656
) -> Result<(), NodeRunError> {
5757
let view_entity = graph.get_input_entity(Self::IN_VIEW)?;
@@ -66,7 +66,7 @@ impl Node for MainPass3dNode {
6666
// Always run opaque pass to ensure screen is cleared
6767
{
6868
// Run the opaque pass, sorted front-to-back
69-
// NOTE: Scoped to drop the mutable borrow of render_context
69+
// NOTE: Scoped to drop the mutable borrow of gpu_context
7070
#[cfg(feature = "trace")]
7171
let _main_opaque_pass_3d_span = info_span!("main_opaque_pass_3d").entered();
7272
let pass_descriptor = RenderPassDescriptor {
@@ -97,7 +97,7 @@ impl Node for MainPass3dNode {
9797

9898
opaque_phase.render(
9999
world,
100-
render_context,
100+
gpu_context,
101101
view_entity,
102102
camera.viewport.as_ref(),
103103
pass_descriptor,
@@ -106,7 +106,7 @@ impl Node for MainPass3dNode {
106106

107107
if !alpha_mask_phase.items.is_empty() {
108108
// Run the alpha mask pass, sorted front-to-back
109-
// NOTE: Scoped to drop the mutable borrow of render_context
109+
// NOTE: Scoped to drop the mutable borrow of gpu_context
110110
#[cfg(feature = "trace")]
111111
let _main_alpha_mask_pass_3d_span = info_span!("main_alpha_mask_pass_3d").entered();
112112
let pass_descriptor = RenderPassDescriptor {
@@ -129,7 +129,7 @@ impl Node for MainPass3dNode {
129129

130130
alpha_mask_phase.render(
131131
world,
132-
render_context,
132+
gpu_context,
133133
view_entity,
134134
camera.viewport.as_ref(),
135135
pass_descriptor,
@@ -138,7 +138,7 @@ impl Node for MainPass3dNode {
138138

139139
if !transparent_phase.items.is_empty() {
140140
// Run the transparent pass, sorted back-to-front
141-
// NOTE: Scoped to drop the mutable borrow of render_context
141+
// NOTE: Scoped to drop the mutable borrow of gpu_context
142142
#[cfg(feature = "trace")]
143143
let _main_transparent_pass_3d_span = info_span!("main_transparent_pass_3d").entered();
144144
let pass_descriptor = RenderPassDescriptor {
@@ -166,7 +166,7 @@ impl Node for MainPass3dNode {
166166

167167
transparent_phase.render(
168168
world,
169-
render_context,
169+
gpu_context,
170170
view_entity,
171171
camera.viewport.as_ref(),
172172
pass_descriptor,
@@ -188,7 +188,7 @@ impl Node for MainPass3dNode {
188188
depth_stencil_attachment: None,
189189
};
190190

191-
render_context
191+
gpu_context
192192
.command_encoder
193193
.begin_render_pass(&pass_descriptor);
194194
}

crates/bevy_core_pipeline/src/core_3d/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ use bevy_render::{
3636
CachedRenderPipelineId, Extent3d, TextureDescriptor, TextureDimension, TextureFormat,
3737
TextureUsages,
3838
},
39-
renderer::RenderDevice,
39+
renderer::GPUDevice,
4040
texture::TextureCache,
4141
view::ViewDepthTexture,
4242
Extract, RenderApp, RenderStage,
@@ -257,7 +257,7 @@ pub fn prepare_core_3d_depth_textures(
257257
mut commands: Commands,
258258
mut texture_cache: ResMut<TextureCache>,
259259
msaa: Res<Msaa>,
260-
render_device: Res<RenderDevice>,
260+
gpu_device: Res<GPUDevice>,
261261
views_3d: Query<
262262
(Entity, &ExtractedCamera),
263263
(
@@ -274,7 +274,7 @@ pub fn prepare_core_3d_depth_textures(
274274
.entry(camera.target.clone())
275275
.or_insert_with(|| {
276276
texture_cache.get(
277-
&render_device,
277+
&gpu_device,
278278
TextureDescriptor {
279279
label: Some("view_depth_texture"),
280280
size: Extent3d {

crates/bevy_core_pipeline/src/fxaa/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use bevy_render::{
99
prelude::Camera,
1010
render_graph::RenderGraph,
1111
render_resource::*,
12-
renderer::RenderDevice,
12+
renderer::GPUDevice,
1313
texture::BevyDefault,
1414
view::{ExtractedView, ViewTarget},
1515
RenderApp, RenderStage,
@@ -153,7 +153,7 @@ pub struct FxaaPipeline {
153153
impl FromWorld for FxaaPipeline {
154154
fn from_world(render_world: &mut World) -> Self {
155155
let texture_bind_group = render_world
156-
.resource::<RenderDevice>()
156+
.resource::<GPUDevice>()
157157
.create_bind_group_layout(&BindGroupLayoutDescriptor {
158158
label: Some("fxaa_texture_bind_group_layout"),
159159
entries: &[

0 commit comments

Comments
 (0)