Update some docs containing OpenGL or GLSL references (#6271)

This commit is contained in:
Johann Muszynski 2024-09-15 10:07:39 +03:00 committed by GitHub
parent a21c0e2696
commit d79ebc4db3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 25 additions and 20 deletions

View File

@ -126,6 +126,10 @@ By @bradwerth [#6216](https://github.com/gfx-rs/wgpu/pull/6216).
- Change the inconsistent `DropGuard` based API on Vulkan and GLES to a consistent, callback-based one. By @jerzywilczek in [#6164](https://github.com/gfx-rs/wgpu/pull/6164)
### Documentation
- Removed some OpenGL and Vulkan references from `wgpu-types` documentation. Fixed Storage texel types in examples. By @Nelarius in [#6271](https://github.com/gfx-rs/wgpu/pull/6271)
### Dependency Updates
#### GLES

View File

@ -568,7 +568,7 @@ bitflags::bitflags! {
/// may also create uniform arrays of storage textures.
///
/// ex.
/// - `var textures: array<texture_storage_2d<f32, write>, 10>` (WGSL)
/// - `var textures: array<texture_storage_2d<r32float, write>, 10>` (WGSL)
/// - `uniform image2D textures[10]` (GLSL)
///
/// This capability allows them to exist and to be indexed by dynamically uniform
@ -1959,12 +1959,13 @@ impl TextureViewDimension {
/// Alpha blend factor.
///
/// Alpha blending is very complicated: see the OpenGL or Vulkan spec for more information.
///
/// Corresponds to [WebGPU `GPUBlendFactor`](
/// https://gpuweb.github.io/gpuweb/#enumdef-gpublendfactor).
/// Values using S1 requires [`Features::DUAL_SOURCE_BLENDING`] and can only be
/// used with the first render target.
/// https://gpuweb.github.io/gpuweb/#enumdef-gpublendfactor). Values using `Src1`
/// require [`Features::DUAL_SOURCE_BLENDING`] and can only be used with the first
/// render target.
///
/// For further details on how the blend factors are applied, see the analogous
/// functionality in OpenGL: <https://www.khronos.org/opengl/wiki/Blending#Blending_Parameters>.
#[repr(C)]
#[derive(Copy, Clone, Debug, Hash, Eq, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
@ -2024,10 +2025,11 @@ impl BlendFactor {
/// Alpha blend operation.
///
/// Alpha blending is very complicated: see the OpenGL or Vulkan spec for more information.
///
/// Corresponds to [WebGPU `GPUBlendOperation`](
/// https://gpuweb.github.io/gpuweb/#enumdef-gpublendoperation).
///
/// For further details on how the blend operations are applied, see
/// the analogous functionality in OpenGL: <https://www.khronos.org/opengl/wiki/Blending#Blend_Equations>.
#[repr(C)]
#[derive(Copy, Clone, Debug, Default, Hash, Eq, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
@ -2102,8 +2104,6 @@ impl Default for BlendComponent {
/// Describe the blend state of a render pipeline,
/// within [`ColorTargetState`].
///
/// See the OpenGL or Vulkan spec for more information.
///
/// Corresponds to [WebGPU `GPUBlendState`](
/// https://gpuweb.github.io/gpuweb/#dictdef-gpublendstate).
#[repr(C)]
@ -6543,7 +6543,7 @@ pub enum StorageTextureAccess {
/// Example WGSL syntax:
/// ```rust,ignore
/// @group(0) @binding(0)
/// var my_storage_image: texture_storage_2d<f32, write>;
/// var my_storage_image: texture_storage_2d<r32float, write>;
/// ```
///
/// Example GLSL syntax:
@ -6560,7 +6560,7 @@ pub enum StorageTextureAccess {
/// Example WGSL syntax:
/// ```rust,ignore
/// @group(0) @binding(0)
/// var my_storage_image: texture_storage_2d<f32, read>;
/// var my_storage_image: texture_storage_2d<r32float, read>;
/// ```
///
/// Example GLSL syntax:
@ -6577,7 +6577,7 @@ pub enum StorageTextureAccess {
/// Example WGSL syntax:
/// ```rust,ignore
/// @group(0) @binding(0)
/// var my_storage_image: texture_storage_2d<f32, read_write>;
/// var my_storage_image: texture_storage_2d<r32float, read_write>;
/// ```
///
/// Example GLSL syntax:
@ -6701,8 +6701,8 @@ pub enum BindingType {
/// Dimension of the texture view that is going to be sampled.
view_dimension: TextureViewDimension,
/// True if the texture has a sample count greater than 1. If this is true,
/// the texture must be read from shaders with `texture1DMS`, `texture2DMS`, or `texture3DMS`,
/// depending on `dimension`.
/// the texture must be declared as `texture_multisampled_2d` or
/// `texture_depth_multisampled_2d` in the shader, and read using `textureLoad`.
multisampled: bool,
},
/// A storage texture.
@ -6710,15 +6710,16 @@ pub enum BindingType {
/// Example WGSL syntax:
/// ```rust,ignore
/// @group(0) @binding(0)
/// var my_storage_image: texture_storage_2d<f32, write>;
/// var my_storage_image: texture_storage_2d<r32float, write>;
/// ```
///
/// Example GLSL syntax:
/// ```cpp,ignore
/// layout(set=0, binding=0, r32f) writeonly uniform image2D myStorageImage;
/// ```
/// Note that the texture format must be specified in the shader as well.
/// A list of valid formats can be found in the specification here: <https://www.khronos.org/registry/OpenGL/specs/gl/GLSLangSpec.4.60.html#layout-qualifiers>
/// Note that the texture format must be specified in the shader, along with the
/// access mode. For WGSL, the format must be one of the enumerants in the list
/// of [storage texel formats](https://gpuweb.github.io/gpuweb/wgsl/#storage-texel-formats).
///
/// Corresponds to [WebGPU `GPUStorageTextureBindingLayout`](
/// https://gpuweb.github.io/gpuweb/#dictdef-gpustoragetexturebindinglayout).

View File

@ -40,8 +40,8 @@ pub struct PipelineLayoutDescriptor<'a> {
/// "set = 0", second entry will provide all the bindings for "set = 1" etc.
pub bind_group_layouts: &'a [&'a BindGroupLayout],
/// Set of push constant ranges this pipeline uses. Each shader stage that uses push constants
/// must define the range in push constant memory that corresponds to its single `layout(push_constant)`
/// uniform block.
/// must define the range in push constant memory that corresponds to its single `var<push_constant>`
/// buffer.
///
/// If this array is non-empty, the [`Features::PUSH_CONSTANTS`] must be enabled.
pub push_constant_ranges: &'a [PushConstantRange],