JDK-8097745 : Investigate the reason of so many setTexture calls in a scene with only one texture
  • Type: Sub-task
  • Component: javafx
  • Sub-Component: graphics
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2011-11-30
  • Updated: 2015-06-12
  • Resolved: 2011-12-13
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
fx2.1Fixed
Description
Here is D3D statistics for Bubblemark test on JavaFX printed by my perf-counter which is being reviewed:

D3D Statistics per last 1 frame(s) :
    numTrianglesDrawn=84002, numDrawCalls=41372, numBufferLocks=41372
    numTextureLocks=0, numTextureTransferKBytes=0
    numRenderTargetSwitch=2, numSetTexture=3, numSetPixelShader=2

This numbers are very strange to me and it seems to be a bug.
We must not have so much drawcalls and buffer locks per frame in a scene with only one texture
Comments
I emulated the fix by reducing float`s precision to have only 10 precision bits after the dot by the following method : float fixValue(double x) { final float _2_10 = 1.f/1024.f; return _2_10*(int)(x*1024); } So that NGImageView stop doing the bug and found that the problem has gone: FPS has increased from 47 fps to 68 fps And D3D Stats also reports that the problem has gone: FROM: D3D Statistics per last 100 frame(s) : numTrianglesDrawn=10002, numDrawCalls=5000, numBufferLocks=5000 numTextureLocks=0, numTextureTransferKBytes=0 numRenderTargetSwitch=2, numSetTexture=3, numSetPixelShader=2 5000 balls 47 FPS TO: D3D Statistics per last 100 frame(s) : numTrianglesDrawn=10002, numDrawCalls=21, numBufferLocks=21 numTextureLocks=0, numTextureTransferKBytes=0 numRenderTargetSwitch=2, numSetTexture=3, numSetPixelShader=2 5000 balls 68 fps numBufferLocks and numDrawCalls has decreased x250 times.
13-12-2011

One of the reason described here : RT-18485 Probably another reasons exists, which will be visible after RT-18485 fixed.
13-12-2011