Helper function to validate the input parameters for NvBlastCreateAsset. See NvBlastCreateAsset for parameter definitions. */
| 51 | Helper function to validate the input parameters for NvBlastCreateAsset. See NvBlastCreateAsset for parameter definitions. |
| 52 | */ |
| 53 | static bool solverAssetBuildValidateInput(void* mem, const NvBlastAssetDesc* desc, void* scratch, NvBlastLog logFn) |
| 54 | { |
| 55 | if (mem == nullptr) |
| 56 | { |
| 57 | NVBLASTLL_LOG_ERROR(logFn, "AssetBuildValidateInput: NULL mem pointer input."); |
| 58 | return false; |
| 59 | } |
| 60 | |
| 61 | if (desc == nullptr) |
| 62 | { |
| 63 | NVBLASTLL_LOG_ERROR(logFn, "AssetBuildValidateInput: NULL desc pointer input."); |
| 64 | return false; |
| 65 | } |
| 66 | |
| 67 | if (desc->chunkCount == 0) |
| 68 | { |
| 69 | NVBLASTLL_LOG_ERROR(logFn, "AssetBuildValidateInput: Zero chunk count not allowed."); |
| 70 | return false; |
| 71 | } |
| 72 | |
| 73 | if (desc->chunkDescs == nullptr) |
| 74 | { |
| 75 | NVBLASTLL_LOG_ERROR(logFn, "AssetBuildValidateInput: NULL chunkDescs pointer input."); |
| 76 | return false; |
| 77 | } |
| 78 | |
| 79 | if (desc->bondCount != 0 && desc->bondDescs == nullptr) |
| 80 | { |
| 81 | NVBLASTLL_LOG_ERROR(logFn, "AssetBuildValidateInput: bondCount non-zero but NULL bondDescs pointer input."); |
| 82 | return false; |
| 83 | } |
| 84 | |
| 85 | if (scratch == nullptr) |
| 86 | { |
| 87 | NVBLASTLL_LOG_ERROR(logFn, "AssetBuildValidateInput: NULL scratch pointer input."); |
| 88 | return false; |
| 89 | } |
| 90 | |
| 91 | return true; |
| 92 | } |
| 93 | |
| 94 | |
| 95 | struct AssetDataOffsets |