| 400 | } |
| 401 | |
| 402 | MTL::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 | |
| 418 | MTL::SamplerState* Graphics::GetOrCreateNearestSamplerState() |
| 419 | { |
nothing calls this directly
no test coverage detected