diff options
author | Ilia Mirkin <[email protected]> | 2018-02-02 07:47:54 +0200 |
---|---|---|
committer | Tapani Pälli <[email protected]> | 2018-02-06 07:28:11 +0200 |
commit | 02a6d901eee188492af54e98c92680a607b02bf8 (patch) | |
tree | 2e46e3a2f1ba25b82bbba2fb3d21a601e6c022d4 /src/compiler/glsl/builtin_functions.cpp | |
parent | fe32f796f2657af966addb9d1f5d54dced3a7abc (diff) |
mesa: add OES_EGL_image_external_essl3 support
Signed-off-by: Ilia Mirkin <[email protected]>
Reviewed-by: Tapani Pälli <[email protected]>
Diffstat (limited to 'src/compiler/glsl/builtin_functions.cpp')
-rw-r--r-- | src/compiler/glsl/builtin_functions.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/compiler/glsl/builtin_functions.cpp b/src/compiler/glsl/builtin_functions.cpp index 530cdc0264c..293e8bd638f 100644 --- a/src/compiler/glsl/builtin_functions.cpp +++ b/src/compiler/glsl/builtin_functions.cpp @@ -188,6 +188,14 @@ texture_external(const _mesa_glsl_parse_state *state) return state->OES_EGL_image_external_enable; } +static bool +texture_external_es3(const _mesa_glsl_parse_state *state) +{ + return state->OES_EGL_image_external_essl3_enable && + state->es_shader && + state->is_version(0, 300); +} + /** True if texturing functions with explicit LOD are allowed. */ static bool lod_exists_in_stage(const _mesa_glsl_parse_state *state) @@ -1919,6 +1927,8 @@ builtin_builder::create_builtins() _texture(ir_tex, v130, glsl_type::float_type, glsl_type::sampler2DRectShadow_type, glsl_type::vec3_type), + _texture(ir_tex, texture_external_es3, glsl_type::vec4_type, glsl_type::samplerExternalOES_type, glsl_type::vec2_type), + _texture(ir_txb, v130_fs_only, glsl_type::vec4_type, glsl_type::sampler1D_type, glsl_type::float_type), _texture(ir_txb, v130_fs_only, glsl_type::ivec4_type, glsl_type::isampler1D_type, glsl_type::float_type), _texture(ir_txb, v130_fs_only, glsl_type::uvec4_type, glsl_type::usampler1D_type, glsl_type::float_type), @@ -2078,6 +2088,9 @@ builtin_builder::create_builtins() _texture(ir_tex, v130, glsl_type::vec4_type, glsl_type::sampler2DRect_type, glsl_type::vec3_type, TEX_PROJECT), _texture(ir_tex, v130, glsl_type::ivec4_type, glsl_type::isampler2DRect_type, glsl_type::vec3_type, TEX_PROJECT), + _texture(ir_tex, texture_external_es3, glsl_type::vec4_type, glsl_type::samplerExternalOES_type, glsl_type::vec3_type, TEX_PROJECT), + _texture(ir_tex, texture_external_es3, glsl_type::vec4_type, glsl_type::samplerExternalOES_type, glsl_type::vec4_type, TEX_PROJECT), + _texture(ir_tex, v130, glsl_type::uvec4_type, glsl_type::usampler2DRect_type, glsl_type::vec3_type, TEX_PROJECT), _texture(ir_tex, v130, glsl_type::vec4_type, glsl_type::sampler2DRect_type, glsl_type::vec4_type, TEX_PROJECT), _texture(ir_tex, v130, glsl_type::ivec4_type, glsl_type::isampler2DRect_type, glsl_type::vec4_type, TEX_PROJECT), @@ -2143,8 +2156,12 @@ builtin_builder::create_builtins() _texelFetch(texture_multisample_array, glsl_type::vec4_type, glsl_type::sampler2DMSArray_type, glsl_type::ivec3_type), _texelFetch(texture_multisample_array, glsl_type::ivec4_type, glsl_type::isampler2DMSArray_type, glsl_type::ivec3_type), _texelFetch(texture_multisample_array, glsl_type::uvec4_type, glsl_type::usampler2DMSArray_type, glsl_type::ivec3_type), + + _texelFetch(texture_external_es3, glsl_type::vec4_type, glsl_type::samplerExternalOES_type, glsl_type::ivec2_type), + NULL); + add_function("texelFetchOffset", _texelFetch(v130, glsl_type::vec4_type, glsl_type::sampler1D_type, glsl_type::int_type, glsl_type::int_type), _texelFetch(v130, glsl_type::ivec4_type, glsl_type::isampler1D_type, glsl_type::int_type, glsl_type::int_type), |