File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -67,13 +67,15 @@ pub enum MyVertex {}
67
67
impl EntryPoint for MyVertex {
68
68
const NAME : EntryPointName = " vertex" ;
69
69
const PARAMETERS : EntryPointParameters = & [];
70
+ const CONSTANTS : EntryPointConstants = & [];
70
71
}
71
72
72
73
pub enum MyFragment {}
73
74
74
75
impl EntryPoint for MyFragment {
75
76
const NAME : EntryPointName = " fragment" ;
76
77
const PARAMETERS : EntryPointParameters = & [];
78
+ const CONSTANTS : EntryPointConstants = & [];
77
79
}
78
80
79
81
// Then, impl RustGpuMaterial for our material to tie them together
@@ -90,8 +92,20 @@ Next, add `RustGpuPlugin` to your bevy app to configure the backend.
90
92
91
93
``` rust
92
94
let mut app = App :: default ();
93
- app . add_plugin (RustGpuPlugin ); // Must be before RenderPlugin, i.e. before DefaultPlugins
94
- app . add_plugins (DefaultPlugins );
95
+
96
+ // Add default plugins
97
+ app . add_plugins (
98
+ DefaultPlugins
99
+ . set (
100
+ // Configure the render plugin with RustGpuPlugin's recommended WgpuSettings
101
+ RenderPlugin {
102
+ wgpu_settings : RustGpuPlugin :: wgpu_settings (),
103
+ },
104
+ ),
105
+ );
106
+
107
+ // Add the Rust-GPU plugin
108
+ app . add_plugin (RustGpuPlugin );
95
109
```
96
110
97
111
For each ` RustGpuMaterial ` implementor, add a ` RustGpuMaterialPlugin::<M> ` to your app to setup backend rendering machinery.
You can’t perform that action at this time.
0 commit comments