summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJose Maria Casanova Crespo <[email protected]>2018-03-01 18:06:52 +0100
committerJason Ekstrand <[email protected]>2018-03-01 09:16:03 -0800
commit4420d8866c2892f6776d10de60fd6656376e1dd4 (patch)
tree8f30b79ccfdf1175da27272553bde877166e7ae6
parent99ee40fb544ce17489fc2511d44ce1026a5ec70c (diff)
nir/search: Include 8 and 16-bit support in construct_value
Reviewed-by: Jason Ekstrand <[email protected]>
-rw-r--r--src/compiler/nir/nir_search.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/compiler/nir/nir_search.c b/src/compiler/nir/nir_search.c
index c7c52ae320d..28b36b2b863 100644
--- a/src/compiler/nir/nir_search.c
+++ b/src/compiler/nir/nir_search.c
@@ -525,6 +525,9 @@ construct_value(const nir_search_value *value,
case nir_type_float:
load->def.name = ralloc_asprintf(load, "%f", c->data.d);
switch (bitsize->dest_size) {
+ case 16:
+ load->value.u16[0] = _mesa_float_to_half(c->data.d);
+ break;
case 32:
load->value.f32[0] = c->data.d;
break;
@@ -539,6 +542,12 @@ construct_value(const nir_search_value *value,
case nir_type_int:
load->def.name = ralloc_asprintf(load, "%" PRIi64, c->data.i);
switch (bitsize->dest_size) {
+ case 8:
+ load->value.i8[0] = c->data.i;
+ break;
+ case 16:
+ load->value.i16[0] = c->data.i;
+ break;
case 32:
load->value.i32[0] = c->data.i;
break;
@@ -553,6 +562,12 @@ construct_value(const nir_search_value *value,
case nir_type_uint:
load->def.name = ralloc_asprintf(load, "%" PRIu64, c->data.u);
switch (bitsize->dest_size) {
+ case 8:
+ load->value.u8[0] = c->data.u;
+ break;
+ case 16:
+ load->value.u16[0] = c->data.u;
+ break;
case 32:
load->value.u32[0] = c->data.u;
break;