@@ -1686,6 +1686,7 @@ class GLCompileMacro
16861686 USE_SHADOWING,
16871687 LIGHT_DIRECTIONAL,
16881688 USE_DEPTH_FADE,
1689+ GENERIC_2D,
16891690 USE_PHYSICAL_MAPPING,
16901691 };
16911692
@@ -2110,6 +2111,26 @@ class GLCompileMacro_USE_DEPTH_FADE :
21102111 }
21112112};
21122113
2114+ class GLCompileMacro_GENERIC_2D :
2115+ GLCompileMacro {
2116+ public:
2117+ GLCompileMacro_GENERIC_2D ( GLShader* shader ) :
2118+ GLCompileMacro ( shader ) {
2119+ }
2120+
2121+ const char * GetName () const override {
2122+ return " GENERIC_2D" ;
2123+ }
2124+
2125+ EGLCompileMacro GetType () const override {
2126+ return EGLCompileMacro::GENERIC_2D;
2127+ }
2128+
2129+ void SetGeneric2D ( bool enable ) {
2130+ SetMacro ( enable );
2131+ }
2132+ };
2133+
21132134class GLCompileMacro_USE_PHYSICAL_MAPPING :
21142135 GLCompileMacro
21152136{
@@ -3918,28 +3939,6 @@ class u_Lights :
39183939 }
39193940};
39203941
3921- // FIXME: this is the same as 'generic' and has no reason for existing.
3922- // It was added along with RmlUi transforms to add "gl_FragDepth = 0;" to the GLSL,
3923- // but that turns out not to be needed.
3924- class GLShader_generic2D :
3925- public GLShader,
3926- public u_ColorMap,
3927- public u_DepthMap,
3928- public u_TextureMatrix,
3929- public u_AlphaThreshold,
3930- public u_ModelMatrix,
3931- public u_ModelViewProjectionMatrix,
3932- public u_ColorModulate,
3933- public u_Color,
3934- public u_DepthScale,
3935- public GLDeformStage
3936- {
3937- public:
3938- GLShader_generic2D ( GLShaderManager *manager );
3939- void BuildShaderCompileMacros ( std::string& compileMacros ) override ;
3940- void SetShaderProgramUniforms ( shaderProgram_t *shaderProgram ) override ;
3941- };
3942-
39433942class GLShader_generic :
39443943 public GLShader,
39453944 public u_ColorMap,
@@ -3962,7 +3961,8 @@ class GLShader_generic :
39623961 public GLCompileMacro_USE_VERTEX_ANIMATION,
39633962 public GLCompileMacro_USE_TCGEN_ENVIRONMENT,
39643963 public GLCompileMacro_USE_TCGEN_LIGHTMAP,
3965- public GLCompileMacro_USE_DEPTH_FADE
3964+ public GLCompileMacro_USE_DEPTH_FADE,
3965+ public GLCompileMacro_GENERIC_2D
39663966{
39673967public:
39683968 GLShader_generic ( GLShaderManager *manager );
@@ -4714,7 +4714,6 @@ std::string GetShaderPath();
47144714
47154715extern ShaderKind shaderKind;
47164716
4717- extern GLShader_generic2D *gl_generic2DShader;
47184717extern GLShader_generic *gl_genericShader;
47194718extern GLShader_genericMaterial *gl_genericShaderMaterial;
47204719extern GLShader_cull *gl_cullShader;
0 commit comments