JDK-8356601 : Separate phong shader functions based on number of lights
  • Type: Sub-task
  • Component: javafx
  • Sub-Component: graphics
  • Affected Version: internal
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: os_x
  • Submitted: 2025-05-09
  • Updated: 2025-05-09
  • Resolved: 2025-05-09
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
internalFixed
Description
Currently we have single Phong vertex and fragment shader, which handle maximum 3 lights.
In scenarios when there is only one light, The shader ends up in causing more processing during rasterization when interpolating attributes that are passed from vertex shader to fragment shader.
Due to limitation of MSL, there cannot be an array of any type in the set of attributes that are passed from vertex to fragment shader.
Hence, the alternative is to have separate shaders based on number of lights.
Comments
Changeset: 0c8bfef0 Branch: metal Author: Ambarish Rapte <arapte@openjdk.org> Date: 2025-05-09 12:57:08 +0000 URL: https://git.openjdk.org/jfx-sandbox/commit/0c8bfef02e26e9db9ccbeea27681c782c309d2ff On M2 machine, this change shows a significant gain in 3DSphere FPS: from 18 to 22 FPS. and shows 4 to 5 % in other 3D tests which were already matching or exceeding that of es2.
09-05-2025