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.
This commit is contained in:
Jökull Máni Reynisson authored and GitHub committed 2021-02-24 16:37:05 -05:00
1 parent f430adb828
commit ce4668a7ac
1 file changed
+2
+2
View File
@@ -566,6 +566,8 @@ bitflags::bitflags! {
const VERTEX = 1;
/// Binding is visible from the fragment shader of a render pipeline.
const FRAGMENT = 2;
/// Binding is visible from the vertex and fragment shaders of a render pipeline.
const VERTEX_FRAGMENT = Self::VERTEX.bits | Self::FRAGMENT.bits;
/// Binding is visible from the compute shader of a compute pipeline.
const COMPUTE = 4;
}