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

OGL: Toolkit.sync() should issue a glFinish()

    XMLWordPrintable

    Details

    • Subcomponent:
      2d
    • Resolved In Build:
      b10
    • CPU:
      generic
    • OS:
      generic
    • Verification:
      Not verified

      Backports

        Description

        In recent fixes involving fragment shaders (6514990, 6521533) it became clear that
        the OpenGL pixel pipeline can be quite long, meaning for complex operations happening
        on the GPU it can take a while for the pixels to go through the complete pipeline
        and appear on the screen. Our current approach in the OpenGL-based pipeline is to
        simply call glFlush() at the end of processing a batch of operations. The glFlush()
        method is basically a way to asynchronously flush operations pending in hardware.
        This is one of the main benefits of hardware acceleration in that we can offload
        complex work to the GPU without having to wait for it on the CPU.

        Currently if you call Toolkit.sync(), all it does is force Java 2D's RenderQueue
        to be flushed, followed by a call to glFlush(). This is usually sufficient for
        ensuring that pending operations are flushed to the screen in a timely manner, but
        for complex operations like the ones described above, it's usually not enough.
        The problem] is that in certain scenarios (e.g. microbenchmarks, regression
        tests that sample screen pixels via Robot) our current approach with glFlush()
        does not always get the pixels to the screen in a timely manner. This can wreak
        havoc with J2DBench results (due to high variance) and can cause regression tests
        to fail (because the hardware isn't flushed by the time Robot needs to sample pixels).

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                campbell Christopher Campbell (Inactive)
                Reporter:
                campbell Christopher Campbell (Inactive)
                Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: