Skip to content

Commit ce4668a

Browse files
authored
const in ShaderStage that represents vertex and fragment access (#1229)
* const in ShaderStage that represents vertex and fragment access We can store `ShaderStage`s as const values or members of const structs in all individual cases, but for example `ShaderStage::VERTEX | ShaderStage::FRAGMENT` cannot be stored in a const. This is not very elegant, but would be convenient. * Correct VERTEX_FRAGMENT definition VERTEX_FRAGMENT definition now follows directly from the bit representation of `ShaderStage::VERTEX` and `Shaderstage::FRAGMENT` such that it does not need to be independently maintained.
1 parent f430adb commit ce4668a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

wgpu-types/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,8 @@ bitflags::bitflags! {
566566
const VERTEX = 1;
567567
/// Binding is visible from the fragment shader of a render pipeline.
568568
const FRAGMENT = 2;
569+
/// Binding is visible from the vertex and fragment shaders of a render pipeline.
570+
const VERTEX_FRAGMENT = Self::VERTEX.bits | Self::FRAGMENT.bits;
569571
/// Binding is visible from the compute shader of a compute pipeline.
570572
const COMPUTE = 4;
571573
}

0 commit comments

Comments
 (0)