Skip to content
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

Start adding compute shader support #143

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open

Conversation

matthewturk
Copy link
Member

This starts the process of adding compute shader support. Compute shaders will run once beforehand, and will have special invocations.

Comment on lines 15 to 18
data = traitlets.Instance(BlockCollection)
bins = traitlets.CInt(64)
min_val = traitlets.CFloat(0.0)
max_val = traitlets.CFloat(1.0)
Copy link
Contributor

Choose a reason for hiding this comment

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

More of a note for the future -- the data attribute here has a data.min_val and data.max_val, which are the raw min/max across all blocks. Since the compute shader will operate on normalized data, makes sense to keep these min_val, max_val values at 0,1. but when drawing the result (however that happens), but when it comes time to draw the result, if there are labels for the binning axis, it'd be nice to be able to re-scale those to the actual data range (which will be easy since data.min_val and data.max_val exist already).

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, awesome! Thank you. I forgot that the data was already normalized.

Copy link
Member Author

Choose a reason for hiding this comment

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

So in principle we could do some fancy work to make these in the normalized coordinates too.

@matthewturk
Copy link
Member Author

I think the right structures are there, and next I'll add the actual compute shader.

@matthewturk
Copy link
Member Author

I've also, I think, addressed #160 in the change in a back-compat way.

@matthewturk
Copy link
Member Author

Still doesn't quite work yet, but that's because I don't have my image bindings all set up properly.

@matthewturk
Copy link
Member Author

In the current state, the histogram successfully executes. I'm working on comparing the results and adding in a display widget.

@matthewturk
Copy link
Member Author

I guess where I'm not 100% sure is if I need to have separate programs for the compute shader and the other. I'm starting to think maybe in fact BaseAnnotation is the wrong base class, and this should be something more akin to the data components, where there's not explicitly a display-associated aspect of the class.

@chrishavlin chrishavlin added the enhancement New feature or request label Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants