gallium: replace 16BIT_TEMPS cap with 16BIT_CONSTS
authorRob Clark <robdclark@chromium.org>
Wed, 5 Aug 2020 17:21:46 +0000 (10:21 -0700)
committerMarge Bot <eric+marge@anholt.net>
Wed, 5 Aug 2020 21:00:44 +0000 (21:00 +0000)
All drivers that support mediump lowering should support 16BIT_TEMPS,
but some do not also want 16b consts to be lowered.  Replace the pipe
cap in preperation to remove LowerPrecisionTemporaries.

Note: also updates reference checksums for the arm64_a630_traces job,
due to lowering more to 16b

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6189>

22 files changed:
.gitlab-ci/traces-baremetal.yml
docs/gallium/screen.rst
src/gallium/auxiliary/gallivm/lp_bld_limits.h
src/gallium/auxiliary/tgsi/tgsi_exec.h
src/gallium/drivers/etnaviv/etnaviv_screen.c
src/gallium/drivers/freedreno/freedreno_screen.c
src/gallium/drivers/i915/i915_screen.c
src/gallium/drivers/iris/iris_screen.c
src/gallium/drivers/nouveau/nv30/nv30_screen.c
src/gallium/drivers/nouveau/nv50/nv50_screen.c
src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
src/gallium/drivers/panfrost/pan_screen.c
src/gallium/drivers/r300/r300_screen.c
src/gallium/drivers/r600/r600_pipe.c
src/gallium/drivers/radeonsi/si_get.c
src/gallium/drivers/svga/svga_screen.c
src/gallium/drivers/v3d/v3d_screen.c
src/gallium/drivers/vc4/vc4_screen.c
src/gallium/drivers/virgl/virgl_screen.c
src/gallium/drivers/zink/zink_screen.c
src/gallium/include/pipe/p_defines.h
src/mesa/state_tracker/st_extensions.c

index 72905a374b4b601ceabe1280ff6c8d465c61a39f..a22e20f697739430360ab794cd1051652e1f078f 100644 (file)
@@ -107,15 +107,15 @@ traces:
   - path: glmark2/bump-bump-render=height.rdc
     expectations:
       - device: freedreno-a630
-        checksum: ed8ef7fcd88f20c5814bbdd95f62824a
+        checksum: 6d06bb78d918ef6376aee4d417c9e9c1
   - path: glmark2/bump-bump-render=high-poly.rdc
     expectations:
       - device: freedreno-a630
-        checksum: 39e9e510819758910efc7b58bd08b981
+        checksum: 55312be6739a7142958bdef174e90269
   - path: glmark2/bump-bump-render=normals.rdc
     expectations:
       - device: freedreno-a630
-        checksum: 3b270da5fcb3c1ee49c889644a5cc439
+        checksum: 9deea36f896b9aea01169839e1913e9b
   - path: glmark2/conditionals-fragment-steps=0:vertex-steps=0.rdc
     expectations:
       # Incorrect rendering, a bunch of the area is uniform gray when it should
@@ -207,11 +207,11 @@ traces:
   - path: glmark2/shading-shading=blinn-phong-inf.rdc
     expectations:
       - device: freedreno-a630
-        checksum: 5a4aa8bebb324d0319ae1ebd95c7ce57
+        checksum: b9af27ae43986f6441235044a7f18e2a
   - path: glmark2/shading-shading=cel.rdc
     expectations:
       - device: freedreno-a630
-        checksum: 444fc5f23e3ce564d9945c20ed5d5e67
+        checksum: fc2c2a68a89ad2ee145819e2a6edcbc5
   - path: glmark2/shading-shading=gouraud.rdc
     expectations:
       - device: freedreno-a630
index 4304764033aef67182f1860303b0d3ae44722376..2f0b4bf0d8840edc7d9b84ca91a3e605e1cc72bb 100644 (file)
@@ -663,8 +663,8 @@ MOV OUT[0], CONST[0][3]  # copy vector 3 of constbuf 0
   DDX and DDY opcodes are supported.
 * ``PIPE_SHADER_CAP_INT16``: Whether 16-bit signed and unsigned integer types
   are supported.
-* ``PIPE_SHADER_CAP_GLSL_16BIT_TEMPS``: Lower mediump temporaries to 16-bit.
-  This generates 16-bit phis in NIR, 16-bit loop counters, and 16-bit indirect arrays.
+* ``PIPE_SHADER_CAP_GLSL_16BIT_CONSTS``: Lower mediump constants to 16-bit.
+  Note that 16-bit constants are not lowered to uniforms in GLSL.
 * ``PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS``: The maximum number of texture
   samplers.
 * ``PIPE_SHADER_CAP_PREFERRED_IR``: Preferred representation of the
