JDK-8309648 : Add support for DRAW_LINE mode in metal
  • Type: Enhancement
  • Component: javafx
  • Sub-Component: graphics
  • Affected Version: internal
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: os_x
  • CPU: generic
  • Submitted: 2023-06-08
  • Updated: 2023-06-14
  • Resolved: 2023-06-14
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
Related Reports
Blocks :  
Description
Currently DRAW_FILL is only supported by default in Metal 3D implementation.
Need to add DRAW_LINE mode also.
This can be tested using Ensemble8 3D demos.
Comments
Changeset: 811e94d3 Author: Jayathirth D V <jdv@openjdk.org> Committer: aghaisas <ajitgh@gmail.com> Date: 2023-06-14 16:56:11 +0000 URL: https://git.openjdk.org/jfx-sandbox/commit/811e94d3d4e3bdc674c6f9a09c4504faf0b73ae7
14-06-2023

In case of Ensemble8 we have intermediate texture to draw 3D things and then we blit it on common texture. Also this intermediate texture is reused when we change DRAWMODE in Ensemble8 3D Box demo. We need to clear this texture when we jump between draw modes, From the logs what i see is we are getting MTLGraphics.clear() call with RGBA(0,0,0,0) but this was not getting honored. In MTLGraphics.clear() we clear RTT texture on RGBA(0,0,0,0) comparing object reference of Color.TRANSPARENT like (color == Color.TRANSPARENT) which is not correct. If i use Color.equals() we clear the RTT even in case of 3D Box demo.
14-06-2023

Observation: Added code to setTriangleFillMode and after this in standalone test case, line drawing works. If i run 3D box demo from Ensemble8 it doesnt update properly for draw_line mode. Looked like we are not clearing contents properly on changing drawMode. If i explicitly clear the colorAttachment everytime we draw 3D primitive i see that Ensemble8 3D box works fine with both drawModes. But with this change if i draw 3D primitive after 2D primitive in standalone test, 2D drawing gets cleared since we use same RTT texture for both 2D and 3D. Have to find proper way to clear the colorAttachment when we change drawmode.
12-06-2023