st/mesa: Use correct size for compute CAPs.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Wed, 20 Apr 2016 13:31:22 +0000 (15:31 +0200)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Wed, 20 Apr 2016 22:27:01 +0000 (00:27 +0200)
Some CAPs are stored as 64-bit value while Mesa stores
the related constant as 32-bit value.

Signed-off-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
src/mesa/state_tracker/st_extensions.c

index 939f15d5e9fca60325fed0c5953424a7e865b765..3f769b62dd46fafe57fd869ae94a5f7f45ef8e18 100644 (file)
@@ -1152,6 +1152,7 @@ void st_init_extensions(struct pipe_screen *screen,
                                   PIPE_SHADER_CAP_SUPPORTED_IRS);
       if (compute_supported_irs & (1 << PIPE_SHADER_IR_TGSI)) {
          uint64_t grid_size[3], block_size[3];
+         uint64_t max_local_size, max_threads_per_block;
 
          screen->get_compute_param(screen, PIPE_SHADER_IR_TGSI,
                                    PIPE_COMPUTE_CAP_MAX_GRID_SIZE, grid_size);
@@ -1159,10 +1160,13 @@ void st_init_extensions(struct pipe_screen *screen,
                                    PIPE_COMPUTE_CAP_MAX_BLOCK_SIZE, block_size);
          screen->get_compute_param(screen, PIPE_SHADER_IR_TGSI,
                                    PIPE_COMPUTE_CAP_MAX_THREADS_PER_BLOCK,
-                                   &consts->MaxComputeWorkGroupInvocations);
+                                   &max_threads_per_block);
          screen->get_compute_param(screen, PIPE_SHADER_IR_TGSI,
                                    PIPE_COMPUTE_CAP_MAX_LOCAL_SIZE,
-                                   &consts->MaxComputeSharedMemorySize);
+                                   &max_local_size);
+
+         consts->MaxComputeWorkGroupInvocations = max_threads_per_block;
+         consts->MaxComputeSharedMemorySize = max_local_size;
 
          for (i = 0; i < 3; i++) {
             consts->MaxComputeWorkGroupCount[i] = grid_size[i];