[Mesa-dev] [PATCH 8/9] st/glsl: lower int->fp64 conversion if cap is set.

Dave Airlie airlied at gmail.com
Thu Feb 1 03:33:57 UTC 2018


From: Dave Airlie <airlied at redhat.com>

This just enables the lowering if requested.

Signed-off-by: Dave Airlie <airlied at redhat.com>
---
 src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index 43dd5fdd40..24dd5b35fd 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -7028,8 +7028,15 @@ st_link_shader(struct gl_context *ctx, struct gl_shader_program *prog)
                                              options->EmitNoIndirectUniform);
       }
 
+      unsigned what_to_64bit_lower = 0;
+
+      if (pscreen->get_param(pscreen, PIPE_CAP_LOWER_INT_TO_FP64_CONVERSIONS))
+         what_to_64bit_lower |= UI2D;
       if (!pscreen->get_param(pscreen, PIPE_CAP_INT64_DIVMOD))
-         lower_64bit_instructions(ir, DIV64 | MOD64);
+         what_to_64bit_lower |= DIV64 | MOD64;
+
+      if (what_to_64bit_lower)
+         lower_64bit_instructions(ir, what_to_64bit_lower);
 
       if (ctx->Extensions.ARB_shading_language_packing) {
          unsigned lower_inst = LOWER_PACK_SNORM_2x16 |
-- 
2.14.3



More information about the mesa-dev mailing list