MCPcopy Create free account
hub / github.com/alibaba/Taobao3D / GetOrCreateRTForVisionOS

Method GetOrCreateRTForVisionOS

HRM2Avatar/src/graphics/Graphics.cpp:402–416  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

400}
401
402MTL::Texture* Graphics::GetOrCreateRTForVisionOS(MTL::Texture* texture)
403{
404 assert(texture != nullptr);
405 if (m_pRenderTarget == nullptr)
406 {
407 MTL::TextureDescriptor* pTextureDesc = MTL::TextureDescriptor::texture2DDescriptor(MTL::PixelFormatRGBA16Float, texture->width(), texture->height(), false);
408 pTextureDesc->setResourceOptions(MTL::ResourceStorageModePrivate);
409 pTextureDesc->setUsage(MTL::TextureUsageRenderTarget | MTL::TextureUsageShaderRead);
410 pTextureDesc->setTextureType(texture->textureType());
411 pTextureDesc->setArrayLength(texture->arrayLength());
412 m_pRenderTarget = m_pDevice->newTexture(pTextureDesc);
413 m_pRenderTarget->setLabel(NS::String::string("VisionOS RT", NS::StringEncoding::UTF8StringEncoding));
414 }
415 return m_pRenderTarget;
416}
417
418MTL::SamplerState* Graphics::GetOrCreateNearestSamplerState()
419{

Callers

nothing calls this directly

Calls 10

widthMethod · 0.80
heightMethod · 0.80
setResourceOptionsMethod · 0.45
setUsageMethod · 0.45
setTextureTypeMethod · 0.45
textureTypeMethod · 0.45
setArrayLengthMethod · 0.45
arrayLengthMethod · 0.45
newTextureMethod · 0.45
setLabelMethod · 0.45

Tested by

no test coverage detected