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

Method ReadBuffer

trinity/Tr2SuballocatedBuffer.cpp:165–177  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

163}
164
165ALResult Tr2SuballocatedBuffer::ReadBuffer( std::unique_ptr<uint8_t[]>& dest, uint32_t offset, uint32_t size, Tr2RenderContextAL& renderContext )
166{
167 const void* data = nullptr;
168 CR_RETURN_HR( m_buffer.MapForReading( data, offset, size, renderContext ) );
169 if( data == nullptr )
170 {
171 return E_FAIL;
172 }
173 dest.reset( new uint8_t[size] );
174 memcpy( dest.get(), data, size );
175 m_buffer.UnmapForReading( renderContext );
176 return S_OK;
177}
178
179const Tr2BufferAL& Tr2SuballocatedBuffer::GetBuffer() const
180{

Callers 1

MapForReadingMethod · 0.80

Calls 4

resetMethod · 0.80
getMethod · 0.80
MapForReadingMethod · 0.45
UnmapForReadingMethod · 0.45

Tested by

no test coverage detected