| 1948 | if (!omm) |
| 1949 | { |
| 1950 | error("createOpacityMicromap returned nullptr"); |
| 1951 | return nullptr; |
| 1952 | } |
| 1953 | return omm; |
| 1954 | } |
| 1955 | |
| 1956 | rt::AccelStructHandle DeviceWrapper::createAccelStruct(const rt::AccelStructDesc& desc) |
| 1957 | { |
| 1958 | rt::AccelStructHandle as = m_Device->createAccelStruct(desc); |
| 1959 | |
| 1960 | if (!as) |
| 1961 | return nullptr; |
| 1962 | |
| 1963 | if ((desc.buildFlags & rt::AccelStructBuildFlags::AllowCompaction) != 0 && |
| 1964 | desc.isTopLevel) |
| 1965 | { |
| 1966 | std::stringstream ss; |
| 1967 | ss << "Cannot create TLAS " << utils::DebugNameToString(desc.debugName) |
| 1968 | << " with the AllowCompaction flag set: compaction is not supported for TLAS'es"; |
| 1969 | error(ss.str()); |
| 1970 | return nullptr; |
| 1971 | } |
| 1972 | |
| 1973 | if ((desc.buildFlags & rt::AccelStructBuildFlags::AllowUpdate) != 0 && |
| 1974 | (desc.buildFlags & rt::AccelStructBuildFlags::AllowCompaction) != 0) |
| 1975 | { |
| 1976 | std::stringstream ss; |
| 1977 | ss << "Cannot create AccelStruct " << utils::DebugNameToString(desc.debugName) |
| 1978 | << " with incompatible flags: AllowUpdate and AllowCompaction"; |
| 1979 | error(ss.str()); |
| 1980 | return nullptr; |
| 1981 | } |
| 1982 | |
| 1983 | AccelStructWrapper* wrapper = new AccelStructWrapper(as); |
| 1984 | wrapper->isTopLevel = desc.isTopLevel; |
| 1985 | wrapper->allowUpdate = !!(desc.buildFlags & rt::AccelStructBuildFlags::AllowUpdate); |
| 1986 | wrapper->allowCompaction = !!(desc.buildFlags & rt::AccelStructBuildFlags::AllowCompaction); |
| 1987 | wrapper->maxInstances = desc.topLevelMaxInstances; |
nothing calls this directly
no test coverage detected