19#include "DeviceContext.h"
20#include "ObjectRegistry.h"
25#include "LaunchParams.h"
34 typedef std::shared_ptr<Context> SP;
47 virtual std::string
toString()
const override {
return "owl::Context"; }
53 Context(int32_t *requestedDeviceIDs,
54 int numRequestedDevices);
59 size_t deviceCount()
const {
return getDevices().size(); }
60 const std::vector<DeviceContext::SP> &getDevices()
const {
return devices; }
61 DeviceContext::SP getDevice(
int ID)
const
62 { assert(ID >= 0 && ID < (
int)devices.size());
return devices[ID]; }
76 void setBoundLaunchParamValues(
const std::vector<OWLBoundValueDecl> &boundValues);
119 void setNumAttributeValues(
size_t numAttributeValues);
123 void setNumPayloadValues(
size_t numPayloadValues);
129 void buildSBT(OWLBuildSBTFlags flags);
130 void buildPipeline();
131 void buildPrograms(
bool debug =
false);
134 void buildModules(
bool debug =
false);
148 OWLTextureFilterMode filterMode,
149 OWLTextureAddressMode addressMode,
150 OWLTextureColorSpace colorSpace,
152 uint32_t linePitchInBytes,
219 cudaGraphicsResource_t resource);
227 const std::string &progName,
228 size_t varStructSize,
229 const std::vector<OWLVarDecl> &varDecls);
240 const std::vector<OWLVarDecl> &varDecls);
251 const std::string &progName,
252 size_t varStructSize,
253 const std::vector<OWLVarDecl> &varDecls);
260 void setMissProg(
int rayTypeToSet, MissProg::SP missProgToUse);
265 size_t varStructSize,
266 const std::vector<OWLVarDecl> &varDecls);
321#if OPTIX_VERSION >= 70200
323 std::vector<OptixModuleCompileBoundValueEntry> boundLaunchParamValues;
339 int numAttributeValues = 2;
342 int numPayloadValues = 2;
350 void enablePeerAccess();
351 std::vector<DeviceContext::SP> devices;
void buildMissProgRecordsOn(const DeviceContext::SP &device)
Definition: Context.cpp:446
RangeAllocator sbtRangeAllocator
Definition: Context.h:302
MissProg::SP createMissProg(const std::shared_ptr< MissProgType > &type)
Definition: Context.cpp:225
bool motionBlurEnabled
Definition: Context.h:328
void enableMotionBlur()
Definition: Context.cpp:613
std::vector< MissProg::SP > missProgPerRayType
Definition: Context.h:305
GeomGroup::SP userGeomGroupCreate(size_t numChildren, unsigned int buildFlags)
Definition: Context.cpp:311
void disablePerGeometrySBTRecords()
Definition: Context.cpp:618
LaunchParamsType::SP createLaunchParamsType(size_t varStructSize, const std::vector< OWLVarDecl > &varDecls)
Definition: Context.cpp:267
void enableSpheres()
Definition: Context.cpp:628
int maxInstancingDepth
Definition: Context.h:309
Buffer::SP hostPinnedBufferCreate(OWLDataType type, size_t count)
Definition: Context.cpp:132
GeomGroup::SP trianglesGeomGroupCreate(size_t numChildren, unsigned int buildFlags)
Definition: Context.cpp:295
void setMaxInstancingDepth(int32_t maxInstanceDepth)
Definition: Context.cpp:596
GeomType::SP createGeomType(OWLGeomKind kind, size_t varStructSize, const std::vector< OWLVarDecl > &varDecls)
Definition: Context.cpp:328
static bool logging()
Definition: Context.h:37
virtual ~Context()
Definition: Context.cpp:72
void setMissProg(int rayTypeToSet, MissProg::SP missProgToUse)
Definition: Context.cpp:243
void destroyPrograms()
Definition: Context.cpp:672
bool perGeometrySBTRecordsDisabled
Definition: Context.h:316
RayGenType::SP createRayGenType(Module::SP module, const std::string &progName, size_t varStructSize, const std::vector< OWLVarDecl > &varDecls)
Definition: Context.cpp:252
Buffer::SP graphicsBufferCreate(OWLDataType type, size_t count, cudaGraphicsResource_t resource)
Definition: Context.cpp:194
Texture::SP texture2DCreate(OWLTexelFormat texelFormat, OWLTextureFilterMode filterMode, OWLTextureAddressMode addressMode, OWLTextureColorSpace colorSpace, const vec2i size, uint32_t linePitchInBytes, const void *texels)
Definition: Context.cpp:176
void enableCurves()
Definition: Context.cpp:623
void buildHitGroupRecordsOn(const DeviceContext::SP &device)
Definition: Context.cpp:369
Buffer::SP deviceBufferCreate(OWLDataType type, size_t count, const void *init)
Definition: Context.cpp:161
MissProgType::SP createMissProgType(Module::SP module, const std::string &progName, size_t varStructSize, const std::vector< OWLVarDecl > &varDecls)
Definition: Context.cpp:280
Module::SP createModule(const std::string &ptxCode)
Definition: Context.cpp:353
int numRayTypes
Definition: Context.h:319
Buffer::SP managedMemoryBufferCreate(OWLDataType type, size_t count, const void *init)
Definition: Context.cpp:146
GeomGroup::SP curvesGeomGroupCreate(size_t numChildren, unsigned int buildFlags)
Definition: Context.cpp:303
LaunchParams::SP dummyLaunchParams
Definition: Context.h:347
RayGen::SP createRayGen(const std::shared_ptr< RayGenType > &type)
Definition: Context.cpp:209
virtual std::string toString() const override
Definition: Context.h:47
GeomGroup::SP sphereGeomGroupCreate(size_t numChildren, unsigned int buildFlags)
Definition: Context.cpp:319
void buildRayGenRecordsOn(const DeviceContext::SP &device)
Definition: Context.cpp:493
void destroyModules()
Definition: Context.cpp:662
LaunchParams::SP createLaunchParams(const std::shared_ptr< LaunchParamsType > &type)
Definition: Context.cpp:217
bool spheresEnabled
Definition: Context.h:336
bool curvesEnabled
Definition: Context.h:332
ObjectRegistryT< Buffer > buffers
Definition: Context.h:283
void setRayTypeCount(size_t rayTypeCount)
Definition: Context.cpp:555
Definition: ObjectRegistry.h:64
Definition: DeviceContext.h:30