mirror of
https://github.com/vulkano-rs/vulkano.git
synced 2024-11-27 09:15:14 +00:00
Implement PipelineLayoutRef on more types
This commit is contained in:
parent
9d9732a3a1
commit
fe00a7f920
@ -24,6 +24,7 @@ use vk;
|
||||
use descriptor::descriptor::ShaderStages;
|
||||
use descriptor::descriptor_set::UnsafeDescriptorSetLayout;
|
||||
use descriptor::pipeline_layout::PipelineLayoutDesc;
|
||||
use descriptor::pipeline_layout::PipelineLayoutRef;
|
||||
use device::Device;
|
||||
|
||||
/// Low-level struct that represents the layout of the resources available to your shaders.
|
||||
@ -132,24 +133,22 @@ impl<L> PipelineLayout<L> where L: PipelineLayoutDesc {
|
||||
pub fn descriptor_set_layout(&self, index: usize) -> Option<&Arc<UnsafeDescriptorSetLayout>> {
|
||||
self.layouts.get(index)
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns the device used to create this pipeline layout.
|
||||
unsafe impl<D> PipelineLayoutRef for PipelineLayout<D> where D: PipelineLayoutDesc {
|
||||
#[inline]
|
||||
pub fn device(&self) -> &Arc<Device> {
|
||||
&self.device
|
||||
fn sys(&self) -> PipelineLayoutSys {
|
||||
PipelineLayoutSys(&self.layout)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn desc(&self) -> &PipelineLayoutDesc {
|
||||
fn desc(&self) -> &PipelineLayoutDesc {
|
||||
&self.desc
|
||||
}
|
||||
|
||||
/// Returns an opaque object that allows internal access to the pipeline layout.
|
||||
///
|
||||
/// > **Note**: This is an internal function that you normally don't need to call.
|
||||
#[inline]
|
||||
pub fn sys(&self) -> PipelineLayoutSys {
|
||||
PipelineLayoutSys(&self.layout)
|
||||
fn device(&self) -> &Arc<Device> {
|
||||
&self.device
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -19,31 +19,57 @@ use device::Device;
|
||||
|
||||
/// Trait for objects that describe the layout of the descriptors and push constants of a pipeline.
|
||||
pub unsafe trait PipelineLayoutRef {
|
||||
/// Returns an opaque struct representing the pipeline layout.
|
||||
/// Returns an opaque object that allows internal access to the pipeline layout.
|
||||
///
|
||||
/// Can be obtained by calling `PipelineLayout::sys()` on the referenced pipeline layout.
|
||||
/// Can be obtained by calling `PipelineLayoutRef::sys()` on the pipeline layout.
|
||||
///
|
||||
/// > **Note**: This is an internal function that you normally don't need to call.
|
||||
fn sys(&self) -> PipelineLayoutSys;
|
||||
|
||||
/// Returns the description of the pipeline layout.
|
||||
///
|
||||
/// Can be obtained by calling `PipelineLayoutRef::desc()` on the pipeline layout.
|
||||
fn desc(&self) -> &PipelineLayoutDesc;
|
||||
|
||||
/// Returns the device that this pipeline layout belongs to.
|
||||
///
|
||||
/// Can be obtained by calling `PipelineLayoutRef::device()` on the pipeline layout.
|
||||
fn device(&self) -> &Arc<Device>;
|
||||
}
|
||||
|
||||
/*unsafe impl<T> PipelineLayoutRef for Arc<T> where T: PipelineLayoutRef {
|
||||
unsafe impl<T> PipelineLayoutRef for Arc<T> where T: PipelineLayoutRef {
|
||||
#[inline]
|
||||
fn inner(&self) -> &PipelineLayout {
|
||||
(**self).inner()
|
||||
fn sys(&self) -> PipelineLayoutSys {
|
||||
(**self).sys()
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn desc(&self) -> &PipelineLayoutDesc {
|
||||
(**self).desc()
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn device(&self) -> &Arc<Device> {
|
||||
(**self).device()
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl<'a, T> PipelineLayoutRef for &'a T where T: 'a + PipelineLayoutRef {
|
||||
#[inline]
|
||||
fn inner(&self) -> &PipelineLayout {
|
||||
(**self).inner()
|
||||
fn sys(&self) -> PipelineLayoutSys {
|
||||
(**self).sys()
|
||||
}
|
||||
}*/
|
||||
|
||||
#[inline]
|
||||
fn desc(&self) -> &PipelineLayoutDesc {
|
||||
(**self).desc()
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn device(&self) -> &Arc<Device> {
|
||||
(**self).device()
|
||||
}
|
||||
}
|
||||
|
||||
/// Trait for objects that describe the layout of the descriptors and push constants of a pipeline.
|
||||
pub unsafe trait PipelineLayoutDesc {
|
||||
|
Loading…
Reference in New Issue
Block a user