MCPcopy Create free account
hub / github.com/NVIDIA-RTX/NRI / ValidateBufferUploadDesc

Function ValidateBufferUploadDesc

Source/Validation/ImplVal.cpp:691–706  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

689}
690
691static bool ValidateBufferUploadDesc(DeviceVal& device, uint32_t i, const BufferUploadDesc& bufferUploadDesc) {
692 if (bufferUploadDesc.dataSize == 0) {
693 REPORT_WARNING(&device, "'bufferUploadDescs[%u].dataSize' is 0 (nothing to upload)", i);
694 return true;
695 }
696
697 const BufferVal& bufferVal = *(BufferVal*)bufferUploadDesc.buffer;
698 const uint64_t rangeEnd = bufferUploadDesc.bufferOffset + bufferUploadDesc.dataSize;
699
700 RETURN_ON_FAILURE(&device, bufferUploadDesc.buffer != nullptr, false, "'bufferUploadDescs[%u].buffer' is invalid", i);
701 RETURN_ON_FAILURE(&device, bufferUploadDesc.data != nullptr, false, "'bufferUploadDescs[%u].data' is invalid", i);
702 RETURN_ON_FAILURE(&device, bufferVal.IsBoundToMemory(), false, "'bufferUploadDescs[%u].buffer' is not bound to memory", i);
703 RETURN_ON_FAILURE(&device, rangeEnd <= bufferVal.GetDesc().size, false, "'bufferUploadDescs[%u].bufferOffset + bufferUploadDescs[%u].dataSize' is out of bounds", i, i);
704
705 return true;
706}
707
708static Result NRI_CALL UploadData(Queue& queue, const TextureUploadDesc* textureUploadDescs, uint32_t textureUploadDescNum, const BufferUploadDesc* bufferUploadDescs, uint32_t bufferUploadDescNum) {
709 QueueVal& queueVal = (QueueVal&)queue;

Callers 1

UploadDataFunction · 0.85

Calls 1

IsBoundToMemoryMethod · 0.45

Tested by

no test coverage detected