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:
98
thirdparty/embree/kernels/common/scene_user_geometry.h
vendored
Normal file
98
thirdparty/embree/kernels/common/scene_user_geometry.h
vendored
Normal file
@@ -0,0 +1,98 @@
|
||||
// Copyright 2009-2021 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "accelset.h"
|
||||
|
||||
namespace embree
|
||||
{
|
||||
/*! User geometry with user defined intersection functions */
|
||||
struct UserGeometry : public AccelSet
|
||||
{
|
||||
/*! type of this geometry */
|
||||
static const Geometry::GTypeMask geom_type = Geometry::MTY_USER_GEOMETRY;
|
||||
|
||||
public:
|
||||
UserGeometry (Device* device, unsigned int items = 0, unsigned int numTimeSteps = 1);
|
||||
virtual void setMask (unsigned mask) override;
|
||||
virtual void setBoundsFunction (RTCBoundsFunction bounds, void* userPtr) override;
|
||||
virtual void setIntersectFunctionN (RTCIntersectFunctionN intersect) override;
|
||||
virtual void setOccludedFunctionN (RTCOccludedFunctionN occluded) override;
|
||||
virtual void build() override {}
|
||||
virtual void addElementsToCount (GeometryCounts & counts) const override;
|
||||
virtual size_t getGeometryDataDeviceByteSize() const override;
|
||||
virtual void convertToDeviceRepresentation(size_t offset, char* data_host, char* data_device) const override;
|
||||
|
||||
__forceinline float projectedPrimitiveArea(const size_t i) const { return 0.0f; }
|
||||
};
|
||||
|
||||
namespace isa
|
||||
{
|
||||
struct UserGeometryISA : public UserGeometry
|
||||
{
|
||||
UserGeometryISA (Device* device)
|
||||
: UserGeometry(device) {}
|
||||
|
||||
PrimInfo createPrimRefArray(PrimRef* prims, const range<size_t>& r, size_t k, unsigned int geomID) const
|
||||
{
|
||||
PrimInfo pinfo(empty);
|
||||
for (size_t j=r.begin(); j<r.end(); j++)
|
||||
{
|
||||
BBox3fa bounds = empty;
|
||||
if (!buildBounds(j,&bounds)) continue;
|
||||
const PrimRef prim(bounds,geomID,unsigned(j));
|
||||
pinfo.add_center2(prim);
|
||||
prims[k++] = prim;
|
||||
}
|
||||
return pinfo;
|
||||
}
|
||||
|
||||
PrimInfo createPrimRefArrayMB(mvector<PrimRef>& prims, size_t itime, const range<size_t>& r, size_t k, unsigned int geomID) const
|
||||
{
|
||||
PrimInfo pinfo(empty);
|
||||
for (size_t j=r.begin(); j<r.end(); j++)
|
||||
{
|
||||
BBox3fa bounds = empty;
|
||||
if (!buildBounds(j,itime,bounds)) continue;
|
||||
const PrimRef prim(bounds,geomID,unsigned(j));
|
||||
pinfo.add_center2(prim);
|
||||
prims[k++] = prim;
|
||||
}
|
||||
return pinfo;
|
||||
}
|
||||
|
||||
PrimInfo createPrimRefArrayMB(PrimRef* prims, const BBox1f& time_range, const range<size_t>& r, size_t k, unsigned int geomID) const
|
||||
{
|
||||
PrimInfo pinfo(empty);
|
||||
const BBox1f t0t1 = BBox1f::intersect(getTimeRange(), time_range);
|
||||
if (t0t1.empty()) return pinfo;
|
||||
|
||||
for (size_t j = r.begin(); j < r.end(); j++) {
|
||||
LBBox3fa lbounds = empty;
|
||||
if (!linearBounds(j, t0t1, lbounds))
|
||||
continue;
|
||||
const PrimRef prim(lbounds.bounds(), geomID, unsigned(j));
|
||||
pinfo.add_center2(prim);
|
||||
prims[k++] = prim;
|
||||
}
|
||||
return pinfo;
|
||||
}
|
||||
|
||||
PrimInfoMB createPrimRefMBArray(mvector<PrimRefMB>& prims, const BBox1f& t0t1, const range<size_t>& r, size_t k, unsigned int geomID) const
|
||||
{
|
||||
PrimInfoMB pinfo(empty);
|
||||
for (size_t j=r.begin(); j<r.end(); j++)
|
||||
{
|
||||
if (!valid(j, timeSegmentRange(t0t1))) continue;
|
||||
const PrimRefMB prim(linearBounds(j,t0t1),this->numTimeSegments(),this->time_range,this->numTimeSegments(),geomID,unsigned(j));
|
||||
pinfo.add_primref(prim);
|
||||
prims[k++] = prim;
|
||||
}
|
||||
return pinfo;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
DECLARE_ISA_FUNCTION(UserGeometry*, createUserGeometry, Device*);
|
||||
}
|
Reference in New Issue
Block a user