1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
|
// Copyright 2009-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#include "scene_user_geometry.h"
#include "scene.h"
namespace embree
{
#if defined(EMBREE_LOWEST_ISA)
UserGeometry::UserGeometry (Device* device, unsigned int items, unsigned int numTimeSteps)
: AccelSet(device,Geometry::GTY_USER_GEOMETRY,items,numTimeSteps) {}
void UserGeometry::addElementsToCount (GeometryCounts & counts) const
{
if (numTimeSteps == 1) counts.numUserGeometries += numPrimitives;
else counts.numMBUserGeometries += numPrimitives;
}
void UserGeometry::setMask (unsigned mask)
{
this->mask = mask;
Geometry::update();
}
void UserGeometry::setBoundsFunction (RTCBoundsFunction bounds, void* userPtr) {
this->boundsFunc = bounds;
}
void UserGeometry::setIntersectFunctionN (RTCIntersectFunctionN intersect) {
intersectorN.intersect = intersect;
}
void UserGeometry::setOccludedFunctionN (RTCOccludedFunctionN occluded) {
intersectorN.occluded = occluded;
}
size_t UserGeometry::getGeometryDataDeviceByteSize() const {
return 16 * ((sizeof(UserGeometry) + 15) / 16);
}
void UserGeometry::convertToDeviceRepresentation(size_t offset, char* data_host, char* data_device) const {
std::memcpy(data_host + offset, (void*)this, sizeof(UserGeometry));
offset += sizeof(Instance);
}
#endif
namespace isa
{
UserGeometry* createUserGeometry(Device* device) {
return new UserGeometryISA(device);
}
}
}
|