This commit is contained in:
tomaka 2017-08-23 15:45:37 +02:00 committed by GitHub
parent 94c376c268
commit 4208814e74
2 changed files with 9 additions and 6 deletions

View File

@ -246,10 +246,10 @@ fn main() {
struct VertLayout(ShaderStages);
unsafe impl PipelineLayoutDesc for VertLayout {
// Number of descriptor sets it takes.
fn num_sets(&self) -> usize { 1 }
fn num_sets(&self) -> usize { 0 }
// Number of entries (bindings) in each set.
fn num_bindings_in_set(&self, set: usize) -> Option<usize> {
match set { 0 => Some(1), _ => None, }
match set { _ => None, }
}
// Descriptor descriptions.
fn descriptor(&self, set: usize, binding: usize) -> Option<DescriptorDesc> {
@ -341,9 +341,9 @@ fn main() {
#[derive(Debug, Copy, Clone)]
struct FragLayout(ShaderStages);
unsafe impl PipelineLayoutDesc for FragLayout {
fn num_sets(&self) -> usize { 1 }
fn num_sets(&self) -> usize { 0 }
fn num_bindings_in_set(&self, set: usize) -> Option<usize> {
match set { 0 => Some(1), _ => None, }
match set { _ => None, }
}
fn descriptor(&self, set: usize, binding: usize) -> Option<DescriptorDesc> {
match (set, binding) { _ => None, }

View File

@ -34,8 +34,11 @@ pub fn check_desc_against_limits<D>(device: &Device, desc: &D)
let mut num_input_attachments = Counter::default();
for set in 0 .. desc.num_sets() {
for binding in 0 .. desc.num_bindings_in_set(set).unwrap() {
let descriptor = desc.descriptor(set, binding).unwrap();
let num_bindings_in_set = desc.num_bindings_in_set(set)
.expect("Wrong implementation of PipelineLayoutDesc");
for binding in 0 .. num_bindings_in_set {
let descriptor = desc.descriptor(set, binding)
.expect("Wrong implementation of PipelineLayoutDesc");
num_resources.increment(descriptor.array_count, &descriptor.stages);
match descriptor.ty.ty().expect("Not implemented yet") { // TODO: