triro
1.3.0
A Python Ray-Mesh Intersector in OptiX
Loading...
Searching...
No Matches
sbtdef.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "device_types.h"
4
#include "optix_types.h"
5
#include "
type.h
"
6
#include <string>
7
#include <tuple>
8
9
enum
SBTType
{
10
INTERSECTS_ANY
,
11
INTERSECTS_FIRST
,
12
INTERSECTS_CLOSEST
,
13
INTERSECTS_COUNT
,
14
INTERSECTS_LOCATION
,
15
count
16
};
17
18
// if the function contains such program
19
using
ProgramMask
= int;
20
// ray generation
21
#define PRG_RG 1
22
// intersection
23
#define PRG_IS 1 << 1
24
// anyhit
25
#define PRG_AH 1 << 2
26
// closest hit
27
#define PRG_CH 1 << 3
28
// miss
29
#define PRG_MS 1 << 4
30
// direct callable
31
#define PRG_DC 1 << 5
32
// continuation callable
33
#define PRG_CC 1 << 6
34
// exception
35
#define PRG_EX 1 << 7
36
37
const
std::tuple<std::string, ProgramMask>
programInfos
[] = {
38
{
"intersectsAny"
,
PRG_RG
|
PRG_AH
|
PRG_MS
},
39
{
"intersectsFirst"
,
PRG_RG
|
PRG_CH
|
PRG_MS
},
40
{
"intersectsClosest"
,
PRG_RG
|
PRG_CH
|
PRG_MS
},
41
{
"intersectsCount"
,
PRG_RG
|
PRG_AH
},
42
{
"intersectsLocation"
,
PRG_RG
|
PRG_AH
}};
43
44
template
<
typename
T>
struct
SBTRecord
{
45
__align__
(
46
OPTIX_SBT_RECORD_ALIGNMENT)
char
header[OPTIX_SBT_RECORD_HEADER_SIZE];
47
T
data
;
48
};
49
50
using
SBTRecordEmpty
=
SBTRecord<void *>
;
programInfos
const std::tuple< std::string, ProgramMask > programInfos[]
Definition
sbtdef.h:37
ProgramMask
int ProgramMask
Definition
sbtdef.h:19
PRG_RG
#define PRG_RG
Definition
sbtdef.h:21
PRG_AH
#define PRG_AH
Definition
sbtdef.h:25
PRG_MS
#define PRG_MS
Definition
sbtdef.h:29
PRG_CH
#define PRG_CH
Definition
sbtdef.h:27
SBTType
SBTType
Definition
sbtdef.h:9
INTERSECTS_LOCATION
@ INTERSECTS_LOCATION
Definition
sbtdef.h:14
count
@ count
Definition
sbtdef.h:15
INTERSECTS_ANY
@ INTERSECTS_ANY
Definition
sbtdef.h:10
INTERSECTS_FIRST
@ INTERSECTS_FIRST
Definition
sbtdef.h:11
INTERSECTS_COUNT
@ INTERSECTS_COUNT
Definition
sbtdef.h:13
INTERSECTS_CLOSEST
@ INTERSECTS_CLOSEST
Definition
sbtdef.h:12
SBTRecord
Definition
sbtdef.h:44
SBTRecord::data
T data
Definition
sbtdef.h:47
SBTRecord::__align__
__align__(OPTIX_SBT_RECORD_ALIGNMENT) char header[OPTIX_SBT_RECORD_HEADER_SIZE]
type.h
triro
backend
sbtdef.h
Generated by
1.9.8