Skip to content

DescriptorSetLayout testing breaks existing code #1652

Description

@rolandhill

Hi Robert,

I just upgrade to the latest master and found that commit 6a76d54 breaks my application. A textured surface that was rendered prior to this commit is no longer rendered.

The commit implements the check below, which fails in my case, so the graph doesn't get compiled.

        if (setLayout->bindings.size() != descriptors.size())
        {
            throw Exception{make_string("Error: invalid DescriptorSet as setLayout bindings size (", setLayout->bindings.size(), ") and descriptors size ", descriptors.size(), ") not equal."), VK_INCOMPLETE};
        }

I may be doing this wrong so I don't know if this is a bug in VSG, but what worked before was (MAX_TEXTURES = 8)

...
    tileDescriptorBindings.push_back(VkDescriptorSetLayoutBinding{2, VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, 1, VK_SHADER_STAGE_VERTEX_BIT | VK_SHADER_STAGE_FRAGMENT_BIT, nullptr}); 

    tileDescriptorBindings.push_back(VkDescriptorSetLayoutBinding{7, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, MAX_TEXTURES, VK_SHADER_STAGE_FRAGMENT_BIT, nullptr});

...
    tileDescriptors.push_back(vsg::DescriptorBuffer::create(sdTileValue::create(), 2));
   
 for(uint32_t i = 0; i < MAX_TEXTURES; i++)
    {
        auto texture = vsg::DescriptorImage::create(surface->_imageSampler, texData, 7, i, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER);
        tileDescriptors.push_back(texture);
    }

The question is, should the test in DescriptorSet::compile() take account of the descriptorCount value in the descriptor bindings before it compares it to the number of descriptors?

Thanks,
Roland

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions