Skip to content

Conversation

@rinon
Copy link
Collaborator

@rinon rinon commented Apr 2, 2024

The pal buffer is a type-erased Pixel buffer that needs to be accessed concurrently. This change adds support for casting DisjointMut guards from [u8] buffers to appropriate bitdepth-dependent types that implement FromBytes.

@rinon rinon requested review from kkysen and randomPoison April 2, 2024 21:22
@rinon rinon force-pushed the sjc/rav1dframecontext/framedata_mutability branch from 63db3b0 to b4144f9 Compare April 3, 2024 05:20
@rinon rinon force-pushed the sjc/rav1dframecontext/bitdepth_dependent_disjointmut branch 3 times, most recently from c3f8db0 to ef78bbc Compare April 4, 2024 21:49
@rinon rinon requested a review from randomPoison April 4, 2024 21:55
@rinon rinon force-pushed the sjc/rav1dframecontext/framedata_mutability branch from b4144f9 to 2cfe342 Compare April 6, 2024 02:12
@rinon rinon force-pushed the sjc/rav1dframecontext/bitdepth_dependent_disjointmut branch from ef78bbc to e7a2e46 Compare April 6, 2024 02:12
@rinon rinon force-pushed the sjc/rav1dframecontext/framedata_mutability branch from 2cfe342 to e603367 Compare April 8, 2024 23:00
@rinon rinon force-pushed the sjc/rav1dframecontext/bitdepth_dependent_disjointmut branch from e7a2e46 to 63e9914 Compare April 8, 2024 23:00
@rinon rinon force-pushed the sjc/rav1dframecontext/framedata_mutability branch 2 times, most recently from b6ff24c to 2105c1b Compare April 15, 2024 21:17
@rinon rinon force-pushed the sjc/rav1dframecontext/bitdepth_dependent_disjointmut branch 2 times, most recently from 6400056 to 815bb20 Compare April 15, 2024 21:35
@rinon rinon requested a review from kkysen April 15, 2024 21:35
Base automatically changed from sjc/rav1dframecontext/framedata_mutability to main April 16, 2024 07:49
@rinon rinon force-pushed the sjc/rav1dframecontext/bitdepth_dependent_disjointmut branch from 815bb20 to 22c7422 Compare April 16, 2024 08:34
@rinon rinon changed the base branch from main to kkysen/struct-Bounds-simplify-DisjointMut April 16, 2024 08:35
@rinon
Copy link
Collaborator Author

rinon commented Apr 16, 2024

I fixed this up so that we don't allow direct access to the guard cast and instead require users to index using the desired output type. Please take another look.

@kkysen kkysen force-pushed the kkysen/struct-Bounds-simplify-DisjointMut branch from e3b8f4f to 3a8ab96 Compare April 16, 2024 11:12
Base automatically changed from kkysen/struct-Bounds-simplify-DisjointMut to main April 16, 2024 16:25
Copy link
Collaborator

@kkysen kkysen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The implementation LGTM, I just had a question about the naming, and also if we can impl Mul<usize> for Bounds.

bounds: Bounds,
}

impl<'a, T: AsMutPtr> DisjointImmutGuard<'a, T, [u8]> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's fine for now, but as a future potential optimization, we should see if we can add alignment info to the [u8] here, as without it, fn cast has to do an alignment check, even though the buffer we're indexing into is usually already aligned enough.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point.

@rinon rinon force-pushed the sjc/rav1dframecontext/bitdepth_dependent_disjointmut branch from 22c7422 to 4a716c2 Compare April 18, 2024 01:09
@rinon rinon force-pushed the sjc/rav1dframecontext/bitdepth_dependent_disjointmut branch from 4a716c2 to 0d3ac6c Compare April 18, 2024 01:38
rinon added 3 commits April 19, 2024 16:41
The pal buffer is a type erased Pixel buffer that
needs to be accessed concurrently. This change
adds support for casting DisjointMut guards from
[u8] buffers to appropriate bitdepth-dependent
types that implement FromBytes.
@rinon rinon force-pushed the sjc/rav1dframecontext/bitdepth_dependent_disjointmut branch from 0d3ac6c to c9c537b Compare April 19, 2024 23:46
@rinon rinon merged commit fdcfe65 into main Apr 20, 2024
@rinon rinon deleted the sjc/rav1dframecontext/bitdepth_dependent_disjointmut branch April 20, 2024 00:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants