From 073734ca7fb326a64c663938f56a5bf23b39de59 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Tue, 10 Dec 2019 14:55:34 +1000 Subject: [PATCH] llvmpipe: add support for compute shader params Acked-by: Roland Scheidegger --- src/gallium/drivers/llvmpipe/lp_screen.c | 60 ++++++++++++++++++++++-- 1 file changed, 55 insertions(+), 5 deletions(-) diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c b/src/gallium/drivers/llvmpipe/lp_screen.c index d0a1b351c49..55181e7115b 100644 --- a/src/gallium/drivers/llvmpipe/lp_screen.c +++ b/src/gallium/drivers/llvmpipe/lp_screen.c @@ -524,17 +524,67 @@ llvmpipe_get_compute_param(struct pipe_screen *_screen, } return sizeof(uint64_t); case PIPE_COMPUTE_CAP_GRID_DIMENSION: + if (ret) { + uint32_t *grid_dim = ret; + *grid_dim = 3; + } + return sizeof(uint32_t); case PIPE_COMPUTE_CAP_MAX_GLOBAL_SIZE: + if (ret) { + uint64_t *max_global_size = ret; + *max_global_size = (1ULL << 31); + } + return sizeof(uint64_t); + case PIPE_COMPUTE_CAP_MAX_MEM_ALLOC_SIZE: + if (ret) { + uint64_t *max_mem_alloc_size = ret; + *max_mem_alloc_size = (1ULL << 31); + } + return sizeof(uint64_t); case PIPE_COMPUTE_CAP_MAX_PRIVATE_SIZE: + if (ret) { + uint64_t *max_private = ret; + *max_private = (1UL << 31); + } + return sizeof(uint64_t); case PIPE_COMPUTE_CAP_MAX_INPUT_SIZE: - case PIPE_COMPUTE_CAP_MAX_MEM_ALLOC_SIZE: - case PIPE_COMPUTE_CAP_MAX_CLOCK_FREQUENCY: - case PIPE_COMPUTE_CAP_MAX_COMPUTE_UNITS: + if (ret) { + uint64_t *max_input = ret; + *max_input = 4096; + } + return sizeof(uint64_t); case PIPE_COMPUTE_CAP_IMAGES_SUPPORTED: + if (ret) { + uint32_t *images = ret; + *images = 0; + } + return sizeof(uint32_t); + case PIPE_COMPUTE_CAP_MAX_VARIABLE_THREADS_PER_BLOCK: + return 0; case PIPE_COMPUTE_CAP_SUBGROUP_SIZE: + if (ret) { + uint32_t *subgroup_size = ret; + *subgroup_size = 32; + } + return sizeof(uint32_t); + case PIPE_COMPUTE_CAP_MAX_COMPUTE_UNITS: + if (ret) { + uint32_t *max_compute_units = ret; + *max_compute_units = 8; + } + return sizeof(uint32_t); + case PIPE_COMPUTE_CAP_MAX_CLOCK_FREQUENCY: + if (ret) { + uint32_t *max_clock_freq = ret; + *max_clock_freq = 300; + } + return sizeof(uint32_t); case PIPE_COMPUTE_CAP_ADDRESS_BITS: - case PIPE_COMPUTE_CAP_MAX_VARIABLE_THREADS_PER_BLOCK: - break; + if (ret) { + uint32_t *address_bits = ret; + *address_bits = 64; + } + return sizeof(uint32_t); } return 0; } -- 2.30.2