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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplified Kernel creation and reuse #4

Merged
merged 2 commits into from
Nov 17, 2021
Merged

Simplified Kernel creation and reuse #4

merged 2 commits into from
Nov 17, 2021

Conversation

UpsettingBoy
Copy link
Owner

  • Added Shader struct (wrapper over wgpu::ShaderModule).
  • Added Program struct (Shader + entry point + bindings). It represents
    a function in a Shader.
  • Kernel is created from a Program. It is the execution of it.
  • DescriptorSet derives Clone.
  • Updated all examples to new setup.
  • Removed KernelBuilder: it added complexity.
  • Removed utils::shaders module. Functionality is now on Shader.

-----TODO-----
% webcam example does not work. Device lost 馃毄
% Update and check documentation. Update README as well.

+ Added `Shader` struct (wrapper over wgpu::ShaderModule).
+ Added `Program` struct (Shader + entry point + bindings). It represents
a function in a `Shader`.

* `Kernel` is created from a `Program`. It is the execution of it.
* `DescriptorSet` derives `Clone`.
* Updated all examples to new setup.

- Removed `KernelBuilder`: it added complexity.
- Removed `utils::shaders` module. Functionality is now on `Shader`.

-----TODO-----
% `webcam` example does not work. Device lost 馃毄
% Update and check documentation. Update README as well.
@UpsettingBoy
Copy link
Owner Author

UpsettingBoy commented Nov 17, 2021

It seems the NVIDIA driver for WSL2 CUDA enablement is making webcam lose the device. Works fine with integrated GPU (Intel UHD 620).

src/kernel.rs Outdated
impl<'fw, 'res, 'sha> KernelBuilder<'fw, 'res, 'sha> {
/// Adds a [`DescriptorSet`] into the [`KernelBuilder`] internal layout.
impl Shader {
/// Creates a [`wgpu::ShaderModule`] instance from a SPIR-V file.
Copy link
Owner Author

Choose a reason for hiding this comment

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

Fix doc

src/kernel.rs Outdated
}
}

/// Adds a [`DescriptorSet`] for this [`Program`].
Copy link
Owner Author

Choose a reason for hiding this comment

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

Typo

src/kernel.rs Outdated
}

impl<'fw> Kernel<'fw> {
/// Creates a [`KernelBuilder`] from a [`Program`].
Copy link
Owner Author

Choose a reason for hiding this comment

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

Change this entire bit of documentation

@UpsettingBoy UpsettingBoy marked this pull request as ready for review November 17, 2021 11:48
@UpsettingBoy UpsettingBoy merged commit abae4db into dev Nov 17, 2021
@UpsettingBoy UpsettingBoy deleted the native-shader branch November 17, 2021 11:54
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.

None yet

1 participant