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

Method CopySubresourceRegion

trinityal/stub/Tr2TextureALStub.cpp:263–292  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

261}
262
263ALResult Tr2TextureAL::CopySubresourceRegion( const Tr2TextureSubresource& destSubresource, Tr2TextureAL& source, const Tr2TextureSubresource& sourceSubresource, Tr2RenderContextAL& renderContext )
264{
265 if( !IsValid() || !renderContext.IsValid() )
266 {
267 return E_INVALIDCALL;
268 }
269 if( !source.IsValid() )
270 {
271 return E_INVALIDARG;
272 }
273 if( !HasFlag( m_cpuUsage, Tr2CpuUsage::WRITE ) && !IsWritable( m_gpuUsage ) )
274 {
275 return E_INVALIDCALL;
276 }
277
278 if( destSubresource.IsSubresourceFull( m_desc ) && sourceSubresource.IsSubresourceFull( source.m_desc ) )
279 {
280 return S_OK;
281 }
282
283 Tr2TextureSubresource src = sourceSubresource;
284 Tr2TextureSubresource dst = destSubresource;
285
286 if( !Crop( src, source.m_desc, dst, m_desc ) )
287 {
288 return E_FAIL;
289 }
290
291 return S_OK;
292}
293
294ALResult Tr2TextureAL::GenerateMipMaps( Tr2RenderContextAL& )
295{

Callers 1

ResolveMethod · 0.45

Calls 6

IsWritableFunction · 0.85
CropFunction · 0.85
IsSubresourceFullMethod · 0.80
HasFlagFunction · 0.70
IsValidFunction · 0.50
IsValidMethod · 0.45

Tested by

no test coverage detected