Improve shader performance significantly by only including raytracing or shadowmaps in the shader if enabled

This commit is contained in:
Magnus Norddahl 2023-04-07 04:22:43 +02:00
commit caefc09549
6 changed files with 15 additions and 17 deletions

View file

@ -255,6 +255,8 @@ void VkRenderState::ApplyRenderPass(int dt)
pipelineKey.ShaderKey.Detailmap = (uTextureMode & TEXF_Detailmap) != 0;
pipelineKey.ShaderKey.Glowmap = (uTextureMode & TEXF_Glowmap) != 0;
pipelineKey.ShaderKey.Simple2D = (mFogEnabled == 2);
pipelineKey.ShaderKey.UseShadowmap = gl_light_shadowmap;
pipelineKey.ShaderKey.UseRaytrace = gl_light_raytrace;
// Is this the one we already have?
bool inRenderPass = mCommandBuffer;