Skip to content
This repository was archived by the owner on Apr 3, 2025. It is now read-only.
This repository was archived by the owner on Apr 3, 2025. It is now read-only.

Support items that don't implement Clone, Eq, and PartialEq #17

Description

@vadixidav

Hi, I am not sure if this would make sense to go in this crate, but I am interested in a case where I need an eventually consistent WebGPU Texture which is not Clone, Eq, or PartialEq. It is not important to me if the same exact texture is explicitly written twice and then read twice. Rather, I simply want to ensure that I am not displaying old frames, only the latest frame, in the case that frames are produced faster than the VSync rate.

Given this, would it make sense to add a variant of the Eventual that always wraps the contained item in an Arc and then uses pointer equality (via https://doc.rust-lang.org/std/sync/struct.Arc.html#method.ptr_eq) to satisfy the Eq requirement. This would still have eventual consistency all the same, but it might trigger someone downstream to get the same value twice. For many applications this is acceptable and possibly even required if the resources are too large or time consuming to compare (like GPU memory). In my case I will probably work around this issue by creating a newtype that implements Eq and PartialEq explicitly using Arc::ptr_eq, but I think having something like this in this crate would be useful for others who have a similar problem.

Thoughts?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions