diff --git a/vulkano-shaders/src/lib.rs b/vulkano-shaders/src/lib.rs index ae1cff81..9e6f950a 100644 --- a/vulkano-shaders/src/lib.rs +++ b/vulkano-shaders/src/lib.rs @@ -383,7 +383,7 @@ fn write_descriptor_sets(doc: &parse::Spirv) -> String { #[derive(Default)] pub struct Set{set}; -unsafe impl ::vulkano::descriptor_set::DescriptorSetDesc for Set{set} {{ +unsafe impl ::vulkano::descriptor_set::SetLayout for Set{set} {{ type Write = {write_ty}; type Init = {write_ty}; diff --git a/vulkano/src/descriptor_set/layout_def.rs b/vulkano/src/descriptor_set/layout_def.rs index ddebfe2b..d160a640 100644 --- a/vulkano/src/descriptor_set/layout_def.rs +++ b/vulkano/src/descriptor_set/layout_def.rs @@ -34,7 +34,7 @@ pub unsafe trait PipelineLayoutDesc { } /// Types that describe a single descriptor set. -pub unsafe trait DescriptorSetDesc { +pub unsafe trait SetLayout { /// Represents a modification of a descriptor set. A parameter of this type must be passed /// when you modify a descriptor set. type Write; @@ -53,7 +53,7 @@ pub unsafe trait DescriptorSetDesc { fn decode_init(&self, Self::Init) -> Vec; // TODO: better perfs // FIXME: implement this correctly - fn is_compatible_with(&self, _: &S) -> bool where S: DescriptorSetDesc { true } + fn is_compatible_with(&self, _: &S) -> bool where S: SetLayout { true } } // FIXME: shoud allow multiple array binds at once diff --git a/vulkano/src/descriptor_set/mod.rs b/vulkano/src/descriptor_set/mod.rs index c4b393ea..ba544067 100644 --- a/vulkano/src/descriptor_set/mod.rs +++ b/vulkano/src/descriptor_set/mod.rs @@ -14,20 +14,20 @@ //! //! To build a `PipelineLayout`, you need to pass a collection of `DescriptorSetLayout` structs. //! A `DescriptorSetLayout` if the equivalent of `PipelineLayout` but for a single descriptor -//! set. The `T` parameter must implement the `DescriptorSetDesc` trait. +//! set. The `T` parameter must implement the `SetLayout` trait. //! //! # Binding resources //! //! In parallel of the pipeline initialization, you have to create a `DescriptorSet`. This //! struct contains the list of actual resources that will be bound when the pipeline is executed. //! To build a `DescriptorSet`, you need to pass a `DescriptorSetLayout`. The `T` parameter -//! must implement `DescriptorSetDesc` as if the same for both the descriptor set and its layout. +//! must implement `SetLayout` as if the same for both the descriptor set and its layout. //! //! TODO: describe descriptor set writes //! //! # Shader analyser //! -//! While you can manually implement the `PipelineLayoutDesc` and `DescriptorSetDesc` traits on +//! While you can manually implement the `PipelineLayoutDesc` and `SetLayout` traits on //! your own types, it is encouraged to use the `vulkano-shaders` crate instead. This crate will //! automatically parse your SPIR-V code and generate structs that implement these traits and //! describe the pipeline layout to vulkano. @@ -36,7 +36,7 @@ use std::option::IntoIter as OptionIntoIter; use std::sync::Arc; pub use self::layout_def::PipelineLayoutDesc; -pub use self::layout_def::DescriptorSetDesc; +pub use self::layout_def::SetLayout; pub use self::layout_def::DescriptorWrite; pub use self::layout_def::DescriptorBind; pub use self::layout_def::DescriptorDesc; @@ -84,7 +84,7 @@ unsafe impl DescriptorSetsCollection for () { } unsafe impl DescriptorSetsCollection for Arc> - where T: 'static + DescriptorSetDesc + where T: 'static + SetLayout { type Iter = OptionIntoIter>; @@ -108,7 +108,7 @@ macro_rules! pipeline_layout { use std::sync::Arc; use $crate::descriptor_set::DescriptorType; use $crate::descriptor_set::DescriptorDesc; - use $crate::descriptor_set::DescriptorSetDesc; + use $crate::descriptor_set::SetLayout; use $crate::descriptor_set::DescriptorWrite; use $crate::descriptor_set::DescriptorBind; use $crate::descriptor_set::PipelineLayout; @@ -118,7 +118,7 @@ macro_rules! pipeline_layout { $( pub struct $set_name; - unsafe impl DescriptorSetDesc for $set_name { + unsafe impl SetLayout for $set_name { type Write = ( // FIXME: variable number of elems Arc // FIXME: strong typing ); diff --git a/vulkano/src/descriptor_set/runtime_desc.rs b/vulkano/src/descriptor_set/runtime_desc.rs index 0180f0dc..00b170c1 100644 --- a/vulkano/src/descriptor_set/runtime_desc.rs +++ b/vulkano/src/descriptor_set/runtime_desc.rs @@ -4,7 +4,7 @@ use descriptor_set::AbstractDescriptorSet; use descriptor_set::AbstractDescriptorSetLayout; use descriptor_set::DescriptorBind; use descriptor_set::DescriptorDesc; -use descriptor_set::DescriptorSetDesc; +use descriptor_set::SetLayout; use descriptor_set::DescriptorWrite; use descriptor_set::PipelineLayoutDesc; @@ -50,7 +50,7 @@ pub struct RuntimeDescriptorSetDesc { pub descriptors: Vec, } -unsafe impl DescriptorSetDesc for RuntimeDescriptorSetDesc { +unsafe impl SetLayout for RuntimeDescriptorSetDesc { type Write = Vec<(u32, DescriptorBind)>; type Init = Vec<(u32, DescriptorBind)>; diff --git a/vulkano/src/descriptor_set/vk_objects.rs b/vulkano/src/descriptor_set/vk_objects.rs index d2bc5b96..701584be 100644 --- a/vulkano/src/descriptor_set/vk_objects.rs +++ b/vulkano/src/descriptor_set/vk_objects.rs @@ -4,7 +4,7 @@ use std::sync::Arc; use buffer::AbstractBuffer; use descriptor_set::layout_def::PipelineLayoutDesc; -use descriptor_set::layout_def::DescriptorSetDesc; +use descriptor_set::layout_def::SetLayout; use descriptor_set::layout_def::DescriptorWrite; use descriptor_set::layout_def::DescriptorBind; use descriptor_set::pool::DescriptorPool; @@ -32,7 +32,7 @@ pub struct DescriptorSet { resources_buffers: Vec>, } -impl DescriptorSet where S: DescriptorSetDesc { +impl DescriptorSet where S: SetLayout { /// /// # Panic /// @@ -91,9 +91,9 @@ impl DescriptorSet where S: DescriptorSetDesc { /// Modifies a descriptor set. /// - /// The parameter depends on your implementation of `DescriptorSetDesc`. + /// The parameter depends on your implementation of `SetLayout`. /// - /// This function trusts the implementation of `DescriptorSetDesc` when it comes to making sure + /// This function trusts the implementation of `SetLayout` when it comes to making sure /// that the correct resource type is written to the correct descriptor. pub fn write(&mut self, write: S::Write) { let write = self.layout.description().decode_write(write); @@ -273,7 +273,7 @@ pub struct DescriptorSetLayout { description: S, } -impl DescriptorSetLayout where S: DescriptorSetDesc { +impl DescriptorSetLayout where S: SetLayout { pub fn new(device: &Arc, description: S) -> Result>, OomError> {