Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Math/mat,Render/BspClipper: Fix NOSSE ifdefs #142

Merged
merged 1 commit into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions SurrealEngine/Math/mat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include "Precomp.h"
#include "mat.h"
#include <cmath>
#ifndef NO_SSE
#ifndef NOSSE
#include <emmintrin.h>
#endif
#include <string.h>
Expand Down Expand Up @@ -199,7 +199,7 @@ mat4 mat4::operator*(const mat4 &mult) const

vec4 mat4::operator*(const vec4 &v) const
{
#ifdef NO_SSE
#ifdef NOSSE
vec4 result;
result.x = matrix[0 * 4 + 0] * v.x + matrix[1 * 4 + 0] * v.y + matrix[2 * 4 + 0] * v.z + matrix[3 * 4 + 0] * v.w;
result.y = matrix[0 * 4 + 1] * v.x + matrix[1 * 4 + 1] * v.y + matrix[2 * 4 + 1] * v.z + matrix[3 * 4 + 1] * v.w;
Expand Down
8 changes: 4 additions & 4 deletions SurrealEngine/Render/BspClipper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "BspClipper.h"
#include "Math/bbox.h"

#ifndef NO_SSE
#ifndef NOSSE
#include <immintrin.h>
#endif

Expand Down Expand Up @@ -247,7 +247,7 @@ bool BspClipper::DrawTriangle(const vec4* const* vert, bool solid, bool ccw)
float viewport_width = (float)ViewportWidth;
float viewport_height = (float)ViewportHeight;

#ifdef NO_SSE
#ifdef NOSSE
// Map to 2D viewport:
for (int j = 0; j < numclipvert; j++)
{
Expand Down Expand Up @@ -356,7 +356,7 @@ int BspClipper::ClipEdge(const vec4* const* verts)

// halfspace clip distances
static const int numclipdistances = 6; // 9;
#ifdef NO_SSE
#ifdef NOSSE
float clipdistance[numclipdistances * 3];
bool needsclipping = false;
float* clipd = clipdistance;
Expand Down Expand Up @@ -441,7 +441,7 @@ int BspClipper::ClipEdge(const vec4* const* verts)
for (int i = 0; i < inputverts; i++)
{
int j = (i + 1) % inputverts;
#ifdef NO_SSE
#ifdef NOSSE
float clipdistance1 =
clipdistance[0 * numclipdistances + p] * input[i * 3 + 0] +
clipdistance[1 * numclipdistances + p] * input[i * 3 + 1] +
Expand Down