[Mesa-dev] [PATCH 5/9] glsl/lower_64bit: add ability to handle 32-bit sources.
Dave Airlie
airlied at gmail.com
Thu Feb 1 03:33:54 UTC 2018
From: Dave Airlie <airlied at redhat.com>
If this function saw a 32-bit source it would just return the
IR without doing any conversion, this adds the ability to denote
where 32-bit sources are expected and will be used in subsequent
patches to add 32->64 conversions.
Signed-off-by: Dave Airlie <airlied at redhat.com>
---
src/compiler/glsl/lower_64bit.cpp | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/src/compiler/glsl/lower_64bit.cpp b/src/compiler/glsl/lower_64bit.cpp
index 020ec2e9c3..b72b5cf799 100644
--- a/src/compiler/glsl/lower_64bit.cpp
+++ b/src/compiler/glsl/lower_64bit.cpp
@@ -122,7 +122,7 @@ private:
ir_factory added_functions;
ir_rvalue *handle_op(ir_expression *ir, const char *function_name,
- function_generator generator);
+ function_generator generator, bool conv_from_32bit = false);
};
} /* anonymous namespace */
@@ -347,12 +347,15 @@ lower_64bit::lower_op_to_function_call(ir_instruction *base_ir,
ir_rvalue *
lower_64bit_visitor::handle_op(ir_expression *ir,
const char *function_name,
- function_generator generator)
+ function_generator generator,
+ bool conv_from_32bit)
{
- for (unsigned i = 0; i < ir->num_operands; i++)
- if (!ir->operands[i]->type->is_integer_64())
- return ir;
-
+ if (conv_from_32bit == false) {
+ for (unsigned i = 0; i < ir->num_operands; i++)
+ if (!ir->operands[i]->type->is_integer_64() &&
+ !ir->operands[i]->type->is_double())
+ return ir;
+ }
/* Get a handle to the correct ir_function_signature for the core
* operation.
*/
--
2.14.3
More information about the mesa-dev
mailing list