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

Method OnPrepareResources

trinity/Tr2SuballocatedBuffer.cpp:103–121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

101}
102
103bool Tr2SuballocatedBuffer::OnPrepareResources()
104{
105 if( m_buffer.IsValid() )
106 {
107 return true;
108 }
109
110 USE_MAIN_THREAD_RENDER_CONTEXT();
111
112 uint32_t bufferSize = static_cast<uint32_t>( m_allocator.GetCurrentSize() );
113
114 Tr2BufferAL buffer;
115 Tr2BufferDescriptionAL desc( 4, bufferSize / 4, m_gpuUsage, Tr2CpuUsage::READ | Tr2CpuUsage::WRITE );
116 buffer.Create( desc, nullptr, renderContext );
117
118 m_buffer = buffer;
119
120 return true;
121}
122
123ALResult Tr2SuballocatedBuffer::Expand()
124{

Callers

nothing calls this directly

Calls 3

GetCurrentSizeMethod · 0.80
IsValidMethod · 0.45
CreateMethod · 0.45

Tested by

no test coverage detected