#define RTC_EXPORT_API
#include "default.h"
#include "device.h"
#include "scene.h"
#include "context.h"
#include "../geometry/filter.h"
#include "../../include/embree4/rtcore_ray.h"
usingnamespaceembree;
RTC_NAMESPACE_BEGIN;
#define RTC_ENTER_DEVICE(arg) …
static MutexSys g_mutex;
RTC_API RTCDevice rtcNewDevice(const char* config)
{ … }
#if defined(EMBREE_SYCL_SUPPORT)
RTC_API RTCDevice rtcNewSYCLDeviceInternal(sycl::context sycl_context, const char* config)
{
RTC_CATCH_BEGIN;
RTC_TRACE(rtcNewSYCLDevice);
Lock<MutexSys> lock(g_mutex);
DeviceGPU* device = new DeviceGPU(sycl_context,config);
return (RTCDevice) device->refInc();
RTC_CATCH_END(nullptr);
return (RTCDevice) nullptr;
}
RTC_API bool rtcIsSYCLDeviceSupported(const sycl::device device)
{
RTC_CATCH_BEGIN;
RTC_TRACE(rtcIsSYCLDeviceSupported);
return rthwifIsSYCLDeviceSupported(device) > 0;
RTC_CATCH_END(nullptr);
return false;
}
RTC_API int rtcSYCLDeviceSelector(const sycl::device device)
{
RTC_CATCH_BEGIN;
RTC_TRACE(rtcSYCLDeviceSelector);
return rthwifIsSYCLDeviceSupported(device);
RTC_CATCH_END(nullptr);
return -1;
}
RTC_API void rtcSetDeviceSYCLDevice(RTCDevice hdevice, const sycl::device sycl_device)
{
RTC_CATCH_BEGIN;
RTC_TRACE(rtcSetDeviceSYCLDevice);
RTC_VERIFY_HANDLE(hdevice);
Lock<MutexSys> lock(g_mutex);
DeviceGPU* device = dynamic_cast<DeviceGPU*>((Device*) hdevice);
if (device == nullptr)
throw_RTCError(RTC_ERROR_INVALID_ARGUMENT, "passed device must be an Embree SYCL device")
device->setSYCLDevice(sycl_device);
RTC_CATCH_END(nullptr);
}
#endif
RTC_API void rtcRetainDevice(RTCDevice hdevice)
{ … }
RTC_API void rtcReleaseDevice(RTCDevice hdevice)
{ … }
RTC_API ssize_t rtcGetDeviceProperty(RTCDevice hdevice, RTCDeviceProperty prop)
{ … }
RTC_API void rtcSetDeviceProperty(RTCDevice hdevice, const RTCDeviceProperty prop, ssize_t val)
{ … }
RTC_API RTCError rtcGetDeviceError(RTCDevice hdevice)
{ … }
RTC_API void rtcSetDeviceErrorFunction(RTCDevice hdevice, RTCErrorFunction error, void* userPtr)
{ … }
RTC_API void rtcSetDeviceMemoryMonitorFunction(RTCDevice hdevice, RTCMemoryMonitorFunction memoryMonitor, void* userPtr)
{ … }
RTC_API RTCBuffer rtcNewBuffer(RTCDevice hdevice, size_t byteSize)
{ … }
RTC_API RTCBuffer rtcNewSharedBuffer(RTCDevice hdevice, void* ptr, size_t byteSize)
{ … }
RTC_API void* rtcGetBufferData(RTCBuffer hbuffer)
{ … }
RTC_API void rtcRetainBuffer(RTCBuffer hbuffer)
{ … }
RTC_API void rtcReleaseBuffer(RTCBuffer hbuffer)
{ … }
RTC_API RTCScene rtcNewScene (RTCDevice hdevice)
{ … }
RTC_API RTCDevice rtcGetSceneDevice(RTCScene hscene)
{ … }
RTC_API void rtcSetSceneProgressMonitorFunction(RTCScene hscene, RTCProgressMonitorFunction progress, void* ptr)
{ … }
RTC_API void rtcSetSceneBuildQuality (RTCScene hscene, RTCBuildQuality quality)
{ … }
RTC_API void rtcSetSceneFlags (RTCScene hscene, RTCSceneFlags flags)
{ … }
RTC_API RTCSceneFlags rtcGetSceneFlags(RTCScene hscene)
{ … }
RTC_API void rtcCommitScene (RTCScene hscene)
{ … }
RTC_API void rtcJoinCommitScene (RTCScene hscene)
{ … }
RTC_API void rtcGetSceneBounds(RTCScene hscene, RTCBounds* bounds_o)
{ … }
RTC_API void rtcGetSceneLinearBounds(RTCScene hscene, RTCLinearBounds* bounds_o)
{ … }
RTC_API void rtcCollide (RTCScene hscene0, RTCScene hscene1, RTCCollideFunc callback, void* userPtr)
{ … }
inline bool pointQuery(Scene* scene, RTCPointQuery* query, RTCPointQueryContext* userContext, RTCPointQueryFunction queryFunc, void* userPtr)
{ … }
RTC_API bool rtcPointQuery(RTCScene hscene, RTCPointQuery* query, RTCPointQueryContext* userContext, RTCPointQueryFunction queryFunc, void* userPtr)
{ … }
RTC_API bool rtcPointQuery4 (const int* valid, RTCScene hscene, RTCPointQuery4* query, struct RTCPointQueryContext* userContext, RTCPointQueryFunction queryFunc, void** userPtrN)
{ … }
RTC_API bool rtcPointQuery8 (const int* valid, RTCScene hscene, RTCPointQuery8* query, struct RTCPointQueryContext* userContext, RTCPointQueryFunction queryFunc, void** userPtrN)
{ … }
RTC_API bool rtcPointQuery16 (const int* valid, RTCScene hscene, RTCPointQuery16* query, struct RTCPointQueryContext* userContext, RTCPointQueryFunction queryFunc, void** userPtrN)
{ … }
RTC_API void rtcIntersect1 (RTCScene hscene, RTCRayHit* rayhit, RTCIntersectArguments* args)
{ … }
RTC_API void rtcForwardIntersect1 (const RTCIntersectFunctionNArguments* args, RTCScene hscene, RTCRay* iray_, unsigned int instID)
{ … }
RTC_API void rtcForwardIntersect1Ex(const RTCIntersectFunctionNArguments* args, RTCScene hscene, RTCRay* iray_, unsigned int instID, unsigned int instPrimID)
{ … }
RTC_API void rtcIntersect4 (const int* valid, RTCScene hscene, RTCRayHit4* rayhit, RTCIntersectArguments* args)
{ … }
template<int N> void copy(float* dst, float* src);
template<>
__forceinline void copy<4>(float* dst, float* src) { … }
template<>
__forceinline void copy<8>(float* dst, float* src) { … }
template<>
__forceinline void copy<16>(float* dst, float* src) { … }
template<typename RTCRay, typename RTCRayHit, int N>
__forceinline void rtcForwardIntersectN(const int* valid, const RTCIntersectFunctionNArguments* args, RTCScene hscene, RTCRay* iray, unsigned int instID, unsigned int instPrimID)
{ … }
RTC_API void rtcForwardIntersect4(const int* valid, const RTCIntersectFunctionNArguments* args, RTCScene hscene, RTCRay4* iray, unsigned int instID)
{ … }
RTC_API void rtcForwardIntersect4Ex(const int* valid, const RTCIntersectFunctionNArguments* args, RTCScene hscene, RTCRay4* iray, unsigned int instID, unsigned int instPrimID)
{ … }
RTC_API void rtcIntersect8 (const int* valid, RTCScene hscene, RTCRayHit8* rayhit, RTCIntersectArguments* args)
{ … }
RTC_API void rtcForwardIntersect8(const int* valid, const RTCIntersectFunctionNArguments* args, RTCScene hscene, RTCRay8* iray, unsigned int instID)
{ … }
RTC_API void rtcForwardIntersect8Ex(const int* valid, const RTCIntersectFunctionNArguments* args, RTCScene hscene, RTCRay8* iray, unsigned int instID, unsigned int instPrimID)
{ … }
RTC_API void rtcIntersect16 (const int* valid, RTCScene hscene, RTCRayHit16* rayhit, RTCIntersectArguments* args)
{ … }
RTC_API void rtcForwardIntersect16(const int* valid, const RTCIntersectFunctionNArguments* args, RTCScene hscene, RTCRay16* iray, unsigned int instID)
{ … }
RTC_API void rtcForwardIntersect16Ex(const int* valid, const RTCIntersectFunctionNArguments* args, RTCScene hscene, RTCRay16* iray, unsigned int instID, unsigned int instPrimID)
{ … }
RTC_API void rtcOccluded1 (RTCScene hscene, RTCRay* ray, RTCOccludedArguments* args)
{ … }
RTC_API void rtcForwardOccluded1 (const RTCOccludedFunctionNArguments* args, RTCScene hscene, RTCRay* iray_, unsigned int instID)
{ … }
RTC_API void rtcForwardOccluded1Ex(const RTCOccludedFunctionNArguments* args, RTCScene hscene, RTCRay* iray_, unsigned int instID, unsigned int instPrimID)
{ … }
RTC_API void rtcOccluded4 (const int* valid, RTCScene hscene, RTCRay4* ray, RTCOccludedArguments* args)
{ … }
template<typename RTCRay, int N>
__forceinline void rtcForwardOccludedN (const int* valid, const RTCOccludedFunctionNArguments* args, RTCScene hscene, RTCRay* iray, unsigned int instID, unsigned int instPrimID)
{ … }
RTC_API void rtcForwardOccluded4(const int* valid, const RTCOccludedFunctionNArguments* args, RTCScene hscene, RTCRay4* iray, unsigned int instID)
{ … }
RTC_API void rtcForwardOccluded4Ex(const int* valid, const RTCOccludedFunctionNArguments* args, RTCScene hscene, RTCRay4* iray, unsigned int instID, unsigned int instPrimID)
{ … }
RTC_API void rtcOccluded8 (const int* valid, RTCScene hscene, RTCRay8* ray, RTCOccludedArguments* args)
{ … }
RTC_API void rtcForwardOccluded8(const int* valid, const RTCOccludedFunctionNArguments* args, RTCScene hscene, RTCRay8* iray, unsigned int instID)
{ … }
RTC_API void rtcForwardOccluded8Ex(const int* valid, const RTCOccludedFunctionNArguments* args, RTCScene hscene, RTCRay8* iray, unsigned int instID, unsigned int instPrimID)
{ … }
RTC_API void rtcOccluded16 (const int* valid, RTCScene hscene, RTCRay16* ray, RTCOccludedArguments* args)
{ … }
RTC_API void rtcForwardOccluded16(const int* valid, const RTCOccludedFunctionNArguments* args, RTCScene hscene, RTCRay16* iray, unsigned int instID)
{ … }
RTC_API void rtcForwardOccluded16Ex(const int* valid, const RTCOccludedFunctionNArguments* args, RTCScene hscene, RTCRay16* iray, unsigned int instID, unsigned int instPrimID)
{ … }
RTC_API void rtcRetainScene (RTCScene hscene)
{ … }
RTC_API void rtcReleaseScene (RTCScene hscene)
{ … }
RTC_API void rtcSetGeometryInstancedScene(RTCGeometry hgeometry, RTCScene hscene)
{ … }
RTC_API void rtcSetGeometryInstancedScenes(RTCGeometry hgeometry, RTCScene* scenes, size_t numScenes)
{ … }
AffineSpace3fa loadTransform(RTCFormat format, const float* xfm)
{ … }
RTC_API void rtcSetGeometryTransform(RTCGeometry hgeometry, unsigned int timeStep, RTCFormat format, const void* xfm)
{ … }
RTC_API void rtcSetGeometryTransformQuaternion(RTCGeometry hgeometry, unsigned int timeStep, const RTCQuaternionDecomposition* qd)
{ … }
RTC_API void rtcGetGeometryTransform(RTCGeometry hgeometry, float time, RTCFormat format, void* xfm)
{ … }
RTC_API void rtcGetGeometryTransformEx(RTCGeometry hgeometry, unsigned int instPrimID, float time, RTCFormat format, void* xfm)
{ … }
RTC_API void rtcGetGeometryTransformFromScene(RTCScene hscene, unsigned int geomID, float time, RTCFormat format, void* xfm)
{ … }
RTC_API void rtcInvokeIntersectFilterFromGeometry(const struct RTCIntersectFunctionNArguments* const args_i, const struct RTCFilterFunctionNArguments* filter_args)
{ … }
RTC_API void rtcInvokeOccludedFilterFromGeometry(const struct RTCOccludedFunctionNArguments* const args_i, const struct RTCFilterFunctionNArguments* filter_args)
{ … }
RTC_API RTCGeometry rtcNewGeometry (RTCDevice hdevice, RTCGeometryType type)
{ … }
RTC_API void rtcSetGeometryUserPrimitiveCount(RTCGeometry hgeometry, unsigned int userPrimitiveCount)
{ … }
RTC_API void rtcSetGeometryTimeStepCount(RTCGeometry hgeometry, unsigned int timeStepCount)
{ … }
RTC_API void rtcSetGeometryTimeRange(RTCGeometry hgeometry, float startTime, float endTime)
{ … }
RTC_API void rtcSetGeometryVertexAttributeCount(RTCGeometry hgeometry, unsigned int N)
{ … }
RTC_API void rtcSetGeometryTopologyCount(RTCGeometry hgeometry, unsigned int N)
{ … }
RTC_API void rtcSetGeometryBuildQuality (RTCGeometry hgeometry, RTCBuildQuality quality)
{ … }
RTC_API void rtcSetGeometryMaxRadiusScale(RTCGeometry hgeometry, float maxRadiusScale)
{ … }
RTC_API void rtcSetGeometryMask (RTCGeometry hgeometry, unsigned int mask)
{ … }
RTC_API void rtcSetGeometrySubdivisionMode (RTCGeometry hgeometry, unsigned topologyID, RTCSubdivisionMode mode)
{ … }
RTC_API void rtcSetGeometryVertexAttributeTopology(RTCGeometry hgeometry, unsigned int vertexAttributeID, unsigned int topologyID)
{ … }
RTC_API void rtcSetGeometryBuffer(RTCGeometry hgeometry, RTCBufferType type, unsigned int slot, RTCFormat format, RTCBuffer hbuffer, size_t byteOffset, size_t byteStride, size_t itemCount)
{ … }
RTC_API void rtcSetSharedGeometryBuffer(RTCGeometry hgeometry, RTCBufferType type, unsigned int slot, RTCFormat format, const void* ptr, size_t byteOffset, size_t byteStride, size_t itemCount)
{ … }
RTC_API void* rtcSetNewGeometryBuffer(RTCGeometry hgeometry, RTCBufferType type, unsigned int slot, RTCFormat format, size_t byteStride, size_t itemCount)
{ … }
RTC_API void* rtcGetGeometryBufferData(RTCGeometry hgeometry, RTCBufferType type, unsigned int slot)
{ … }
RTC_API void rtcEnableGeometry (RTCGeometry hgeometry)
{ … }
RTC_API void rtcUpdateGeometryBuffer (RTCGeometry hgeometry, RTCBufferType type, unsigned int slot)
{ … }
RTC_API void rtcDisableGeometry (RTCGeometry hgeometry)
{ … }
RTC_API void rtcSetGeometryTessellationRate (RTCGeometry hgeometry, float tessellationRate)
{ … }
RTC_API void rtcSetGeometryUserData (RTCGeometry hgeometry, void* ptr)
{ … }
RTC_API void* rtcGetGeometryUserData (RTCGeometry hgeometry)
{ … }
RTC_API void* rtcGetGeometryUserDataFromScene (RTCScene hscene, unsigned int geomID)
{ … }
RTC_API void rtcSetGeometryBoundsFunction (RTCGeometry hgeometry, RTCBoundsFunction bounds, void* userPtr)
{ … }
RTC_API void rtcSetGeometryDisplacementFunction (RTCGeometry hgeometry, RTCDisplacementFunctionN displacement)
{ … }
RTC_API void rtcSetGeometryIntersectFunction (RTCGeometry hgeometry, RTCIntersectFunctionN intersect)
{ … }
RTC_API void rtcSetGeometryPointQueryFunction(RTCGeometry hgeometry, RTCPointQueryFunction pointQuery)
{ … }
RTC_API unsigned int rtcGetGeometryFirstHalfEdge(RTCGeometry hgeometry, unsigned int faceID)
{ … }
RTC_API unsigned int rtcGetGeometryFace(RTCGeometry hgeometry, unsigned int edgeID)
{ … }
RTC_API unsigned int rtcGetGeometryNextHalfEdge(RTCGeometry hgeometry, unsigned int edgeID)
{ … }
RTC_API unsigned int rtcGetGeometryPreviousHalfEdge(RTCGeometry hgeometry, unsigned int edgeID)
{ … }
RTC_API unsigned int rtcGetGeometryOppositeHalfEdge(RTCGeometry hgeometry, unsigned int topologyID, unsigned int edgeID)
{ … }
RTC_API void rtcSetGeometryOccludedFunction (RTCGeometry hgeometry, RTCOccludedFunctionN occluded)
{ … }
RTC_API void rtcSetGeometryIntersectFilterFunction (RTCGeometry hgeometry, RTCFilterFunctionN filter)
{ … }
RTC_API void rtcSetGeometryOccludedFilterFunction (RTCGeometry hgeometry, RTCFilterFunctionN filter)
{ … }
RTC_API void rtcSetGeometryEnableFilterFunctionFromArguments (RTCGeometry hgeometry, bool enable)
{ … }
RTC_API void rtcInterpolate(const RTCInterpolateArguments* const args)
{ … }
RTC_API void rtcInterpolateN(const RTCInterpolateNArguments* const args)
{ … }
RTC_API void rtcCommitGeometry (RTCGeometry hgeometry)
{ … }
RTC_API unsigned int rtcAttachGeometry (RTCScene hscene, RTCGeometry hgeometry)
{ … }
RTC_API void rtcAttachGeometryByID (RTCScene hscene, RTCGeometry hgeometry, unsigned int geomID)
{ … }
RTC_API void rtcDetachGeometry (RTCScene hscene, unsigned int geomID)
{ … }
RTC_API void rtcRetainGeometry (RTCGeometry hgeometry)
{ … }
RTC_API void rtcReleaseGeometry (RTCGeometry hgeometry)
{ … }
RTC_API RTCGeometry rtcGetGeometry (RTCScene hscene, unsigned int geomID)
{ … }
RTC_API RTCGeometry rtcGetGeometryThreadSafe (RTCScene hscene, unsigned int geomID)
{ … }
RTC_NAMESPACE_END