Skip to content
Snippets Groups Projects
Commit c5e34a83 authored by Hadrien Grasland's avatar Hadrien Grasland
Browse files

Review chapter 23

parent 5f2791a2
Branches
Tags
No related merge requests found
...@@ -36,7 +36,8 @@ First of all, `vulkano-shaders` generated SPIR-V code from our GLSL, but we must ...@@ -36,7 +36,8 @@ First of all, `vulkano-shaders` generated SPIR-V code from our GLSL, but we must
turn it into a device-specific turn it into a device-specific
[`ShaderModule`](https://docs.rs/vulkano/latest/vulkano/shader/struct.ShaderModule.html) [`ShaderModule`](https://docs.rs/vulkano/latest/vulkano/shader/struct.ShaderModule.html)
before we do anything with it. This is done using the `load()` function that before we do anything with it. This is done using the `load()` function that
`vulkano-shaders` also generated for us within the `shader` module: `vulkano-shaders` also generated for us within the `gpu::pipeline::shader`
module:
```rust,ignore ```rust,ignore
let shader_module = shader::load(context.device.clone())?; let shader_module = shader::load(context.device.clone())?;
...@@ -92,7 +93,7 @@ basic default configuration from the shader itself: ...@@ -92,7 +93,7 @@ basic default configuration from the shader itself:
use vulkano::pipeline::layout::PipelineDescriptorSetLayoutCreateInfo; use vulkano::pipeline::layout::PipelineDescriptorSetLayoutCreateInfo;
let mut layout_info = let mut layout_info =
PipelineDescriptorSetLayoutCreateInfo::from_stages(&[shader_stage]); PipelineDescriptorSetLayoutCreateInfo::from_stages([&shader_stage]);
``` ```
There are three parts to the pipeline layout configuration: There are three parts to the pipeline layout configuration:
...@@ -184,7 +185,8 @@ With that, we are done configuring our descriptors, so we can finalize our ...@@ -184,7 +185,8 @@ With that, we are done configuring our descriptors, so we can finalize our
descriptor set layouts... descriptor set layouts...
```rust,ignore ```rust,ignore
let layout_info = layout_info.into_pipeline_layout_create_info()?; let layout_info = layout_info
.into_pipeline_layout_create_info(context.device.clone())?;
``` ```
...create our compute pipeline layout... ...create our compute pipeline layout...
...@@ -205,7 +207,7 @@ use vulkano::pipeline::compute::{ComputePipeline, ComputePipelineCreateInfo}; ...@@ -205,7 +207,7 @@ use vulkano::pipeline::compute::{ComputePipeline, ComputePipelineCreateInfo};
let pipeline = ComputePipeline::new( let pipeline = ComputePipeline::new(
context.device.clone(), context.device.clone(),
Some(context.pipeline_cache.cache.clone()), Some(context.pipeline_cache.cache.clone()),
create_info: ComputePipelineCreateInfo::stage_layout(shader_stage, layout), ComputePipelineCreateInfo::stage_layout(shader_stage, layout),
)?; )?;
``` ```
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment