mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
[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:
parent
82c9c227ad
commit
6438d12a32
@ -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
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include <impeller/texture.glsl>
|
||||
#include <impeller/types.glsl>
|
||||
|
||||
uniform sampler2D texture_sampler;
|
||||
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include <impeller/texture.glsl>
|
||||
#include <impeller/types.glsl>
|
||||
|
||||
uniform sampler2D texture_sampler_src;
|
||||
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
|
||||
#include <impeller/gaussian.glsl>
|
||||
#include <impeller/texture.glsl>
|
||||
#include <impeller/types.glsl>
|
||||
|
||||
// Constant time mask blur for image borders.
|
||||
//
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
@ -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.
|
||||
//
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include <impeller/transform.glsl>
|
||||
#include <impeller/types.glsl>
|
||||
|
||||
uniform FrameInfo {
|
||||
mat4 mvp;
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include <impeller/transform.glsl>
|
||||
#include <impeller/types.glsl>
|
||||
|
||||
uniform FrameInfo {
|
||||
mat4 mvp;
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include <impeller/texture.glsl>
|
||||
#include <impeller/types.glsl>
|
||||
|
||||
uniform sampler2D texture_sampler;
|
||||
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
|
||||
#include <impeller/gradient.glsl>
|
||||
#include <impeller/texture.glsl>
|
||||
#include <impeller/types.glsl>
|
||||
|
||||
readonly buffer ColorData {
|
||||
vec4 colors[];
|
||||
|
||||
@ -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.
|
||||
//
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include <impeller/transform.glsl>
|
||||
#include <impeller/types.glsl>
|
||||
|
||||
uniform VertInfo {
|
||||
mat4 mvp;
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include <impeller/transform.glsl>
|
||||
#include <impeller/types.glsl>
|
||||
|
||||
uniform VertInfo {
|
||||
mat4 mvp;
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include <impeller/transform.glsl>
|
||||
#include <impeller/types.glsl>
|
||||
|
||||
uniform VertInfo {
|
||||
mat4 mvp;
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include <impeller/texture.glsl>
|
||||
#include <impeller/types.glsl>
|
||||
|
||||
uniform sampler2D texture_sampler;
|
||||
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
|
||||
#include <impeller/gradient.glsl>
|
||||
#include <impeller/texture.glsl>
|
||||
#include <impeller/types.glsl>
|
||||
|
||||
readonly buffer ColorData {
|
||||
vec4 colors[];
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include <impeller/gaussian.glsl>
|
||||
#include <impeller/types.glsl>
|
||||
|
||||
uniform FragInfo {
|
||||
vec4 color;
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
|
||||
#include <impeller/constants.glsl>
|
||||
#include <impeller/texture.glsl>
|
||||
#include <impeller/types.glsl>
|
||||
|
||||
uniform sampler2D texture_sampler;
|
||||
|
||||
|
||||
@ -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[];
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include <impeller/texture.glsl>
|
||||
#include <impeller/types.glsl>
|
||||
|
||||
uniform sampler2D texture_sampler;
|
||||
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include <impeller/texture.glsl>
|
||||
#include <impeller/types.glsl>
|
||||
|
||||
uniform sampler2D texture_sampler;
|
||||
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include <impeller/transform.glsl>
|
||||
#include <impeller/types.glsl>
|
||||
|
||||
uniform VertInfo {
|
||||
mat4 mvp;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
|
||||
#include <impeller/color.glsl>
|
||||
#include <impeller/texture.glsl>
|
||||
#include <impeller/types.glsl>
|
||||
|
||||
uniform sampler2D y_texture;
|
||||
uniform sampler2D uv_texture;
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user