gallium: add PIPE_COMPUTE_CAP_MAX_VARIABLE_THREADS_PER_BLOCK
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Sat, 10 Sep 2016 14:31:27 +0000 (16:31 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 6 Oct 2016 22:18:57 +0000 (00:18 +0200)
v3: - use a new case statement in r600_pipe_common.c
    - fix compilation of softpipe...

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/docs/source/screen.rst
src/gallium/drivers/ilo/ilo_screen.c
src/gallium/drivers/nouveau/nv50/nv50_screen.c
src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
src/gallium/drivers/radeon/r600_pipe_common.c
src/gallium/drivers/softpipe/sp_screen.c
src/gallium/include/pipe/p_defines.h

index 5dff650fe8d8343067b117a5931d39b3f0c9f327..cfc0a1b727a9cbbcc7ba2aa8efde01e94b5f4107 100644 (file)
@@ -498,6 +498,10 @@ pipe_screen::get_compute_param.
   threads. Also known as wavefront size, warp size or SIMD width.
 * ``PIPE_COMPUTE_CAP_ADDRESS_BITS``: The default compute device address space
   size specified as an unsigned integer value in bits.
+* ``PIPE_COMPUTE_CAP_MAX_VARIABLE_THREADS_PER_BLOCK``: Maximum variable number
+  of threads that a single block can contain. This is similar to
+  PIPE_COMPUTE_CAP_MAX_THREADS_PER_BLOCK, except that the variable size is not
+  known a compile-time but at dispatch-time.
 
 .. _pipe_bind:
 
index b9e5ad6184fa06841fbf8aff6c6d653c08aef66d..85357fa1fcb61ecc2a02645f8268bf839419a3fe 100644 (file)
@@ -303,6 +303,8 @@ ilo_get_compute_param(struct pipe_screen *screen,
       ptr = &val.subgroup_size;
       size = sizeof(val.subgroup_size);
       break;
+   case PIPE_COMPUTE_CAP_MAX_VARIABLE_THREADS_PER_BLOCK:
+      /* fallthrough */
    default:
       ptr = NULL;
       size = 0;
index 1ec791d5163cafed4c3d828db0c05239a90c0be2..6eb18eadc4705caa2606703ce8602b0587642222 100644 (file)
@@ -418,6 +418,8 @@ nv50_screen_get_compute_param(struct pipe_screen *pscreen,
       RET((uint32_t []) { 512 }); /* FIXME: arbitrary limit */
    case PIPE_COMPUTE_CAP_ADDRESS_BITS:
       RET((uint32_t []) { 32 });
+   case PIPE_COMPUTE_CAP_MAX_VARIABLE_THREADS_PER_BLOCK:
+      RET((uint64_t []) { 0 });
    default:
       return 0;
    }
index 1757cbb93a55c0621394225e14f1e764dbad3e34..df6c6af6037261efe07a5ae8bc4420663c7c50e9 100644 (file)
@@ -478,6 +478,8 @@ nvc0_screen_get_compute_param(struct pipe_screen *pscreen,
       RET((uint32_t []) { 512 }); /* FIXME: arbitrary limit */
    case PIPE_COMPUTE_CAP_ADDRESS_BITS:
       RET((uint32_t []) { 64 });
+   case PIPE_COMPUTE_CAP_MAX_VARIABLE_THREADS_PER_BLOCK:
+      RET((uint64_t []) { 0 });
    default:
       return 0;
    }
index 6f71ef60ecab54103f498f565bbe4b4a8363dbde..44863eeca65b0c1d2e974fde67b8ea17a16e9c33 100644 (file)
@@ -1036,6 +1036,8 @@ static int r600_get_compute_param(struct pipe_screen *screen,
                        *subgroup_size = r600_wavefront_size(rscreen->family);
                }
                return sizeof(uint32_t);
+       case PIPE_COMPUTE_CAP_MAX_VARIABLE_THREADS_PER_BLOCK:
+               return 0;
        }
 
         fprintf(stderr, "unknown PIPE_COMPUTE_CAP %d\n", param);
index cd4269f99290e5ffdbed01494bb242b738554b7e..6ffc7771c8353c14495792adc54dbf7bfb7880c4 100644 (file)
@@ -522,6 +522,7 @@ softpipe_get_compute_param(struct pipe_screen *_screen,
    case PIPE_COMPUTE_CAP_IMAGES_SUPPORTED:
    case PIPE_COMPUTE_CAP_SUBGROUP_SIZE:
    case PIPE_COMPUTE_CAP_ADDRESS_BITS:
+   case PIPE_COMPUTE_CAP_MAX_VARIABLE_THREADS_PER_BLOCK:
       break;
    }
    return 0;
index 12d9b1a51398e67b876537bb416a3dabd0d22bb9..db96c51088735e97a5b47069429f0cc701537f52 100644 (file)
@@ -847,7 +847,8 @@ enum pipe_compute_cap
    PIPE_COMPUTE_CAP_MAX_CLOCK_FREQUENCY,
    PIPE_COMPUTE_CAP_MAX_COMPUTE_UNITS,
    PIPE_COMPUTE_CAP_IMAGES_SUPPORTED,
-   PIPE_COMPUTE_CAP_SUBGROUP_SIZE
+   PIPE_COMPUTE_CAP_SUBGROUP_SIZE,
+   PIPE_COMPUTE_CAP_MAX_VARIABLE_THREADS_PER_BLOCK,
 };
 
 /**