JDK-8094943 : Shader compile failure with PickTest3D on i.MX6
  • Type: Bug
  • Component: javafx
  • Sub-Component: graphics
  • Affected Version: 8u40
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2014-09-08
  • Updated: 2015-06-12
  • Resolved: 2014-09-08
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.
JDK 8
8u40Fixed
Related Reports
Relates :  
Description

I think this is new, looks like a change in the source of one of the shaders ?

root@nitrogen6x:~/sb/insanity/toys/PickTest3D# javafx -jar dist/*.jar
Mar 02, 2014 2:19:03 AM com.sun.prism.es2.ES2PhongMaterial lockTextureMaps
WARNING: Warning: Low on texture resources. Cannot create texture.
Shader compile log: (185:0) : error : function: 'apply_diffuse' hasn't the corresponding declaration
(200:0) : error : undefined identifier: 'diffuse'
(201:0) : error : undefined identifier: 'rez'
(203:0) : error : undefined identifier: 'rez'
(203:0) : error : undefined identifier: 'diffuse'

java.lang.RuntimeException: Error creating fragment shader
	at com.sun.prism.es2.ES2Shader.createFromSource(ES2Shader.java:141)
	at com.sun.prism.es2.ES2PhongShader.getShader(ES2PhongShader.java:177)
	at com.sun.prism.es2.ES2Context.getPhongShader(ES2Context.java:130)
	at com.sun.prism.es2.ES2Context.renderMeshView(ES2Context.java:476)
	at com.sun.prism.es2.ES2MeshView.render(ES2MeshView.java:119)
	at com.sun.javafx.sg.prism.NGShape3D.renderMeshView(NGShape3D.java:179)
	at com.sun.javafx.sg.prism.NGShape3D.renderContent(NGShape3D.java:198)
	at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:2067)
	at com.sun.javafx.sg.prism.NGNode.render(NGNode.java:1959)
	at com.sun.javafx.sg.prism.NGGroup.renderContent(NGGroup.java:235)
	at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:2067)
	at com.sun.javafx.sg.prism.NGNode.render(NGNode.java:1959)
	at com.sun.javafx.sg.prism.NGGroup.renderContent(NGGroup.java:235)
	at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:2067)
	at com.sun.javafx.sg.prism.NGNode.render(NGNode.java:1959)
	at com.sun.javafx.sg.prism.NGGroup.renderContent(NGGroup.java:235)
	at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:2067)
	at com.sun.javafx.sg.prism.NGNode.render(NGNode.java:1959)
	at com.sun.javafx.sg.prism.NGGroup.renderContent(NGGroup.java:235)
	at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:2067)
	at com.sun.javafx.sg.prism.NGNode.render(NGNode.java:1959)
	at com.sun.javafx.sg.prism.NGGroup.renderContent(NGGroup.java:235)
	at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:2067)
	at com.sun.javafx.sg.prism.NGNode.render(NGNode.java:1959)
	at com.sun.javafx.tk.quantum.ViewPainter.doPaint(ViewPainter.java:474)
	at com.sun.javafx.tk.quantum.ViewPainter.paintImpl(ViewPainter.java:327)
	at com.sun.javafx.tk.quantum.PresentingPainter.run(PresentingPainter.java:92)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
	at com.sun.javafx.tk.RenderJob.run(RenderJob.java:58)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
	at java.lang.Thread.run(Thread.java:744)
Comments
post commit +1
09-09-2014

Thanks.
09-09-2014

Thanks for noticing it. I clearly didn't mean what I typed earlier. It is fix now: Changeset: d7ac4b8e6371 Author: Chien Yang <chien.yang@oracle.com> Date: 2014-09-08 16:57 -0700 URL: http://hg.openjdk.java.net/openjfx/8u-dev/rt/rev/d7ac4b8e6371
09-09-2014

I just noticed a typo in the change. You are missing a set of parens around the test for DIFFUSE || SELF_ILLUM. As coded, this will check for "(!embedded AND diffuse) OR self_illum", meaning that a self-illum map will be rendered with mipmap even on embedded. The correct expression should be: boolean useMipmap = (!PlatformUtil.isEmbedded()) && ((i == PhongMaterial.DIFFUSE) || (i == PhongMaterial.SELF_ILLUM)); I didn't notice it because of the extra parens (causing me to misread it). You could remove the unneeded parens and just say: boolean useMipmap = !PlatformUtil.isEmbedded() && (i == PhongMaterial.DIFFUSE || i == PhongMaterial.SELF_ILLUM); but that's up to you.
08-09-2014

Changeset: 3abef7f2f13f Author: Chien Yang <chien.yang@oracle.com> Date: 2014-09-08 15:47 -0700 URL: http://hg.openjdk.java.net/openjfx/8u-dev/rt/rev/3abef7f2f13f
08-09-2014

+1
08-09-2014

The proposed fix is to disable mipmap on the embedded until with have a better solution for such platform. The following simple fix tested good on my i.MX6 device: diff -r 1d08d9490df0 modules/graphics/src/main/java/com/sun/prism/es2/ES2PhongMaterial.java --- a/modules/graphics/src/main/java/com/sun/prism/es2/ES2PhongMaterial.java Mon Sep 08 10:51:13 2014 +0300 +++ b/modules/graphics/src/main/java/com/sun/prism/es2/ES2PhongMaterial.java Mon Sep 08 14:51:18 2014 -0700 @@ -25,6 +25,7 @@ package com.sun.prism.es2; +import com.sun.javafx.PlatformUtil; import com.sun.prism.Image; import com.sun.prism.PhongMaterial; import com.sun.prism.Texture; @@ -96,8 +97,8 @@ continue; } } - // Enable mipmap if map is diffuse or self illum. - boolean useMipmap = (i == PhongMaterial.DIFFUSE) || (i == PhongMaterial.SELF_ILLUM); + // Enable mipmap if platform isn't embedded and map is diffuse or self illum + boolean useMipmap = (!PlatformUtil.isEmbedded()) && (i == PhongMaterial.DIFFUSE) || (i == PhongMaterial.SELF_ILLUM); texture = setupTexture(maps[i], useMipmap); maps[i].setTexture(texture); maps[i].setDirty(false);
08-09-2014

looks like most of run-3d.sh is not behaving now.
08-09-2014

It was a "build not really clean issue" from my IDE. I should have verified the command line before reporting the error but usually they are the same.
08-09-2014

Ok, a clean build and running from the command line again has fixed the Mac issue.
08-09-2014

The mac issue may be a different bug, but both issues could be caused by the recent addition of auto-generated mipmap support.
08-09-2014

I don't think that the shaders have changed recently, but Chien can evaluate.
08-09-2014

Windows works fine.
08-09-2014

On Mac, I get black objects and a bunch of: warning: Unknown value. Returning value = 55 warning: Unknown value. Returning value = 53 warning: Unknown value. Returning value = 53 warning: Unknown value. Returning value = 53 warning: Unknown value. Returning value = 55 warning: Unknown value. Returning value = 55 warning: Unknown value. Returning value = 55 warning: Unknown value. Returning value = 55 warning: Unknown value. Returning value = 55 warning: Unknown value. Returning value = 55 warning: Unknown value. Returning value = 55 warning: Unknown value. Returning value = 55 warning: Unknown value. Returning value = 55 warning: Unknown value. Returning value = 55 warning: Unknown value. Returning value = 55
08-09-2014