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

Method createCubemap

Source/Falcor/Core/API/FBO.cpp:558–591  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

556}
557
558ref<Fbo> Fbo::createCubemap(
559 ref<Device> pDevice,
560 uint32_t width,
561 uint32_t height,
562 const Desc& fboDesc,
563 uint32_t arraySize,
564 uint32_t mipLevels
565)
566{
567 FALCOR_CHECK(width > 0, "'width' must not be zero.");
568 FALCOR_CHECK(height > 0, "'height' must not be zero.");
569 FALCOR_CHECK(arraySize > 0, "'arraySize' must not be zero.");
570 FALCOR_CHECK(mipLevels > 0, "'mipLevels' must not be zero.");
571 FALCOR_CHECK(fboDesc.getSampleCount() == 1, "Cannot create multi-sampled cube map.");
572
573 ref<Fbo> pFbo = create(pDevice);
574
575 // Create the color targets
576 for (uint32_t i = 0; i < getMaxColorTargetCount(); i++)
577 {
578 ResourceBindFlags flags = getBindFlags(false, fboDesc.isColorTargetUav(i));
579 auto pTex = pDevice->createTextureCube(width, height, fboDesc.getColorTargetFormat(i), arraySize, mipLevels, nullptr, flags);
580 pFbo->attachColorTarget(pTex, i, 0, kAttachEntireMipLevel);
581 }
582
583 if (fboDesc.getDepthStencilFormat() != ResourceFormat::Unknown)
584 {
585 ResourceBindFlags flags = getBindFlags(true, fboDesc.isDepthStencilUav());
586 auto pDepth = pDevice->createTextureCube(width, height, fboDesc.getDepthStencilFormat(), arraySize, mipLevels, nullptr, flags);
587 pFbo->attachDepthStencilTarget(pDepth, 0, kAttachEntireMipLevel);
588 }
589
590 return pFbo;
591}
592
593ref<Fbo> Fbo::create2D(ref<Device> pDevice, uint32_t width, uint32_t height, ResourceFormat color, ResourceFormat depth)
594{

Callers

nothing calls this directly

Calls 5

createTextureCubeMethod · 0.80
attachColorTargetMethod · 0.80
createFunction · 0.70
getBindFlagsFunction · 0.70

Tested by

no test coverage detected