summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/video_core/command_processor.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/video_core/command_processor.cpp b/src/video_core/command_processor.cpp
index 6bd5b281c..b7c32035e 100644
--- a/src/video_core/command_processor.cpp
+++ b/src/video_core/command_processor.cpp
@@ -235,7 +235,8 @@ static void WritePicaReg(u32 id, u32 value, u32 mask) {
235 // The size has been tuned for optimal balance between hit-rate and the cost of lookup 235 // The size has been tuned for optimal balance between hit-rate and the cost of lookup
236 const size_t VERTEX_CACHE_SIZE = 32; 236 const size_t VERTEX_CACHE_SIZE = 32;
237 std::array<u16, VERTEX_CACHE_SIZE> vertex_cache_ids; 237 std::array<u16, VERTEX_CACHE_SIZE> vertex_cache_ids;
238 std::array<Shader::OutputRegisters, VERTEX_CACHE_SIZE> vertex_cache; 238 std::array<Shader::OutputVertex, VERTEX_CACHE_SIZE> vertex_cache;
239 Shader::OutputVertex output_vertex;
239 240
240 unsigned int vertex_cache_pos = 0; 241 unsigned int vertex_cache_pos = 0;
241 vertex_cache_ids.fill(-1); 242 vertex_cache_ids.fill(-1);
@@ -265,7 +266,7 @@ static void WritePicaReg(u32 id, u32 value, u32 mask) {
265 266
266 for (unsigned int i = 0; i < VERTEX_CACHE_SIZE; ++i) { 267 for (unsigned int i = 0; i < VERTEX_CACHE_SIZE; ++i) {
267 if (vertex == vertex_cache_ids[i]) { 268 if (vertex == vertex_cache_ids[i]) {
268 output_registers = vertex_cache[i]; 269 output_vertex = vertex_cache[i];
269 vertex_cache_hit = true; 270 vertex_cache_hit = true;
270 break; 271 break;
271 } 272 }
@@ -284,16 +285,16 @@ static void WritePicaReg(u32 id, u32 value, u32 mask) {
284 g_state.vs.Run(shader_unit, input, loader.GetNumTotalAttributes()); 285 g_state.vs.Run(shader_unit, input, loader.GetNumTotalAttributes());
285 output_registers = shader_unit.output_registers; 286 output_registers = shader_unit.output_registers;
286 287
288 // Retrieve vertex from register data
289 output_vertex = output_registers.ToVertex(regs.vs);
290
287 if (is_indexed) { 291 if (is_indexed) {
288 vertex_cache[vertex_cache_pos] = output_registers; 292 vertex_cache[vertex_cache_pos] = output_vertex;
289 vertex_cache_ids[vertex_cache_pos] = vertex; 293 vertex_cache_ids[vertex_cache_pos] = vertex;
290 vertex_cache_pos = (vertex_cache_pos + 1) % VERTEX_CACHE_SIZE; 294 vertex_cache_pos = (vertex_cache_pos + 1) % VERTEX_CACHE_SIZE;
291 } 295 }
292 } 296 }
293 297
294 // Retrieve vertex from register data
295 Shader::OutputVertex output_vertex = output_registers.ToVertex(regs.vs);
296
297 // Send to renderer 298 // Send to renderer
298 using Pica::Shader::OutputVertex; 299 using Pica::Shader::OutputVertex;
299 auto AddTriangle = [](const OutputVertex& v0, const OutputVertex& v1, 300 auto AddTriangle = [](const OutputVertex& v0, const OutputVertex& v1,