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

Remove Flush & Finish in ES2SwapChain

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • None
    • javafx

      OpenGL is documented to flush when buffers are swapped so a glFlush() in C code (and other extra calls that flush OpenGL) can be removed. For example:

      JNIEXPORT jboolean JNICALL Java_com_sun_prism_es2_EGLFBGLDrawable_nSwapBuffers
      (JNIEnv *env, jclass jeglfbDrawable, jlong nativeDInfo) {
          int value;

          // Do not flush - eglSwapBuffers() is documented to already do a glFlush()
          //glFlush();
          
          DrawableInfo *dInfo = (DrawableInfo *) jlong_to_ptr(nativeDInfo);
          if (dInfo == NULL) {
              return JNI_FALSE;
          }
          PRISM_LOG("eglSwapBuffers(display=%p, surface=%p)",
                    dInfo->egldisplay, dInfo->eglsurface);
          if (!eglSwapBuffers(dInfo->egldisplay, dInfo->eglsurface)) {
              fprintf(stderr, "eglSwapBuffers failed; eglGetError %d\n", eglGetError());
          }
          return JNI_TRUE;
      }

            Unassigned Unassigned
            snorthov Steve Northover (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Imported: