diff --git a/rpcs3/Emu/RSX/Common/GLSLCommon.h b/rpcs3/Emu/RSX/Common/GLSLCommon.h index b4128f64d2..34fc8554f1 100644 --- a/rpcs3/Emu/RSX/Common/GLSLCommon.h +++ b/rpcs3/Emu/RSX/Common/GLSLCommon.h @@ -278,9 +278,35 @@ namespace glsl OS << "vec4 read_location(int location)\n"; OS << "{\n"; OS << " attribute_desc desc = fetch_desc(location);\n"; - OS << " //if attribute is disabled return 1 (makes all operations with it nop except add/sub - TODO)\n"; - OS << " if (desc.attribute_size == 0) return vec4(1.);\n"; - OS << "\n"; + OS << " if (desc.attribute_size == 0)\n"; + OS << " {\n"; + OS << " //default values\n"; + OS << " switch (location)\n"; + OS << " {\n"; + OS << " case 0:\n"; + OS << " //position\n"; + OS << " return vec4(0., 0., 0., 1.);\n"; + OS << " case 1:\n"; + OS << " case 2:\n"; + OS << " //weight, normals\n"; + OS << " return vec4(0.);\n"; + OS << " case 3:\n"; + OS << " //diffuse\n"; + OS << " return vec4(1.);\n"; + OS << " case 4:\n"; + OS << " //specular\n"; + OS << " return vec4(0.);\n"; + OS << " case 5:\n"; + OS << " //fog\n"; + OS << " return vec4(0.);\n"; + OS << " case 6:\n"; + OS << " //point size\n"; + OS << " return vec4(1.);\n"; + OS << " default:\n"; + OS << " //mostly just texture coordinates\n"; + OS << " return vec4(0.);\n"; + OS << " }\n"; + OS << " }\n\n"; OS << " int vertex_id = " << vertex_id_name << " - int(vertex_base_index);\n"; OS << " if (desc.frequency == 0)\n"; OS << " vertex_id = 0;\n";