Blender V5.3
kernel/device/optix/bvh.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2021-2022 Blender Foundation
2 *
3 * SPDX-License-Identifier: Apache-2.0 */
4
5/* OptiX implementation of ray-scene intersection.
6 *
7 * Note on the payload registers.
8 * Intersection and filtering functions might be sharing the same registers, even if it is not
9 * very obvious from the trace/traverse call. The registers that have special meaning and are to
10 * be kept "locked" to their meaning:
11 * uint p4 = visibility;
12 * uint p6 = pointer_pack_to_uint_0(ray);
13 * uint p7 = pointer_pack_to_uint_1(ray); */
14
15#pragma once
16
17#include "kernel/bvh/types.h"
18#include "kernel/bvh/util.h"
19
20#define OPTIX_DEFINE_ABI_VERSION_ONLY
21#include <optix_function_table.h>
22
24
25/* Utilities. */
26
31
33{
34 return pointer_unpack_from_uint<T>(optixGetPayload_0(), optixGetPayload_1());
35}
37{
38 return pointer_unpack_from_uint<T>(optixGetPayload_2(), optixGetPayload_3());
39}
40
42{
43 return (T *)(((uint64_t)optixGetPayload_7() << 32) | optixGetPayload_6());
44}
45
47{
48#ifdef __OBJECT_MOTION__
49 /* Always get the instance ID from the TLAS
50 * There might be a motion transform node between TLAS and BLAS which does not have one. */
51 return optixGetInstanceIdFromHandle(optixGetTransformListHandle(0));
52#else
53 return optixGetInstanceId();
54#endif
55}
56
58{
59 Intersection isect;
60
61 isect.t = optixGetRayTmax();
62 isect.prim = optixGetPrimitiveIndex();
63 isect.object = get_object_id();
64
65 if (optixIsTriangleHit()) {
66 /* Triangle. */
67 const float2 barycentrics = optixGetTriangleBarycentrics();
68 isect.u = barycentrics.x;
69 isect.v = barycentrics.y;
70 isect.type = kernel_data_fetch(objects, isect.object).primitive_type;
71 }
72#ifdef __HAIR__
73 else if (optixGetHitKind() != CUSTOM_PRIMITIVE_HIT_KIND_POINT) {
74 /* Curve. */
75 isect.u = __uint_as_float(optixGetAttribute_0());
76 isect.v = __uint_as_float(optixGetAttribute_1());
77
78 const KernelCurveSegment segment = kernel_data_fetch(curve_segments, isect.prim);
79 isect.type = segment.type;
80 isect.prim = segment.prim;
81 }
82#endif
83 else {
84 /* Point. */
86 isect.u = 0.0f;
87 isect.v = 0.0f;
88 isect.type = kernel_data_fetch(objects, isect.object).primitive_type;
89 }
90
91 return isect;
92}
93
94/* Hit/miss functions. */
95
96extern "C" __global__ void __miss__kernel_optix_miss()
97{
98 /* 'kernel_path_lamp_emission' checks intersection distance, so need to set it even on a miss. */
99 optixSetPayload_0(__float_as_uint(optixGetRayTmax()));
100 optixSetPayload_5(PRIMITIVE_NONE);
101}
102
103extern "C" __global__ void __anyhit__kernel_optix_ignore()
104{
105 return optixIgnoreIntersection();
106}
107
108extern "C" __global__ void __closesthit__kernel_optix_ignore() {}
109
110extern "C" __global__ void __anyhit__kernel_optix_local_hit()
111{
112#if defined(__HAIR__) || defined(__POINTCLOUD__)
113 if (!optixIsTriangleHit()) {
114 /* Ignore curves and points. */
115 return optixIgnoreIntersection();
116 }
117#endif
118
119#ifdef __BVH_LOCAL__
120 const int object = get_object_id();
121 if (object != optixGetPayload_4() /* local_object */) {
122 /* Only intersect with matching object. */
123 return optixIgnoreIntersection();
124 }
125
126 const int prim = optixGetPrimitiveIndex();
128 if (intersection_skip_self_local(ray->self, prim)) {
129 return optixIgnoreIntersection();
130 }
131
132 const uint max_hits = optixGetPayload_5();
133 if (max_hits == 0) {
134 /* Special case for when no hit information is requested, just report that something was hit */
135 optixSetPayload_5(true);
136 return optixTerminateRay();
137 }
138
139 const float isect_t = optixGetRayTmax();
140 uint *const lcg_state = get_payload_ptr_0<uint>();
142
143 const int hit_index = local_intersect_get_record_index(
144 local_isect, isect_t, lcg_state, max_hits);
145 if (hit_index == -1) {
146 return optixIgnoreIntersection();
147 }
148
149 Intersection *isect = &local_isect->hits[hit_index];
150 isect->t = isect_t;
151 isect->prim = prim;
152 isect->object = get_object_id();
153 isect->type = kernel_data_fetch(objects, isect->object).primitive_type;
154
155 const float2 barycentrics = optixGetTriangleBarycentrics();
156 isect->u = barycentrics.x;
157 isect->v = barycentrics.y;
158
159 /* Record geometric normal. */
160 const int position_offset = kernel_data_fetch(objects, object).position_offset;
161 const packed_uint3 tri_vindex = kernel_data_fetch(tri_vindex, prim);
162 const float3 tri_a = kernel_data_fetch(tri_verts, position_offset + tri_vindex.x);
163 const float3 tri_b = kernel_data_fetch(tri_verts, position_offset + tri_vindex.y);
164 const float3 tri_c = kernel_data_fetch(tri_verts, position_offset + tri_vindex.z);
165
166 local_isect->Ng[hit_index] = normalize(cross(tri_b - tri_a, tri_c - tri_a));
167
168 /* Continue tracing (without this the trace call would return after the first hit). */
169 optixIgnoreIntersection();
170#endif
171}
172
173extern "C" __global__ void __anyhit__kernel_optix_shadow_all_hit()
174{
175#ifdef __TRANSPARENT_SHADOWS__
176 KernelGlobals kg = nullptr;
177
178 ccl_private BVHShadowAllPayload *payload = get_payload_ptr_0<BVHShadowAllPayload>();
179 const uint ray_visibility = optixGetPayload_4();
181
184 kg, payload->state, *payload, ray->self, ray_visibility, isect))
185 {
186 optixTerminateRay();
187 return;
188 }
189
190 /* The idea here is to accept the hit, so that traversal won't consider any more hits beyond the
191 * distance of the current hit anymore.
192 *
193 * We could accept the hit which is furthest away from the ones that are already recorded (for
194 * this `>` needs to be replaced with `>=`). However, doing so has a performance impact in the
195 * pabellon benchmark scene. The hypothesis here is that allowing to traverse one extra hit after
196 * the array is filled allows to hit an opaque surface and do early exit from the shadow shading.
197 *
198 * Similar to this logic (allowing an extra hit) was in the original OptiX integration, so we
199 * just keep following it to avoid performance regression. There is no the correct solution here,
200 * as it depends on the scene. For example, if there are many transparent surfaces with no opaque
201 * hit then it is faster to start accepting hits as soon as possible. However, if there are many
202 * transparent surfaces, followed up with an opaque surface, it is faster to not accept any hit
203 * and allow the opaque optimization to lead to an early output from the intersect-shade loop. */
204 if (isect.t > payload->max_record_isect_t) {
205 return;
206 }
207
208 optixIgnoreIntersection();
209#endif
210}
211
212extern "C" __global__ void __anyhit__kernel_optix_volume_test()
213{
214#if defined(__HAIR__) || defined(__POINTCLOUD__)
215 if (!optixIsTriangleHit()) {
216 /* Ignore curves. */
217 return optixIgnoreIntersection();
218 }
219#endif
220
221 KernelGlobals kg = nullptr;
222
223 const int object = get_object_id();
224 const int prim = optixGetPrimitiveIndex();
226 const uint ray_visibility = optixGetPayload_4();
227
228 if (bvh_volume_anyhit_triangle_filter(kg, object, prim, ray->self, ray_visibility)) {
229 return optixIgnoreIntersection();
230 }
231}
232
233extern "C" __global__ void __anyhit__kernel_optix_visibility_test()
234{
235 const uint object = get_object_id();
236 const uint visibility = optixGetPayload_4();
237#ifdef __VISIBILITY_FLAG__
238 if ((kernel_data_fetch(objects, object).visibility & visibility) == 0) {
239 return optixIgnoreIntersection();
240 }
241#endif
242
243 int prim = optixGetPrimitiveIndex();
244 if (optixIsTriangleHit()) {
245 /* Triangle. */
246 }
247#ifdef __HAIR__
248 else if (optixGetHitKind() != CUSTOM_PRIMITIVE_HIT_KIND_POINT) {
249 /* Curve. */
250 prim = kernel_data_fetch(curve_segments, prim).prim;
251 }
252#endif
253
255
256 if (visibility & PATH_RAY_VISIBILITY_SHADOW_OPAQUE) {
257#ifdef __SHADOW_LINKING__
258 if (intersection_skip_shadow_link(nullptr, ray->self, object)) {
259 return optixIgnoreIntersection();
260 }
261#endif
262
263 if (intersection_skip_self_shadow(ray->self, object, prim)) {
264 return optixIgnoreIntersection();
265 }
266 else {
267 /* Shadow ray early termination. */
268 return optixTerminateRay();
269 }
270 }
271 else {
272 if (intersection_skip_self(ray->self, object, prim)) {
273 return optixIgnoreIntersection();
274 }
275 }
276}
277
278extern "C" __global__ void __closesthit__kernel_optix_hit()
279{
280 const int object = get_object_id();
281 const int prim = optixGetPrimitiveIndex();
282
283 optixSetPayload_0(__float_as_uint(optixGetRayTmax())); /* Intersection distance */
284 optixSetPayload_4(object);
285
286 if (optixIsTriangleHit()) {
287 const float2 barycentrics = optixGetTriangleBarycentrics();
288 optixSetPayload_1(__float_as_uint(barycentrics.x));
289 optixSetPayload_2(__float_as_uint(barycentrics.y));
290 optixSetPayload_3(prim);
291 optixSetPayload_5(kernel_data_fetch(objects, object).primitive_type);
292 }
293 else if (optixGetHitKind() != CUSTOM_PRIMITIVE_HIT_KIND_POINT) {
294 const KernelCurveSegment segment = kernel_data_fetch(curve_segments, prim);
295 optixSetPayload_1(optixGetAttribute_0()); /* Same as 'optixGetCurveParameter()' */
296 optixSetPayload_2(optixGetAttribute_1());
297 optixSetPayload_3(segment.prim);
298 optixSetPayload_5(segment.type);
299 }
300 else {
302 optixSetPayload_1(0);
303 optixSetPayload_2(0);
304 optixSetPayload_3(prim);
305 optixSetPayload_5(kernel_data_fetch(objects, object).primitive_type);
306 }
307}
308
309/* Custom primitive intersection functions. */
310
311#ifdef __HAIR__
312ccl_device_inline void optix_intersection_curve(const int prim, const int type)
313{
314 const int object = get_object_id();
315
316# ifdef __VISIBILITY_FLAG__
317 const uint visibility = optixGetPayload_4();
318 if ((kernel_data_fetch(objects, object).visibility & visibility) == 0) {
319 return;
320 }
321# endif
322
323 const float3 ray_P = optixGetObjectRayOrigin();
324 const float3 ray_D = optixGetObjectRayDirection();
325 const float ray_tmin = optixGetRayTmin();
326
327# ifdef __OBJECT_MOTION__
328 const float time = optixGetRayTime();
329# else
330 const float time = 0.0f;
331# endif
332
333 Intersection isect;
334 isect.t = optixGetRayTmax();
335
336 if (curve_intersect(nullptr, &isect, ray_P, ray_D, ray_tmin, isect.t, object, prim, time, type))
337 {
338 optixReportIntersection(isect.t,
340 __float_as_int(isect.u), /* Attribute_0 */
341 __float_as_int(isect.v)); /* Attribute_1 */
342 }
343}
344
345extern "C" __global__ void __intersection__curve_ribbon()
346{
347 const KernelCurveSegment segment = kernel_data_fetch(curve_segments, optixGetPrimitiveIndex());
348 const int prim = segment.prim;
349 const int type = segment.type;
350 if ((type & PRIMITIVE_CURVE) == PRIMITIVE_CURVE_RIBBON) {
351 optix_intersection_curve(prim, type);
352 }
353}
354#endif
355
356#ifdef __POINTCLOUD__
357extern "C" __global__ void __intersection__point()
358{
359 const int prim = optixGetPrimitiveIndex();
360 const int object = get_object_id();
361 const int type = kernel_data_fetch(objects, object).primitive_type;
362
363# ifdef __VISIBILITY_FLAG__
364 const uint visibility = optixGetPayload_4();
365 if ((kernel_data_fetch(objects, object).visibility & visibility) == 0) {
366 return;
367 }
368# endif
369
370 const float3 ray_P = optixGetObjectRayOrigin();
371 const float3 ray_D = optixGetObjectRayDirection();
372 const float ray_tmin = optixGetRayTmin();
373
374# ifdef __OBJECT_MOTION__
375 const float time = optixGetRayTime();
376# else
377 const float time = 0.0f;
378# endif
379
380 Intersection isect;
381 isect.t = optixGetRayTmax();
382
383 if (point_or_gsplat_intersect(
384 nullptr, &isect, ray_P, ray_D, ray_tmin, isect.t, object, prim, time, type))
385 {
386 optixReportIntersection(isect.t, CUSTOM_PRIMITIVE_HIT_KIND_POINT);
387 }
388}
389#endif
390
391/* Scene intersection. */
392
394 const ccl_private Ray *ray,
395 const uint visibility,
397{
398 /* Note: some registers have hardcoded meaning.
399 * Be careful when changing the values here. See the note at the top of this file for more
400 * details. */
401 uint p0 = 0;
402 uint p1 = 0;
403 uint p2 = 0;
404 uint p3 = 0;
405 uint p4 = visibility;
406 uint p5 = PRIMITIVE_NONE;
407 uint p6 = pointer_pack_to_uint_0(ray);
408 uint p7 = pointer_pack_to_uint_1(ray);
409
410 uint ray_mask = visibility & 0xFF;
411 uint ray_flags = OPTIX_RAY_FLAG_ENFORCE_ANYHIT;
412 if (0 == ray_mask && (visibility & ~0xFF) != 0) {
413 ray_mask = 0xFF;
414 }
415 else if (visibility & PATH_RAY_VISIBILITY_SHADOW_OPAQUE) {
416 ray_flags |= OPTIX_RAY_FLAG_TERMINATE_ON_FIRST_HIT;
417 }
418
419 optixTrace(intersection_ray_valid(ray) ? kernel_data.device_bvh : 0,
420 ray->P,
421 ray->D,
422 ray->tmin,
423 ray->tmax,
424 ray->time,
425 ray_mask,
426 ray_flags,
427 0, /* SBT offset for PG_HITD */
428 0,
429 0,
430 p0,
431 p1,
432 p2,
433 p3,
434 p4,
435 p5,
436 p6,
437 p7);
438
439 isect->t = __uint_as_float(p0);
440 isect->u = __uint_as_float(p1);
441 isect->v = __uint_as_float(p2);
442 isect->prim = p3;
443 isect->object = p4;
444 isect->type = p5;
445
446 return p5 != PRIMITIVE_NONE;
447}
448
450 const ccl_private Ray *ray,
451 const uint visibility)
452{
453 /* Note: some registers have hardcoded meaning.
454 * Be careful when changing the values here. See the note at the top of this file for more
455 * details. */
456 uint p0 = 0;
457 uint p1 = 0;
458 uint p2 = 0;
459 uint p3 = 0;
460 uint p4 = visibility;
461 uint p5 = PRIMITIVE_NONE;
462 uint p6 = pointer_pack_to_uint_0(ray);
463 uint p7 = pointer_pack_to_uint_1(ray);
464
465 uint ray_mask = visibility & 0xFF;
466 uint ray_flags = OPTIX_RAY_FLAG_ENFORCE_ANYHIT;
467 if (0 == ray_mask && (visibility & ~0xFF) != 0) {
468 ray_mask = 0xFF;
469 }
470 else if (visibility & PATH_RAY_VISIBILITY_SHADOW_OPAQUE) {
471 ray_flags |= OPTIX_RAY_FLAG_TERMINATE_ON_FIRST_HIT;
472 }
473
474 optixTraverse(intersection_ray_valid(ray) ? kernel_data.device_bvh : 0,
475 ray->P,
476 ray->D,
477 ray->tmin,
478 ray->tmax,
479 ray->time,
480 ray_mask,
481 ray_flags,
482 0, /* SBT offset for PG_HITD */
483 0,
484 0,
485 p0,
486 p1,
487 p2,
488 p3,
489 p4,
490 p5,
491 p6,
492 p7);
493
494 return optixHitObjectIsHit();
495}
496
497#ifdef __BVH_LOCAL__
498template<bool single_hit = false>
499ccl_device_intersect bool scene_intersect_local(KernelGlobals kg,
500 const ccl_private Ray *ray,
501 ccl_private LocalIntersection *local_isect,
502 const int local_object,
503 ccl_private uint *lcg_state,
504 const int max_hits)
505{
506 /* Note: some registers have hardcoded meaning.
507 * Be careful when changing the values here. See the note at the top of this file for more
508 * details. */
509 uint p0 = pointer_pack_to_uint_0(lcg_state);
510 uint p1 = pointer_pack_to_uint_1(lcg_state);
511 uint p2 = pointer_pack_to_uint_0(local_isect);
512 uint p3 = pointer_pack_to_uint_1(local_isect);
513 uint p4 = local_object;
516
517 /* Is set to zero on miss or if ray is aborted, so can be used as return value. */
518 uint p5 = max_hits;
519
520 if (local_isect) {
521 local_isect->num_hits = 0; /* Initialize hit count to zero. */
522 }
523 optixTraverse(intersection_ray_valid(ray) ? kernel_data.device_bvh : 0,
524 ray->P,
525 ray->D,
526 ray->tmin,
527 ray->tmax,
528 ray->time,
529 0xFF,
530 /* Need to always call into __anyhit__kernel_optix_local_hit. */
531 OPTIX_RAY_FLAG_ENFORCE_ANYHIT,
532 2, /* SBT offset for PG_HITL */
533 0,
534 0,
535 p0,
536 p1,
537 p2,
538 p3,
539 p4,
540 p5,
541 p6,
542 p7);
543
544 return p5;
545}
546#endif
547
548#ifdef __TRANSPARENT_SHADOWS__
549ccl_device_intersect void scene_intersect_shadow_all_optix(
550 const ccl_private Ray *ccl_restrict ray,
551 const uint ray_visibility,
552 ccl_private BVHShadowAllPayload &ccl_restrict payload)
553{
554 /* Note: some registers have hardcoded meaning.
555 * Be careful when changing the values here. See the note at the top of this file for more
556 * details. */
557 uint p0 = pointer_pack_to_uint_0(&payload);
558 uint p1 = pointer_pack_to_uint_1(&payload);
559 uint p2 = 0;
560 uint p3 = 0;
561 uint p4 = ray_visibility;
562 uint p5 = 0;
565
566 uint ray_mask = ray_visibility & 0xFF;
567 if (0 == ray_mask && (ray_visibility & ~0xFF) != 0) {
568 ray_mask = 0xFF;
569 }
570
571 optixTraverse(intersection_ray_valid(ray) ? kernel_data.device_bvh : 0,
572 ray->P,
573 ray->D,
574 ray->tmin,
575 ray->tmax,
576 ray->time,
577 ray_mask,
578 /* Need to always call into __anyhit__kernel_optix_shadow_all_hit. */
579 OPTIX_RAY_FLAG_ENFORCE_ANYHIT,
580 1, /* SBT offset for PG_HITS */
581 0,
582 0,
583 p0,
584 p1,
585 p2,
586 p3,
587 p4,
588 p5,
589 p6,
590 p7);
591}
592#endif
593
594#ifdef __VOLUME__
595ccl_device_intersect bool scene_intersect_volume(KernelGlobals kg,
596 const ccl_private Ray *ray,
598 const uint visibility)
599{
600 /* Note: some registers have hardcoded meaning.
601 * Be careful when changing the values here. See the note at the top of this file for more
602 * details. */
603 uint p0 = 0;
604 uint p1 = 0;
605 uint p2 = 0;
606 uint p3 = 0;
607 uint p4 = visibility;
608 uint p5 = PRIMITIVE_NONE;
611
612 uint ray_mask = visibility & 0xFF;
613 if (0 == ray_mask && (visibility & ~0xFF) != 0) {
614 ray_mask = 0xFF;
615 }
616
617 optixTrace(intersection_ray_valid(ray) ? kernel_data.device_bvh : 0,
618 ray->P,
619 ray->D,
620 ray->tmin,
621 ray->tmax,
622 ray->time,
623 ray_mask,
624 /* Need to always call into __anyhit__kernel_optix_volume_test. */
625 OPTIX_RAY_FLAG_ENFORCE_ANYHIT,
626 3, /* SBT offset for PG_HITV */
627 0,
628 0,
629 p0,
630 p1,
631 p2,
632 p3,
633 p4,
634 p5,
635 p6,
636 p7);
637
638 isect->t = __uint_as_float(p0);
639 isect->u = __uint_as_float(p1);
640 isect->v = __uint_as_float(p2);
641 isect->prim = p3;
642 isect->object = p4;
643 isect->type = p5;
644
645 return p5 != PRIMITIVE_NONE;
646}
647#endif
648
unsigned long long int uint64_t
ccl_device_inline bool intersection_skip_shadow_link(KernelGlobals kg, const ccl_ray_data RaySelfPrimitives &self, const int isect_object)
ccl_device_inline bool intersection_skip_self_shadow(const ccl_ray_data RaySelfPrimitives &self, const int object, const int prim)
ccl_device_inline bool intersection_skip_self(const ccl_ray_data RaySelfPrimitives &self, const int object, const int prim)
CCL_NAMESPACE_BEGIN ccl_device_inline bool intersection_ray_valid(const ccl_private Ray *ray)
ccl_device_inline bool intersection_skip_self_local(const ccl_ray_data RaySelfPrimitives &self, const int prim)
#define kernel_assert(cond)
#define kernel_data
#define ccl_restrict
#define ccl_device_forceinline
#define kernel_data_fetch(name, index)
#define ccl_private
#define ccl_device_inline
#define CCL_NAMESPACE_END
#define __float_as_int(x)
#define __float_as_uint(x)
#define __uint_as_float(x)
VecBase< float, D > normalize(VecOp< float, D >) RET
VecBase< float, 3 > cross(VecOp< float, 3 >, VecOp< float, 3 >) RET
ccl_device_forceinline bool bvh_shadow_all_anyhit_filter(KernelGlobals kg, IntegratorShadowState state, ccl_ray_data BVHShadowAllPayload &ccl_restrict payload, const ccl_ray_data RaySelfPrimitives &ccl_restrict ray_self, const uint ray_visibility, const Intersection isect)
ccl_device_forceinline bool bvh_volume_anyhit_triangle_filter(KernelGlobals kg, const int object, const int prim, const ccl_ray_data RaySelfPrimitives &ccl_restrict ray_self, const uint ray_visibility)
ccl_device_intersect bool scene_intersect(KernelGlobals kg, const ccl_private Ray *ray, const uint visibility, ccl_private Intersection *isect)
ccl_device_intersect bool scene_intersect_shadow(KernelGlobals kg, const ccl_private Ray *ray, const uint visibility)
#define ccl_device_intersect
ccl_device_forceinline T * get_payload_ptr_6()
__global__ void __anyhit__kernel_optix_volume_test()
__global__ void __miss__kernel_optix_miss()
__global__ void __anyhit__kernel_optix_visibility_test()
__global__ void __closesthit__kernel_optix_ignore()
ccl_device_forceinline T * get_payload_ptr_0()
__global__ void __anyhit__kernel_optix_local_hit()
ccl_device_forceinline Intersection get_intersection()
__global__ void __anyhit__kernel_optix_shadow_all_hit()
__global__ void __closesthit__kernel_optix_hit()
__global__ void __anyhit__kernel_optix_ignore()
@ CUSTOM_PRIMITIVE_HIT_KIND_POINT
@ CUSTOM_PRIMITIVE_HIT_KIND_CURVE
ccl_device_forceinline T * get_payload_ptr_2()
ccl_device_forceinline int get_object_id()
@ PRIMITIVE_NONE
@ PRIMITIVE_CURVE_RIBBON
@ PRIMITIVE_CURVE
@ PATH_RAY_VISIBILITY_SHADOW_OPAQUE
ccl_device_inline uint pointer_pack_to_uint_1(T *ptr)
Definition math_base.h:330
ccl_device_inline uint pointer_pack_to_uint_0(T *ptr)
Definition math_base.h:325
ccl_device_inline T * pointer_unpack_from_uint(const uint a, const uint b)
Definition math_base.h:335
#define T
Segment< FEdge *, Vec3r > segment
std::string time(const std::tm &date_time, TimeFormat format=TimeFormat::H24)
unsigned int uint
Definition BKE_text.h:55
void visibility(Visibility &srt, const ViewCulling &culling, const uint3 global_id, const uint3 local_id, const uint3 workgroup_id)
Intersection hits[LOCAL_MAX_HITS]
float3 Ng[LOCAL_MAX_HITS]
float x
float y