[Mesa-dev] [RFC 16/16] nir: Consider float precision when deciding opcode: part 2
Topi Pohjolainen
topi.pohjolainen at intel.com
Fri May 15 02:39:43 PDT 2015
Signed-off-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
---
src/glsl/nir/glsl_to_nir.cpp | 32 ++++++++++++++++----------------
1 file changed, 16 insertions(+), 16 deletions(-)
diff --git a/src/glsl/nir/glsl_to_nir.cpp b/src/glsl/nir/glsl_to_nir.cpp
index b4777aa..14c4324 100644
--- a/src/glsl/nir/glsl_to_nir.cpp
+++ b/src/glsl/nir/glsl_to_nir.cpp
@@ -1185,37 +1185,37 @@ nir_visitor::visit(ir_expression *ir)
switch (ir->type->vector_elements) {
case 1:
switch (ir->operands[0]->type->vector_elements) {
- case 1: emit(nir_op_fnoise1_1, dest_size, srcs); break;
- case 2: emit(nir_op_fnoise1_2, dest_size, srcs); break;
- case 3: emit(nir_op_fnoise1_3, dest_size, srcs); break;
- case 4: emit(nir_op_fnoise1_4, dest_size, srcs); break;
+ case 1: emit(OP_FLT(types[0], noise1_1), dest_size, srcs); break;
+ case 2: emit(OP_FLT(types[0], noise1_2), dest_size, srcs); break;
+ case 3: emit(OP_FLT(types[0], noise1_3), dest_size, srcs); break;
+ case 4: emit(OP_FLT(types[0], noise1_4), dest_size, srcs); break;
default: unreachable("not reached");
}
break;
case 2:
switch (ir->operands[0]->type->vector_elements) {
- case 1: emit(nir_op_fnoise2_1, dest_size, srcs); break;
- case 2: emit(nir_op_fnoise2_2, dest_size, srcs); break;
- case 3: emit(nir_op_fnoise2_3, dest_size, srcs); break;
- case 4: emit(nir_op_fnoise2_4, dest_size, srcs); break;
+ case 1: emit(OP_FLT(types[0], noise2_1), dest_size, srcs); break;
+ case 2: emit(OP_FLT(types[0], noise2_2), dest_size, srcs); break;
+ case 3: emit(OP_FLT(types[0], noise2_3), dest_size, srcs); break;
+ case 4: emit(OP_FLT(types[0], noise2_4), dest_size, srcs); break;
default: unreachable("not reached");
}
break;
case 3:
switch (ir->operands[0]->type->vector_elements) {
- case 1: emit(nir_op_fnoise3_1, dest_size, srcs); break;
- case 2: emit(nir_op_fnoise3_2, dest_size, srcs); break;
- case 3: emit(nir_op_fnoise3_3, dest_size, srcs); break;
- case 4: emit(nir_op_fnoise3_4, dest_size, srcs); break;
+ case 1: emit(OP_FLT(types[0], noise3_1), dest_size, srcs); break;
+ case 2: emit(OP_FLT(types[0], noise3_2), dest_size, srcs); break;
+ case 3: emit(OP_FLT(types[0], noise3_3), dest_size, srcs); break;
+ case 4: emit(OP_FLT(types[0], noise3_4), dest_size, srcs); break;
default: unreachable("not reached");
}
break;
case 4:
switch (ir->operands[0]->type->vector_elements) {
- case 1: emit(nir_op_fnoise4_1, dest_size, srcs); break;
- case 2: emit(nir_op_fnoise4_2, dest_size, srcs); break;
- case 3: emit(nir_op_fnoise4_3, dest_size, srcs); break;
- case 4: emit(nir_op_fnoise4_4, dest_size, srcs); break;
+ case 1: emit(OP_FLT(types[0], noise4_1), dest_size, srcs); break;
+ case 2: emit(OP_FLT(types[0], noise4_2), dest_size, srcs); break;
+ case 3: emit(OP_FLT(types[0], noise4_3), dest_size, srcs); break;
+ case 4: emit(OP_FLT(types[0], noise4_4), dest_size, srcs); break;
default: unreachable("not reached");
}
break;
--
1.9.3
More information about the mesa-dev
mailing list