< prev index next >

src/java.desktop/share/native/common/java2d/opengl/OGLContext.c

Print this page




 896         // this is an Nvidia board, at least PS 2.0, but we can't
 897         // use the "max instructions" heuristic since GeForce FX
 898         // boards report 1024 even though they're only PS 2.0,
 899         // so we'll check the following, which does imply PS 3.0
 900         if (OGLContext_IsExtensionAvailable(e, "GL_NV_fragment_program2")) {
 901             *caps |= CAPS_PS30;
 902         }
 903     } else {
 904         // for all other boards, we look at the "max instructions"
 905         // count reported by the GL_ARB_fragment_program extension
 906         // as a heuristic for detecting PS 3.0 compatible hardware
 907         if (OGLContext_IsExtensionAvailable(e, "GL_ARB_fragment_program")) {
 908             GLint instr;
 909             j2d_glGetProgramivARB(GL_FRAGMENT_PROGRAM_ARB,
 910                                   GL_MAX_PROGRAM_INSTRUCTIONS_ARB, &instr);
 911             if (instr > 512) {
 912                 *caps |= CAPS_PS30;
 913             }
 914         }
 915     }




 916     // stuff vendor descriptor in the upper bits of the caps
 917     if (vendor != NULL) {
 918         if (strncmp(vendor, "ATI", 3) == 0) {
 919             vcap = OGLC_VENDOR_ATI;
 920         } else if (strncmp(vendor, "NVIDIA", 6) == 0) {
 921             vcap = OGLC_VENDOR_NVIDIA;
 922         } else if (strncmp(vendor, "Intel", 5) == 0) {
 923             vcap = OGLC_VENDOR_INTEL;
 924         }
 925         // REMIND: new in 7 - check if needs fixing
 926         *caps |= ((vcap & OGLC_VCAP_MASK) << OGLC_VCAP_OFFSET);
 927     }
 928 
 929 }
 930 
 931 /**
 932  * Returns JNI_TRUE if the given GL_VERSION string meets the minimum
 933  * requirements (>= 1.2); JNI_FALSE otherwise.
 934  */
 935 jboolean




 896         // this is an Nvidia board, at least PS 2.0, but we can't
 897         // use the "max instructions" heuristic since GeForce FX
 898         // boards report 1024 even though they're only PS 2.0,
 899         // so we'll check the following, which does imply PS 3.0
 900         if (OGLContext_IsExtensionAvailable(e, "GL_NV_fragment_program2")) {
 901             *caps |= CAPS_PS30;
 902         }
 903     } else {
 904         // for all other boards, we look at the "max instructions"
 905         // count reported by the GL_ARB_fragment_program extension
 906         // as a heuristic for detecting PS 3.0 compatible hardware
 907         if (OGLContext_IsExtensionAvailable(e, "GL_ARB_fragment_program")) {
 908             GLint instr;
 909             j2d_glGetProgramivARB(GL_FRAGMENT_PROGRAM_ARB,
 910                                   GL_MAX_PROGRAM_INSTRUCTIONS_ARB, &instr);
 911             if (instr > 512) {
 912                 *caps |= CAPS_PS30;
 913             }
 914         }
 915     }
 916     if (OGLContext_IsExtensionAvailable(e, "GL_NV_texture_barrier")) {
 917         *caps |= CAPS_EXT_TEXBARRIER;
 918     }
 919     
 920     // stuff vendor descriptor in the upper bits of the caps
 921     if (vendor != NULL) {
 922         if (strncmp(vendor, "ATI", 3) == 0) {
 923             vcap = OGLC_VENDOR_ATI;
 924         } else if (strncmp(vendor, "NVIDIA", 6) == 0) {
 925             vcap = OGLC_VENDOR_NVIDIA;
 926         } else if (strncmp(vendor, "Intel", 5) == 0) {
 927             vcap = OGLC_VENDOR_INTEL;
 928         }
 929         // REMIND: new in 7 - check if needs fixing
 930         *caps |= ((vcap & OGLC_VCAP_MASK) << OGLC_VCAP_OFFSET);
 931     }
 932 
 933 }
 934 
 935 /**
 936  * Returns JNI_TRUE if the given GL_VERSION string meets the minimum
 937  * requirements (>= 1.2); JNI_FALSE otherwise.
 938  */
 939 jboolean


< prev index next >