@@ -19,14 +19,7 @@ use bevy::{
19
19
render_graph:: {
20
20
NodeRunError , RenderGraphApp , RenderGraphContext , ViewNode , ViewNodeRunner ,
21
21
} ,
22
- render_resource:: {
23
- BindGroupEntries , BindGroupLayout , BindGroupLayoutDescriptor , BindGroupLayoutEntry ,
24
- BindingType , CachedRenderPipelineId , ColorTargetState , ColorWrites , FragmentState ,
25
- MultisampleState , Operations , PipelineCache , PrimitiveState , RenderPassColorAttachment ,
26
- RenderPassDescriptor , RenderPipelineDescriptor , Sampler , SamplerBindingType ,
27
- SamplerDescriptor , ShaderStages , ShaderType , TextureFormat , TextureSampleType ,
28
- TextureViewDimension ,
29
- } ,
22
+ render_resource:: * ,
30
23
renderer:: { RenderContext , RenderDevice } ,
31
24
texture:: BevyDefault ,
32
25
view:: ViewTarget ,
@@ -226,40 +219,21 @@ impl FromWorld for PostProcessPipeline {
226
219
let render_device = world. resource :: < RenderDevice > ( ) ;
227
220
228
221
// We need to define the bind group layout used for our pipeline
229
- let layout = render_device. create_bind_group_layout ( & BindGroupLayoutDescriptor {
230
- label : Some ( "post_process_bind_group_layout" ) ,
231
- entries : & [
232
- // The screen texture
233
- BindGroupLayoutEntry {
234
- binding : 0 ,
235
- visibility : ShaderStages :: FRAGMENT ,
236
- ty : BindingType :: Texture {
237
- sample_type : TextureSampleType :: Float { filterable : true } ,
238
- view_dimension : TextureViewDimension :: D2 ,
239
- multisampled : false ,
240
- } ,
241
- count : None ,
242
- } ,
243
- // The sampler that will be used to sample the screen texture
244
- BindGroupLayoutEntry {
245
- binding : 1 ,
246
- visibility : ShaderStages :: FRAGMENT ,
247
- ty : BindingType :: Sampler ( SamplerBindingType :: Filtering ) ,
248
- count : None ,
249
- } ,
250
- // The settings uniform that will control the effect
251
- BindGroupLayoutEntry {
252
- binding : 2 ,
253
- visibility : ShaderStages :: FRAGMENT ,
254
- ty : BindingType :: Buffer {
255
- ty : bevy:: render:: render_resource:: BufferBindingType :: Uniform ,
256
- has_dynamic_offset : false ,
257
- min_binding_size : Some ( PostProcessSettings :: min_size ( ) ) ,
258
- } ,
259
- count : None ,
260
- } ,
261
- ] ,
262
- } ) ;
222
+ let layout = render_device. create_bind_group_layout (
223
+ "post_process_bind_group_layout" ,
224
+ & BindGroupLayoutEntries :: sequential (
225
+ // The layout entries will only be visible in the fragment stage
226
+ ShaderStages :: FRAGMENT ,
227
+ (
228
+ // The screen texture
229
+ texture_2d ( TextureSampleType :: Float { filterable : true } ) ,
230
+ // The sampler that will be used to sample the screen texture
231
+ sampler ( SamplerBindingType :: Filtering ) ,
232
+ // The settings uniform that will control the effect
233
+ uniform_buffer ( false , Some ( PostProcessSettings :: min_size ( ) ) ) ,
234
+ ) ,
235
+ ) ,
236
+ ) ;
263
237
264
238
// We can create the sampler here since it won't change at runtime and doesn't depend on the view
265
239
let sampler = render_device. create_sampler ( & SamplerDescriptor :: default ( ) ) ;
0 commit comments