[Impeller] opt float/sampler into relaxed precision for gles (flutter/engine#37828)

* [Impeller] opt float/sampler into relaxed precision for gles

* re-arrange define
This commit is contained in:
Jonah Williams 2022-11-22 10:27:31 -08:00 committed by GitHub
parent 82c9c227ad
commit 6438d12a32
45 changed files with 79 additions and 0 deletions

View File

@ -5,6 +5,21 @@
#ifndef TYPES_GLSL_
#define TYPES_GLSL_
#extension GL_AMD_gpu_shader_half_float : enable
#ifndef IMPELLER_TARGET_METAL
precision mediump sampler2D;
precision mediump float;
#define float16_t float
#define f16vec2 vec2
#define f16vec3 vec3
#define f16vec4 vec4
#define f16mat4 mat4
#endif // IMPELLER_TARGET_METAL
#define BoolF float
#define BoolV2 vec2
#define BoolV3 vec3

View File

@ -3,6 +3,7 @@
// found in the LICENSE file.
#include <impeller/texture.glsl>
#include <impeller/types.glsl>
uniform sampler2D texture_sampler;

View File

@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <impeller/types.glsl>
uniform VertInfo {
mat4 mvp;
}

View File

@ -5,6 +5,7 @@
#include <impeller/blending.glsl>
#include <impeller/color.glsl>
#include <impeller/texture.glsl>
#include <impeller/types.glsl>
uniform BlendInfo {
float dst_input_alpha;

View File

@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <impeller/types.glsl>
uniform FrameInfo {
mat4 mvp;
}

View File

@ -3,6 +3,7 @@
// found in the LICENSE file.
#include <impeller/texture.glsl>
#include <impeller/types.glsl>
uniform sampler2D texture_sampler_src;

View File

@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <impeller/types.glsl>
uniform FrameInfo {
mat4 mvp;
}

View File

@ -4,6 +4,7 @@
#include <impeller/gaussian.glsl>
#include <impeller/texture.glsl>
#include <impeller/types.glsl>
// Constant time mask blur for image borders.
//

View File

@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <impeller/types.glsl>
uniform FrameInfo {
mat4 mvp;

View File

@ -4,6 +4,7 @@
#include <impeller/color.glsl>
#include <impeller/texture.glsl>
#include <impeller/types.glsl>
// A color filter that transforms colors through a 4x5 color matrix.
//

View File

@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <impeller/types.glsl>
uniform FrameInfo {
mat4 mvp;
}

View File

@ -16,6 +16,7 @@
#include <impeller/constants.glsl>
#include <impeller/gaussian.glsl>
#include <impeller/texture.glsl>
#include <impeller/types.glsl>
uniform sampler2D texture_sampler;
uniform sampler2D alpha_mask_sampler;

View File

@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <impeller/types.glsl>
uniform FrameInfo {
mat4 mvp;
}

View File

@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <impeller/types.glsl>
uniform sampler2D glyph_atlas_sampler;
uniform FragInfo {

View File

@ -3,6 +3,7 @@
// found in the LICENSE file.
#include <impeller/transform.glsl>
#include <impeller/types.glsl>
uniform FrameInfo {
mat4 mvp;

View File

@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <impeller/types.glsl>
uniform sampler2D glyph_atlas_sampler;
uniform FragInfo {

View File

@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <impeller/types.glsl>
#include <impeller/transform.glsl>
uniform FrameInfo {

View File

@ -3,6 +3,7 @@
// found in the LICENSE file.
#include <impeller/transform.glsl>
#include <impeller/types.glsl>
uniform FrameInfo {
mat4 mvp;

View File

@ -3,6 +3,7 @@
// found in the LICENSE file.
#include <impeller/texture.glsl>
#include <impeller/types.glsl>
uniform sampler2D texture_sampler;

View File

@ -4,6 +4,7 @@
#include <impeller/gradient.glsl>
#include <impeller/texture.glsl>
#include <impeller/types.glsl>
readonly buffer ColorData {
vec4 colors[];

View File

@ -4,6 +4,7 @@
#include <impeller/color.glsl>
#include <impeller/texture.glsl>
#include <impeller/types.glsl>
// A color filter that applies the sRGB gamma curve to the color.
//

View File

@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <impeller/types.glsl>
uniform FrameInfo {
mat4 mvp;
}

View File

@ -4,6 +4,7 @@
#include <impeller/constants.glsl>
#include <impeller/texture.glsl>
#include <impeller/types.glsl>
// These values must correspond to the order of the items in the
// 'FilterContents::MorphType' enum class.

View File

@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <impeller/types.glsl>
uniform FrameInfo {
mat4 mvp;
}

View File

@ -3,6 +3,7 @@
// found in the LICENSE file.
#include <impeller/transform.glsl>
#include <impeller/types.glsl>
uniform VertInfo {
mat4 mvp;

View File

@ -3,6 +3,7 @@
// found in the LICENSE file.
#include <impeller/transform.glsl>
#include <impeller/types.glsl>
uniform VertInfo {
mat4 mvp;

View File

@ -3,6 +3,7 @@
// found in the LICENSE file.
#include <impeller/transform.glsl>
#include <impeller/types.glsl>
uniform VertInfo {
mat4 mvp;

View File

@ -3,6 +3,7 @@
// found in the LICENSE file.
#include <impeller/texture.glsl>
#include <impeller/types.glsl>
uniform sampler2D texture_sampler;

View File

@ -4,6 +4,7 @@
#include <impeller/gradient.glsl>
#include <impeller/texture.glsl>
#include <impeller/types.glsl>
readonly buffer ColorData {
vec4 colors[];

View File

@ -3,6 +3,7 @@
// found in the LICENSE file.
#include <impeller/gaussian.glsl>
#include <impeller/types.glsl>
uniform FragInfo {
vec4 color;

View File

@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <impeller/types.glsl>
uniform VertInfo {
mat4 mvp;
}

View File

@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <impeller/types.glsl>
uniform VertInfo {
mat4 mvp;
}

View File

@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <impeller/types.glsl>
uniform FragInfo {
vec4 color;
}

View File

@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <impeller/types.glsl>
uniform VertInfo {
mat4 mvp;
}

View File

@ -8,6 +8,8 @@
// Creates a color filter that applies the inverse of the sRGB gamma curve
// to the RGB channels.
#include <impeller/types.glsl>
uniform sampler2D input_texture;
uniform FragInfo {

View File

@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <impeller/types.glsl>
uniform FrameInfo {
mat4 mvp;
}

View File

@ -4,6 +4,7 @@
#include <impeller/constants.glsl>
#include <impeller/texture.glsl>
#include <impeller/types.glsl>
uniform sampler2D texture_sampler;

View File

@ -5,6 +5,7 @@
#include <impeller/constants.glsl>
#include <impeller/gradient.glsl>
#include <impeller/texture.glsl>
#include <impeller/types.glsl>
readonly buffer ColorData {
vec4 colors[];

View File

@ -3,6 +3,7 @@
// found in the LICENSE file.
#include <impeller/texture.glsl>
#include <impeller/types.glsl>
uniform sampler2D texture_sampler;

View File

@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <impeller/types.glsl>
uniform VertInfo {
mat4 mvp;
}

View File

@ -3,6 +3,7 @@
// found in the LICENSE file.
#include <impeller/texture.glsl>
#include <impeller/types.glsl>
uniform sampler2D texture_sampler;

View File

@ -3,6 +3,7 @@
// found in the LICENSE file.
#include <impeller/transform.glsl>
#include <impeller/types.glsl>
uniform VertInfo {
mat4 mvp;

View File

@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <impeller/types.glsl>
in vec4 v_color;
out vec4 frag_color;

View File

@ -4,6 +4,7 @@
#include <impeller/color.glsl>
#include <impeller/texture.glsl>
#include <impeller/types.glsl>
uniform sampler2D y_texture;
uniform sampler2D uv_texture;

View File

@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <impeller/types.glsl>
uniform FrameInfo {
mat4 mvp;
}