Skip to content

Commit

Permalink
Don't re-export bitflags and log.
Browse files Browse the repository at this point in the history
Also, switch away from `#[macro_use]` and `extern crate` for
these crates.
  • Loading branch information
waywardmonkeys authored and grovesNL committed May 23, 2024
1 parent f7296a2 commit 0b4e1e8
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/accelerator_structure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

use super::*;

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

use block::Block;
use log::warn;
use objc::runtime::{NO, YES};

use std::{ffi::CStr, os::raw::c_char, path::Path, ptr};
Expand Down Expand Up @@ -92,7 +93,7 @@ pub enum MTLDeviceLocation {
Unspecified = u64::MAX,
}

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

bitflags! {
bitflags::bitflags! {
/// Options that determine how Metal prepares the pipeline.
#[derive(Copy, Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)]
pub struct MTLPipelineOption: NSUInteger {
Expand Down
2 changes: 1 addition & 1 deletion src/encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ pub enum MTLTriangleFillMode {
Lines = 1,
}

bitflags! {
bitflags::bitflags! {
/// https://developer.apple.com/documentation/metal/mtlblitoption
#[allow(non_upper_case_globals)]
#[derive(Copy, Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)]
Expand Down
2 changes: 1 addition & 1 deletion src/indirect_encoder.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use super::*;

bitflags! {
bitflags::bitflags! {
/// See <https://developer.apple.com/documentation/metal/mtlindirectcommandtype/>
#[allow(non_upper_case_globals)]
#[derive(Copy, Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)]
Expand Down
4 changes: 0 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@
#![allow(non_snake_case)]
#![allow(non_upper_case_globals)]

#[macro_use]
pub extern crate bitflags;
#[macro_use]
pub extern crate log;
#[macro_use]
pub extern crate objc;
#[macro_use]
Expand Down
2 changes: 1 addition & 1 deletion src/library.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ impl FunctionConstantRef {
}
}

bitflags! {
bitflags::bitflags! {
/// Only available on (macos(11.0), ios(14.0))
///
/// See <https://developer.apple.com/documentation/metal/mtlfunctionoptions/>
Expand Down
4 changes: 2 additions & 2 deletions src/mps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ pub enum MPSRayDataType {
OriginMaskDirectionMaxDistance = 2,
}

bitflags! {
bitflags::bitflags! {
/// See <https://developer.apple.com/documentation/metalperformanceshaders/mpsraymaskoptions>
#[allow(non_upper_case_globals)]
#[derive(Copy, Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)]
Expand Down Expand Up @@ -116,7 +116,7 @@ pub enum MPSAccelerationStructureStatus {
Built = 1,
}

bitflags! {
bitflags::bitflags! {
/// See <https://developer.apple.com/documentation/metalperformanceshaders/mpsaccelerationstructureusage>
#[allow(non_upper_case_globals)]
#[derive(Copy, Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)]
Expand Down
2 changes: 1 addition & 1 deletion src/pipeline/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ pub enum MTLBlendOperation {
Max = 4,
}

bitflags! {
bitflags::bitflags! {
/// See <https://developer.apple.com/documentation/metal/mtlcolorwritemask>
#[derive(Copy, Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)]
pub struct MTLColorWriteMask: NSUInteger {
Expand Down
4 changes: 2 additions & 2 deletions src/resource.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ pub const MTLResourceStorageModeMask: NSUInteger = 0xf << MTLResourceStorageMode
pub const MTLResourceHazardTrackingModeShift: NSUInteger = 8;
pub const MTLResourceHazardTrackingModeMask: NSUInteger = 0x3 << MTLResourceHazardTrackingModeShift;

bitflags! {
bitflags::bitflags! {
/// See <https://developer.apple.com/documentation/metal/mtlresourceoptions>
#[allow(non_upper_case_globals)]
#[derive(Copy, Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)]
Expand All @@ -77,7 +77,7 @@ bitflags! {
}
}

bitflags! {
bitflags::bitflags! {
/// Options that describe how a graphics or compute function uses an argument buffer’s resource.
///
/// Enabling certain options for certain resources determines whether the Metal driver should
Expand Down
2 changes: 1 addition & 1 deletion src/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ impl FenceRef {
}
}

bitflags! {
bitflags::bitflags! {
/// The render stages at which a synchronization command is triggered.
///
/// Render stages provide finer control for specifying when synchronization must occur,
Expand Down
2 changes: 1 addition & 1 deletion src/texture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pub enum MTLTextureCompressionType {
Lossy = 1,
}

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

0 comments on commit 0b4e1e8

Please sign in to comment.