MCPcopy Create free account
hub / github.com/carbonengine/trinity / GetOpaqueColorMapIfNeeded

Method GetOpaqueColorMapIfNeeded

trinity/Eve/EveSpaceSceneRenderDriver.cpp:702–723  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

700}
701
702Tr2GpuResourcePool::Texture EveSpaceSceneRenderDriver::GetOpaqueColorMapIfNeeded( const TextureSize2D& size, const Span<TempOutput>& outputs )
703{
704 auto namedOutput = FindNamedOutput( outputs, "OpaqueColorMap" );
705 bool needsOpaqueBackBuffer = m_upscalingContext != nullptr || m_settings.antiAliasingQuality >= AntiAliasingQuality::Medium || m_settings.forceOpaqueBuffer || namedOutput;
706 if( !needsOpaqueBackBuffer )
707 {
708 // If there are SSSSS batches, we need an opaque back buffer
709 auto batches = m_scene->m_primaryBatches[TRIBATCHTYPE_OPAQUE];
710 static const auto SSSSS = BlueSharedString( "SSSSS" );
711 needsOpaqueBackBuffer = Tr2RenderContext::TechniqueInBatch( batches->GetGdprBatches(), SSSSS ) || Tr2RenderContext::TechniqueInBatch( batches->GetBatches(), SSSSS );
712 }
713 if( needsOpaqueBackBuffer )
714 {
715 auto texture = m_gpuResourcePool.GetTempTexture( "opaqueBackBuffer", size, m_internalPixelFormat, Tr2GpuUsage::RENDER_TARGET | Tr2GpuUsage::SHADER_RESOURCE );
716 if( namedOutput )
717 {
718 namedOutput->texture = texture;
719 }
720 return texture;
721 }
722 return {};
723}
724
725std::vector<Tr2TextureReferencePtr> EveSpaceSceneRenderDriver::GetAllTempTextures() const
726{

Callers

nothing calls this directly

Calls 3

FindNamedOutputFunction · 0.85
GetTempTextureMethod · 0.80
GetBatchesMethod · 0.45

Tested by

no test coverage detected