JDK-8079652 : Could not enable D3D pipeline
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 9
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows
  • Submitted: 2015-05-07
  • Updated: 2015-09-29
  • Resolved: 2015-05-27
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 JDK 9
8u60Fixed 9 b70Fixed
Description
After the compiler upgrade D3D can't create device, running with -Dsun.java2d.d3d=True shows:
Could not enable Direct3D pipeline on screen 0
debug logs with set set J2D_TRACE_LEVEL=5:
[E] D3D Error: D3DContext::ConfigureContext: error creating d3d device res=-2147467263
D3D debug logs:
[6160] Direct3D9: (ERROR) :Failed to create driver surface
[6160] Direct3D9: (ERROR) :Failed to initialize primary swapchain
[6160] Direct3D9: (ERROR) :Failed to initialize Framework Device. CreateDeviceEx Failed. 

Apparently this happens because the client area of the focus window isn't big enough to create a device.
MSDN states that "If you attempt to create a device on a 0x0 sized window, CreateDevice will fail."
It seems that this mean client area size, not window size.
Creating focus window of size 100x100 instead of 1x1 solves the problem.

The test is as simple as:
import java.awt.GraphicsEnvironment;

public class TestD3D {
    public static void main(String[] arg) {
        boolean isD3D = GraphicsEnvironment.getLocalGraphicsEnvironment().
            getDefaultScreenDevice().toString().contains("D3DGraphicsDevice"); // poor man's instanceof
        System.out.println("isD3D = " + isD3D);
    }
}
Comments
We don't have a facility to check if the certain pipeline is enabled, hence no regression test.
27-05-2015

I think that at some point the build logic updated how it locates D3D to be from the Windows SDK and the compiler upgrade has implied a Windows SDK upgrade too.
07-05-2015

I can't imagine how this aligns with the compiler upgrade, but the b57 works and b58 doesn't and the only fix there is compiler upgrade.
07-05-2015