Path: blob/master/libmupen64plus/mupen64plus-video-rice/src/OGLES2FragmentShaders.h
2 views
/*1Copyright (C) 2005 Rice196423This program is free software; you can redistribute it and/or4modify it under the terms of the GNU General Public License5as published by the Free Software Foundation; either version 26of the License, or (at your option) any later version.78This program is distributed in the hope that it will be useful,9but WITHOUT ANY WARRANTY; without even the implied warranty of10MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the11GNU General Public License for more details.1213You should have received a copy of the GNU General Public License14along with this program; if not, write to the Free Software15Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.16*/1718#ifndef _OGL_FRAGMENT_SHADER_H_19#define _OGL_FRAGMENT_SHADER_H_2021#include <vector>2223#include "osal_opengl.h"2425#include "OGLCombiner.h"26#include "OGLExtCombiner.h"27#include "GeneralCombiner.h"2829typedef struct {30uint32 dwMux0;31uint32 dwMux1;3233bool fogIsUsed;34bool alphaTest;35GLuint fragmentShaderID;36GLuint vertexShaderID;37GLuint programID;3839GLint PrimColorLocation;40GLint EnvColorLocation;41GLint PrimFracLocation;42GLint EnvFracLocation;43GLint AlphaRefLocation;44GLint FogColorLocation;45GLint FogMinMaxLocation;4647} OGLShaderCombinerSaveType;484950class COGL_FragmentProgramCombiner : public COGLColorCombiner451{52public:53bool Initialize(void);54float m_AlphaRef;55void UpdateFog(bool bEnable);5657protected:58friend class OGLDeviceBuilder;5960void DisableCombiner(void);61void InitCombinerCycleCopy(void);62void InitCombinerCycleFill(void);63void InitCombinerCycle12(void);6465COGL_FragmentProgramCombiner(CRender *pRender);66~COGL_FragmentProgramCombiner();6768bool m_bFragmentProgramIsSupported;69std::vector<OGLShaderCombinerSaveType> m_vCompiledShaders;7071private:72virtual int ParseDecodedMux();73virtual void GenerateProgramStr();74int FindCompiledMux();75virtual void GenerateCombinerSetting(int index);76virtual void GenerateCombinerSettingConstants(int index);7778#ifdef DEBUGGER79void DisplaySimpleMuxString(void);80#endif8182};83848586class COGLFragmentShaderCombiner : public COGLColorCombiner87{88public:89bool Initialize(void);90void InitCombinerBlenderForSimpleTextureDraw(uint32 tile=0);91protected:92friend class OGLDeviceBuilder;9394void DisableCombiner(void);95void InitCombinerCycleCopy(void);96void InitCombinerCycleFill(void);97void InitCombinerCycle12(void);9899COGLFragmentShaderCombiner(CRender *pRender);100~COGLFragmentShaderCombiner();101102bool m_bShaderIsSupported;103104#ifdef DEBUGGER105void DisplaySimpleMuxString(void);106#endif107108};109110111#endif112113114115