| 148 | nvrhi::BindingSetItem& descriptor = m_Descriptors[index]; |
| 149 | |
| 150 | if (descriptor.resourceHandle) |
| 151 | descriptor.resourceHandle->Release(); |
| 152 | |
| 153 | // Erase the existing descriptor from the index map to prevent its "reuse" later |
| 154 | const auto indexMapEntry = m_DescriptorIndexMap.find(m_Descriptors[index]); |
| 155 | if (indexMapEntry != m_DescriptorIndexMap.end()) |
| 156 | m_DescriptorIndexMap.erase(indexMapEntry); |
| 157 | |
| 158 | descriptor = nvrhi::BindingSetItem::None(index); |
| 159 | |
| 160 | m_Device->writeDescriptorTable(m_DescriptorTable, descriptor); |
| 161 | |
| 162 | m_AllocatedDescriptors[index] = false; |
| 163 | m_SearchStart = std::min(m_SearchStart, index); |