radeon/compute: Report a value for PIPE_SHADER_CAP_MAX_CONST_BUFFER_SIZE
authorTom Stellard <thomas.stellard@amd.com>
Thu, 7 Aug 2014 19:31:17 +0000 (15:31 -0400)
committerTom Stellard <thomas.stellard@amd.com>
Wed, 13 Aug 2014 18:11:44 +0000 (14:11 -0400)
CC: "10.2" <mesa-stable@lists.freedesktop.org>
src/gallium/drivers/r600/r600_pipe.c
src/gallium/drivers/radeonsi/si_pipe.c

index f0a71c3027d3af696c099d18161ab18fbac8cbd4..20d9f950e4c6560e7efc4b5564dd9bab6c6b0e88 100644 (file)
@@ -418,7 +418,16 @@ static int r600_get_shader_param(struct pipe_screen* pscreen, unsigned shader, e
        case PIPE_SHADER_CAP_MAX_TEMPS:
                return 256; /* Max native temporaries. */
        case PIPE_SHADER_CAP_MAX_CONST_BUFFER_SIZE:
-               return R600_MAX_CONST_BUFFER_SIZE;
+               if (shader == PIPE_SHADER_COMPUTE) {
+                       uint64_t max_const_buffer_size;
+                       pscreen->get_compute_param(pscreen,
+                               PIPE_COMPUTE_CAP_MAX_MEM_ALLOC_SIZE,
+                               &max_const_buffer_size);
+                       return max_const_buffer_size;
+
+               } else {
+                       return R600_MAX_CONST_BUFFER_SIZE;
+               }
        case PIPE_SHADER_CAP_MAX_CONST_BUFFERS:
                return R600_MAX_USER_CONST_BUFFERS;
        case PIPE_SHADER_CAP_MAX_PREDS:
index 592069746d970c78605b79fa3f2523c38a8bec31..879387f0fba711c3a93db5e8a9e6983cf3071712 100644 (file)
@@ -328,6 +328,13 @@ static int si_get_shader_param(struct pipe_screen* pscreen, unsigned shader, enu
                case PIPE_SHADER_CAP_DOUBLES:
                        return 0; /* XXX: Enable doubles once the compiler can
                                     handle them. */
+               case PIPE_SHADER_CAP_MAX_CONST_BUFFER_SIZE: {
+                       uint64_t max_const_buffer_size;
+                       pscreen->get_compute_param(pscreen,
+                               PIPE_COMPUTE_CAP_MAX_MEM_ALLOC_SIZE,
+                               &max_const_buffer_size);
+                       return max_const_buffer_size;
+               }
                default:
                        return 0;
                }