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

Method getSubresourceLayout

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

Source from the content-addressed store, hash-verified

542}
543
544Texture::SubresourceLayout Texture::getSubresourceLayout(uint32_t subresource) const
545{
546 FALCOR_CHECK(subresource < getSubresourceCount(), "subresource out of range");
547
548 gfx::ITextureResource* gfxTexture = getGfxTextureResource();
549 gfx::FormatInfo gfxFormatInfo;
550 FALCOR_GFX_CALL(gfx::gfxGetFormatInfo(gfxTexture->getDesc()->format, &gfxFormatInfo));
551
552 SubresourceLayout layout;
553 uint32_t mipLevel = getSubresourceMipLevel(subresource);
554 layout.rowSize = div_round_up(getWidth(mipLevel), uint32_t(gfxFormatInfo.blockWidth)) * gfxFormatInfo.blockSizeInBytes;
555 layout.rowSizeAligned = align_to(mpDevice->getTextureRowAlignment(), layout.rowSize);
556 layout.rowCount = div_round_up(getHeight(mipLevel), uint32_t(gfxFormatInfo.blockHeight));
557 layout.depth = getDepth();
558
559 return layout;
560}
561
562void Texture::setSubresourceBlob(uint32_t subresource, const void* pData, size_t size)
563{

Callers 2

texture_to_numpyFunction · 0.80
texture_from_numpyFunction · 0.80

Calls 9

getSubresourceCountFunction · 0.85
getGfxTextureResourceFunction · 0.85
getSubresourceMipLevelFunction · 0.85
div_round_upFunction · 0.85
align_toFunction · 0.85
getWidthFunction · 0.70
getHeightFunction · 0.70
getDepthFunction · 0.70

Tested by

no test coverage detected