diff --git a/src/engine/renderer/glsl_source/cull_cp.glsl b/src/engine/renderer/glsl_source/cull_cp.glsl index 74c762c4b8..71e29d54ed 100644 --- a/src/engine/renderer/glsl_source/cull_cp.glsl +++ b/src/engine/renderer/glsl_source/cull_cp.glsl @@ -92,6 +92,9 @@ bool CullSurface( in BoundingSphere boundingSphere ) { void ProcessSurfaceCommands( const in SurfaceDescriptor surface, const in bool enabled ) { for( uint i = 0; i < MAX_SURFACE_COMMANDS; i++ ) { const uint commandID = surface.surfaceCommandIDs[i]; + if( commandID == 0 ) { + return; + } surfaceCommands[commandID + u_SurfaceCommandsOffset].enabled = enabled; } }