Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
WIP
Antonio Scandurradc40ac854a8d
diff --git a/crates/gpui3/build.rs b/crates/gpui3/build.rsindex af63512b8a2..138cef6b83f 100644--- a/crates/gpui3/build.rs+++ b/crates/gpui3/build.rs@@ -48,6 +48,8 @@ fn generate_shader_bindings() -> PathBuf {"Quad".into(),"QuadInputIndex".into(),"QuadUniforms".into(),+ "AtlasTile".into(),+ "MonochromeSprite".into(),]);config.no_includes = true;config.enumeration.prefix_with_name = true;@@ -55,6 +57,7 @@ fn generate_shader_bindings() -> PathBuf {.with_src(crate_dir.join("src/scene.rs")).with_src(crate_dir.join("src/geometry.rs")).with_src(crate_dir.join("src/color.rs"))+ .with_src(crate_dir.join("src/platform.rs")).with_src(crate_dir.join("src/platform/mac/metal_renderer.rs")).with_config(config).generate()diff --git a/crates/gpui3/src/platform.rs b/crates/gpui3/src/platform.rsindex 2c81cb4fbba..e27a222e384 100644--- a/crates/gpui3/src/platform.rs+++ b/crates/gpui3/src/platform.rs@@ -196,29 +196,23 @@ pub struct AtlasTile {pub(crate) bounds_in_atlas: Bounds<DevicePixels>,}-#[derive(Clone, Copy, Debug, PartialEq, Eq)]+#[derive(Clone, Copy, Debug, PartialEq, Eq, Zeroable, Pod)]#[repr(C)]pub(crate) struct AtlasTextureId(pub(crate) usize);-#[derive(Clone, Copy, Debug, PartialEq, Eq)]+#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Zeroable, Pod)]#[repr(C)]-pub(crate) struct TileId(pub(crate) etagere::AllocId);+pub(crate) struct TileId(pub(crate) u32);impl From<etagere::AllocId> for TileId {fn from(id: etagere::AllocId) -> Self {- Self(id)+ Self(id.serialize())}}-impl Ord for TileId {- fn cmp(&self, other: &Self) -> Ordering {- self.0.serialize().cmp(&other.0.serialize())- }-}--impl PartialOrd for TileId {- fn partial_cmp(&self, other: &Self) -> Option<Ordering> {- Some(self.cmp(other))+impl From<TileId> for etagere::AllocId {+ fn from(id: TileId) -> Self {+ Self::deserialize(id.0)}}