Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat(WebGPU): support more data types for volume rendering #2069

Merged
merged 1 commit into from
Sep 23, 2021

Conversation

martinken
Copy link
Member

Use half float to support types other than uint8

Fix a matrix computation that impacts imageData that
has a direction in its transformations.

@martinken martinken force-pushed the webgpu_half_float_support branch from f6f6945 to 39fcfb3 Compare September 23, 2021 16:06
@martinken
Copy link
Member Author

@jourdain PTAL mainly at the typescript stuff

*/

/**
* Convert a Base64 string to an ArrayBuffer.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is that the real description?

Copy link
Member Author

Choose a reason for hiding this comment

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

See that is why I have you review it :-) But really I was worried about the types I chose to use.

Copy link
Collaborator

Choose a reason for hiding this comment

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

number is fine, but now, I just noticed that you export both function as default.

That is wrong. You should export your function as-is (no default keyword).

Then add at the bottom

export default {
  toHalf,
  fromHalf,
};

Copy link
Collaborator

Choose a reason for hiding this comment

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

By doing that also in your JS you should export your function as well. That would allow someone to import them individually to match the TS description.

Copy link
Member Author

Choose a reason for hiding this comment

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

or maybe

export declare const HalfFloat: {
	toHalf: typeof toHalf;
	fromHalf: typeof fromHalf;
}

export default HalfFloat;

Copy link
Member Author

Choose a reason for hiding this comment

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

Does that look OK?

Copy link
Collaborator

Choose a reason for hiding this comment

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

yes it is.

@martinken martinken force-pushed the webgpu_half_float_support branch from 39fcfb3 to d6c9772 Compare September 23, 2021 16:36
Use half float to support types other than uint8

Fix a matrix computation that impacts imageData that
has a direction in its transformations.
@martinken martinken force-pushed the webgpu_half_float_support branch from d6c9772 to f7c05b3 Compare September 23, 2021 16:50
@martinken martinken merged commit 8561dbb into master Sep 23, 2021
@martinken martinken deleted the webgpu_half_float_support branch September 23, 2021 18:27
@github-actions
Copy link

🎉 This PR is included in version 19.4.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions github-actions bot added the released Automated label label Sep 23, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
released Automated label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants