14# include <hiprt/hiprt_types.h>
25class HIPRTDevice :
public HIPDevice {
28 static bool is_supported();
32 HIPRTDevice(
const DeviceInfo &info, Stats &stats, Profiler &profiler,
bool headless);
34 ~HIPRTDevice()
override;
35 unique_ptr<DeviceQueue> gpu_queue_create()
override;
36 string compile_kernel_get_common_cflags(
uint64_t kernel_features);
37 string compile_kernel(
uint64_t kernel_features,
const char *name,
const char *base =
"hiprt");
39 bool load_kernels(
uint64_t kernel_features)
override;
41 void const_copy_to(
const char *name,
void *host,
const size_t size)
override;
43 void build_bvh(
BVH *bvh, Progress &progress,
bool refit)
override;
45 void release_bvh(
BVH *bvh)
override;
47 hiprtContext get_hiprt_context()
52 hiprtGlobalStackBuffer global_stack_buffer;
55 enum Filter_Function { Closest = 0, Shadows,
Local, Volume, Max_Intersect_Filter_Function };
56 enum Primitive_Type { Triangle = 0,
Curve, Motion_Triangle,
Point, Max_Primitive_Type };
58 hiprtGeometryBuildInput prepare_triangle_blas(BVHHIPRT *bvh, Mesh *mesh);
59 hiprtGeometryBuildInput prepare_curve_blas(BVHHIPRT *bvh, Hair *hair);
60 hiprtGeometryBuildInput prepare_point_blas(BVHHIPRT *bvh, PointCloud *pointcloud);
61 void build_blas(BVHHIPRT *bvh, Geometry *geom);
62 hiprtScene build_tlas(BVHHIPRT *bvh,
const vector<Object *> &objects,
bool refit);
63 void free_bvh_memory_delayed();
65 hiprtContext hiprt_context;
66 hipModule_t hiprt_module_;
69 hiprtFuncTable functions_table;
72 size_t scratch_buffer_size;
73 device_vector<char> scratch_buffer;
80 vector<hiprtGeometry> stale_bvh;
84 bool use_motion_blur =
false;
96 device_vector<uint32_t> prim_visibility;
100 device_vector<hiprtFrameMatrix> instance_transform_matrix;
109 device_vector<hiprtTransformHeader> transform_headers;
120 device_vector<int> user_instance_id;
121 device_vector<hiprtInstance> hiprt_blas_ptr;
122 device_vector<uint64_t> blas_ptr;
unsigned long long int uint64_t
void refit(btStridingMeshInterface *triangles, const btVector3 &aabbMin, const btVector3 &aabbMax)
#define CCL_NAMESPACE_END
ccl_device bool BVH_FUNCTION_FULL_NAME BVH(KernelGlobals kg, const ccl_private Ray *ray, ccl_private LocalIntersection *local_isect, const int local_object, ccl_private uint *lcg_state, const int max_hits)