aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_nir.c
diff options
context:
space:
mode:
authorEduardo Lima Mitev <[email protected]>2015-04-17 18:10:50 +0200
committerJason Ekstrand <[email protected]>2015-08-03 09:40:47 -0700
commit97e205fd35bf77fd761caf24c611ff72cc0d85e2 (patch)
treec88ffa3339df6ea101edc931c616adba3ea74c98 /src/mesa/drivers/dri/i965/brw_nir.c
parentf7152525374015594e037fa11bb64e1c7174829b (diff)
i965/nir: Move brw_type_for_nir_type() to brw_nir to allow reuse
Upcoming NIR->vec4 pass can benefit from this method, so lets move it up. Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_nir.c')
-rw-r--r--src/mesa/drivers/dri/i965/brw_nir.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_nir.c b/src/mesa/drivers/dri/i965/brw_nir.c
index a4b65d24e27..b241121dac7 100644
--- a/src/mesa/drivers/dri/i965/brw_nir.c
+++ b/src/mesa/drivers/dri/i965/brw_nir.c
@@ -186,3 +186,21 @@ brw_create_nir(struct brw_context *brw,
return nir;
}
+
+enum brw_reg_type
+brw_type_for_nir_type(nir_alu_type type)
+{
+ switch (type) {
+ case nir_type_unsigned:
+ return BRW_REGISTER_TYPE_UD;
+ case nir_type_bool:
+ case nir_type_int:
+ return BRW_REGISTER_TYPE_D;
+ case nir_type_float:
+ return BRW_REGISTER_TYPE_F;
+ default:
+ unreachable("unknown type");
+ }
+
+ return BRW_REGISTER_TYPE_F;
+}