gallium,clover: add compute caps used by clover only

To remove ir_type param when get_compute_param. These caps depend
on IR type and used by clover only (only clover query with
PIPE_SHADER_IR_NATIVE, others query with PIPE_SHADER_IR_NIR).
Only r600 and radeonsi support PIPE_SHADER_IR_NATIVE.

These caps can be removed when clover is deprecated.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33176>
This commit is contained in:
Qiang Yu 2025-01-20 15:48:45 +08:00
parent 2af8172b62
commit 8a6eb7041e
5 changed files with 12 additions and 2 deletions

View file

@ -761,11 +761,15 @@ pipe_screen::get_compute_param.
units. Value type: ``uint64_t []``. Shader IR type dependent.
* ``PIPE_COMPUTE_CAP_MAX_BLOCK_SIZE``: Maximum block size in thread
units. Value type: ``uint64_t []``. Shader IR type dependent.
* ``PIPE_COMPUTE_CAP_MAX_BLOCK_SIZE_CLOVER``: Same as ``PIPE_COMPUTE_CAP_MAX_BLOCK_SIZE``
but used by clover only.
* ``PIPE_COMPUTE_CAP_MAX_THREADS_PER_BLOCK``: Maximum number of threads that
a single block can contain. Value type: ``uint64_t``. Shader IR type dependent.
This may be less than the product of the components of MAX_BLOCK_SIZE and is
usually limited by the number of threads that can be resident simultaneously
on a compute unit.
* ``PIPE_COMPUTE_CAP_MAX_THREADS_PER_BLOCK_CLOVER``: Same as
``PIPE_COMPUTE_CAP_MAX_THREADS_PER_BLOCK`` but used by clover only.
* ``PIPE_COMPUTE_CAP_MAX_GLOBAL_SIZE``: Maximum size of the GLOBAL
resource. Value type: ``uint64_t``. Shader IR type dependent.
* ``PIPE_COMPUTE_CAP_MAX_LOCAL_SIZE``: Maximum size of the LOCAL

View file

@ -896,6 +896,7 @@ static int r600_get_compute_param(struct pipe_screen *screen,
return 3 * sizeof(uint64_t) ;
case PIPE_COMPUTE_CAP_MAX_BLOCK_SIZE:
case PIPE_COMPUTE_CAP_MAX_BLOCK_SIZE_CLOVER:
if (ret) {
uint64_t *block_size = ret;
unsigned threads_per_block = get_max_threads_per_block(rscreen, ir_type);
@ -906,6 +907,7 @@ static int r600_get_compute_param(struct pipe_screen *screen,
return 3 * sizeof(uint64_t);
case PIPE_COMPUTE_CAP_MAX_THREADS_PER_BLOCK:
case PIPE_COMPUTE_CAP_MAX_THREADS_PER_BLOCK_CLOVER:
if (ret) {
uint64_t *max_threads_per_block = ret;
*max_threads_per_block = get_max_threads_per_block(rscreen, ir_type);

View file

@ -857,6 +857,7 @@ static int si_get_compute_param(struct pipe_screen *screen, enum pipe_shader_ir
return 3 * sizeof(uint64_t);
case PIPE_COMPUTE_CAP_MAX_BLOCK_SIZE:
case PIPE_COMPUTE_CAP_MAX_BLOCK_SIZE_CLOVER:
if (ret) {
uint64_t *block_size = ret;
unsigned threads_per_block = get_max_threads_per_block(sscreen, ir_type);
@ -867,6 +868,7 @@ static int si_get_compute_param(struct pipe_screen *screen, enum pipe_shader_ir
return 3 * sizeof(uint64_t);
case PIPE_COMPUTE_CAP_MAX_THREADS_PER_BLOCK:
case PIPE_COMPUTE_CAP_MAX_THREADS_PER_BLOCK_CLOVER:
if (ret) {
uint64_t *max_threads_per_block = ret;
*max_threads_per_block = get_max_threads_per_block(sscreen, ir_type);

View file

@ -300,7 +300,7 @@ device::max_const_buffers() const {
size_t
device::max_threads_per_block() const {
return get_compute_param<uint64_t>(
pipe, ir_format(), PIPE_COMPUTE_CAP_MAX_THREADS_PER_BLOCK)[0];
pipe, ir_format(), PIPE_COMPUTE_CAP_MAX_THREADS_PER_BLOCK_CLOVER)[0];
}
cl_ulong
@ -415,7 +415,7 @@ device::allows_user_pointers() const {
std::vector<size_t>
device::max_block_size() const {
auto v = get_compute_param<uint64_t>(pipe, ir_format(),
PIPE_COMPUTE_CAP_MAX_BLOCK_SIZE);
PIPE_COMPUTE_CAP_MAX_BLOCK_SIZE_CLOVER);
return { v.begin(), v.end() };
}

View file

@ -801,7 +801,9 @@ enum pipe_compute_cap
PIPE_COMPUTE_CAP_GRID_DIMENSION,
PIPE_COMPUTE_CAP_MAX_GRID_SIZE,
PIPE_COMPUTE_CAP_MAX_BLOCK_SIZE,
PIPE_COMPUTE_CAP_MAX_BLOCK_SIZE_CLOVER,
PIPE_COMPUTE_CAP_MAX_THREADS_PER_BLOCK,
PIPE_COMPUTE_CAP_MAX_THREADS_PER_BLOCK_CLOVER,
PIPE_COMPUTE_CAP_MAX_GLOBAL_SIZE,
PIPE_COMPUTE_CAP_MAX_LOCAL_SIZE,
PIPE_COMPUTE_CAP_MAX_PRIVATE_SIZE,