@@ -3888,64 +3888,6 @@ static void InitShader( const char *name, int lightmapIndex ) {
38883888}
38893889
38903890
3891- static void DetectNeeds ( void )
3892- {
3893- int i , n ;
3894-
3895- for ( i = 0 ; i < MAX_SHADER_STAGES ; i ++ )
3896- {
3897- if ( !stages [i ].active )
3898- break ;
3899-
3900- for ( n = 0 ; n < NUM_TEXTURE_BUNDLES ; n ++ ) {
3901- const texCoordGen_t t = stages [i ].bundle [n ].tcGen ;
3902- if ( t == TCGEN_LIGHTMAP )
3903- {
3904- shader .needsST2 = qtrue ;
3905- }
3906- if ( t == TCGEN_ENVIRONMENT_MAPPED || t == TCGEN_ENVIRONMENT_MAPPED_FP )
3907- {
3908- shader .needsNormal = qtrue ;
3909- }
3910- if ( stages [i ].bundle [n ].alphaGen == AGEN_LIGHTING_SPECULAR || stages [i ].bundle [n ].rgbGen == CGEN_LIGHTING_DIFFUSE )
3911- {
3912- shader .needsNormal = qtrue ;
3913- }
3914- }
3915- #if 0
3916- t1 = stages [i ].bundle [0 ].tcGen ;
3917- t2 = stages [i ].bundle [1 ].tcGen ;
3918-
3919- if ( t1 == TCGEN_LIGHTMAP || t2 == TCGEN_LIGHTMAP )
3920- {
3921- shader .needsST2 = qtrue ;
3922- }
3923- if ( t1 == TCGEN_ENVIRONMENT_MAPPED || t1 == TCGEN_ENVIRONMENT_MAPPED_FP )
3924- {
3925- shader .needsNormal = qtrue ;
3926- }
3927- if ( t2 == TCGEN_ENVIRONMENT_MAPPED || t2 == TCGEN_ENVIRONMENT_MAPPED_FP )
3928- {
3929- shader .needsNormal = qtrue ;
3930- }
3931- if ( stages [i ].bundle [0 ].alphaGen == AGEN_LIGHTING_SPECULAR || stages [i ].bundle [0 ].rgbGen == CGEN_LIGHTING_DIFFUSE )
3932- {
3933- shader .needsNormal = qtrue ;
3934- }
3935- #endif
3936- }
3937- for ( i = 0 ; i < shader .numDeforms ; i ++ )
3938- {
3939- if ( shader .deforms [i ].deformation == DEFORM_WAVE || shader .deforms [i ].deformation == DEFORM_NORMALS || shader .deforms [i ].deformation == DEFORM_BULGE ) {
3940- shader .needsNormal = qtrue ;
3941- }
3942- if ( shader .deforms [i ].deformation >= DEFORM_TEXT0 && shader .deforms [i ].deformation <= DEFORM_TEXT7 ) {
3943- shader .needsNormal = qtrue ;
3944- }
3945- }
3946- }
3947-
3948-
39493891/*
39503892=========================
39513893FinishShader
@@ -4104,8 +4046,6 @@ static shader_t *FinishShader( void ) {
41044046 }
41054047 }
41064048
4107- DetectNeeds ();
4108-
41094049 // fix alphaGen flags to avoid redundant comparisons in R_ComputeColors()
41104050 for ( i = 0 ; i < MAX_SHADER_STAGES ; i ++ ) {
41114051 shaderStage_t * pStage = & stages [ i ];
@@ -4196,7 +4136,6 @@ static shader_t *FinishShader( void ) {
41964136
41974137#ifdef USE_VULKAN
41984138
4199- #ifdef USE_FOG_COLLAPSE
42004139 if ( vk .maxBoundDescriptorSets >= 6 && !(shader .contentFlags & CONTENTS_FOG ) && shader .fogPass != FP_NONE ) {
42014140 fogCollapse = qtrue ;
42024141 if ( stage == 1 ) {
@@ -4248,7 +4187,6 @@ static shader_t *FinishShader( void ) {
42484187 // if there is no fogs - assume that we can apply all color optimizations without any restrictions
42494188 fogCollapse = qtrue ;
42504189 }
4251- #endif
42524190
42534191 shader .tessFlags = TESS_XYZ ;
42544192
@@ -4541,7 +4479,6 @@ static shader_t *FinishShader( void ) {
45414479 }
45424480
45434481
4544- #ifdef USE_FOG_COLLAPSE
45454482 if ( fogCollapse && tr .numFogs > 0 ) {
45464483 Vk_Pipeline_Def fog_def ;
45474484 Vk_Pipeline_Def fog_def_mirror ;
@@ -4583,7 +4520,6 @@ static shader_t *FinishShader( void ) {
45834520
45844521 shader .fogCollapse = qtrue ;
45854522 }
4586- #endif
45874523 }
45884524 }
45894525#endif // USE_VULKAN
@@ -4844,11 +4780,6 @@ shader_t *R_FindShader( const char *name, int lightmapIndex, qboolean mipRawImag
48444780
48454781 InitShader ( strippedName , lightmapIndex );
48464782
4847- /* needsNormal etc. could be set based on stage requirements. */
4848- //shader.needsST1 = qtrue;
4849- //shader.needsST2 = qtrue;
4850- //shader.needsColor = qtrue;
4851-
48524783 //
48534784 // attempt to define shader from an explicit parameter file
48544785 //
@@ -4933,11 +4864,6 @@ qhandle_t RE_RegisterShaderFromImage(const char *name, int lightmapIndex, image_
49334864
49344865 InitShader ( name , lightmapIndex );
49354866
4936- /* needsNormal etc. could be set based on stage requirements. */
4937- //shader.needsST1 = qtrue;
4938- //shader.needsST2 = qtrue;
4939- //shader.needsColor = qtrue;
4940-
49414867 //
49424868 // create the default shading commands
49434869 //
0 commit comments