Compare commits
1 Commits
d0b8b0d182
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
a1054477d0
|
+9
-43
@@ -1,5 +1,3 @@
|
|||||||
const CREATE_SPV_PIPELINE: bool = false;
|
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
env_logger::init();
|
env_logger::init();
|
||||||
|
|
||||||
@@ -26,8 +24,7 @@ fn main() {
|
|||||||
| wgpu::Features::STORAGE_RESOURCE_BINDING_ARRAY
|
| wgpu::Features::STORAGE_RESOURCE_BINDING_ARRAY
|
||||||
| wgpu::Features::SAMPLED_TEXTURE_AND_STORAGE_BUFFER_ARRAY_NON_UNIFORM_INDEXING
|
| wgpu::Features::SAMPLED_TEXTURE_AND_STORAGE_BUFFER_ARRAY_NON_UNIFORM_INDEXING
|
||||||
| wgpu::Features::STORAGE_TEXTURE_ARRAY_NON_UNIFORM_INDEXING
|
| wgpu::Features::STORAGE_TEXTURE_ARRAY_NON_UNIFORM_INDEXING
|
||||||
| wgpu::Features::PARTIALLY_BOUND_BINDING_ARRAY
|
| wgpu::Features::PARTIALLY_BOUND_BINDING_ARRAY,
|
||||||
| wgpu::Features::PASSTHROUGH_SHADERS,
|
|
||||||
required_limits: wgpu::Limits {
|
required_limits: wgpu::Limits {
|
||||||
max_binding_array_elements_per_shader_stage: 1000,
|
max_binding_array_elements_per_shader_stage: 1000,
|
||||||
max_compute_invocations_per_workgroup: 512,
|
max_compute_invocations_per_workgroup: 512,
|
||||||
@@ -43,17 +40,8 @@ fn main() {
|
|||||||
let wgsl_module = device.create_shader_module(wgpu::include_wgsl!("shader.wgsl"));
|
let wgsl_module = device.create_shader_module(wgpu::include_wgsl!("shader.wgsl"));
|
||||||
log::logger().flush();
|
log::logger().flush();
|
||||||
|
|
||||||
log::info!("Creating SPV passthrough module...");
|
|
||||||
let spv_ps_module =
|
|
||||||
unsafe { device.create_shader_module_passthrough(wgpu::include_spirv_raw!("shader.spv")) };
|
|
||||||
log::logger().flush();
|
|
||||||
|
|
||||||
log::info!("Creating SPV module...");
|
log::info!("Creating SPV module...");
|
||||||
let spv_module = if CREATE_SPV_PIPELINE {
|
let spv_module = device.create_shader_module(wgpu::include_spirv!("shader.spv"));
|
||||||
Some(device.create_shader_module(wgpu::include_spirv!("shader.spv")))
|
|
||||||
} else {
|
|
||||||
None
|
|
||||||
};
|
|
||||||
log::logger().flush();
|
log::logger().flush();
|
||||||
|
|
||||||
let bind_group_layout = device.create_bind_group_layout(&wgpu::BindGroupLayoutDescriptor {
|
let bind_group_layout = device.create_bind_group_layout(&wgpu::BindGroupLayoutDescriptor {
|
||||||
@@ -99,41 +87,19 @@ fn main() {
|
|||||||
});
|
});
|
||||||
log::logger().flush();
|
log::logger().flush();
|
||||||
|
|
||||||
log::info!("Creating SPV Passthrough pipeline...");
|
log::info!("Creating SPV pipeline...");
|
||||||
let spv_ps_pipeline = device.create_compute_pipeline(&wgpu::ComputePipelineDescriptor {
|
let spv_pipeline = device.create_compute_pipeline(&wgpu::ComputePipelineDescriptor {
|
||||||
label: None,
|
label: None,
|
||||||
layout: Some(&pipeline_layout),
|
layout: Some(&pipeline_layout),
|
||||||
module: &spv_ps_module,
|
module: &spv_module,
|
||||||
entry_point: Some("main"),
|
entry_point: Some("main"),
|
||||||
compilation_options: wgpu::PipelineCompilationOptions::default(),
|
compilation_options: wgpu::PipelineCompilationOptions::default(),
|
||||||
cache: None,
|
cache: None,
|
||||||
});
|
});
|
||||||
|
|
||||||
log::logger().flush();
|
log::logger().flush();
|
||||||
|
|
||||||
log::info!("Creating SPV pipeline...");
|
log::info!("WGSL module: {wgsl_module:?}");
|
||||||
let spv_pipeline = if CREATE_SPV_PIPELINE {
|
log::info!("SPV module: {spv_module:?}");
|
||||||
Some(
|
log::info!("WGSL pipeline: {wgsl_pipeline:?}");
|
||||||
device.create_compute_pipeline(&wgpu::ComputePipelineDescriptor {
|
log::info!("SPV pipeline: {spv_pipeline:?}");
|
||||||
label: None,
|
|
||||||
layout: Some(&pipeline_layout),
|
|
||||||
module: spv_module.as_ref().unwrap(),
|
|
||||||
entry_point: Some("main"),
|
|
||||||
compilation_options: wgpu::PipelineCompilationOptions::default(),
|
|
||||||
cache: None,
|
|
||||||
}),
|
|
||||||
)
|
|
||||||
} else {
|
|
||||||
None
|
|
||||||
};
|
|
||||||
log::logger().flush();
|
|
||||||
|
|
||||||
log::info!("WGSL module: {wgsl_module:?}");
|
|
||||||
log::info!("SPV module: {spv_module:?}");
|
|
||||||
log::info!("SPV ps module: {spv_ps_module:?}");
|
|
||||||
log::info!("WGSL pipeline: {wgsl_pipeline:?}");
|
|
||||||
log::info!("SPV pipeline: {spv_pipeline:?}");
|
|
||||||
log::info!("SPV ps pipeline: {spv_ps_pipeline:?}");
|
|
||||||
|
|
||||||
loop {}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user