aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2019-12-10 14:55:34 +1000
committerDave Airlie <[email protected]>2019-12-27 13:26:33 +1000
commit073734ca7fb326a64c663938f56a5bf23b39de59 (patch)
tree247d5a11eca47b0ccfb5c33a3c4e4b3f28e1c9e6
parent22d631e2355eaf2857f5c775f189539d1b8bc834 (diff)
llvmpipe: add support for compute shader params
Acked-by: Roland Scheidegger <[email protected]>
-rw-r--r--src/gallium/drivers/llvmpipe/lp_screen.c60
1 files 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;
}