Don't duplicate vf bindings.
This commit is contained in:
parent
df841acb70
commit
367ca09f1d
|
@ -9,6 +9,8 @@
|
||||||
|
|
||||||
#include "xenia/gpu/glsl_shader_translator.h"
|
#include "xenia/gpu/glsl_shader_translator.h"
|
||||||
|
|
||||||
|
#include <unordered_set>
|
||||||
|
|
||||||
namespace xe {
|
namespace xe {
|
||||||
namespace gpu {
|
namespace gpu {
|
||||||
|
|
||||||
|
@ -246,8 +248,16 @@ void main() {
|
||||||
|
|
||||||
// Add vertex shader input declarations.
|
// Add vertex shader input declarations.
|
||||||
if (is_vertex_shader()) {
|
if (is_vertex_shader()) {
|
||||||
|
std::unordered_set<uint64_t> defined_locations;
|
||||||
for (auto& binding : vertex_bindings()) {
|
for (auto& binding : vertex_bindings()) {
|
||||||
for (auto& attrib : binding.attributes) {
|
for (auto& attrib : binding.attributes) {
|
||||||
|
uint64_t key = (static_cast<uint64_t>(binding.fetch_constant) << 32) |
|
||||||
|
attrib.fetch_instr.attributes.offset;
|
||||||
|
if (defined_locations.count(key)) {
|
||||||
|
// Already defined.
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
defined_locations.insert(key);
|
||||||
const char* type_name =
|
const char* type_name =
|
||||||
GetVertexFormatTypeName(attrib.fetch_instr.attributes.data_format);
|
GetVertexFormatTypeName(attrib.fetch_instr.attributes.data_format);
|
||||||
EmitSource("layout(location = %d) in %s vf%u_%d;\n",
|
EmitSource("layout(location = %d) in %s vf%u_%d;\n",
|
||||||
|
|
Loading…
Reference in New Issue