index 7744c2582ebb5184ca674215af2b889d8691ef46..9ef11fa5f6b1b42b3049620a2c12a994697701a0 100644 (file)
@@ -128,7 +128,7 @@ gallivm_get_shader_param(enum pipe_shader_cap param)
    case PIPE_SHADER_CAP_FP16:
    case PIPE_SHADER_CAP_FP16_DERIVATIVES:
    case PIPE_SHADER_CAP_INT16:
-   case PIPE_SHADER_CAP_GLSL_16BIT_TEMPS:
+   case PIPE_SHADER_CAP_GLSL_16BIT_CONSTS:
       return 0;
    case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS:
       return PIPE_MAX_SAMPLERS;
index f08ca161b395946a98023f68997e1d318f9776d6..2f03798d5efccc6c4b4cadd8c2c9ee3606bd6f16 100644 (file)
@@ -510,7 +510,7 @@ tgsi_exec_get_shader_param(enum pipe_shader_cap param)
    case PIPE_SHADER_CAP_FP16:
    case PIPE_SHADER_CAP_FP16_DERIVATIVES:
    case PIPE_SHADER_CAP_INT16:
-   case PIPE_SHADER_CAP_GLSL_16BIT_TEMPS:
+   case PIPE_SHADER_CAP_GLSL_16BIT_CONSTS:
       return 0;
    case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS:
       return PIPE_MAX_SAMPLERS;
