Changes after github review.

Remap with binding instead of name.
This commit is contained in:
Amer Koleci 2017-11-10 20:08:55 +01:00 committed by Hans-Kristian Arntzen
parent 7216d13620
commit 7cf44099c9
2 changed files with 3 additions and 5 deletions

View File

@ -674,7 +674,7 @@ void CompilerHLSL::emit_interface_block_in_struct(const SPIRVariable &var, unord
{
for (auto &attribute : vertex_attributes)
{
if (attribute.name == name)
if (attribute.binding == binding_number)
{
semantic = attribute.semantic;
semantic_index = attribute.semantic_index;
@ -3165,9 +3165,7 @@ string CompilerHLSL::compile(std::vector<HLSLVertexAttr> *p_vertex_attributes)
{
if (p_vertex_attributes)
{
vertex_attributes.clear();
for (auto &va : *p_vertex_attributes)
vertex_attributes.emplace_back(va);
vertex_attributes = *p_vertex_attributes;
}
return compile();

View File

@ -25,7 +25,7 @@ namespace spirv_cross
{
struct HLSLVertexAttr
{
std::string name;
uint32_t binding;
std::string semantic;
uint32_t semantic_index;
};