| 348 | } |
| 349 | |
| 350 | void Fbo::attachDepthStencilTarget(const ref<Texture>& pDepthStencil, uint32_t mipLevel, uint32_t firstArraySlice, uint32_t arraySize) |
| 351 | { |
| 352 | bool changed = (mDepthStencil.pTexture != pDepthStencil); |
| 353 | changed |= (mDepthStencil.mipLevel != mipLevel); |
| 354 | changed |= (mDepthStencil.firstArraySlice != firstArraySlice); |
| 355 | changed |= (mDepthStencil.arraySize != arraySize); |
| 356 | if (!changed) |
| 357 | return; |
| 358 | |
| 359 | checkAttachArguments(pDepthStencil.get(), mipLevel, firstArraySlice, arraySize, true); |
| 360 | |
| 361 | mpDesc = nullptr; |
| 362 | mDepthStencil.pTexture = pDepthStencil; |
| 363 | mDepthStencil.mipLevel = mipLevel; |
| 364 | mDepthStencil.firstArraySlice = firstArraySlice; |
| 365 | mDepthStencil.arraySize = arraySize; |
| 366 | bool allowUav = false; |
| 367 | if (pDepthStencil) |
| 368 | { |
| 369 | allowUav = ((pDepthStencil->getBindFlags() & ResourceBindFlags::UnorderedAccess) != ResourceBindFlags::None); |
| 370 | } |
| 371 | |
| 372 | mTempDesc.setDepthStencilTarget(pDepthStencil ? pDepthStencil->getFormat() : ResourceFormat::Unknown, allowUav); |
| 373 | applyDepthAttachment(); |
| 374 | } |
| 375 | |
| 376 | void Fbo::attachColorTarget(const ref<Texture>& pTexture, uint32_t rtIndex, uint32_t mipLevel, uint32_t firstArraySlice, uint32_t arraySize) |
| 377 | { |
no test coverage detected