| 2128 | if (!validateClusterOperationParams(params)) |
| 2129 | { |
| 2130 | return rt::cluster::OperationSizeInfo{}; |
| 2131 | } |
| 2132 | |
| 2133 | return m_Device->getClusterOperationSizeInfo(params); |
| 2134 | } |
| 2135 | |
| 2136 | bool DeviceWrapper::bindAccelStructMemory(rt::IAccelStruct* as, IHeap* heap, uint64_t offset) |
| 2137 | { |
| 2138 | if (as == nullptr) |
| 2139 | { |
| 2140 | error("bindAccelStructMemory: texture is NULL"); |
| 2141 | return false; |
| 2142 | } |
| 2143 | |
| 2144 | if (heap == nullptr) |
| 2145 | { |
| 2146 | error("bindAccelStructMemory: heap is NULL"); |
| 2147 | return false; |
| 2148 | } |
| 2149 | |
| 2150 | AccelStructWrapper* wrapper = dynamic_cast<AccelStructWrapper*>(as); |
| 2151 | if (wrapper) |
| 2152 | as = wrapper->getUnderlyingObject(); |
| 2153 | |
| 2154 | const HeapDesc& heapDesc = heap->getDesc(); |
| 2155 | const rt::AccelStructDesc& asDesc = as->getDesc(); |
| 2156 | |
| 2157 | if (!asDesc.isVirtual) |
| 2158 | { |
| 2159 | std::stringstream ss; |
| 2160 | ss << "Cannot perform bindAccelStructMemory on AccelStruct " << utils::DebugNameToString(asDesc.debugName) |
| 2161 | << " because it was created with isVirtual = false"; |
| 2162 | |
| 2163 | error(ss.str()); |
| 2164 | return false; |
| 2165 | } |
| 2166 | |
| 2167 | MemoryRequirements memReq = m_Device->getAccelStructMemoryRequirements(as); |
| 2168 | |
| 2169 | if (offset + memReq.size > heapDesc.capacity) |
| 2170 | { |
| 2171 | std::stringstream ss; |
| 2172 | ss << "AccelStruct " << utils::DebugNameToString(asDesc.debugName) |
| 2173 | << " does not fit into heap " << utils::DebugNameToString(heapDesc.debugName) |
| 2174 | << " at offset " << offset << " because it requires " << memReq.size << " bytes," |
| 2175 | << " and the heap capacity is " << heapDesc.capacity << " bytes"; |
| 2176 | |
| 2177 | error(ss.str()); |
| 2178 | return false; |
| 2179 | } |
| 2180 | |
| 2181 | if (memReq.alignment != 0 && (offset % memReq.alignment) != 0) |
| 2182 | { |
| 2183 | std::stringstream ss; |
| 2184 | ss << "AccelStruct " << utils::DebugNameToString(asDesc.debugName) |
| 2185 | << " is placed in heap " << utils::DebugNameToString(heapDesc.debugName) |
| 2186 | << " at invalid alignment: required alignment to " << memReq.alignment << " bytes," |
| 2187 | << " actual offset is " << offset << " bytes"; |
nothing calls this directly
no test coverage detected