Skip to content

Commit

Permalink
Fix uniform buffer block naming.
Browse files Browse the repository at this point in the history
  • Loading branch information
mellinoe committed Jul 29, 2019
1 parent f995484 commit 05ac786
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/libveldrid-spirv/libveldrid-spirv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,14 @@ void AddResources(
bi.Binding = compiler->get_decoration(resource.id, spv::Decoration::DecorationBinding);

std::string name = "vdspv_" + std::to_string(bi.Set) + "_" + std::to_string(bi.Binding);
compiler->set_name(resource.id, name);
if (kind == ResourceKind::UniformBuffer)
{
compiler->set_name(resource.base_type_id, name);
}
else
{
compiler->set_name(resource.id, name);
}

ResourceInfo ri = {};
ri.Name = name;
Expand Down

2 comments on commit 05ac786

@bootzin
Copy link

@bootzin bootzin commented on 05ac786 Nov 7, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @mellinoe !
Any chance this may be related to #8 ? I'm having that same problem, and I think this may be the issue..

@mellinoe
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is related. However, this is only part of a larger change that normalizes all resource names into a common format. The backwards-compatible fix (which has yet to be written) is to hide this new behavior behind a compiler flag of some sort, and to restore the old behavior in the general case.

Please sign in to comment.