JDK-8310273 : Metal - code cleanup
  • Type: Task
  • Component: javafx
  • Sub-Component: graphics
  • Affected Version: internal
  • Priority: P3
  • Status: Open
  • Resolution: Unresolved
  • OS: os_x
  • CPU: generic
  • Submitted: 2023-06-19
  • Updated: 2024-09-02
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
internalUnresolved
Related Reports
Blocks :  
Sub Tasks
JDK-8310616 :  
JDK-8311042 :  
JDK-8315432 :  
JDK-8335598 :  
JDK-8338892 :  
Description
We have few cleanup tasks to be done.
1. Add error checks/variable validation
2. Remove any un-required/stale comments
3. Add comments wherever necessary.
4. Review TODOs and address any important EA blockers
5. Fix warnings
6. Java coding guidelines
7, Objective coding guidelines
8. Remove dead code
9. Error fallback/ no service / no memory /

We can do this file level, by creating a new sub task for set of files as and when we fix.
Comments
Files : MetalContext.h/.m Remove unused : 1) getResourceFactory() method and related class member & import "#import "MetalResourceFactory.h"" 2) tripleBufferSemaphore declaration and usage 3) rttCleared declaration and usage 4) resetRenderPass - method is used only at one place and I think it can be removed from there as well. Please check. 5) `color` argument of clearRTT method is unused 6) MAX_QUADS_IN_A_BATCH is unused in MetalContext.m
02-09-2024

File : MetalContext.m Remove below code - this was useful in debugging - but not required anymore. [currentCommandBuffer addScheduledHandler:^(id<MTLCommandBuffer> cb) { CTX_LOG(@"------------------> Native: commandBuffer Scheduled"); }];
24-07-2024

Comment : “//TODO: MTL: This enables sharing of MTLCommandQueue between PRISM and GLASS, if needed. //Note : Currently, PRISM and GLASS create their own dedicated MTLCommandQueue” in GlassView3D.m is wrong because we use only single commandQueue between Prism and Glass. Looks like we have similar comment at more places we need to update them also as part of cleanup.
23-07-2024