/*
 * Copyright (C) 2021 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
#include <stdio.h>
#include <string.h>
#include <utils/Log.h>

bool supportsRenderEffectCache(const char* vendor, const char* version) {
    if (strcmp(vendor, "Qualcomm") != 0) {
       return true;
    }

    int major;
    int minor;
    int driverMajor;
    int driverMinor;
    int n = sscanf(version,"OpenGL ES %d.%d V@%d.%d",
                           &major,
                           &minor,
                           &driverMajor,
                           &driverMinor);
    // Ensure we have parsed the vendor string properly and we have either
    // a newer major driver version, or the minor version is rev'ed
    // Based on b/198227600#comment5 it appears that the corresponding fix
    // is in driver version 571.0
    return n == 4 && driverMajor >= 571;
}