diff options
author | Ian Romanick <[email protected]> | 2015-11-17 17:09:09 -0800 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2015-11-19 20:17:16 -0800 |
commit | 457bb290efc162ea3c7c51a820ab7cf88a4efb8d (patch) | |
tree | 33bfa15fcb89fae6ff9783adb33ef8da313c4598 /src/glsl | |
parent | 06c56f443aa1850b2651df3636c42a8740cff847 (diff) |
nir: Add nir_texop_samples_identical opcode
This is the NIR analog to GLSL IR ir_samples_identical.
v2: Don't add the second nir_tex_src_ms_index parameter. Suggested by
Ken and Jason.
Signed-off-by: Ian Romanick <[email protected]>
Reviewed-by: Jason Ekstrand <[email protected]>
Reviewed-by: Chris Forbes <[email protected]>
Diffstat (limited to 'src/glsl')
-rw-r--r-- | src/glsl/nir/glsl_to_nir.cpp | 6 | ||||
-rw-r--r-- | src/glsl/nir/nir.h | 4 | ||||
-rw-r--r-- | src/glsl/nir/nir_print.c | 4 |
3 files changed, 13 insertions, 1 deletions
diff --git a/src/glsl/nir/glsl_to_nir.cpp b/src/glsl/nir/glsl_to_nir.cpp index e149d73e051..18ef4909049 100644 --- a/src/glsl/nir/glsl_to_nir.cpp +++ b/src/glsl/nir/glsl_to_nir.cpp @@ -1798,6 +1798,11 @@ nir_visitor::visit(ir_texture *ir) num_srcs = 0; break; + case ir_samples_identical: + op = nir_texop_samples_identical; + num_srcs = 1; /* coordinate */ + break; + default: unreachable("not reached"); } @@ -1825,6 +1830,7 @@ nir_visitor::visit(ir_texture *ir) case GLSL_TYPE_INT: instr->dest_type = nir_type_int; break; + case GLSL_TYPE_BOOL: case GLSL_TYPE_UINT: instr->dest_type = nir_type_unsigned; break; diff --git a/src/glsl/nir/nir.h b/src/glsl/nir/nir.h index 09eb712c06a..087b4537c09 100644 --- a/src/glsl/nir/nir.h +++ b/src/glsl/nir/nir.h @@ -956,6 +956,9 @@ typedef enum { nir_texop_tg4, /**< Texture gather */ nir_texop_query_levels, /**< Texture levels query */ nir_texop_texture_samples, /**< Texture samples query */ + nir_texop_samples_identical, /**< Query whether all samples are definitely + * identical. + */ } nir_texop; typedef struct { @@ -1029,6 +1032,7 @@ nir_tex_instr_dest_size(nir_tex_instr *instr) case nir_texop_texture_samples: case nir_texop_query_levels: + case nir_texop_samples_identical: return 1; default: diff --git a/src/glsl/nir/nir_print.c b/src/glsl/nir/nir_print.c index 54b8cc64a9b..c98a0476ef9 100644 --- a/src/glsl/nir/nir_print.c +++ b/src/glsl/nir/nir_print.c @@ -512,7 +512,9 @@ print_tex_instr(nir_tex_instr *instr, print_state *state) case nir_texop_texture_samples: fprintf(fp, "texture_samples "); break; - + case nir_texop_samples_identical: + fprintf(fp, "samples_identical "); + break; default: unreachable("Invalid texture operation"); break; |