NVIDIA OptiX 7.1 API nvidia_logo_transpbg.gif Up
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
optix_7_types.h
Go to the documentation of this file.
1 
2 /*
3  * Copyright (c) 2020 NVIDIA Corporation. All rights reserved.
4  *
5  * NVIDIA Corporation and its licensors retain all intellectual property and proprietary
6  * rights in and to this software, related documentation and any modifications thereto.
7  * Any use, reproduction, disclosure or distribution of this software and related
8  * documentation without an express license agreement from NVIDIA Corporation is strictly
9  * prohibited.
10  *
11  * TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED *AS IS*
12  * AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS OR IMPLIED,
13  * INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
14  * PARTICULAR PURPOSE. IN NO EVENT SHALL NVIDIA OR ITS SUPPLIERS BE LIABLE FOR ANY
15  * SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT
16  * LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF
17  * BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR
18  * INABILITY TO USE THIS SOFTWARE, EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF
19  * SUCH DAMAGES
20  */
21 
28 
29 #if !defined( __OPTIX_INCLUDE_INTERNAL_HEADERS__ )
30 #error("optix_7_types.h is an internal header file and must not be used directly. Please use optix_types.h, optix_host.h, optix_device.h or optix.h instead.")
31 #endif
32 
33 #ifndef __optix_optix_7_types_h__
34 #define __optix_optix_7_types_h__
35 
36 #if !defined(__CUDACC_RTC__)
37 #include <stddef.h> /* for size_t */
38 #endif
39 
42 
47 // This typedef should match the one in cuda.h in order to avoid compilation errors.
48 #if defined(__x86_64) || defined(AMD64) || defined(_M_AMD64) || defined(__powerpc64__) || defined(__EDG_IA64_ABI)/*=NVRTC*/ || defined(__aarch64__)
49 typedef unsigned long long CUdeviceptr;
51 #else
52 typedef unsigned int CUdeviceptr;
54 #endif
55 
57 typedef struct OptixDeviceContext_t* OptixDeviceContext;
58 
60 typedef struct OptixModule_t* OptixModule;
61 
63 typedef struct OptixProgramGroup_t* OptixProgramGroup;
64 
66 typedef struct OptixPipeline_t* OptixPipeline;
67 
69 typedef struct OptixDenoiser_t* OptixDenoiser;
70 
72 typedef unsigned long long OptixTraversableHandle;
73 
75 typedef unsigned int OptixVisibilityMask;
76 
78 #define OPTIX_SBT_RECORD_HEADER_SIZE ( (size_t)32 )
79 
81 #define OPTIX_SBT_RECORD_ALIGNMENT 16ull
82 
84 #define OPTIX_ACCEL_BUFFER_BYTE_ALIGNMENT 128ull
85 
87 #define OPTIX_INSTANCE_BYTE_ALIGNMENT 16ull
88 
90 #define OPTIX_AABB_BUFFER_BYTE_ALIGNMENT 8ull
91 
93 #define OPTIX_GEOMETRY_TRANSFORM_BYTE_ALIGNMENT 16ull
94 
96 #define OPTIX_TRANSFORM_BYTE_ALIGNMENT 64ull
97 
99 #define OPTIX_COMPILE_DEFAULT_MAX_REGISTER_COUNT 0
100 
101 
109 typedef enum OptixResult
110 {
145 } OptixResult;
146 
151 {
154 
158 
162 
166 
170 
173 
177 
181 
185 
210 typedef void ( *OptixLogCallback )( unsigned int level, const char* tag, const char* message, void* cbdata );
211 
216 {
224 
228 typedef enum OptixGeometryFlags
229 {
232 
236 
242 
248 typedef enum OptixHitKind
249 {
254 } OptixHitKind;
255 
257 typedef enum OptixIndicesFormat
258 {
266 
268 typedef enum OptixVertexFormat
269 {
278 
281 {
285 
290 {
299 
301  unsigned int numVertices;
302 
305 
308  unsigned int vertexStrideInBytes;
309 
314 
316  unsigned int numIndexTriplets;
317 
320 
323  unsigned int indexStrideInBytes;
324 
329 
333  const unsigned int* flags;
334 
336  unsigned int numSbtRecords;
337 
342 
345 
349 
352  unsigned int primitiveIndexOffset;
353 
357 
360 typedef enum OptixPrimitiveType
361 {
373 
378 {
390 
409 {
414  unsigned int numPrimitives;
415 
422  unsigned int numVertices;
425  unsigned int vertexStrideInBytes;
426 
432  unsigned int widthStrideInBytes;
433 
437  unsigned int normalStrideInBytes;
438 
447  unsigned int indexStrideInBytes;
448 
451  unsigned int flag;
452 
455  unsigned int primitiveIndexOffset;
457 
459 typedef struct OptixAabb
460 {
461  float minX;
462  float minY;
463  float minZ;
464  float maxX;
465  float maxY;
466  float maxZ;
467 } OptixAabb;
468 
473 {
479 
482  unsigned int numPrimitives;
483 
487  unsigned int strideInBytes;
488 
492  const unsigned int* flags;
493 
495  unsigned int numSbtRecords;
496 
501 
504 
508 
511  unsigned int primitiveIndexOffset;
513 
518 {
527 
529  unsigned int numInstances;
530 
576 
579  unsigned int numAabbs;
580 
582 
587 {
599 
605 typedef struct OptixBuildInput
606 {
609 
610  union
611  {
620  char pad[1024];
621  };
623 
624 
628 typedef enum OptixInstanceFlags
629 {
632 
637 
641 
646 
652 
656 
660 typedef struct OptixInstance
661 {
663  float transform[12];
664 
666  unsigned int instanceId;
667 
671  unsigned int sbtOffset;
672 
675  unsigned int visibilityMask;
676 
678  unsigned int flags;
679 
682 
684  unsigned int pad[2];
685 } OptixInstance;
686 
690 typedef enum OptixBuildFlags
691 {
694 
698 
700 
702 
704 
708 
721 {
727 
731 typedef enum OptixMotionFlags
732 {
737 
742 typedef struct OptixMotionOptions
743 {
746  unsigned short numKeys;
747 
749  unsigned short flags;
750 
752  float timeBegin;
753 
755  float timeEnd;
757 
762 {
764  unsigned int buildFlags;
765 
771 
775 
781 typedef struct OptixAccelBufferSizes
782 {
786 
790 
797 
802 {
805 
809 
813 typedef struct OptixAccelEmitDesc
814 {
817 
821 
826 {
828  unsigned long long info[4];
830 
836 typedef struct OptixStaticTransform
837 {
840 
842  unsigned int pad[2];
843 
845  float transform[12];
846 
849  float invTransform[12];
851 
877 {
880 
883 
885  unsigned int pad[3];
886 
888  float transform[2][12];
890 
917 typedef struct OptixSRTData
918 {
921  float sx, a, b, pvx, sy, c, pvy, sz, pvz, qx, qy, qz, qw, tx, ty, tz;
923 } OptixSRTData;
924 
925 // TODO Define a static assert for C/pre-C++-11
926 #if defined( __cplusplus ) && __cplusplus >= 201103L
927 static_assert( sizeof( OptixSRTData ) == 16 * 4, "OptixSRTData has wrong size" );
928 #endif
929 
955 {
958 
961 
963  unsigned int pad[3];
964 
968 
969 // TODO Define a static assert for C/pre-C++-11
970 #if defined( __cplusplus ) && __cplusplus >= 201103L
971 static_assert( sizeof( OptixSRTMotionTransform ) == 8 + 12 + 12 + 2 * 16 * 4, "OptixSRTMotionTransform has wrong size" );
972 #endif
973 
978 {
986 
990 typedef enum OptixPixelFormat
991 {
999 
1003 typedef struct OptixImage2D
1004 {
1008  unsigned int width;
1010  unsigned int height;
1012  unsigned int rowStrideInBytes;
1015  unsigned int pixelStrideInBytes;
1018 } OptixImage2D;
1019 
1027 {
1032 
1037 {
1041 
1044 
1048 
1052 typedef struct OptixDenoiserOptions
1053 {
1057 
1061 typedef struct OptixDenoiserParams
1062 {
1063  unsigned int denoiseAlpha;
1067 
1071 typedef struct OptixDenoiserSizes
1072 {
1078 
1083 typedef enum OptixRayFlags
1084 {
1087 
1093 
1099 
1103 
1106 
1112 
1118 
1125 
1132 } OptixRayFlags;
1133 
1140 {
1147 
1151 {
1155 
1160 
1167 
1172 {
1184 
1189 {
1199 
1204 {
1208 
1211 
1215 
1218 {
1222 
1226 
1230 
1234 
1239 
1242 {
1246 
1254 {
1258  const char* entryFunctionName;
1260 
1267 {
1271  const char* entryFunctionNameCH;
1275  const char* entryFunctionNameAH;
1279  const char* entryFunctionNameIS;
1281 
1288 {
1292  const char* entryFunctionNameDC;
1296  const char* entryFunctionNameCC;
1298 
1301 {
1304 
1306  unsigned int flags;
1307 
1308  union
1309  {
1320  };
1322 
1327 {
1331 
1334 {
1338 
1342 
1348 
1355 
1361 
1366  // sbt-index (See optixGetExceptionInvalidSbtOffset),
1367  // sbt-instance-offset (See OptixInstance::sbtOffset),
1379 
1383 
1389 
1396 
1399 
1401  // (see OptixTraversableGraphFlags::OPTIX_TRAVERSABLE_GRAPH_FLAG_ALLOW_SINGLE_GAS).
1408 
1413 {
1416 
1419 
1422 
1426 
1430 
1437 {
1440 
1443 
1446 
1450 
1452  unsigned int exceptionFlags;
1453 
1458 
1463 
1468 {
1471  unsigned int maxTraceDepth;
1472 
1476 
1481 {
1485 
1489 
1495  unsigned int missRecordCount;
1497 
1503  unsigned int hitgroupRecordCount;
1505 
1512  unsigned int callablesRecordCount;
1514 
1516 
1520 typedef struct OptixStackSizes
1521 {
1523  unsigned int cssRG;
1525  unsigned int cssMS;
1527  unsigned int cssCH;
1529  unsigned int cssAH;
1531  unsigned int cssIS;
1533  unsigned int cssCC;
1535  unsigned int dssDC;
1536 
1537 } OptixStackSizes;
1538 
1541 {
1544 
1546 
1549  unsigned int numOptions,
1550  OptixQueryFunctionTableOptions* /*optionKeys*/,
1551  const void** /*optionValues*/,
1552  void* functionTable,
1553  size_t sizeOfTable );
1554 
1560 {
1564 
1565 #if defined( __CUDACC__ )
1566 typedef struct OptixInvalidRayExceptionDetails
1571 {
1572  float3 origin;
1573  float3 direction;
1574  float tmin;
1575  float tmax;
1576  float time;
1577 } OptixInvalidRayExceptionDetails;
1578 
1585 typedef struct OptixParameterMismatchExceptionDetails
1586 {
1588  unsigned int expectedParameterCount;
1590  unsigned int passedArgumentCount;
1592  unsigned int sbtIndex;
1594  char* callableName;
1595 } OptixParameterMismatchExceptionDetails;
1596 #endif
1597 
1598  // end group optix_types
1600 
1601 #endif // __optix_optix_7_types_h__
1602