MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/Falcor / allocateStructuredBuffer

Method allocateStructuredBuffer

Source/Falcor/Testing/UnitTest.cpp:692–706  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

690}
691
692void GPUUnitTestContext::allocateStructuredBuffer(const std::string& name, uint32_t nElements, const void* pInitData, size_t initDataSize)
693{
694 FALCOR_CHECK(mpVars != nullptr, "Program vars not created");
695 mStructuredBuffers[name] = mpDevice->createStructuredBuffer(mpVars->getRootVar()[name], nElements);
696 if (pInitData)
697 {
698 ref<Buffer> buffer = mStructuredBuffers[name];
699 size_t expectedDataSize = buffer->getStructSize() * buffer->getElementCount();
700 if (initDataSize == 0)
701 initDataSize = expectedDataSize;
702 else if (initDataSize != expectedDataSize)
703 throw ErrorRunningTestException("StructuredBuffer '" + name + "' initial data size mismatch");
704 buffer->setBlob(pInitData, 0, initDataSize);
705 }
706}
707
708void GPUUnitTestContext::runProgram(const uint3& dimensions)
709{

Callers 15

GPU_TESTFunction · 0.80
testFunction · 0.80
testFunction · 0.80
testEnumFunction · 0.80
GPU_TESTFunction · 0.80
testFunction · 0.80
testFunction · 0.80
GPU_TESTFunction · 0.80
GPU_TESTFunction · 0.80
ShaderString.cppFile · 0.80
GPU_TESTFunction · 0.80

Calls 4

getRootVarMethod · 0.80
setBlobMethod · 0.45

Tested by

no test coverage detected