initial commit, 4.5 stable
Some checks failed
🔗 GHA / 📊 Static checks (push) Has been cancelled
🔗 GHA / 🤖 Android (push) Has been cancelled
🔗 GHA / 🍏 iOS (push) Has been cancelled
🔗 GHA / 🐧 Linux (push) Has been cancelled
🔗 GHA / 🍎 macOS (push) Has been cancelled
🔗 GHA / 🏁 Windows (push) Has been cancelled
🔗 GHA / 🌐 Web (push) Has been cancelled
Some checks failed
🔗 GHA / 📊 Static checks (push) Has been cancelled
🔗 GHA / 🤖 Android (push) Has been cancelled
🔗 GHA / 🍏 iOS (push) Has been cancelled
🔗 GHA / 🐧 Linux (push) Has been cancelled
🔗 GHA / 🍎 macOS (push) Has been cancelled
🔗 GHA / 🏁 Windows (push) Has been cancelled
🔗 GHA / 🌐 Web (push) Has been cancelled
This commit is contained in:
49
thirdparty/embree/kernels/geometry/curve_intersector_precalculations.h
vendored
Normal file
49
thirdparty/embree/kernels/geometry/curve_intersector_precalculations.h
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
// Copyright 2009-2021 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "../common/ray.h"
|
||||
#include "../common/geometry.h"
|
||||
|
||||
namespace embree
|
||||
{
|
||||
namespace isa
|
||||
{
|
||||
struct CurvePrecalculations1
|
||||
{
|
||||
float depth_scale;
|
||||
LinearSpace3fa ray_space;
|
||||
|
||||
__forceinline CurvePrecalculations1() {}
|
||||
|
||||
__forceinline CurvePrecalculations1(const Ray& ray, const void* ptr)
|
||||
{
|
||||
depth_scale = rsqrt(dot(ray.dir,ray.dir));
|
||||
LinearSpace3fa space = frame(depth_scale*ray.dir);
|
||||
space.vz *= depth_scale;
|
||||
ray_space = space.transposed();
|
||||
}
|
||||
};
|
||||
|
||||
template<int K>
|
||||
struct CurvePrecalculationsK
|
||||
{
|
||||
vfloat<K> depth_scale;
|
||||
LinearSpace3fa ray_space[K];
|
||||
|
||||
__forceinline CurvePrecalculationsK(const vbool<K>& valid, const RayK<K>& ray)
|
||||
{
|
||||
size_t mask = movemask(valid);
|
||||
depth_scale = rsqrt(dot(ray.dir,ray.dir));
|
||||
while (mask) {
|
||||
size_t k = bscf(mask);
|
||||
Vec3fa ray_dir_k = Vec3fa(ray.dir.x[k],ray.dir.y[k],ray.dir.z[k]);
|
||||
LinearSpace3fa ray_space_k = frame(depth_scale[k]*ray_dir_k);
|
||||
ray_space_k.vz *= depth_scale[k];
|
||||
ray_space[k] = ray_space_k.transposed();
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user