@@ -104,23 +104,39 @@ impl Deref for BindGroup {
104
104
/// are generally bound to group 1.
105
105
///
106
106
/// The following field-level attributes are supported:
107
+ ///
107
108
/// * `uniform(BINDING_INDEX)`
108
109
/// * The field will be converted to a shader-compatible type using the [`ShaderType`] trait, written to a [`Buffer`], and bound as a uniform.
109
110
/// [`ShaderType`] is implemented for most math types already, such as [`f32`], [`Vec4`](bevy_math::Vec4), and
110
111
/// [`Color`](crate::color::Color). It can also be derived for custom structs.
111
- /// * `texture(BINDING_INDEX)`
112
+ ///
113
+ /// * `texture(BINDING_INDEX, arguments)`
112
114
/// * This field's [`Handle<Image>`](bevy_asset::Handle) will be used to look up the matching [`Texture`](crate::render_resource::Texture)
113
115
/// GPU resource, which will be bound as a texture in shaders. The field will be assumed to implement [`Into<Option<Handle<Image>>>`]. In practice,
114
116
/// most fields should be a [`Handle<Image>`](bevy_asset::Handle) or [`Option<Handle<Image>>`]. If the value of an [`Option<Handle<Image>>`] is
115
117
/// [`None`], the [`FallbackImage`] resource will be used instead. This attribute can be used in conjunction with a `sampler` binding attribute
116
118
/// (with a different binding index) if a binding of the sampler for the [`Image`] is also required.
117
- /// * `sampler(BINDING_INDEX)`
119
+ ///
120
+ /// | Arguments | Values | Default |
121
+ /// |-----------------------|-------------------------------------------------------------------------|----------------------|
122
+ /// | `dimension` = "..." | `"1d"`, `"2d"`, `"2d_array"`, `"3d"`, `"cube"`, `"cube_array"` | `"2d"` |
123
+ /// | `sample_type` = "..." | `"float"`, `"depth"`, `"s_int"` or `"u_int"` | `"float"` |
124
+ /// | `filterable` = ... | `true`, `false` | `true` |
125
+ /// | `multisampled` = ... | `true`, `false` | `false` |
126
+ /// | `visibility(...)` | `all`, `none`, or a list-combination of `vertex`, `fragment`, `compute` | `vertex`, `fragment` |
127
+ ///
128
+ /// * `sampler(BINDING_INDEX, arguments)`
118
129
/// * This field's [`Handle<Image>`](bevy_asset::Handle) will be used to look up the matching [`Sampler`](crate::render_resource::Sampler) GPU
119
130
/// resource, which will be bound as a sampler in shaders. The field will be assumed to implement [`Into<Option<Handle<Image>>>`]. In practice,
120
131
/// most fields should be a [`Handle<Image>`](bevy_asset::Handle) or [`Option<Handle<Image>>`]. If the value of an [`Option<Handle<Image>>`] is
121
132
/// [`None`], the [`FallbackImage`] resource will be used instead. This attribute can be used in conjunction with a `texture` binding attribute
122
133
/// (with a different binding index) if a binding of the texture for the [`Image`] is also required.
123
134
///
135
+ /// | Arguments | Values | Default |
136
+ /// |------------------------|-------------------------------------------------------------------------|------------------------|
137
+ /// | `sampler_type` = "..." | `"filtering"`, `"non_filtering"`, `"comparison"`. | `"filtering"` |
138
+ /// | `visibility(...)` | `all`, `none`, or a list-combination of `vertex`, `fragment`, `compute` | `vertex`, `fragment` |
139
+ ///
124
140
/// Note that fields without field-level binding attributes will be ignored.
125
141
/// ```
126
142
/// # use bevy_render::{color::Color, render_resource::AsBindGroup};
0 commit comments