mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 06:48:06 +02:00
glsl/nir: ftrunc for native_integers=false float to int cast
out_type in the default cast case is always GLSL_TYPE_FLOAT, so we get a mov otherwise. Signed-off-by: Jonathan Marek <jonathan@marek.ca> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
This commit is contained in:
parent
d3b47e073e
commit
b27ad17115
1 changed files with 4 additions and 0 deletions
|
|
@ -1643,7 +1643,11 @@ nir_visitor::visit(ir_expression *ir)
|
|||
result = supports_ints ? nir_b2f32(&b, srcs[0]) : nir_fmov(&b, srcs[0]);
|
||||
break;
|
||||
case ir_unop_f2i:
|
||||
result = supports_ints ? nir_f2i32(&b, srcs[0]) : nir_ftrunc(&b, srcs[0]);
|
||||
break;
|
||||
case ir_unop_f2u:
|
||||
result = supports_ints ? nir_f2u32(&b, srcs[0]) : nir_ftrunc(&b, srcs[0]);
|
||||
break;
|
||||
case ir_unop_f2b:
|
||||
case ir_unop_i2b:
|
||||
case ir_unop_b2i:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue