[Mesa-dev] [PATCH 03/10] nir: add nir_texop_texture_samples and convert from glsl
Ilia Mirkin
imirkin at alum.mit.edu
Thu Aug 27 20:48:32 PDT 2015
Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
---
src/glsl/nir/glsl_to_nir.cpp | 5 +++++
src/glsl/nir/nir.h | 4 +++-
src/glsl/nir/nir_print.c | 3 +++
3 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/src/glsl/nir/glsl_to_nir.cpp b/src/glsl/nir/glsl_to_nir.cpp
index 5fb4ee2..ed1a91e 100644
--- a/src/glsl/nir/glsl_to_nir.cpp
+++ b/src/glsl/nir/glsl_to_nir.cpp
@@ -1717,6 +1717,11 @@ nir_visitor::visit(ir_texture *ir)
num_srcs = 0;
break;
+ case ir_texture_samples:
+ op = nir_texop_texture_samples;
+ num_srcs = 0;
+ break;
+
default:
unreachable("not reached");
}
diff --git a/src/glsl/nir/nir.h b/src/glsl/nir/nir.h
index 9703372..8edb818 100644
--- a/src/glsl/nir/nir.h
+++ b/src/glsl/nir/nir.h
@@ -944,7 +944,8 @@ typedef enum {
nir_texop_txs, /**< Texture size */
nir_texop_lod, /**< Texture lod query */
nir_texop_tg4, /**< Texture gather */
- nir_texop_query_levels /**< Texture levels query */
+ nir_texop_query_levels, /**< Texture levels query */
+ nir_texop_texture_samples, /**< Texture samples query */
} nir_texop;
typedef struct {
@@ -1016,6 +1017,7 @@ nir_tex_instr_dest_size(nir_tex_instr *instr)
case nir_texop_lod:
return 2;
+ case nir_texop_texture_samples:
case nir_texop_query_levels:
return 1;
diff --git a/src/glsl/nir/nir_print.c b/src/glsl/nir/nir_print.c
index f591c4b..69cadba 100644
--- a/src/glsl/nir/nir_print.c
+++ b/src/glsl/nir/nir_print.c
@@ -417,6 +417,9 @@ print_tex_instr(nir_tex_instr *instr, print_var_state *state, FILE *fp)
case nir_texop_query_levels:
fprintf(fp, "query_levels ");
break;
+ case nir_texop_texture_samples:
+ fprintf(fp, "texture_samples ");
+ break;
default:
unreachable("Invalid texture operation");
--
2.4.6
More information about the mesa-dev
mailing list