[Mesa-dev] [PATCH 2/8] gallium/vl: Add sampler views to video filter fragment shaders

Thomas Hellstrom thellstrom at vmware.com
Tue Feb 21 20:52:42 UTC 2017


Needed for at least the svga driver.

Signed-off-by: Thomas Hellstrom <thellstrom at vmware.com>
Reviewed-by: Brian Paul <brianp at vmware.com>
---
 src/gallium/auxiliary/vl/vl_bicubic_filter.c | 5 +++++
 src/gallium/auxiliary/vl/vl_matrix_filter.c  | 5 +++++
 src/gallium/auxiliary/vl/vl_median_filter.c  | 5 +++++
 3 files changed, 15 insertions(+)

diff --git a/src/gallium/auxiliary/vl/vl_bicubic_filter.c b/src/gallium/auxiliary/vl/vl_bicubic_filter.c
index 570f153..ae29208 100644
--- a/src/gallium/auxiliary/vl/vl_bicubic_filter.c
+++ b/src/gallium/auxiliary/vl/vl_bicubic_filter.c
@@ -174,6 +174,11 @@ create_frag_shader(struct vl_bicubic_filter *filter, unsigned video_width,
 
    i_vtex = ureg_DECL_fs_input(shader, TGSI_SEMANTIC_GENERIC, VS_O_VTEX, TGSI_INTERPOLATE_LINEAR);
    sampler = ureg_DECL_sampler(shader, 0);
+   ureg_DECL_sampler_view(shader, 0, TGSI_TEXTURE_2D,
+                          TGSI_RETURN_TYPE_FLOAT,
+                          TGSI_RETURN_TYPE_FLOAT,
+                          TGSI_RETURN_TYPE_FLOAT,
+                          TGSI_RETURN_TYPE_FLOAT);
 
    for (i = 0; i < 23; ++i)
       t_array[i] = ureg_DECL_temporary(shader);
diff --git a/src/gallium/auxiliary/vl/vl_matrix_filter.c b/src/gallium/auxiliary/vl/vl_matrix_filter.c
index e331cb7..11ec816 100644
--- a/src/gallium/auxiliary/vl/vl_matrix_filter.c
+++ b/src/gallium/auxiliary/vl/vl_matrix_filter.c
@@ -95,6 +95,11 @@ create_frag_shader(struct vl_matrix_filter *filter, unsigned num_offsets,
 
    i_vtex = ureg_DECL_fs_input(shader, TGSI_SEMANTIC_GENERIC, VS_O_VTEX, TGSI_INTERPOLATE_LINEAR);
    sampler = ureg_DECL_sampler(shader, 0);
+   ureg_DECL_sampler_view(shader, 0, TGSI_TEXTURE_2D,
+                          TGSI_RETURN_TYPE_FLOAT,
+                          TGSI_RETURN_TYPE_FLOAT,
+                          TGSI_RETURN_TYPE_FLOAT,
+                          TGSI_RETURN_TYPE_FLOAT);
 
    for (i = 0; i < num_offsets; ++i)
       if (matrix_values[i] != 0.0f)
diff --git a/src/gallium/auxiliary/vl/vl_median_filter.c b/src/gallium/auxiliary/vl/vl_median_filter.c
index f7477b7..0183b875 100644
--- a/src/gallium/auxiliary/vl/vl_median_filter.c
+++ b/src/gallium/auxiliary/vl/vl_median_filter.c
@@ -107,6 +107,11 @@ create_frag_shader(struct vl_median_filter *filter,
 
    i_vtex = ureg_DECL_fs_input(shader, TGSI_SEMANTIC_GENERIC, VS_O_VTEX, TGSI_INTERPOLATE_LINEAR);
    sampler = ureg_DECL_sampler(shader, 0);
+   ureg_DECL_sampler_view(shader, 0, TGSI_TEXTURE_2D,
+                          TGSI_RETURN_TYPE_FLOAT,
+                          TGSI_RETURN_TYPE_FLOAT,
+                          TGSI_RETURN_TYPE_FLOAT,
+                          TGSI_RETURN_TYPE_FLOAT);
 
    for (i = 0; i < num_offsets; ++i)
       t_array[i] = ureg_DECL_temporary(shader);
-- 
2.5.0



More information about the mesa-dev mailing list