---------------------------------------------------------------------
| 668 | } |
| 669 | //--------------------------------------------------------------------- |
| 670 | TextureGpu *RenderSystem::createDepthBufferFor( TextureGpu *colourTexture, bool preferDepthTexture, |
| 671 | PixelFormatGpu depthBufferFormat, uint16 poolId ) |
| 672 | { |
| 673 | uint32 textureFlags = TextureFlags::RenderToTexture; |
| 674 | |
| 675 | if( !preferDepthTexture ) |
| 676 | textureFlags |= TextureFlags::NotTexture | TextureFlags::DiscardableContent; |
| 677 | |
| 678 | char tmpBuffer[64]; |
| 679 | LwString depthBufferName( LwString::FromEmptyPointer( tmpBuffer, sizeof( tmpBuffer ) ) ); |
| 680 | depthBufferName.a( "DepthBuffer_", Id::generateNewId<TextureGpu>() ); |
| 681 | |
| 682 | TextureGpu *retVal = mTextureGpuManager->createTexture( |
| 683 | depthBufferName.c_str(), GpuPageOutStrategy::Discard, textureFlags, TextureTypes::Type2D ); |
| 684 | retVal->setResolution( colourTexture->getInternalWidth(), colourTexture->getInternalHeight() ); |
| 685 | retVal->setPixelFormat( depthBufferFormat ); |
| 686 | retVal->_setDepthBufferDefaults( poolId, preferDepthTexture, depthBufferFormat ); |
| 687 | retVal->_setSourceType( TextureSourceType::SharedDepthBuffer ); |
| 688 | retVal->setSampleDescription( colourTexture->getRequestedSampleDescription() ); |
| 689 | |
| 690 | retVal->_transitionTo( GpuResidency::Resident, (uint8 *)0 ); |
| 691 | |
| 692 | // Start reference count on the depth buffer here |
| 693 | mSharedDepthBufferRefs[retVal] = 1u; |
| 694 | return retVal; |
| 695 | } |
| 696 | //--------------------------------------------------------------------- |
| 697 | TextureGpu *RenderSystem::getDepthBufferFor( TextureGpu *colourTexture, uint16 poolId, |
| 698 | bool preferDepthTexture, |
nothing calls this directly
no test coverage detected