Lines Matching defs:format
277 // make sure this table is updated if format table is updated
316 // make sure this table is updated if format table is updated
354 // make sure this table is updated if format table is updated
397 // make sure this table is updated if format table is updated
488 // make sure this table is updated if format table is updated
636 bool isValid (TextureFormat format)
638 const bool isColor = isColorOrder(format.order);
640 switch (format.type)
651 return isColor || format.order == TextureFormat::D;
655 return format.order == TextureFormat::RG;
660 return format.order == TextureFormat::RGB || format.order == TextureFormat::BGR;
666 return format.order == TextureFormat::RGBA || format.order == TextureFormat::BGRA
667 || format.order == TextureFormat::ARGB || format.order == TextureFormat::ABGR;
670 return format.order == TextureFormat::ARGB || format.order == TextureFormat::ABGR;
673 return format.order == TextureFormat::RGB;
681 return format.order == TextureFormat::RGBA || format.order == TextureFormat::BGRA;
685 return format.order == TextureFormat::RGB;
688 return format.order == TextureFormat::DS;
692 return format.order == TextureFormat::D || format.order == TextureFormat::DS;
709 return isColor || format.order == TextureFormat::S;
714 return isColor || format.order == TextureFormat::D;
717 return format.order == TextureFormat::DS;
724 DE_FATAL("Unknown format");
768 // make sure this table is updated if format table is updated
805 int getPixelSize (TextureFormat format)
807 const TextureFormat::ChannelOrder order = format.order;
808 const TextureFormat::ChannelType type = format.type;
810 DE_ASSERT(isValid(format));
812 // make sure this table is updated if format table is updated
968 IVec3 calculatePackedPitch (const TextureFormat& format, const IVec3& size)
970 const int pixelSize = format.getPixelSize();
985 ConstPixelBufferAccess::ConstPixelBufferAccess (const TextureFormat& format, int width, int height, int depth, const void* data)
986 : m_format (format)
992 DE_ASSERT(isValid(format));
995 ConstPixelBufferAccess::ConstPixelBufferAccess (const TextureFormat& format, const IVec3& size, const void* data)
996 : m_format (format)
1002 DE_ASSERT(isValid(format));
1005 ConstPixelBufferAccess::ConstPixelBufferAccess (const TextureFormat& format, int width, int height, int depth, int rowPitch, int slicePitch, const void* data)
1006 : m_format (format)
1008 , m_pitch (format.getPixelSize(), rowPitch, slicePitch)
1012 DE_ASSERT(isValid(format));
1015 ConstPixelBufferAccess::ConstPixelBufferAccess (const TextureFormat& format, const IVec3& size, const IVec3& pitch, const void* data)
1016 : m_format (format)
1022 DE_ASSERT(isValid(format));
1026 ConstPixelBufferAccess::ConstPixelBufferAccess(const TextureFormat& format, const IVec3& size, const IVec3& pitch, const IVec3& block, const void* data)
1027 : m_format (format)
1033 DE_ASSERT(isValid(format));
1046 PixelBufferAccess::PixelBufferAccess (const TextureFormat& format, int width, int height, int depth, void* data)
1047 : ConstPixelBufferAccess(format, width, height, depth, data)
1051 PixelBufferAccess::PixelBufferAccess (const TextureFormat& format, const IVec3& size, void* data)
1052 : ConstPixelBufferAccess(format, size, data)
1056 PixelBufferAccess::PixelBufferAccess (const TextureFormat& format, int width, int height, int depth, int rowPitch, int slicePitch, void* data)
1057 : ConstPixelBufferAccess(format, width, height, depth, rowPitch, slicePitch, data)
1061 PixelBufferAccess::PixelBufferAccess (const TextureFormat& format, const IVec3& size, const IVec3& pitch, void* data)
1062 : ConstPixelBufferAccess(format, size, pitch, data)
1066 PixelBufferAccess::PixelBufferAccess(const TextureFormat& format, const IVec3& size, const IVec3& pitch, const IVec3& block, void* data)
1067 : ConstPixelBufferAccess(format, size, pitch, block, data)
1209 static tcu::Vector<T, 4> getPixelIntGeneric (const deUint8* pixelPtr, const tcu::TextureFormat& format)
1214 const TextureSwizzle::Channel* channelMap = getChannelReadSwizzle(format.order).components;
1215 int channelSize = getChannelSize(format.type);
1225 result[c] = channelToIntType<T>(pixelPtr + channelSize*((int)channelMap[c]), format.type);
1244 static U64Vec4 getPixelAsBitsUint64 (const deUint8* pixelPtr, const tcu::TextureFormat& format)
1249 const TextureSwizzle::Channel* channelMap = getChannelReadSwizzle(format.order).components;
1250 int channelSize = getChannelSize(format.type);
1260 result[c] = retrieveChannelBitsAsUint64(pixelPtr + channelSize*((int)channelMap[c]), format.type);
1939 static bool isFixedPointDepthTextureFormat (const tcu::TextureFormat& format)
1941 DE_ASSERT(format.order == TextureFormat::D || format.order == TextureFormat::R);
1943 const tcu::TextureChannelClass channelClass = tcu::getTextureChannelClass(format.type);
1958 const TextureFormat& format = access.getFormat();
1960 if (isSRGB(format))
1962 if (format.type == TextureFormat::UNORM_INT8 && format.order == TextureFormat::sRGB)
1964 else if (format.type == TextureFormat::UNORM_INT8 && format.order == TextureFormat::sRGBA)
1976 static inline Vec4 lookupBorder (const tcu::TextureFormat& format, const tcu::Sampler& sampler)
1978 // "lookup" for a combined format does not make sense, disallow
1979 DE_ASSERT(!isCombinedDepthStencilType(format.type));
1981 const tcu::TextureChannelClass channelClass = tcu::getTextureChannelClass(format.type);
1989 return sampleTextureBorder<float>(format, sampler);
1991 return sampleTextureBorder<deInt32>(format, sampler).cast<float>();
1993 return sampleTextureBorder<deUint32>(format, sampler).cast<float>();
2571 TextureLevel::TextureLevel (const TextureFormat& format)
2572 : m_format (format)
2577 TextureLevel::TextureLevel (const TextureFormat& format, int width, int height, int depth)
2578 : m_format (format)
2588 void TextureLevel::setStorage (const TextureFormat& format, int width, int height, int depth)
2590 m_format = format;
3697 TextureLevelPyramid::TextureLevelPyramid (const TextureFormat& format, int numLevels)
3698 : m_format (format)
3770 Texture1D::Texture1D (const TextureFormat& format, int width)
3771 : TextureLevelPyramid (format, computeMipPyramidLevels(width))
3812 Texture2D::Texture2D (const TextureFormat& format, int width, int height, bool es2)
3813 : TextureLevelPyramid (format, computeMipPyramidLevels(width, height))
3821 Texture2D::Texture2D (const TextureFormat& format, int width, int height, int mipmaps)
3822 : TextureLevelPyramid (format, mipmaps)
3962 TextureCube::TextureCube (const TextureFormat& format, int size, bool es2)
3963 : m_format (format)
4148 Texture1DArray::Texture1DArray (const TextureFormat& format, int width, int numLayers)
4149 : TextureLevelPyramid (format, computeMipPyramidLevels(width))
4193 Texture2DArray::Texture2DArray (const TextureFormat& format, int width, int height, int numLayers)
4194 : TextureLevelPyramid (format, computeMipPyramidLevels(width, height))
4252 Texture3D::Texture3D (const TextureFormat& format, int width, int height, int depth)
4253 : TextureLevelPyramid (format, computeMipPyramidLevels(width, height, depth))
4346 TextureCubeArray::TextureCubeArray (const TextureFormat& format, int size, int depth)
4347 : TextureLevelPyramid (format, computeMipPyramidLevels(size))
4500 std::ostream& operator<< (std::ostream& str, TextureFormat format)
4502 return str << format.order << ", " << format.type << "";
4507 return str << "format = (" << access.getFormat() << "), size = "