| 556 | } |
| 557 | |
| 558 | ref<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 | |
| 593 | ref<Fbo> Fbo::create2D(ref<Device> pDevice, uint32_t width, uint32_t height, ResourceFormat color, ResourceFormat depth) |
| 594 | { |
nothing calls this directly
no test coverage detected