-
-
Notifications
You must be signed in to change notification settings - Fork 620
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
Introduce geometry primitives #1862
Conversation
These are based on Eigen and will basically get compiled away into ideal representations for each platform conky is compiled for. This means that many operations can be SIMD optimized with very little effort. Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
✅ Deploy Preview for conkyweb canceled.
|
c680997
to
31da166
Compare
Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
@brndnmtthws Is it okay to add Eigen as dependency? I can do without it, but it might optimize some instructions. Alternatively, I could make it optional and apply SIMD only if present. EDIT: We do surprisingly many vector computations while drawing components. I don't use majority of Eigen though. It might be better to simply add a way to provide optimized assembly for certain architectures and data types. 🤷♂️ And then someone can easily add optimizations later if they want to. |
672fa4e
to
e3f8d3f
Compare
Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
e3f8d3f
to
a7c6fd1
Compare
This should help avoid bad pointer reinterpretation. Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
35feea4
to
edc6390
Compare
Also fixed bad previous substitutions. Will go through all of them at the end just in case, though this time I replaced them one component at a time. Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Last commit is expected be functionally equivalent to original. Besides noted exceptions.
Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
251bd38
to
cac4361
Compare
Added intermediate member access structures which map direct member access and mutation into indirect one as provided by eigen an most other representations. This should _almost_ always just work, but in some cases template specialization consuming these values might fail in which case dereferencing them should work. Sadly there's no way of providing `T&` access to values because actual data layout and representation can be wildly different between different architectures. Even if eigen wasn't being used, if we want to make use of SIMD we have to provide access through separate getters and setters. All this abstraction should be optimized away by the compiler, so it's just adding API ergonomics. Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
1b4494f
to
ccf0cf6
Compare
Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
e324fae
to
bb232b0
Compare
Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
9b96af3
to
963552c
Compare
Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 , seems like Vc is a better choice than Eigen for our needs.
This is a pretty big change, so it's probably going to have some unintended side effects. There are a few things I'd refactor, but probably better to do it in a separate PR later.
Same here 😆, I just tried adding semantics to rectangle via tempates (absolute vs. sized) and realized there's a lot that could be improved. C++ doesn't have traits as Rust does so it's somewhat tricky to get things like swizzling to layer properly and still allow the compiler to optimize code. I'll probably address those issues at some point, but it's better to have something and I don't want to keep this PR waiting for too long as it will be painful to update. |
Changes
This PR introduces
point
andrect
primitives and replaces previous value pairs with them. It also replaces output-wayland.ccrectangle
as it's effectively doing the same.This aims to make future changes more consistent and to reduce number of global variables by grouping them. As a side bonus, it allows us to optimize some common operations a little by relying on Vc to make the compiler more aware of available opportunities to parallelize computation. Just grouping things results in significant reduction in number of generated move instructions:
Details
vec
andrect
structures.