gallium: add a cap to enable double rounding opcodes
authorIlia Mirkin <imirkin@alum.mit.edu>
Fri, 25 Jul 2014 21:03:33 +0000 (17:03 -0400)
committerIlia Mirkin <imirkin@alum.mit.edu>
Fri, 20 Feb 2015 00:32:49 +0000 (19:32 -0500)
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Dave Airlie <airlied@redhat.com>
src/gallium/auxiliary/gallivm/lp_bld_limits.h
src/gallium/auxiliary/tgsi/tgsi_exec.h
src/gallium/docs/source/screen.rst
src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
src/gallium/drivers/r600/r600_pipe.c
src/gallium/drivers/radeonsi/si_pipe.c
src/gallium/drivers/svga/svga_screen.c
src/gallium/include/pipe/p_defines.h

index 8c66f9d618e06e2597c8137e07147ab5cfdc5986..1af720504a1b86690108ebbd14ea445dff673641 100644 (file)
@@ -127,6 +127,7 @@ gallivm_get_shader_param(enum pipe_shader_cap param)
    case PIPE_SHADER_CAP_TGSI_SQRT_SUPPORTED:
       return 1;
    case PIPE_SHADER_CAP_DOUBLES:
+   case PIPE_SHADER_CAP_TGSI_DROUND_SUPPORTED:
       return 0;
    }
    /* if we get here, we missed a shader cap above (and should have seen
index 256cf725dbc27595c3bd16b5fb85eec805db11a3..02ee4c726c04ec3ffdb03f85edef627469b2f767 100644 (file)
@@ -457,6 +457,8 @@ tgsi_exec_get_shader_param(enum pipe_shader_cap param)
       return 1;
    case PIPE_SHADER_CAP_DOUBLES:
       return 1;
+   case PIPE_SHADER_CAP_TGSI_DROUND_SUPPORTED:
+      return 0;
    }
    /* if we get here, we missed a shader cap above (and should have seen
     * a compiler warning.)
index 373a2fe25d0a53c87239c20cfa7b6bf8b2862874..0cb5425bc8534a991f01b32fb4734582b97a5dff 100644 (file)
@@ -332,6 +332,8 @@ to be 0.
   sampler views. Must not be lower than PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS.
 * ``PIPE_SHADER_CAP_DOUBLES``: Whether double precision floating-point
   operations are supported.
+* ``PIPE_SHADER_CAP_TGSI_DROUND_SUPPORTED``: Whether double precision rounding
+  is supported. If it is, DTRUNC/DCEIL/DFLR/DROUND opcodes may be used.
 
 
 .. _pipe_compute_cap:
index edea845ecba8f279f187c22b38fb1af8ebe66dd0..868491ce34a036b51855a2b93f50f094d833938f 100644 (file)
@@ -290,6 +290,10 @@ nvc0_screen_get_shader_param(struct pipe_screen *pscreen, unsigned shader,
       return 1;
    case PIPE_SHADER_CAP_INTEGERS:
       return 1;
+   case PIPE_SHADER_CAP_DOUBLES:
+      return 0;
+   case PIPE_SHADER_CAP_TGSI_DROUND_SUPPORTED:
+      return 0;
    case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS:
       return 16; /* would be 32 in linked (OpenGL-style) mode */
    case PIPE_SHADER_CAP_MAX_SAMPLER_VIEWS:
index a4b7b66ace1d6a15276b91428acdafe3e3229bcf..447513b5981b66abbd2a5168246799ece3e7d201 100644 (file)
@@ -489,6 +489,8 @@ static int r600_get_shader_param(struct pipe_screen* pscreen, unsigned shader, e
                }
        case PIPE_SHADER_CAP_DOUBLES:
                return 0;
+       case PIPE_SHADER_CAP_TGSI_DROUND_SUPPORTED:
+               return 0;
        }
        return 0;
 }
index ec533310b8cd9b24753f16f04ccdb0e9170711d0..4c720458842da5fdc26934bf6ef25f59413b78f9 100644 (file)
@@ -423,6 +423,7 @@ static int si_get_shader_param(struct pipe_screen* pscreen, unsigned shader, enu
        case PIPE_SHADER_CAP_PREFERRED_IR:
                return PIPE_SHADER_IR_TGSI;
        case PIPE_SHADER_CAP_DOUBLES:
+       case PIPE_SHADER_CAP_TGSI_DROUND_SUPPORTED:
                return 0;
        }
        return 0;
index e468a2f89ce6a85b0e3b665c9558a3bdd0c9e5d0..a951792ef694c449dbe965f3ebba5f1bd75116fe 100644 (file)
@@ -373,6 +373,7 @@ static int svga_get_shader_param(struct pipe_screen *screen, unsigned shader, en
       case PIPE_SHADER_CAP_PREFERRED_IR:
          return PIPE_SHADER_IR_TGSI;
       case PIPE_SHADER_CAP_DOUBLES:
+      case PIPE_SHADER_CAP_TGSI_DROUND_SUPPORTED:
          return 0;
       }
       /* If we get here, we failed to handle a cap above */
index 17850438dc80ea1c692f93cb7f95b4382659e126..685e37cefcb19fc244e12514748cd19d86850cfe 100644 (file)
@@ -635,7 +635,8 @@ enum pipe_shader_cap
    PIPE_SHADER_CAP_PREFERRED_IR,
    PIPE_SHADER_CAP_TGSI_SQRT_SUPPORTED,
    PIPE_SHADER_CAP_MAX_SAMPLER_VIEWS,
-   PIPE_SHADER_CAP_DOUBLES
+   PIPE_SHADER_CAP_DOUBLES,
+   PIPE_SHADER_CAP_TGSI_DROUND_SUPPORTED, /* all rounding modes */
 };
 
 /**