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

Method getSubresourceBlob

Source/Falcor/Core/API/Texture.cpp:573–584  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

571}
572
573void Texture::getSubresourceBlob(uint32_t subresource, void* pData, size_t size) const
574{
575 FALCOR_CHECK(subresource < getSubresourceCount(), "'subresource' ({}) is out of range ({})", subresource, getSubresourceCount());
576 SubresourceLayout layout = getSubresourceLayout(subresource);
577 FALCOR_CHECK(
578 size == layout.getTotalByteSize(), "'size' ({}) does not match the subresource size ({})", size, layout.getTotalByteSize()
579 );
580
581 auto data = mpDevice->getRenderContext()->readTextureSubresource(this, subresource);
582 FALCOR_ASSERT(data.size() == size);
583 std::memcpy(pData, data.data(), data.size());
584}
585
586void Texture::captureToFile(
587 uint32_t mipLevel,

Callers 1

texture_to_numpyFunction · 0.80

Calls 5

getSubresourceCountFunction · 0.85
getTotalByteSizeMethod · 0.80
sizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected