summaryrefslogtreecommitdiffstats
path: root/src/compiler
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2018-08-06 02:48:12 -0400
committerMarek Olšák <[email protected]>2018-12-04 15:33:29 -0500
commit1660f3aa05f9cdc62787972d7f1905e00580e011 (patch)
treeb3cba1cf79fafd2bac8ed78d47f29422b77125d9 /src/compiler
parent908f817918fb14a12887f942b8358a5c648b3f92 (diff)
mesa: expose AMD_texture_texture4
because the closed driver exposes it. Tested by piglit. Reviewed-by: Ilia Mirkin <[email protected]>
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/glsl/builtin_functions.cpp10
-rw-r--r--src/compiler/glsl/glsl_parser_extras.cpp1
-rw-r--r--src/compiler/glsl/glsl_parser_extras.h2
3 files changed, 13 insertions, 0 deletions
diff --git a/src/compiler/glsl/builtin_functions.cpp b/src/compiler/glsl/builtin_functions.cpp
index b6018806865..0f747b94757 100644
--- a/src/compiler/glsl/builtin_functions.cpp
+++ b/src/compiler/glsl/builtin_functions.cpp
@@ -419,6 +419,12 @@ texture_gather_cube_map_array(const _mesa_glsl_parse_state *state)
}
static bool
+texture_texture4(const _mesa_glsl_parse_state *state)
+{
+ return state->AMD_texture_texture4_enable;
+}
+
+static bool
texture_gather_or_es31(const _mesa_glsl_parse_state *state)
{
return state->is_version(400, 310) ||
@@ -2891,6 +2897,10 @@ builtin_builder::create_builtins()
_texture(ir_txd, shader_texture_lod_and_rect, glsl_type::vec4_type, glsl_type::sampler2DRectShadow_type, glsl_type::vec4_type, TEX_PROJECT),
NULL);
+ add_function("texture4",
+ _texture(ir_tg4, texture_texture4, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec2_type),
+ NULL);
+
add_function("textureGather",
_texture(ir_tg4, texture_gather_or_es31, glsl_type::vec4_type, glsl_type::sampler2D_type, glsl_type::vec2_type),
_texture(ir_tg4, texture_gather_or_es31, glsl_type::ivec4_type, glsl_type::isampler2D_type, glsl_type::vec2_type),
diff --git a/src/compiler/glsl/glsl_parser_extras.cpp b/src/compiler/glsl/glsl_parser_extras.cpp
index f9178d8c107..2048a7f9006 100644
--- a/src/compiler/glsl/glsl_parser_extras.cpp
+++ b/src/compiler/glsl/glsl_parser_extras.cpp
@@ -706,6 +706,7 @@ static const _mesa_glsl_extension _mesa_glsl_supported_extensions[] = {
EXT(AMD_gpu_shader_int64),
EXT(AMD_shader_stencil_export),
EXT(AMD_shader_trinary_minmax),
+ EXT(AMD_texture_texture4),
EXT(AMD_vertex_shader_layer),
EXT(AMD_vertex_shader_viewport_index),
EXT(ANDROID_extension_pack_es31a),
diff --git a/src/compiler/glsl/glsl_parser_extras.h b/src/compiler/glsl/glsl_parser_extras.h
index 7ceee7469d8..b17b5125e0b 100644
--- a/src/compiler/glsl/glsl_parser_extras.h
+++ b/src/compiler/glsl/glsl_parser_extras.h
@@ -786,6 +786,8 @@ struct _mesa_glsl_parse_state {
bool AMD_shader_stencil_export_warn;
bool AMD_shader_trinary_minmax_enable;
bool AMD_shader_trinary_minmax_warn;
+ bool AMD_texture_texture4_enable;
+ bool AMD_texture_texture4_warn;
bool AMD_vertex_shader_layer_enable;
bool AMD_vertex_shader_layer_warn;
bool AMD_vertex_shader_viewport_index_enable;