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