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

Method OnPrepareResources

trinity/Tr2DepthStencil.cpp:186–202  ·  view source on GitHub ↗

--------------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

184
185// --------------------------------------------------------------------------------------
186bool Tr2DepthStencil::OnPrepareResources()
187{
188 if( !m_depthStencil.IsValid() && m_width != 0 )
189 {
190 USE_MAIN_THREAD_RENDER_CONTEXT();
191
192 auto gpuUsage = Tr2GpuUsage::DEPTH_STENCIL | Tr2GpuUsage::SHADER_RESOURCE;
193 if( ( m_flags & Tr2RenderContextEnum::EX_CREATE_SHARED ) != 0 )
194 {
195 gpuUsage |= Tr2GpuUsage::SHARED;
196 }
197
198 m_depthStencil.Create( Tr2BitmapDimensions( m_width, m_height, 1, Tr2RenderContextEnum::ConvertDepthStencilFormat( m_format ) ), m_msaa, gpuUsage, renderContext );
199 m_onTextureChange();
200 }
201 return true;
202}

Callers

nothing calls this directly

Calls 2

IsValidMethod · 0.45
CreateMethod · 0.45

Tested by

no test coverage detected