[virglrenderer-devel] [PATCH] vrend: use bits in caps set v2

Gurchetan Singh gurchetansingh at chromium.org
Mon Jun 4 17:24:18 UTC 2018


We don't need the entire 32 bits to report the presence of TGSI
invariant support.

Suggested-by: Gert Wollny <gert.wollny at collabora.com>
Suggested-by: Dave Airlie <airlied at redhat.com>
---
 src/virgl_hw.h       | 6 +++++-
 src/vrend_renderer.c | 2 +-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/virgl_hw.h b/src/virgl_hw.h
index a430fae..282669b 100644
--- a/src/virgl_hw.h
+++ b/src/virgl_hw.h
@@ -209,6 +209,10 @@ enum virgl_formats {
    VIRGL_FORMAT_MAX,
 };
 
+/* These are used by the capability_bits field in virgl_caps_v2. */
+#define VIRGL_CAP_NONE 0
+#define VIRGL_CAP_TGSI_INVARIANT       (1 << 0)
+
 struct virgl_caps_bool_set1 {
         unsigned indep_blend_enable:1;
         unsigned indep_blend_func:1;
@@ -296,8 +300,8 @@ struct virgl_caps_v2 {
         int32_t max_texture_gather_offset;
         uint32_t texture_buffer_offset_alignment;
         uint32_t uniform_buffer_offset_alignment;
-        uint32_t tgsi_invariant;
         uint32_t shader_buffer_offset_alignment;
+        uint32_t capability_bits;
 };
 
 union virgl_caps {
diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c
index df575b1..a115a88 100644
--- a/src/vrend_renderer.c
+++ b/src/vrend_renderer.c
@@ -7079,7 +7079,7 @@ void vrend_renderer_fill_caps(uint32_t set, uint32_t version,
       glGetIntegerv(GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT, (GLint*)&caps->v2.shader_buffer_offset_alignment);
    }
 
-   caps->v2.tgsi_invariant = 1;
+   caps->v2.capability_bits |= VIRGL_CAP_TGSI_INVARIANT;
 }
 
 GLint64 vrend_renderer_get_timestamp(void)
-- 
2.17.1.1185.g55be947832-goog



More information about the virglrenderer-devel mailing list