Lines Matching refs:mtl

37 gl::ImageIndex GetZeroLevelIndex(const mtl::TextureRef &image)
60 gl::ImageIndex GetCubeOrArraySliceMipIndex(const mtl::TextureRef &image,
89 gl::ImageIndex GetLayerMipIndex(const mtl::TextureRef &image, uint32_t layer, uint32_t level)
247 mtl::BufferRef *bufferOut)
252 mtl::BufferRef stagingBuffer;
253 ANGLE_TRY(mtl::Buffer::MakeBuffer(contextMtl, stagingBufferSize, nullptr, &stagingBuffer));
274 const mtl::MipmapNativeLevel &mipmapLevel,
279 const mtl::TextureRef &texture)
293 mtl::BufferRef stagingBuffer;
300 mtl::BlitCommandEncoder *encoder = contextMtl->getBlitCommandEncoder();
313 const mtl::MipmapNativeLevel &mipmapLevel,
318 const mtl::TextureRef &texture)
356 mtl::BufferRef stagingDepthbuffer, stagingStencilBuffer;
370 mtl::BlitCommandEncoder *encoder = contextMtl->getBlitCommandEncoder();
385 const mtl::MipmapNativeLevel &mipmapLevel,
390 const mtl::TextureRef &texture)
393 ContextMtl *contextMtl = mtl::GetImpl(context);
427 const mtl::Format &format,
523 for (mtl::TextureRef &view : mNativeLevelViews)
531 mFormat = mtl::Format();
543 ContextMtl *contextMtl = mtl::GetImpl(context);
563 ContextMtl *contextMtl = mtl::GetImpl(context);
575 ANGLE_TRY(mtl::Texture::Make2DTexture(
582 ANGLE_TRY(mtl::Texture::MakeCubeTexture(
588 ANGLE_TRY(mtl::Texture::Make3DTexture(
595 ANGLE_TRY(mtl::Texture::Make2DArrayTexture(
607 mtl::BlitCommandEncoder *encoder = nullptr;
610 for (mtl::MipmapNativeLevel actualMip = mtl::kZeroNativeMipLevel; actualMip.get() < mips;
613 GLuint imageMipLevel = mtl::GetGLMipLevel(actualMip, mState.getEffectiveBaseLevel());
614 mtl::TextureRef &imageToTransfer = mTexImageDefs[face][imageMipLevel].image;
626 encoder->copyTexture(imageToTransfer, 0, mtl::kZeroNativeMipLevel, mNativeTexture,
649 ContextMtl *contextMtl = mtl::GetImpl(context);
652 mtl::SamplerDesc samplerDesc(mState.getSamplerState());
688 ContextMtl *contextMtl = mtl::GetImpl(context);
703 mtl::TextureRef &image = getImage(index);
717 for (mtl::MipmapNativeLevel mip = mtl::kZeroNativeMipLevel;
726 mTexImageDefs[0][mtl::GetGLMipLevel(mip, baseLevel)].image)
729 mNativeLevelViews[mip] = mTexImageDefs[0][mtl::GetGLMipLevel(mip, baseLevel)].image;
739 mtl::TextureRef TextureMtl::createImageViewFromNativeTexture(
741 const mtl::MipmapNativeLevel &nativeLevel)
743 mtl::TextureRef image;
786 for (mtl::MipmapNativeLevel mip = mtl::kZeroNativeMipLevel; mip.get() < mips; ++mip)
788 GLuint imageMipLevel = mtl::GetGLMipLevel(mip, mCurrentBaseLevel);
806 mtl::MipmapNativeLevel TextureMtl::getNativeLevel(const gl::ImageIndex &imageIndex) const
809 return mtl::GetNativeMipLevel(imageIndex.getLevelIndex(), baseLevel);
812 mtl::TextureRef &TextureMtl::getImage(const gl::ImageIndex &imageIndex)
833 mtl::MipmapNativeLevel nativeLevel = getNativeLevel(imageIndex);
856 mtl::TextureRef &image = getImage(imageIndex);
862 rtt.set(image, mtl::kZeroNativeMipLevel, 0, mFormat);
866 rtt.set(image, mtl::kZeroNativeMipLevel, layer, mFormat);
947 ContextMtl *contextMtl = mtl::GetImpl(context);
950 const mtl::Format &mtlFormat = contextMtl->getPixelFormat(angleFormatId);
952 FramebufferMtl *srcFramebufferMtl = mtl::GetImpl(source);
984 FramebufferMtl *srcFramebufferMtl = mtl::GetImpl(source);
1007 ContextMtl *contextMtl = mtl::GetImpl(context);
1010 const mtl::Format &mtlFormat = contextMtl->getPixelFormat(angleFormatId);
1050 ContextMtl *contextMtl = mtl::GetImpl(context);
1054 const mtl::Format &mtlFormat = contextMtl->getPixelFormat(angleFormatId);
1092 ContextMtl *contextMtl = mtl::GetImpl(context);
1094 ImageMtl *imageMtl = mtl::GetImpl(image);
1131 ContextMtl *contextMtl = mtl::GetImpl(context);
1137 const mtl::FormatCaps &caps = mFormat.getCaps();
1155 mtl::BlitCommandEncoder *blitEncoder = contextMtl->getBlitCommandEncoder();
1170 ContextMtl *contextMtl = mtl::GetImpl(context);
1177 mtl::MipmapNativeLevel maxMipLevel =
1178 mtl::GetNativeMipLevel(mNativeTexture->mipmapLevels() - 1, 0);
1179 const mtl::MipmapNativeLevel firstLevel = mtl::kZeroNativeMipLevel;
1197 for (mtl::MipmapNativeLevel mip = firstLevel + 1; mip <= maxMipLevel; ++mip)
1253 ContextMtl *contextMtl = mtl::GetImpl(context);
1273 ContextMtl *contextMtl = mtl::GetImpl(context);
1285 ContextMtl *contextMtl = mtl::GetImpl(context);
1335 mtl::RenderCommandEncoder *cmdEncoder,
1350 ContextMtl *contextMtl = mtl::GetImpl(context);
1359 mtl::GetTextureSwizzle(OverrideSwizzleValue(
1361 mtl::GetTextureSwizzle(OverrideSwizzleValue(
1363 mtl::GetTextureSwizzle(OverrideSwizzleValue(
1365 mtl::GetTextureSwizzle(OverrideSwizzleValue(
1385 SamplerMtl *samplerMtl = mtl::GetImpl(sampler);
1386 samplerState = samplerMtl->getSampler(mtl::GetImpl(context));
1402 const mtl::Format &mtlFormat,
1409 mtl::MipmapNativeLevel nativeLevel = getNativeLevel(index);
1413 bool typeChanged = mNativeTexture->textureType() != mtl::GetTextureType(index.getType());
1427 ContextMtl *contextMtl = mtl::GetImpl(context);
1437 mtl::GetTextureType(GetTextureImageType(index.getType())) &&
1448 ANGLE_TRY(mtl::Texture::Make2DTexture(
1454 ANGLE_TRY(mtl::Texture::Make3DTexture(
1460 ANGLE_TRY(mtl::Texture::Make2DArrayTexture(
1483 const mtl::Format &mtlFormat,
1489 ContextMtl *contextMtl = mtl::GetImpl(context);
1511 ContextMtl *contextMtl = mtl::GetImpl(context);
1514 const mtl::Format &mtlFormat = contextMtl->getPixelFormat(angleFormatId);
1552 ContextMtl *contextMtl = mtl::GetImpl(context);
1555 mtl::TextureRef &image = getImage(index);
1636 const mtl::TextureRef &image)
1648 ContextMtl *contextMtl = mtl::GetImpl(context);
1666 BufferMtl *unpackBufferMtl = mtl::GetImpl(unpackBuffer);
1675 mtl::kZeroNativeMipLevel, slice, clientData,
1681 mtl::BlitCommandEncoder *blitEncoder = contextMtl->getBlitCommandEncoder();
1684 mtlArea.size, image, slice, mtl::kZeroNativeMipLevel, mtlArea.origin,
1685 mFormat.isPVRTC() ? mtl::kBlitOptionRowLinearPVRTC : MTLBlitOptionNone);
1692 mtl::kZeroNativeMipLevel, slice, pixels, pixelsRowPitch,
1708 const mtl::TextureRef &image)
1712 ContextMtl *contextMtl = mtl::GetImpl(context);
1722 BufferMtl *unpackBufferMtl = mtl::GetImpl(unpackBuffer);
1736 mtl::CopyPixelsFromBufferParams params;
1742 params.textureArea = mtl::MTLRegionToGLBox(mtlArea);
1750 // For mtl::RenderUtils we convert to OpenGL convention: z layer is used as either array
1787 context, dstFormat, mtlArea, mtl::kZeroNativeMipLevel, slice,
1797 mtl::kZeroNativeMipLevel, slice, pixels,
1842 mtl::kZeroNativeMipLevel, slice,
1853 const mtl::Format &mtlFormat,
1854 const mtl::TextureRef &texture)
1856 bool emulatedChannels = mtl::IsFormatEmulated(mtlFormat);
1869 auto index = mtl::ImageNativeIndex::FromBaseZeroGLIndex(
1872 ANGLE_TRY(mtl::InitializeTextureContents(context, texture, mtlFormat, index));
1918 ContextMtl *contextMtl = mtl::GetImpl(context);
1920 const mtl::TextureRef &image = imageDef.image;
1921 const mtl::Format &format = contextMtl->getPixelFormat(imageDef.formatID);
1927 return mtl::InitializeTextureContents(
1929 mtl::ImageNativeIndex::FromBaseZeroGLIndex(
1982 ContextMtl *contextMtl = mtl::GetImpl(context);
1987 mtl::RenderCommandEncoder *cmdEncoder = contextMtl->getRenderTargetCommandEncoder(imageRtt);
1988 mtl::ColorBlitParams blitParams;
2016 mtl::TextureRef &image = getImage(index);
2019 ContextMtl *contextMtl = mtl::GetImpl(context);
2062 ANGLE_TRY(UploadTextureContents(context, dstFormat, mtlDstRowArea, mtl::kZeroNativeMipLevel,
2085 ContextMtl *contextMtl = mtl::GetImpl(context);
2086 TextureMtl *sourceMtl = mtl::GetImpl(source);
2093 const mtl::TextureRef &sourceImage = srcImageDef.image;
2094 const mtl::Format &sourceFormat = contextMtl->getPixelFormat(srcImageDef.formatID);
2100 mtl::kZeroNativeMipLevel, sourceBox, sourceAngleFormat,
2105 context, index, destOffset, internalFormat, mtl::kZeroNativeMipLevel, sourceBox,
2113 const mtl::MipmapNativeLevel &sourceNativeLevel,
2119 const mtl::TextureRef &sourceTexture)
2121 ContextMtl *contextMtl = mtl::GetImpl(context);
2124 mtl::TextureRef image = getImage(index);
2132 mtl::RenderCommandEncoder *cmdEncoder = contextMtl->getTextureRenderCommandEncoder(
2133 image, mtl::ImageNativeIndex::FromBaseZeroGLIndex(GetZeroLevelIndex(image)));
2134 mtl::ColorBlitParams blitParams;
2161 const mtl::MipmapNativeLevel &sourceNativeLevel,
2167 const mtl::TextureRef &sourceTexture)
2169 mtl::TextureRef &image = getImage(index);
2172 ContextMtl *contextMtl = mtl::GetImpl(context);
2201 ANGLE_TRY(UploadTextureContents(context, dstAngleFormat, mtlDstArea, mtl::kZeroNativeMipLevel,