Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8079652

Could not enable D3D pipeline

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P2
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 9
    • Component/s: client-libs
    • Labels:
    • Subcomponent:
      2d
    • Introduced In Build:
      b58
    • Introduced In Version:
      9
    • Resolved In Build:
      b70
    • OS:
      windows

      Backports

        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);
            }
        }

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                vadim Vadim Pakhnushev
                Reporter:
                vadim Vadim Pakhnushev
                Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: