Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dc43a6c9 authored by Romain Guy's avatar Romain Guy
Browse files

Add missing GLES 3.x metadata

Prevent a crash when glGetIntegerv(GL_NUM_PROGRAM_BINARY_FORMATS) returns 0

Bug: 33106868
Test: Manual test app
Change-Id: If843b99efe5498f88ec10e1bd2b2819a01983864
parent ed717563
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -272,6 +272,19 @@ getDirectBufferPointer(JNIEnv *_env, jobject buffer) {
 */
static int getNeededCount(GLint pname) {
    int needed = 1;
#ifdef GL_ES_VERSION_3_0
    // GLES 3.x pnames
    switch (pname) {
        case GL_MAX_VIEWPORT_DIMS:
            needed = 2;
            break;

        case GL_PROGRAM_BINARY_FORMATS:
            glGetIntegerv(GL_NUM_PROGRAM_BINARY_FORMATS, &needed);
            break;
    }
#endif

#ifdef GL_ES_VERSION_2_0
    // GLES 2.x pnames
    switch (pname) {
+13 −0
Original line number Diff line number Diff line
@@ -272,6 +272,19 @@ getDirectBufferPointer(JNIEnv *_env, jobject buffer) {
 */
static int getNeededCount(GLint pname) {
    int needed = 1;
#ifdef GL_ES_VERSION_3_0
    // GLES 3.x pnames
    switch (pname) {
        case GL_MAX_VIEWPORT_DIMS:
            needed = 2;
            break;

        case GL_PROGRAM_BINARY_FORMATS:
            glGetIntegerv(GL_NUM_PROGRAM_BINARY_FORMATS, &needed);
            break;
    }
#endif

#ifdef GL_ES_VERSION_2_0
    // GLES 2.x pnames
    switch (pname) {
+13 −0
Original line number Diff line number Diff line
@@ -272,6 +272,19 @@ getDirectBufferPointer(JNIEnv *_env, jobject buffer) {
 */
static int getNeededCount(GLint pname) {
    int needed = 1;
#ifdef GL_ES_VERSION_3_0
    // GLES 3.x pnames
    switch (pname) {
        case GL_MAX_VIEWPORT_DIMS:
            needed = 2;
            break;

        case GL_PROGRAM_BINARY_FORMATS:
            glGetIntegerv(GL_NUM_PROGRAM_BINARY_FORMATS, &needed);
            break;
    }
#endif

#ifdef GL_ES_VERSION_2_0
    // GLES 2.x pnames
    switch (pname) {
+13 −0
Original line number Diff line number Diff line
@@ -272,6 +272,19 @@ getDirectBufferPointer(JNIEnv *_env, jobject buffer) {
 */
static int getNeededCount(GLint pname) {
    int needed = 1;
#ifdef GL_ES_VERSION_3_0
    // GLES 3.x pnames
    switch (pname) {
        case GL_MAX_VIEWPORT_DIMS:
            needed = 2;
            break;

        case GL_PROGRAM_BINARY_FORMATS:
            glGetIntegerv(GL_NUM_PROGRAM_BINARY_FORMATS, &needed);
            break;
    }
#endif

#ifdef GL_ES_VERSION_2_0
    // GLES 2.x pnames
    switch (pname) {
+13 −0
Original line number Diff line number Diff line
@@ -272,6 +272,19 @@ getDirectBufferPointer(JNIEnv *_env, jobject buffer) {
 */
static int getNeededCount(GLint pname) {
    int needed = 1;
#ifdef GL_ES_VERSION_3_0
    // GLES 3.x pnames
    switch (pname) {
        case GL_MAX_VIEWPORT_DIMS:
            needed = 2;
            break;

        case GL_PROGRAM_BINARY_FORMATS:
            glGetIntegerv(GL_NUM_PROGRAM_BINARY_FORMATS, &needed);
            break;
    }
#endif

#ifdef GL_ES_VERSION_2_0
    // GLES 2.x pnames
    switch (pname) {
Loading