Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump bitflags to v2 #269

Merged
merged 1 commit into from
May 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ mps = []

[dependencies]
core-graphics-types = "0.1"
bitflags = "1"
bitflags = "2"
log = "0.4"
block = "0.1.6"
foreign-types = "0.5"
Expand Down
2 changes: 1 addition & 1 deletion src/accelerator_structure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use super::*;

bitflags! {
#[derive(Default)]
#[derive(Copy, Clone, Debug, Default, Hash, PartialEq, Eq, PartialOrd, Ord)]
pub struct MTLAccelerationStructureInstanceOptions: u32 {
const None = 0;
const DisableTriangleCulling = (1 << 0);
Expand Down
2 changes: 2 additions & 0 deletions src/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ pub enum MTLDeviceLocation {
}

bitflags! {
#[derive(Copy, Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)]
pub struct PixelFormatCapabilities: u32 {
const Filter = 1 << 0;
const Write = 1 << 1;
Expand Down Expand Up @@ -1432,6 +1433,7 @@ pub enum MTLSparseTextureRegionAlignmentMode {

bitflags! {
/// Options that determine how Metal prepares the pipeline.
#[derive(Copy, Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)]
pub struct MTLPipelineOption: NSUInteger {
/// Do not provide any reflection information.
const None = 0;
Expand Down
1 change: 1 addition & 0 deletions src/encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ pub enum MTLTriangleFillMode {
bitflags! {
/// https://developer.apple.com/documentation/metal/mtlblitoption
#[allow(non_upper_case_globals)]
#[derive(Copy, Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)]
pub struct MTLBlitOption: NSUInteger {
/// https://developer.apple.com/documentation/metal/mtlblitoption/mtlblitoptionnone
const None = 0;
Expand Down
1 change: 1 addition & 0 deletions src/indirect_encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use super::*;
bitflags! {
/// See <https://developer.apple.com/documentation/metal/mtlindirectcommandtype/>
#[allow(non_upper_case_globals)]
#[derive(Copy, Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)]
pub struct MTLIndirectCommandType: NSUInteger {
const Draw = 1 << 0;
const DrawIndexed = 1 << 1;
Expand Down
1 change: 1 addition & 0 deletions src/library.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ bitflags! {
/// Only available on (macos(11.0), ios(14.0))
///
/// See <https://developer.apple.com/documentation/metal/mtlfunctionoptions/>
#[derive(Copy, Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)]
pub struct MTLFunctionOptions: NSUInteger {
const None = 0;
const CompileToBinary = 1 << 0;
Expand Down
2 changes: 2 additions & 0 deletions src/mps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ pub enum MPSRayDataType {
bitflags! {
/// See <https://developer.apple.com/documentation/metalperformanceshaders/mpsraymaskoptions>
#[allow(non_upper_case_globals)]
#[derive(Copy, Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)]
pub struct MPSRayMaskOptions: NSUInteger {
/// Enable primitive masks
const Primitive = 1;
Expand Down Expand Up @@ -115,6 +116,7 @@ pub enum MPSAccelerationStructureStatus {
bitflags! {
/// See <https://developer.apple.com/documentation/metalperformanceshaders/mpsaccelerationstructureusage>
#[allow(non_upper_case_globals)]
#[derive(Copy, Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)]
pub struct MPSAccelerationStructureUsage: NSUInteger {
/// No usage options specified
const None = 0;
Expand Down
1 change: 1 addition & 0 deletions src/pipeline/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ pub enum MTLBlendOperation {

bitflags! {
/// See <https://developer.apple.com/documentation/metal/mtlcolorwritemask>
#[derive(Copy, Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)]
pub struct MTLColorWriteMask: NSUInteger {
const None = 0;
const Red = 0x1 << 3;
Expand Down
2 changes: 2 additions & 0 deletions src/resource.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ pub const MTLResourceHazardTrackingModeMask: NSUInteger = 0x3 << MTLResourceHaza
bitflags! {
/// See <https://developer.apple.com/documentation/metal/mtlresourceoptions>
#[allow(non_upper_case_globals)]
#[derive(Copy, Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)]
pub struct MTLResourceOptions: NSUInteger {
const CPUCacheModeDefaultCache = (MTLCPUCacheMode::DefaultCache as NSUInteger) << MTLResourceCPUCacheModeShift;
const CPUCacheModeWriteCombined = (MTLCPUCacheMode::WriteCombined as NSUInteger) << MTLResourceCPUCacheModeShift;
Expand All @@ -83,6 +84,7 @@ bitflags! {
/// convert the resource to another format (for example, whether to decompress a color render target).
///
/// See <https://developer.apple.com/documentation/metal/mtlresourceusage>
#[derive(Copy, Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)]
pub struct MTLResourceUsage: NSUInteger {
/// An option that enables reading from the resource.
const Read = 1 << 0;
Expand Down
1 change: 1 addition & 0 deletions src/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ bitflags! {
/// allowing for vertex and fragment processing to overlap in execution.
///
/// See <https://developer.apple.com/documentation/metal/mtlrenderstages>
#[derive(Copy, Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)]
pub struct MTLRenderStages: NSUInteger {
/// The vertex rendering stage.
const Vertex = 1 << 0;
Expand Down
1 change: 1 addition & 0 deletions src/texture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ pub enum MTLTextureCompressionType {

bitflags! {
/// See <https://developer.apple.com/documentation/metal/mtltextureusage>
#[derive(Copy, Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)]
pub struct MTLTextureUsage: NSUInteger {
const Unknown = 0x0000;
const ShaderRead = 0x0001;
Expand Down