- fixed: non-SSE2 drawers still had SSE2 intrinsics for light calculations, preventing successful compilation on ARM.

This commit is contained in:
Rachael Alexanderson 2017-03-21 17:51:09 -04:00
parent fc3cb01029
commit 4110f34139
2 changed files with 2 additions and 2 deletions

View file

@ -329,7 +329,7 @@ namespace swrenderer
float Lyz2 = light_y; // L.y*L.y + L.z*L.z float Lyz2 = light_y; // L.y*L.y + L.z*L.z
float Lx = light_x - viewpos_x; float Lx = light_x - viewpos_x;
float dist2 = Lyz2 + Lx * Lx; float dist2 = Lyz2 + Lx * Lx;
float rcp_dist = _mm_cvtss_f32(_mm_rsqrt_ss(_mm_set_ss(dist2))); float rcp_dist = 1.f/sqrt(dist2);
float dist = dist2 * rcp_dist; float dist = dist2 * rcp_dist;
float distance_attenuation = 256.0f - MIN(dist * light_radius, 256.0f); float distance_attenuation = 256.0f - MIN(dist * light_radius, 256.0f);

View file

@ -249,7 +249,7 @@ namespace swrenderer
float Lxy2 = light_x; // L.x*L.x + L.y*L.y float Lxy2 = light_x; // L.x*L.x + L.y*L.y
float Lz = light_z - viewpos_z; float Lz = light_z - viewpos_z;
float dist2 = Lxy2 + Lz * Lz; float dist2 = Lxy2 + Lz * Lz;
float rcp_dist = _mm_cvtss_f32(_mm_rsqrt_ss(_mm_set_ss(dist2))); float rcp_dist = 1.f/sqrt(dist2);
float dist = dist2 * rcp_dist; float dist = dist2 * rcp_dist;
float distance_attenuation = 256.0f - MIN(dist * light_radius, 256.0f); float distance_attenuation = 256.0f - MIN(dist * light_radius, 256.0f);