* Add a hit group. * A hit group consists of any combination of closest hit, any hit, and intersection shaders. * Note that a hit group that contains an intersection shader only be used with procedural geometry. * A hit group that does not contain an intersection shader can only be used with triangle geometry. * It is valid to create a hit group entirely without entry points. G
| 494 | * @return Shader ID for hit group. This is used when building the binding table. |
| 495 | */ |
| 496 | ShaderID addHitGroup( |
| 497 | const std::string& closestHit, |
| 498 | const std::string& anyHit = "", |
| 499 | const std::string& intersection = "", |
| 500 | const TypeConformanceList& typeConformances_ = TypeConformanceList(), |
| 501 | const std::string& entryPointNameSuffix = "" |
| 502 | ) |
| 503 | { |
| 504 | FALCOR_CHECK( |
| 505 | !(closestHit.empty() && anyHit.empty() && intersection.empty()), |
| 506 | "At least one of 'closestHit', 'anyHit' or 'intersection' entry point names must not be empty" |
| 507 | ); |
| 508 | |
| 509 | auto& group = addEntryPointGroup(); |
| 510 | group.setTypeConformances(typeConformances_); |
| 511 | if (!closestHit.empty()) |
| 512 | group.addEntryPoint(ShaderType::ClosestHit, closestHit, closestHit + entryPointNameSuffix); |
| 513 | if (!anyHit.empty()) |
| 514 | group.addEntryPoint(ShaderType::AnyHit, anyHit, anyHit + entryPointNameSuffix); |
| 515 | if (!intersection.empty()) |
| 516 | group.addEntryPoint(ShaderType::Intersection, intersection, intersection + entryPointNameSuffix); |
| 517 | |
| 518 | return ShaderID{int32_t(entryPointGroups.size() - 1)}; |
| 519 | } |
| 520 | |
| 521 | /** |
| 522 | * Set the max recursion depth. |