[virglrenderer-devel] [PATCH] compute: add more caps for block/grid size

Dave Airlie airlied at gmail.com
Mon Jul 30 22:50:03 UTC 2018


From: Dave Airlie <airlied at redhat.com>

---
 src/virgl_hw.h       | 2 ++
 src/vrend_renderer.c | 7 +++++++
 2 files changed, 9 insertions(+)

diff --git a/src/virgl_hw.h b/src/virgl_hw.h
index df44a4f..890fada 100644
--- a/src/virgl_hw.h
+++ b/src/virgl_hw.h
@@ -342,6 +342,8 @@ struct virgl_caps_v2 {
         uint32_t max_image_samples;
         uint32_t max_compute_work_group_invocations;
         uint32_t max_compute_shared_memory_size;
+        uint32_t max_compute_grid_size[3];
+        uint32_t max_compute_block_size[3];
 };
 
 union virgl_caps {
diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c
index 1126d05..68c21b3 100644
--- a/src/vrend_renderer.c
+++ b/src/vrend_renderer.c
@@ -8195,6 +8195,13 @@ void vrend_renderer_fill_caps(uint32_t set, UNUSED uint32_t version,
    if (has_feature(feat_compute_shader)) {
       glGetIntegerv(GL_MAX_COMPUTE_WORK_GROUP_INVOCATIONS, (GLint*)&caps->v2.max_compute_work_group_invocations);
       glGetIntegerv(GL_MAX_COMPUTE_SHARED_MEMORY_SIZE, (GLint*)&caps->v2.max_compute_shared_memory_size);
+      glGetIntegeri_v(GL_MAX_COMPUTE_WORK_GROUP_COUNT, 0, (GLint*)&caps->v2.max_compute_grid_size[0]);
+      glGetIntegeri_v(GL_MAX_COMPUTE_WORK_GROUP_COUNT, 1, (GLint*)&caps->v2.max_compute_grid_size[1]);
+      glGetIntegeri_v(GL_MAX_COMPUTE_WORK_GROUP_COUNT, 2, (GLint*)&caps->v2.max_compute_grid_size[2]);
+      glGetIntegeri_v(GL_MAX_COMPUTE_WORK_GROUP_SIZE, 0, (GLint*)&caps->v2.max_compute_block_size[0]);
+      glGetIntegeri_v(GL_MAX_COMPUTE_WORK_GROUP_SIZE, 1, (GLint*)&caps->v2.max_compute_block_size[1]);
+      glGetIntegeri_v(GL_MAX_COMPUTE_WORK_GROUP_SIZE, 2, (GLint*)&caps->v2.max_compute_block_size[2]);
+
       caps->v2.capability_bits |= VIRGL_CAP_COMPUTE_SHADER;
    }
 
-- 
2.14.3



More information about the virglrenderer-devel mailing list