gallium: remove PIPE_SHADER_CAP_MAX_ADDRS
authorMarek Olšák <marek.olsak@amd.com>
Wed, 6 Aug 2014 21:58:10 +0000 (23:58 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Mon, 11 Aug 2014 19:53:57 +0000 (21:53 +0200)
This limit is fixed in Mesa core and cannot be changed.
It only affects ARB_vertex_program and ARB_fragment_program.

The minimum value for ARB_vertex_program is 1 according to the spec.
The maximum value for ARB_vertex_program is limited to 1 by Mesa core.

The value should be zero for ARB_fragment_program, because it doesn't
support ARL.

Finally, drivers shouldn't mess with these values arbitrarily.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
16 files changed:
src/gallium/auxiliary/gallivm/lp_bld_limits.h
src/gallium/auxiliary/tgsi/tgsi_exec.h
src/gallium/auxiliary/util/u_caps.c
src/gallium/docs/source/screen.rst
src/gallium/drivers/freedreno/freedreno_screen.c
src/gallium/drivers/i915/i915_screen.c
src/gallium/drivers/ilo/ilo_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/r300/r300_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
src/mesa/state_tracker/st_extensions.c

index eb83ea88516067da87d0aed39bc7aa57131f6ea4..a96ab2924d2f1b82ea7eaa0b9ace75afbd54a41a 100644 (file)
@@ -103,8 +103,6 @@ gallivm_get_shader_param(enum pipe_shader_cap param)
       return PIPE_MAX_CONSTANT_BUFFERS;
    case PIPE_SHADER_CAP_MAX_TEMPS:
       return LP_MAX_TGSI_TEMPS;
-   case PIPE_SHADER_CAP_MAX_ADDRS:
-      return LP_MAX_TGSI_ADDRS;
    case PIPE_SHADER_CAP_MAX_PREDS:
       return LP_MAX_TGSI_PREDS;
    case PIPE_SHADER_CAP_TGSI_CONT_SUPPORTED:
index c6fd3d7d112b79c6ada5f1e8f7c5d2f266570dbe..4720ec673cfb8ce118b71e271fce61686d406ab5 100644 (file)
@@ -193,7 +193,6 @@ struct tgsi_sampler
 #define TGSI_EXEC_NUM_TEMP_R        4
 
 #define TGSI_EXEC_TEMP_ADDR         (TGSI_EXEC_NUM_TEMPS + 8)
-#define TGSI_EXEC_NUM_ADDRS         1
 
 /* predicate register */
 #define TGSI_EXEC_TEMP_P0           (TGSI_EXEC_NUM_TEMPS + 9)
@@ -433,8 +432,6 @@ tgsi_exec_get_shader_param(enum pipe_shader_cap param)
       return PIPE_MAX_CONSTANT_BUFFERS;
    case PIPE_SHADER_CAP_MAX_TEMPS:
       return TGSI_EXEC_NUM_TEMPS;
-   case PIPE_SHADER_CAP_MAX_ADDRS:
-      return TGSI_EXEC_NUM_ADDRS;
    case PIPE_SHADER_CAP_MAX_PREDS:
       return TGSI_EXEC_NUM_PREDS;
    case PIPE_SHADER_CAP_TGSI_CONT_SUPPORTED:
index ec8938b374d511677d301ef4e8b7b62ba13a1968..cd005d68b3e0d66ea581d3b8d20cb5b3de61f300 100644 (file)
@@ -197,13 +197,11 @@ static unsigned caps_sm3[] = {
     UTIL_CHECK_SHADER(FRAGMENT, MAX_INSTRUCTIONS, 512),
     UTIL_CHECK_SHADER(FRAGMENT, MAX_INPUTS, 10),
     UTIL_CHECK_SHADER(FRAGMENT, MAX_TEMPS, 32),
-    UTIL_CHECK_SHADER(FRAGMENT, MAX_ADDRS, 1),
     UTIL_CHECK_SHADER(FRAGMENT, MAX_CONST_BUFFER_SIZE, 224 * 16),
 
     UTIL_CHECK_SHADER(VERTEX, MAX_INSTRUCTIONS, 512),
     UTIL_CHECK_SHADER(VERTEX, MAX_INPUTS, 16),
     UTIL_CHECK_SHADER(VERTEX, MAX_TEMPS, 32),
-    UTIL_CHECK_SHADER(VERTEX, MAX_ADDRS, 2),
     UTIL_CHECK_SHADER(VERTEX, MAX_CONST_BUFFER_SIZE, 256 * 16),
 
     UTIL_CHECK_TERMINATE
index 74cecc23b0e3c68a38eff6ae48f060c5e8b256cb..814e3aec69b6ddf4fc95854c9108cb4970bd4fcc 100644 (file)
@@ -269,7 +269,6 @@ file is still supported. In that case, the constbuf index is assumed
 to be 0.
 
 * ``PIPE_SHADER_CAP_MAX_TEMPS``: The maximum number of temporary registers.
-* ``PIPE_SHADER_CAP_MAX_ADDRS``: The maximum number of address registers.
 * ``PIPE_SHADER_CAP_MAX_PREDS``: The maximum number of predicate registers.
 * ``PIPE_SHADER_CAP_TGSI_CONT_SUPPORTED``: Whether the continue opcode is supported.
 * ``PIPE_SHADER_CAP_INDIRECT_INPUT_ADDR``: Whether indirect addressing
index 8fae5dddabacb8e708375640e60d32e1947450ce..5fb73525e13b4ebf8ffc521f264ef252c094bcbc 100644 (file)
@@ -327,8 +327,6 @@ fd_screen_get_shader_param(struct pipe_screen *pscreen, unsigned shader,
                return 16;
        case PIPE_SHADER_CAP_MAX_TEMPS:
                return 64; /* Max native temporaries. */
-       case PIPE_SHADER_CAP_MAX_ADDRS:
-               return 1; /* Max native address registers */
        case PIPE_SHADER_CAP_MAX_CONST_BUFFER_SIZE:
                return ((screen->gpu_id >= 300) ? 1024 : 64) * sizeof(float[4]);
        case PIPE_SHADER_CAP_MAX_CONST_BUFFERS:
index 133c773a0bedb27a45d7e158a78a1198c04ed8cd..ca3dd4a6f72a3ff8934c823583ad259082088f69 100644 (file)
@@ -135,8 +135,6 @@ i915_get_shader_param(struct pipe_screen *screen, unsigned shader, enum pipe_sha
          return 1;
       case PIPE_SHADER_CAP_MAX_TEMPS:
          return 12; /* XXX: 12 -> 32 ? */
-      case PIPE_SHADER_CAP_MAX_ADDRS:
-         return 0;
       case PIPE_SHADER_CAP_MAX_PREDS:
          return 0;
       case PIPE_SHADER_CAP_TGSI_CONT_SUPPORTED:
index fde4cc4f34c9eed31560f46498700acf9c16b6f4..bd6d8ddb4e7576d97aa747ca906da5aa286c4d79 100644 (file)
@@ -122,8 +122,6 @@ ilo_get_shader_param(struct pipe_screen *screen, unsigned shader,
       return ILO_MAX_CONST_BUFFERS;
    case PIPE_SHADER_CAP_MAX_TEMPS:
       return 256;
-   case PIPE_SHADER_CAP_MAX_ADDRS:
-      return (shader == PIPE_SHADER_FRAGMENT) ? 0 : 1;
    case PIPE_SHADER_CAP_MAX_PREDS:
       return 0;
    case PIPE_SHADER_CAP_TGSI_CONT_SUPPORTED:
index 4fa34e372f779ceea11931c30f3026414df72206..2860188961a3dc223dc71b5003634dd610ec6b8a 100644 (file)
@@ -207,8 +207,6 @@ nv30_screen_get_shader_param(struct pipe_screen *pscreen, unsigned shader,
       case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS:
       case PIPE_SHADER_CAP_MAX_SAMPLER_VIEWS:
          return 0;
-      case PIPE_SHADER_CAP_MAX_ADDRS:
-         return 2;
       case PIPE_SHADER_CAP_MAX_PREDS:
       case PIPE_SHADER_CAP_TGSI_CONT_SUPPORTED:
       case PIPE_SHADER_CAP_TGSI_SQRT_SUPPORTED:
@@ -241,8 +239,6 @@ nv30_screen_get_shader_param(struct pipe_screen *pscreen, unsigned shader,
          return 1;
       case PIPE_SHADER_CAP_MAX_TEMPS:
          return 32;
-      case PIPE_SHADER_CAP_MAX_ADDRS:
-         return (eng3d->oclass >= NV40_3D_CLASS) ? 1 : 0;
       case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS:
       case PIPE_SHADER_CAP_MAX_SAMPLER_VIEWS:
          return 16;
index 677f688f4455676a4cdd0fc5b1a99b1cd9ee4cd9..7b1b1125178837447f7d462dccef7d9dd304ec45 100644 (file)
@@ -236,8 +236,6 @@ nv50_screen_get_shader_param(struct pipe_screen *pscreen, unsigned shader,
       return 65536;
    case PIPE_SHADER_CAP_MAX_CONST_BUFFERS:
       return NV50_MAX_PIPE_CONSTBUFS;
-   case PIPE_SHADER_CAP_MAX_ADDRS:
-      return 1;
    case PIPE_SHADER_CAP_INDIRECT_INPUT_ADDR:
    case PIPE_SHADER_CAP_INDIRECT_OUTPUT_ADDR:
       return shader != PIPE_SHADER_FRAGMENT;
index 24aee6b5ab7d378fee74ef5cab0374f6cd30416d..686da329869e188e1679c387da754bfc6941deff 100644 (file)
@@ -244,8 +244,6 @@ nvc0_screen_get_shader_param(struct pipe_screen *pscreen, unsigned shader,
       if (shader == PIPE_SHADER_COMPUTE && class_3d >= NVE4_3D_CLASS)
          return NVE4_MAX_PIPE_CONSTBUFS_COMPUTE;
       return NVC0_MAX_PIPE_CONSTBUFS;
-   case PIPE_SHADER_CAP_MAX_ADDRS:
-      return 1;
    case PIPE_SHADER_CAP_INDIRECT_INPUT_ADDR:
    case PIPE_SHADER_CAP_INDIRECT_OUTPUT_ADDR:
       return shader != PIPE_SHADER_FRAGMENT;
index 1c5f43f4dc01c5fba6fe0b22afd3598124fed311..4e46f77ee02492bf6b87fcb9e2ec8dd1a73c5340 100644 (file)
@@ -252,7 +252,6 @@ static int r300_get_shader_param(struct pipe_screen *pscreen, unsigned shader, e
         case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS:
         case PIPE_SHADER_CAP_MAX_SAMPLER_VIEWS:
            return r300screen->caps.num_tex_units;
-        case PIPE_SHADER_CAP_MAX_ADDRS:
         case PIPE_SHADER_CAP_TGSI_CONT_SUPPORTED:
         case PIPE_SHADER_CAP_TGSI_SQRT_SUPPORTED:
         case PIPE_SHADER_CAP_INDIRECT_INPUT_ADDR:
@@ -296,8 +295,6 @@ static int r300_get_shader_param(struct pipe_screen *pscreen, unsigned shader, e
             return 1;
         case PIPE_SHADER_CAP_MAX_TEMPS:
             return 32;
-        case PIPE_SHADER_CAP_MAX_ADDRS:
-            return 1; /* XXX guessed */
         case PIPE_SHADER_CAP_MAX_PREDS:
             return is_r500 ? 4 : 0; /* XXX guessed. */
         case PIPE_SHADER_CAP_INDIRECT_CONST_ADDR:
index a08e70e9c91a55c8127ed5e34a57ac96e9492d68..f0a71c3027d3af696c099d18161ab18fbac8cbd4 100644 (file)
@@ -417,9 +417,6 @@ static int r600_get_shader_param(struct pipe_screen* pscreen, unsigned shader, e
                return shader == PIPE_SHADER_VERTEX ? 16 : 32;
        case PIPE_SHADER_CAP_MAX_TEMPS:
                return 256; /* Max native temporaries. */
-       case PIPE_SHADER_CAP_MAX_ADDRS:
-               /* XXX Isn't this equal to TEMPS? */
-               return 1; /* Max native address registers */
        case PIPE_SHADER_CAP_MAX_CONST_BUFFER_SIZE:
                return R600_MAX_CONST_BUFFER_SIZE;
        case PIPE_SHADER_CAP_MAX_CONST_BUFFERS:
index 85b57f4b3bd3c22fc071854e737ecbea6fc761b1..592069746d970c78605b79fa3f2523c38a8bec31 100644 (file)
@@ -348,9 +348,6 @@ static int si_get_shader_param(struct pipe_screen* pscreen, unsigned shader, enu
                return shader == PIPE_SHADER_VERTEX ? SI_NUM_VERTEX_BUFFERS : 32;
        case PIPE_SHADER_CAP_MAX_TEMPS:
                return 256; /* Max native temporaries. */
-       case PIPE_SHADER_CAP_MAX_ADDRS:
-               /* FIXME Isn't this equal to TEMPS? */
-               return 1; /* Max native address registers */
        case PIPE_SHADER_CAP_MAX_CONST_BUFFER_SIZE:
                return 4096 * sizeof(float[4]); /* actually only memory limits this */
        case PIPE_SHADER_CAP_MAX_CONST_BUFFERS:
index 9326c777526a5c2732712c9ddce1d6d38b17aeb6..2fcc75c45bce6a12ac178fe0f7b5320d6ddd217f 100644 (file)
@@ -321,7 +321,6 @@ static int svga_get_shader_param(struct pipe_screen *screen, unsigned shader, en
          if (!sws->get_cap(sws, SVGA3D_DEVCAP_MAX_FRAGMENT_SHADER_TEMPS, &result))
             return 32;
          return MIN2(result.u, SVGA3D_TEMPREG_MAX);
-      case PIPE_SHADER_CAP_MAX_ADDRS:
       case PIPE_SHADER_CAP_INDIRECT_INPUT_ADDR:
         /* 
          * Although PS 3.0 has some addressing abilities it can only represent
@@ -379,8 +378,6 @@ static int svga_get_shader_param(struct pipe_screen *screen, unsigned shader, en
          if (!sws->get_cap(sws, SVGA3D_DEVCAP_MAX_VERTEX_SHADER_TEMPS, &result))
             return 32;
          return MIN2(result.u, SVGA3D_TEMPREG_MAX);
-      case PIPE_SHADER_CAP_MAX_ADDRS:
-         return 1;
       case PIPE_SHADER_CAP_MAX_PREDS:
          return 1;
       case PIPE_SHADER_CAP_TGSI_CONT_SUPPORTED:
index 2caacc4e635c89f6395b7c4b0529648e29de6abd..7a10d9833f3a0904407db608aa28f252d590e85f 100644 (file)
@@ -607,7 +607,6 @@ enum pipe_shader_cap
    PIPE_SHADER_CAP_MAX_CONST_BUFFER_SIZE,
    PIPE_SHADER_CAP_MAX_CONST_BUFFERS,
    PIPE_SHADER_CAP_MAX_TEMPS,
-   PIPE_SHADER_CAP_MAX_ADDRS,
    PIPE_SHADER_CAP_MAX_PREDS,
    /* boolean caps */
    PIPE_SHADER_CAP_TGSI_CONT_SUPPORTED,
index 2d7b147969a8449261ccb51fae9825e9ec5553ef..a530c8597e48e0c9451e67fac0704ed38b2f639b 100644 (file)
@@ -187,8 +187,7 @@ void st_init_limits(struct pipe_screen *screen,
       pc->MaxTemps           = pc->MaxNativeTemps           =
          screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_TEMPS);
       pc->MaxAddressRegs     = pc->MaxNativeAddressRegs     =
-         _min(screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_ADDRS),
-              MAX_PROGRAM_ADDRESS_REGS);
+         sh == PIPE_SHADER_VERTEX ? 1 : 0;
       pc->MaxParameters      = pc->MaxNativeParameters      =
          screen->get_shader_param(screen, sh,
                    PIPE_SHADER_CAP_MAX_CONST_BUFFER_SIZE) / sizeof(float[4]);