mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-04-28 12:58:05 +03:00
Merge 2c0e5ecc48
into 8ee64a84c7
This commit is contained in:
commit
50902f24d7
2 changed files with 8 additions and 2 deletions
|
@ -3,6 +3,7 @@
|
|||
|
||||
#include "VideoBackends/Software/SWVertexLoader.h"
|
||||
|
||||
#include <cfenv>
|
||||
#include <cstddef>
|
||||
#include <limits>
|
||||
|
||||
|
@ -77,6 +78,10 @@ void SWVertexLoader::DrawCurrentBatch(u32 base_index, u32 num_indices, u32 base_
|
|||
SetFormat();
|
||||
ParseVertex(VertexLoaderManager::GetCurrentVertexFormat()->GetVertexDeclaration(), index);
|
||||
|
||||
// At least the position transform uses round-to-zero.
|
||||
const auto round_mode = std::fegetround();
|
||||
std::fesetround(FE_TOWARDZERO);
|
||||
|
||||
// transform this vertex so that it can be used for rasterization (outVertex)
|
||||
OutputVertexData* outVertex = m_setup_unit.GetVertex();
|
||||
TransformUnit::TransformPosition(&m_vertex, outVertex);
|
||||
|
@ -84,6 +89,8 @@ void SWVertexLoader::DrawCurrentBatch(u32 base_index, u32 num_indices, u32 base_
|
|||
TransformUnit::TransformColor(&m_vertex, outVertex);
|
||||
TransformUnit::TransformTexCoord(&m_vertex, outVertex);
|
||||
|
||||
std::fesetround(round_mode);
|
||||
|
||||
// assemble and rasterize the primitive
|
||||
m_setup_unit.SetupVertex();
|
||||
|
||||
|
|
|
@ -61,8 +61,7 @@ static void MultipleVec3Perspective(const Vec3& vec, const Projection::Raw& proj
|
|||
{
|
||||
result.x = proj[0] * vec.x + proj[1] * vec.z;
|
||||
result.y = proj[2] * vec.y + proj[3] * vec.z;
|
||||
// result.z = (proj[4] * vec.z + proj[5]);
|
||||
result.z = (proj[4] * vec.z + proj[5]) * (1.0f - (float)1e-7);
|
||||
result.z = proj[4] * vec.z + proj[5];
|
||||
result.w = -vec.z;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue