gluTextureUtil.hpp revision 07b89ce0885a4a9e02b7057d45a4260d24740ba9
1#ifndef _GLUTEXTUREUTIL_HPP 2#define _GLUTEXTUREUTIL_HPP 3/*------------------------------------------------------------------------- 4 * drawElements Quality Program OpenGL ES Utilities 5 * ------------------------------------------------ 6 * 7 * Copyright 2014 The Android Open Source Project 8 * 9 * Licensed under the Apache License, Version 2.0 (the "License"); 10 * you may not use this file except in compliance with the License. 11 * You may obtain a copy of the License at 12 * 13 * http://www.apache.org/licenses/LICENSE-2.0 14 * 15 * Unless required by applicable law or agreed to in writing, software 16 * distributed under the License is distributed on an "AS IS" BASIS, 17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 * See the License for the specific language governing permissions and 19 * limitations under the License. 20 * 21 *//*! 22 * \file 23 * \brief Texture format utilities. 24 *//*--------------------------------------------------------------------*/ 25 26#include "gluDefs.hpp" 27#include "tcuTexture.hpp" 28#include "tcuCompressedTexture.hpp" 29#include "gluShaderUtil.hpp" 30#include "deInt32.h" 31 32namespace glu 33{ 34 35class RenderContext; 36class ContextInfo; 37 38/*--------------------------------------------------------------------*//*! 39 * \brief GL pixel transfer format. 40 *//*--------------------------------------------------------------------*/ 41struct TransferFormat 42{ 43 deUint32 format; //!< Pixel format. 44 deUint32 dataType; //!< Data type. 45 46 TransferFormat (void) 47 : format (0) 48 , dataType (0) 49 { 50 } 51 52 TransferFormat (deUint32 format_, deUint32 dataType_) 53 : format (format_) 54 , dataType (dataType_) 55 { 56 } 57}; 58 59tcu::TextureFormat mapGLTransferFormat (deUint32 format, deUint32 dataType); 60tcu::TextureFormat mapGLInternalFormat (deUint32 internalFormat); 61bool isGLInternalColorFormatFilterable (deUint32 internalFormat); 62tcu::Sampler mapGLSampler (deUint32 wrapS, deUint32 minFilter, deUint32 magFilter); 63tcu::Sampler mapGLSampler (deUint32 wrapS, deUint32 wrapT, deUint32 minFilter, deUint32 magFilter); 64tcu::Sampler mapGLSampler (deUint32 wrapS, deUint32 wrapT, deUint32 wrapR, deUint32 minFilter, deUint32 magFilter); 65tcu::Sampler::CompareMode mapGLCompareFunc (deUint32 mode); 66 67TransferFormat getTransferFormat (tcu::TextureFormat format); 68deUint32 getInternalFormat (tcu::TextureFormat format); 69deUint32 getGLFormat (tcu::CompressedTexFormat format); 70 71deUint32 getGLWrapMode (tcu::Sampler::WrapMode wrapMode); 72deUint32 getGLFilterMode (tcu::Sampler::FilterMode filterMode); 73deUint32 getGLCompareFunc (tcu::Sampler::CompareMode compareMode); 74 75deUint32 getGLCubeFace (tcu::CubeFace face); 76tcu::CubeFace getCubeFaceFromGL (deUint32 face); 77 78DataType getSampler1DType (tcu::TextureFormat format); 79DataType getSampler2DType (tcu::TextureFormat format); 80DataType getSamplerCubeType (tcu::TextureFormat format); 81DataType getSampler2DArrayType (tcu::TextureFormat format); 82DataType getSampler3DType (tcu::TextureFormat format); 83DataType getSamplerCubeArrayType (tcu::TextureFormat format); 84 85bool isSizedFormatColorRenderable (const RenderContext& renderCtx, const ContextInfo& contextInfo, deUint32 sizedFormat); 86 87} // glu 88 89#endif // _GLUTEXTUREUTIL_HPP 90