Conversation
… mike-numba-triangle
examples/numba_support.py
Outdated
| OPTIX_RAY_FLAG_NONE = 0 | ||
| # class OptixRayFlags(Enum): | ||
| # OPTIX_RAY_FLAG_NONE = 0 | ||
| # OPTIX_RAY_FLAG_DISABLE_ANYHIT = 1 << 0 | ||
| # OPTIX_RAY_FLAG_ENFORCE_ANYHIT = 1 << 1 | ||
| # OPTIX_RAY_FLAG_TERMINATE_ON_FIRST_HIT = 1 << 2 | ||
| # OPTIX_RAY_FLAG_DISABLE_CLOSESTHIT = 1 << 3, | ||
| # OPTIX_RAY_FLAG_CULL_BACK_FACING_TRIANGLES = 1 << 4 | ||
| # OPTIX_RAY_FLAG_CULL_FRONT_FACING_TRIANGLES = 1 << 5 | ||
| # OPTIX_RAY_FLAG_CULL_DISABLED_ANYHIT = 1 << 6 | ||
| # OPTIX_RAY_FLAG_CULL_ENFORCED_ANYHIT = 1 << 7 |
There was a problem hiding this comment.
Using enums inside kernel still needs to be worked on. BTW, there are duplicate "declaration" of this enum in both pybind and numba, I expect there might be many of these duplication down the road. Perhaps we can figure out which ones are only usable in kernel code and avoid double wrapping?
| # Structures as declared in triangle.h | ||
|
|
||
|
|
||
| class ParamsStruct: |
There was a problem hiding this comment.
Params, MissData belong to the user defined code space, ideally we should create some useful helper function that allows user to custom define their structure.
| def lower_miss_data_ctor(context, builder, sig, args): | ||
| # Anyway to err if this ctor is not called inside __miss__* program? |
There was a problem hiding this comment.
I learnt a little bit more that this cast in cpp (from SBTDataPointer to MissData) is possible because there is no RayGenData and HitGroupData. The base of MissData just so happens to be the base of SBTDataPointer.
So this function here is also only specific to the triangle example. Ideally we should have an SBTRecord type based on the layout defined in create_sbt and generates the proper record type based on user's request. (e.g. sbtrecord.get_miss_data() or sbtrecord.get_ray_gen_data() etc.)
…_type x vector_type
Add README and a couple of other small fixes
I moved all numba typing and lowerings to
numba_support.py, in a hope they can be shared and improved when we implement other examples in the future.