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

Commit 09b8556f authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Modifies EVS shader programs"

parents d659c520 55217072
Loading
Loading
Loading
Loading
+19 −21
Original line number Diff line number Diff line
@@ -37,11 +37,9 @@ constexpr float kDefaultColorInRgba[] = {0.1f, 0.5f, 0.1f, 1.0f};
constexpr float kDisplayAreaRatio = 0.8f;

constexpr const char vertexShaderSource[] =
        ""
        "#version 300 es                    \n"
        "layout(location = 0) in vec4 pos;  \n"
        "layout(location = 1) in vec2 tex;  \n"
        "out vec2 uv;                       \n"
        "attribute vec4 pos;                    \n"
        "attribute vec2 tex;                    \n"
        "varying vec2 uv;                       \n"
        "void main()                            \n"
        "{                                      \n"
        "   gl_Position = pos;                  \n"
@@ -49,15 +47,12 @@ constexpr const char vertexShaderSource[] =
        "}                                      \n";

constexpr const char pixelShaderSource[] =
        "#version 300 es                    \n"
        "precision mediump float;               \n"
        "uniform sampler2D tex;                 \n"
        "in vec2 uv;                        \n"
        "out vec4 color;                    \n"
        "varying vec2 uv;                       \n"
        "void main()                            \n"
        "{                                      \n"
        "    vec4 texel = texture(tex, uv); \n"
        "    color = texel;                 \n"
        "    gl_FragColor = texture2D(tex, uv); \n"
        "}                                      \n";

const char* getEGLError(void) {
@@ -157,6 +152,9 @@ GLuint buildShaderProgram(const char* vtxSrc, const char* pxlSrc) {
    glAttachShader(program, vertexShader);
    glAttachShader(program, pixelShader);

    glBindAttribLocation(program, 0, "pos");
    glBindAttribLocation(program, 1, "tex");

    // Link the program
    glLinkProgram(program);
    GLint linked = 0;
@@ -235,7 +233,7 @@ bool GlWrapper::initialize(const sp<IAutomotiveDisplayProxyService>& service, ui
        return false;
    }

    EGLint major = 3;
    EGLint major = 2;
    EGLint minor = 0;
    if (!eglInitialize(mDisplay, &major, &minor)) {
        LOG(ERROR) << "Failed to initialize EGL: " << getEGLError();