Skip to content

Commit

Permalink
Merge pull request #1 from DelinWorks/main
Browse files Browse the repository at this point in the history
Update shader-migrate.cpp
  • Loading branch information
halx99 committed Jul 9, 2023
2 parents 83e08d9 + e970eb8 commit 06a995d
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions shader-migrate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,8 @@ void parse_vertex_100_310(std::string& vertex_shader, UBOIndexMap& ubo_indexer)
std::string location = std::to_string(locationIn++);

line = fmt::format("layout (location = {}) in {} {};", location, datatype, varname);

continue;
}

if (line.starts_with("varying")) {
Expand All @@ -269,6 +271,8 @@ void parse_vertex_100_310(std::string& vertex_shader, UBOIndexMap& ubo_indexer)
std::string location = std::to_string(locationOut++);

line = fmt::format("layout (location = {}) out {} {};", location, datatype, varname);

continue;
}

if (line.starts_with("uniform")) {
Expand Down Expand Up @@ -301,20 +305,7 @@ void parse_vertex_100_310(std::string& vertex_shader, UBOIndexMap& ubo_indexer)
i += lineOffsetIndex - 1;
}

/*if (!isInUBO) {
std::string index = std::to_string(UBOIndex);
UBOsymbols.insert({ UBOIndex, {} });
std::string head = "\nlayout(std140, binding = 0) uniform UBO_" + index + " {";
lines.insert(lines.begin() + i, head);
isInUBO = true;
std::string temp;
lines[1 + i++] = temp = fmt::format(" {} {};", datatype, varname);
UBOsymbols.find(UBOIndex)->second.push_back(temp);
currentBoundUBOIndex = UBOIndex++;
continue;
}*/

//line = fmt::format(" {} {};", datatype, varname);
continue;
}

if (line.starts_with("void main") && currentUBOIndex < ubo_indexer.size()) {
Expand Down

0 comments on commit 06a995d

Please sign in to comment.