Make hue saturation node work on the gpu + make f32 default for user inputs

This commit is contained in:
Dennis Kobert
2023-06-18 05:51:11 -07:00
committed by Keavon Chambers
parent fea9f8ea24
commit 4abad688a2
21 changed files with 235 additions and 217 deletions
+1
View File
@@ -7,6 +7,7 @@ license = "MIT OR Apache-2.0"
[features]
default = []
profiling = ["nvtx"]
passthrough = []
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
+3 -4
View File
@@ -19,17 +19,16 @@ impl Context {
// `request_adapter` instantiates the general connection to the GPU
let adapter = instance.request_adapter(&wgpu::RequestAdapterOptions::default()).await?;
//let limits = adapter.limits();
//log::trace!("Adapter limits: {:?}", limits);
// `request_device` instantiates the feature specific connection to the GPU, defining some parameters,
// `features` being the available features.
let (device, queue) = adapter
.request_device(
&wgpu::DeviceDescriptor {
label: None,
#[cfg(not(feature = "passthrough"))]
features: wgpu::Features::empty(),
#[cfg(feature = "passthrough")]
features: wgpu::Features::SPIRV_SHADER_PASSTHROUGH,
limits: Default::default(),
},
None,
+8
View File
@@ -118,10 +118,18 @@ impl gpu_executor::GpuExecutor for WgpuExecutor {
type Window = Arc<winit::window::Window>;
fn load_shader(&self, shader: Shader) -> Result<Self::ShaderHandle> {
#[cfg(not(feature = "passthrough"))]
let shader_module = self.context.device.create_shader_module(wgpu::ShaderModuleDescriptor {
label: Some(shader.name),
source: wgpu::ShaderSource::SpirV(shader.source),
});
#[cfg(feature = "passthrough")]
let shader_module = unsafe {
self.context.device.create_shader_module_spirv(&wgpu::ShaderModuleDescriptorSpirV {
label: Some(shader.name),
source: shader.source,
})
};
Ok(ShaderModuleWrapper(shader_module))
}