st/mesa: lower DFRACEXP/DLDEXP when they are not supported
authorIlia Mirkin <imirkin@alum.mit.edu>
Fri, 18 Jul 2014 04:38:59 +0000 (00:38 -0400)
committerIlia Mirkin <imirkin@alum.mit.edu>
Fri, 20 Feb 2015 00:39:15 +0000 (19:39 -0500)
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Dave Airlie <airlied@redhat.com>
src/mesa/state_tracker/st_glsl_to_tgsi.cpp

index 1723c3fd7c1ed863f797a547b1796120516c9910..0b3477161b732f4e00f8cd8999492a299c0c9664 100644 (file)
@@ -5707,6 +5707,8 @@ st_link_shader(struct gl_context *ctx, struct gl_shader_program *prog)
       unsigned ptarget = shader_stage_to_ptarget(stage);
       bool have_dround = pscreen->get_shader_param(pscreen, ptarget,
                                                    PIPE_SHADER_CAP_TGSI_DROUND_SUPPORTED);
+      bool have_dfrexp = pscreen->get_shader_param(pscreen, ptarget,
+                                                   PIPE_SHADER_CAP_TGSI_DFRACEXP_DLDEXP_SUPPORTED);
 
       /* If there are forms of indirect addressing that the driver
        * cannot handle, perform the lowering pass.
@@ -5744,6 +5746,7 @@ st_link_shader(struct gl_context *ctx, struct gl_shader_program *prog)
                          EXP_TO_EXP2 |
                          LOG_TO_LOG2 |
                          LDEXP_TO_ARITH |
+                         (have_dfrexp ? 0 : DFREXP_DLDEXP_TO_ARITH) |
                          CARRY_TO_ARITH |
                          BORROW_TO_ARITH |
                          (have_dround ? 0 : DOPS_TO_DFRAC) |