diff --git a/src/video_core/shader/shader.cpp b/src/video_core/shader/shader.cpp index f8b7460e04..2d0ffe8216 100644 --- a/src/video_core/shader/shader.cpp +++ b/src/video_core/shader/shader.cpp @@ -99,16 +99,16 @@ GSEmitter::~GSEmitter() { delete handlers; } -void GSEmitter::Emit(Math::Vec4 (&vertex)[16]) { +void GSEmitter::Emit(Math::Vec4 (&output_regs)[16]) { ASSERT(vertex_id < 3); - std::copy(std::begin(vertex), std::end(vertex), buffer[vertex_id].begin()); + // TODO: This should be merged with UnitState::WriteOutput somehow + CopyRegistersToOutput(output_regs, output_mask, buffer[vertex_id]); + if (prim_emit) { if (winding) handlers->winding_setter(); for (size_t i = 0; i < buffer.size(); ++i) { - AttributeBuffer output; - CopyRegistersToOutput(buffer[i].data(), output_mask, output); - handlers->vertex_handler(output); + handlers->vertex_handler(buffer[i]); } } } diff --git a/src/video_core/shader/shader.h b/src/video_core/shader/shader.h index a3789da012..8740a16189 100644 --- a/src/video_core/shader/shader.h +++ b/src/video_core/shader/shader.h @@ -72,7 +72,7 @@ static_assert(sizeof(OutputVertex) == 24 * sizeof(float), "OutputVertex has inva * This structure contains state information for primitive emitting in geometry shader. */ struct GSEmitter { - std::array, 16>, 3> buffer; + std::array buffer; u8 vertex_id; bool prim_emit; bool winding; @@ -87,7 +87,7 @@ struct GSEmitter { GSEmitter(); ~GSEmitter(); - void Emit(Math::Vec4 (&vertex)[16]); + void Emit(Math::Vec4 (&output_regs)[16]); }; static_assert(std::is_standard_layout::value, "GSEmitter is not standard layout type");