But only if a binding qualifier is not present. This allows using
multiple descriptor sets on Vulkan without breaking OpenGL.
bool LocationAllocator::visit_uniform(const string &name, RefPtr<Layout> &layout)
{
bool LocationAllocator::visit_uniform(const string &name, RefPtr<Layout> &layout)
{
+ int desc_set = get_layout_value(layout.get(), "set");
int bind_point = get_layout_value(layout.get(), "binding");
if(features.target_api==VULKAN)
{
int bind_point = get_layout_value(layout.get(), "binding");
if(features.target_api==VULKAN)
{
- desc_set = get_layout_value(layout.get(), "set");
if(desc_set<0 && bind_point>=0)
{
desc_set = 0;
if(desc_set<0 && bind_point>=0)
{
desc_set = 0;
if(desc_set>=0)
uniforms[name].desc_set = desc_set;
}
if(desc_set>=0)
uniforms[name].desc_set = desc_set;
}
+ else if(desc_set>=0 && bind_point<0)
+ {
+ auto i = find_member(layout->qualifiers, string("set"), &Layout::Qualifier::name);
+ layout->qualifiers.erase(i);
+ }