/*---------------------------------------------------------------------------* Copyright 2013 Nintendo. All rights reserved. These coded instructions, statements, and computer programs contain proprietary information of Nintendo of America Inc. and/or Nintendo Company Ltd., and are protected by Federal copyright law. They may not be disclosed to third parties or copied or duplicated in any form, in whole or in part, without the prior written consent of Nintendo. *---------------------------------------------------------------------------*/ // // shaderUtils optimization defines // #ifndef OPTFLAGS_HEADER_ #define OPTFLAGS_HEADER_ #if defined(__cplusplus) extern "C" { #endif /// \brief Optimization flag settings for optimizeFlags (only if options.optFlagsPresent is 1). /// Note that optimization flags are bit numbers, and have to be converted to bit masks vish GSH2_OPTMASK(). /// For example, to set optimizeFlags to do -Ofastmath and -Oloopvar, we would set: /// optimizeFlags = GSH2_OPTMASK(GSH2_OPTFLAG_FASTMATH) | GSH2_OPTMASK(GSH2_OPTFLAG_LOOPVAR) enum GSH2OptimizeFlags { GSH2_OPTFLAG_SC = 0, ///< enable AMD specific Shader Compiler optimizations GSH2_OPTFLAG_FASTMATH = 1, ///< enable optimizations that may violate IEEE floating point guarantees GSH2_OPTFLAG_LOOPVAR = 2, ///< enable optimizations to find loop initialization GSH2_OPTFLAG_CONST = 3, ///< enable constant propagation GSH2_OPTFLAG_LOOPEXPR = 4, ///< enable unrolling loops containing complex expressions GSH2_OPTFLAG_UNUSEDVAR = 5, ///< enable removing unused variables GSH2_OPTFLAG_LIMITARRAYSYMS = 6, ///< do not emit more than 2 symbols for array elements (size optimization) GSH2_OPTFLAG_GLSL = 7, ///< run first glsl to glsl optimization pass }; /// \brief Convert a flag into a bit mask. #define GSH2_OPTMASK(bit) (((uint64)1)<glsl optimization pass to remove unused code and variables", GSH2_OPTMASK(GSH2_OPTFLAG_GLSL) }, \ { "all", "enable all optimizations", GSH2_OPTFLAGS_ALL }, \ { "none", NULL, 0 }, \ { NULL, NULL, 0 } #if defined(__cplusplus) } #endif #endif