index 5a03b86c327d3b3cb41bdb0945c9478f3a12c8ca..68befeeeee3087e788e6e1cd6f17ad0f57bb6f1e 100644 (file)
@@ -355,7 +355,7 @@ etna_screen_get_shader_param(struct pipe_screen *pscreen,
    case PIPE_SHADER_CAP_FP16:
    case PIPE_SHADER_CAP_FP16_DERIVATIVES:
    case PIPE_SHADER_CAP_INT16:
-   case PIPE_SHADER_CAP_GLSL_16BIT_TEMPS:
+   case PIPE_SHADER_CAP_GLSL_16BIT_CONSTS:
       return 0;
    case PIPE_SHADER_CAP_INTEGERS:
       return DBG_ENABLED(ETNA_DBG_NIR) && screen->specs.halti >= 2;
index 25da1ae6c34106cd356e35663f5c65993d92d481..ef542a7446edeecfd0b4bac8d9e24d0ff2fe1fa5 100644 (file)
@@ -574,7 +574,7 @@ fd_screen_get_shader_param(struct pipe_screen *pscreen,
        case PIPE_SHADER_CAP_INT64_ATOMICS:
        case PIPE_SHADER_CAP_FP16_DERIVATIVES:
        case PIPE_SHADER_CAP_INT16:
-       case PIPE_SHADER_CAP_GLSL_16BIT_TEMPS:
+       case PIPE_SHADER_CAP_GLSL_16BIT_CONSTS:
                return 0;
        case PIPE_SHADER_CAP_FP16:
                return ((is_a5xx(screen) || is_a6xx(screen)) &&
index c8b2004af6759402f7d28aa0bf7e7d7c63a0c9ba..da878d4a43de113049b816910f9cd67f4a51fadc 100644 (file)
@@ -162,7 +162,7 @@ i915_get_shader_param(struct pipe_screen *screen,
       case PIPE_SHADER_CAP_FP16:
       case PIPE_SHADER_CAP_FP16_DERIVATIVES:
       case PIPE_SHADER_CAP_INT16:
-      case PIPE_SHADER_CAP_GLSL_16BIT_TEMPS:
+      case PIPE_SHADER_CAP_GLSL_16BIT_CONSTS:
          return 0;
       case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS:
       case PIPE_SHADER_CAP_MAX_SAMPLER_VIEWS:
index dc2295689ea4c3c645c433298de6268b17cb74b1..ca75a1308ddf0f13826e118575bc8f7c17fd1044 100644 (file)
@@ -408,7 +408,7 @@ iris_get_shader_param(struct pipe_screen *pscreen,
    case PIPE_SHADER_CAP_FP16:
    case PIPE_SHADER_CAP_FP16_DERIVATIVES:
    case PIPE_SHADER_CAP_INT16:
-   case PIPE_SHADER_CAP_GLSL_16BIT_TEMPS:
+   case PIPE_SHADER_CAP_GLSL_16BIT_CONSTS:
       return 0;
    case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS:
    case PIPE_SHADER_CAP_MAX_SAMPLER_VIEWS:
index 19a606e74277d78490ad9b69dbb1550c7de0529e..d2530481a7997720106d6a7758a9a59657fe67b7 100644 (file)
@@ -353,7 +353,7 @@ nv30_screen_get_shader_param(struct pipe_screen *pscreen,
       case PIPE_SHADER_CAP_FP16:
       case PIPE_SHADER_CAP_FP16_DERIVATIVES:
       case PIPE_SHADER_CAP_INT16:
-      case PIPE_SHADER_CAP_GLSL_16BIT_TEMPS:
+      case PIPE_SHADER_CAP_GLSL_16BIT_CONSTS:
       case PIPE_SHADER_CAP_TGSI_DROUND_SUPPORTED:
       case PIPE_SHADER_CAP_TGSI_DFRACEXP_DLDEXP_SUPPORTED:
       case PIPE_SHADER_CAP_TGSI_LDEXP_SUPPORTED:
@@ -408,7 +408,7 @@ nv30_screen_get_shader_param(struct pipe_screen *pscreen,
       case PIPE_SHADER_CAP_FP16:
       case PIPE_SHADER_CAP_FP16_DERIVATIVES:
       case PIPE_SHADER_CAP_INT16:
-      case PIPE_SHADER_CAP_GLSL_16BIT_TEMPS:
+      case PIPE_SHADER_CAP_GLSL_16BIT_CONSTS:
       case PIPE_SHADER_CAP_TGSI_DROUND_SUPPORTED:
       case PIPE_SHADER_CAP_TGSI_DFRACEXP_DLDEXP_SUPPORTED:
       case PIPE_SHADER_CAP_TGSI_LDEXP_SUPPORTED:
index 7742ce0e14b8ed7a58ce0811cf943e6becb69eec..06f73ab6be2d7cb2201b5b3f61bee09b6a0ba24f 100644 (file)
@@ -438,7 +438,7 @@ nv50_screen_get_shader_param(struct pipe_screen *pscreen,
    case PIPE_SHADER_CAP_FP16:
    case PIPE_SHADER_CAP_FP16_DERIVATIVES:
    case PIPE_SHADER_CAP_INT16:
-   case PIPE_SHADER_CAP_GLSL_16BIT_TEMPS:
+   case PIPE_SHADER_CAP_GLSL_16BIT_CONSTS:
    case PIPE_SHADER_CAP_SUBROUTINES:
       return 0; /* please inline, or provide function declarations */
    case PIPE_SHADER_CAP_INTEGERS:
index 1ea24fd8a7e06ed169d10bd3e6fdd873d658cd13..814a42d609c04fc3db0ed50b0711d94b7d388d1a 100644 (file)
@@ -513,7 +513,7 @@ nvc0_screen_get_shader_param(struct pipe_screen *pscreen,
    case PIPE_SHADER_CAP_FP16:
    case PIPE_SHADER_CAP_FP16_DERIVATIVES:
    case PIPE_SHADER_CAP_INT16:
-   case PIPE_SHADER_CAP_GLSL_16BIT_TEMPS:
+   case PIPE_SHADER_CAP_GLSL_16BIT_CONSTS:
    case PIPE_SHADER_CAP_MAX_HW_ATOMIC_COUNTERS:
    case PIPE_SHADER_CAP_MAX_HW_ATOMIC_COUNTER_BUFFERS:
       return 0;
index 2e5658036d33e925c5d340587e52e99f8dc62cae..c2e4b9beb65b2e2015188e57cf97dd58adf93eae 100644 (file)
@@ -336,7 +336,7 @@ panfrost_get_shader_param(struct pipe_screen *screen,
                 return 1;
 
         case PIPE_SHADER_CAP_FP16:
-        case PIPE_SHADER_CAP_GLSL_16BIT_TEMPS:
+        case PIPE_SHADER_CAP_GLSL_16BIT_CONSTS:
                 return !is_nofp16;
 
         case PIPE_SHADER_CAP_FP16_DERIVATIVES:
index 8658801ed8031d13bb69389b15b759555f9c1fdb..dcd921ae7c70167f998c341b821e9c0e642a43d5 100644 (file)
@@ -295,7 +295,7 @@ static int r300_get_shader_param(struct pipe_screen *pscreen,
         case PIPE_SHADER_CAP_FP16:
         case PIPE_SHADER_CAP_FP16_DERIVATIVES:
         case PIPE_SHADER_CAP_INT16:
-        case PIPE_SHADER_CAP_GLSL_16BIT_TEMPS:
+        case PIPE_SHADER_CAP_GLSL_16BIT_CONSTS:
         case PIPE_SHADER_CAP_TGSI_DROUND_SUPPORTED:
         case PIPE_SHADER_CAP_TGSI_DFRACEXP_DLDEXP_SUPPORTED:
         case PIPE_SHADER_CAP_TGSI_LDEXP_SUPPORTED:
@@ -361,7 +361,7 @@ static int r300_get_shader_param(struct pipe_screen *pscreen,
         case PIPE_SHADER_CAP_FP16:
         case PIPE_SHADER_CAP_FP16_DERIVATIVES:
         case PIPE_SHADER_CAP_INT16:
-        case PIPE_SHADER_CAP_GLSL_16BIT_TEMPS:
+        case PIPE_SHADER_CAP_GLSL_16BIT_CONSTS:
         case PIPE_SHADER_CAP_INT64_ATOMICS:
         case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS:
         case PIPE_SHADER_CAP_MAX_SAMPLER_VIEWS:
index d65b2841613d2d986077b87ed1b110c9f8b4417c..40e19cc0b73d5fe4e2b5b2d9f4be3a0b6c2d4956 100644 (file)
@@ -615,7 +615,7 @@ static int r600_get_shader_param(struct pipe_screen* pscreen,
        case PIPE_SHADER_CAP_FP16:
         case PIPE_SHADER_CAP_FP16_DERIVATIVES:
         case PIPE_SHADER_CAP_INT16:
-        case PIPE_SHADER_CAP_GLSL_16BIT_TEMPS:
+        case PIPE_SHADER_CAP_GLSL_16BIT_CONSTS:
                return 0;
        case PIPE_SHADER_CAP_INTEGERS:
        case PIPE_SHADER_CAP_TGSI_ANY_INOUT_DECL_RANGE:
index bed2061070ac0f60c46c7a269487707435f26bc8..3dcbb6f3678f0278ab6a359a94c63584e027a7fd 100644 (file)
@@ -457,7 +457,7 @@ static int si_get_shader_param(struct pipe_screen *pscreen, enum pipe_shader_typ
    case PIPE_SHADER_CAP_FP16:
    case PIPE_SHADER_CAP_FP16_DERIVATIVES:
    case PIPE_SHADER_CAP_INT16:
-   case PIPE_SHADER_CAP_GLSL_16BIT_TEMPS:
+   case PIPE_SHADER_CAP_GLSL_16BIT_CONSTS:
    case PIPE_SHADER_CAP_SUBROUTINES:
    case PIPE_SHADER_CAP_SUPPORTED_IRS:
    case PIPE_SHADER_CAP_MAX_HW_ATOMIC_COUNTERS:
index b7202913dd3904feb9024f4f33229c20942ea074..fc8b8d200b33d165d597ba6d9dd05419540a219e 100644 (file)
@@ -482,7 +482,7 @@ vgpu9_get_shader_param(struct pipe_screen *screen,
       case PIPE_SHADER_CAP_FP16:
       case PIPE_SHADER_CAP_FP16_DERIVATIVES:
       case PIPE_SHADER_CAP_INT16:
-      case PIPE_SHADER_CAP_GLSL_16BIT_TEMPS:
+      case PIPE_SHADER_CAP_GLSL_16BIT_CONSTS:
          return 0;
       case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS:
       case PIPE_SHADER_CAP_MAX_SAMPLER_VIEWS:
@@ -552,7 +552,7 @@ vgpu9_get_shader_param(struct pipe_screen *screen,
       case PIPE_SHADER_CAP_FP16:
       case PIPE_SHADER_CAP_FP16_DERIVATIVES:
       case PIPE_SHADER_CAP_INT16:
-      case PIPE_SHADER_CAP_GLSL_16BIT_TEMPS:
+      case PIPE_SHADER_CAP_GLSL_16BIT_CONSTS:
          return 0;
       case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS:
       case PIPE_SHADER_CAP_MAX_SAMPLER_VIEWS:
@@ -663,7 +663,7 @@ vgpu10_get_shader_param(struct pipe_screen *screen,
    case PIPE_SHADER_CAP_FP16:
    case PIPE_SHADER_CAP_FP16_DERIVATIVES:
    case PIPE_SHADER_CAP_INT16:
-   case PIPE_SHADER_CAP_GLSL_16BIT_TEMPS:
+   case PIPE_SHADER_CAP_GLSL_16BIT_CONSTS:
       return FALSE;
    case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS:
    case PIPE_SHADER_CAP_MAX_SAMPLER_VIEWS:
index 8d721da8a0c3cdcc1d068005c977ee16d9ee9917..63309e9c8d15c1598d04862506eaf94b0a5900eb 100644 (file)
@@ -375,7 +375,7 @@ v3d_screen_get_shader_param(struct pipe_screen *pscreen, unsigned shader,
         case PIPE_SHADER_CAP_FP16:
         case PIPE_SHADER_CAP_FP16_DERIVATIVES:
         case PIPE_SHADER_CAP_INT16:
-        case PIPE_SHADER_CAP_GLSL_16BIT_TEMPS:
+        case PIPE_SHADER_CAP_GLSL_16BIT_CONSTS:
         case PIPE_SHADER_CAP_TGSI_DROUND_SUPPORTED:
         case PIPE_SHADER_CAP_TGSI_DFRACEXP_DLDEXP_SUPPORTED:
         case PIPE_SHADER_CAP_TGSI_LDEXP_SUPPORTED:
index d8bc17cd422ae0c79ecfad243dc4f9bbeba02441..4c9a4527abb10d5a085d281b6532405caee8a96f 100644 (file)
@@ -280,7 +280,7 @@ vc4_screen_get_shader_param(struct pipe_screen *pscreen,
         case PIPE_SHADER_CAP_FP16:
         case PIPE_SHADER_CAP_FP16_DERIVATIVES:
         case PIPE_SHADER_CAP_INT16:
-        case PIPE_SHADER_CAP_GLSL_16BIT_TEMPS:
+        case PIPE_SHADER_CAP_GLSL_16BIT_CONSTS:
         case PIPE_SHADER_CAP_TGSI_DROUND_SUPPORTED:
         case PIPE_SHADER_CAP_TGSI_DFRACEXP_DLDEXP_SUPPORTED:
         case PIPE_SHADER_CAP_TGSI_LDEXP_SUPPORTED:
index ed5786f2caab1d61ac9b97af73a0ebf22eba36d7..fc2a403104a048796ad7981868402bced27aec8f 100644 (file)
@@ -412,7 +412,7 @@ virgl_get_shader_param(struct pipe_screen *screen,
       case PIPE_SHADER_CAP_FP16:
       case PIPE_SHADER_CAP_FP16_DERIVATIVES:
       case PIPE_SHADER_CAP_INT16:
-      case PIPE_SHADER_CAP_GLSL_16BIT_TEMPS:
+      case PIPE_SHADER_CAP_GLSL_16BIT_CONSTS:
          return 0;
       default:
          return 0;
index 921581d517dd2d75ea5655058b11f924993db66f..3c1c4d936d1b62216d03d431bf053a739a2f0e2f 100644 (file)
@@ -432,7 +432,7 @@ zink_get_shader_param(struct pipe_screen *pscreen,
    case PIPE_SHADER_CAP_FP16:
    case PIPE_SHADER_CAP_FP16_DERIVATIVES:
    case PIPE_SHADER_CAP_INT16:
-   case PIPE_SHADER_CAP_GLSL_16BIT_TEMPS:
+   case PIPE_SHADER_CAP_GLSL_16BIT_CONSTS:
       return 0; /* not implemented */
 
    case PIPE_SHADER_CAP_PREFERRED_IR:
index eac8f768705c0a5ca8d6a095a1e809a765985a36..ddeac139f938cfd3cfc5263160a48fee7977db5f 100644 (file)
@@ -1023,7 +1023,7 @@ enum pipe_shader_cap
    PIPE_SHADER_CAP_FP16,
    PIPE_SHADER_CAP_FP16_DERIVATIVES,
    PIPE_SHADER_CAP_INT16,
-   PIPE_SHADER_CAP_GLSL_16BIT_TEMPS,
+   PIPE_SHADER_CAP_GLSL_16BIT_CONSTS,
    PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS,
    PIPE_SHADER_CAP_PREFERRED_IR,
    PIPE_SHADER_CAP_TGSI_SQRT_SUPPORTED,
index 331df122ddaf55a3b48cdf11e8926629813f9319..bd6203a1901eb6fcfef28f0c16d4736bf9510d9b 100644 (file)
@@ -346,9 +346,9 @@ void st_init_limits(struct pipe_screen *screen,
          screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_FP16_DERIVATIVES);
       options->LowerPrecisionInt16 =
          screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_INT16);
-      options->LowerPrecisionTemporaries =
-         screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_GLSL_16BIT_TEMPS);
-      options->LowerPrecisionConstants = options->LowerPrecisionTemporaries;
+      options->LowerPrecisionConstants =
+         screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_GLSL_16BIT_CONSTS);
+      options->LowerPrecisionTemporaries = true;
    }
 
    c->MaxUserAssignableUniformLocations =