/*---------------------------------------------------------------------------* Copyright (C) 2010-2011 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. *---------------------------------------------------------------------------*/ #pragma once #ifndef __GFDFILESHADER_H__ #define __GFDFILESHADER_H__ #ifdef __cplusplus extern "C" { #endif // __cplusplus /// @addtogroup GFDFileShaderGroup /// @{ /// \brief Struct for containing GX2 Shaders /// /// \brief Creates a gsh file based on the passed in GFDShaders /// /// \param pFilename Name of the output file /// \param gpuVer GPU version /// \param swapMode Endian swap mode for shader data (GPU data) /// \param alignMode Align mode for adding data specific allignment size padding block before image data (GPU data) /// \param numShader Number of shaders in pShaders /// \param pShaders Input GFDShaders array pointer used to create gsh file. /// If it's includes GX2XXXShader with NULL pointer, it's ignored. // It's used for creating a separate shader binary file. /// \return true or false /// /// \donotcall \notthreadsafe \hostonly \enddonotcall /// GFD_DECLSPEC bool GFD_API GFDWriteFileShader(char* pFilename, GFDGPUVersion gpuVer, GFDEndianSwapMode swapMode, GFDAlignMode alignMode, u32 numShader, const GFDShaders *pShaders); /// \brief Creates a gsh file based on the passed in GFDShaders2 /// /// \param pFilename Name of the output file /// \param gpuVer GPU version /// \param swapMode Endian swap mode for shader data (GPU data) /// \param alignMode Align mode for adding data specific allignment size padding block before image data (GPU data) /// \param numShader Number of shaders in pShaders /// \param pShaders Input GFDShaders2 array pointer used to create gsh file. /// If it's includes GX2XXXShader with NULL pointer, it's ignored. // It's used for creating a separate shader binary file. /// \return true or false /// /// \donotcall \notthreadsafe \hostonly \enddonotcall /// GFD_DECLSPEC bool GFD_API GFDWriteFileShader2(char* pFilename, GFDGPUVersion gpuVer, GFDEndianSwapMode swapMode, GFDAlignMode alignMode, u32 numShader, const GFDShaders2 *pShaders); /// \brief Appends shaders based on the passed in GFDShaders to an existing gsh file /// /// \param pFilename Name of the file to append shaders /// \param gpuVer GPU version /// \param swapMode Endian swap mode for shader data (GPU data) /// \param alignMode Align mode for adding data specific alignment size padding block before image data (GPU data) /// \param numShader Number of shaders in pShaders /// \param pShaders Input GFDShaders array pointer used to create gsh file. /// If it includes GX2XXXShader with NULL pointer, it's ignored. // It's used for creating a separate shader binary file. /// \return true or false /// /// \donotcall \notthreadsafe \hostonly \enddonotcall /// GFD_DECLSPEC bool GFD_API GFDAppendWriteFileShader(char* pFilename, GFDGPUVersion gpuVer, GFDEndianSwapMode swapMode, GFDAlignMode alignMode, u32 numShader, const GFDShaders *pShaders); /// \brief Appends shaders based on the passed in GFDShaders2 to an existing gsh file /// /// \param pFilename Name of the file to append shaders /// \param gpuVer GPU version /// \param swapMode Endian swap mode for shader data (GPU data) /// \param alignMode Align mode for adding data specific alignment size padding block before image data (GPU data) /// \param numShader Number of shaders in pShaders /// \param pShaders Input GFDShaders2 array pointer used to create gsh file. /// If it includes GX2XXXShader with NULL pointer, it's ignored. // It's used for creating a separate shader binary file. /// \return true or false /// /// \donotcall \notthreadsafe \hostonly \enddonotcall /// GFD_DECLSPEC bool GFD_API GFDAppendWriteFileShader2(char* pFilename, GFDGPUVersion gpuVer, GFDEndianSwapMode swapMode, GFDAlignMode alignMode, u32 numShader, const GFDShaders2 *pShaders); /// \brief Write out a header file containing all the attributes, uniforms, samplers, and even the code as compilable code. /// /// \param pFilename Name of the output file /// \param swapMode Endian swap mode for shader data (GPU data) /// \param pShaders Input GFDShaders array pointer used to create gsh file. /// If it includes GX2XXXShader with NULL pointer, it's ignored. /// It's used for creating a separate shader binary file. /// \return true or false /// /// \donotcall \notthreadsafe \hostonly \enddonotcall /// GFD_DECLSPEC bool GFD_API GFDWriteFileShaderAsCode(char* pFilename, GFDEndianSwapMode swapMode, const GFDShaders *pShaders); /// \brief Write out a header file containing all the attributes, uniforms, samplers, and even the code as compilable code. /// /// \param pFilename Name of the output file /// \param swapMode Endian swap mode for shader data (GPU data) /// \param pShaders Input GFDShaders2 array pointer used to create gsh file. /// If it includes GX2XXXShader with NULL pointer, it's ignored. /// It's used for creating a separate shader binary file. /// \return true or false /// /// \donotcall \notthreadsafe \hostonly \enddonotcall /// GFD_DECLSPEC bool GFD_API GFDWriteFileShaderAsCode2(char* pFilename, GFDEndianSwapMode swapMode, const GFDShaders2 *pShaders); /// \brief Write out a header file containing all the attributes, uniforms, samplers, and even the code as compilable code. /// /// \param pFilename Name of the output file /// \param swapMode Endian swap mode for shader data (GPU data) /// \param pShaders Input GFDShaders2 array pointer used to create gsh file. /// If it includes GX2XXXShader with NULL pointer, it's ignored. // It's used for creating a separate shader binary file. /// \param pShadersSrc Original source used to create shaders /// \return true or false // GFD_DECLSPEC bool GFD_API GFDWriteFileShaderAsCodeWithSource(char* pFilename, GFDEndianSwapMode swapMode, const GFDShaders2 *pShaders, const GFDShadersSrc *pShadersSrc); /// @} #ifdef __cplusplus } #endif // __cplusplus #endif // __GFDFILESHADER_H__