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

Commit 4a745e78 authored by Romain Guy's avatar Romain Guy Committed by Android (Google) Code Review
Browse files

Merge "Change the dither texture's swizzling" into jb-mr2-dev

parents 2355d131 032d47af
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -38,6 +38,10 @@ void Dither::bindDitherTexture() {
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);

        if (useFloatTexture) {
            // We use a R16F texture, let's remap the alpha channel to the
            // red channel to avoid changing the shader sampling code on GL ES 3.0+
            glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_A, GL_RED);

            float dither = 1.0f / (255.0f * DITHER_KERNEL_SIZE * DITHER_KERNEL_SIZE);
            const GLfloat pattern[] = {
                 0 * dither,  8 * dither,  2 * dither, 10 * dither,
+1 −1
Original line number Diff line number Diff line
@@ -186,7 +186,7 @@ const char* gFS_Main_Dither[2] = {
        // ES 2.0
        "texture2D(ditherSampler, ditherTexCoords).a * " STR(DITHER_KERNEL_SIZE_INV_SQUARE),
        // ES 3.0
        "texture2D(ditherSampler, ditherTexCoords).r"
        "texture2D(ditherSampler, ditherTexCoords).a"
};
const char* gFS_Main_AddDitherToGradient =
        "    gradientColor += %s;\n";