[v2,2/2] virgl-caps: Report support for GL_ARB_copy_image to the guest

Submitted by Gert Wollny on July 3, 2018, 11:21 a.m.

Details

Message ID 20180703112148.901-3-gert.wollny@collabora.com
State New
Series "Fix GLES31 copy_image.non-compressed tests"
Headers show

Commit Message

Gert Wollny July 3, 2018, 11:21 a.m.
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
---
Currently the code path for gles and gl for setting caps needs duplication, 
I intend to clean this up in a future patch.  

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

Patch hide | download patch | download mbox

diff --git a/src/virgl_hw.h b/src/virgl_hw.h
index 589cd73..7c791d6 100644
--- a/src/virgl_hw.h
+++ b/src/virgl_hw.h
@@ -215,6 +215,7 @@  enum virgl_formats {
 #define VIRGL_CAP_NONE 0
 #define VIRGL_CAP_TGSI_INVARIANT       (1 << 0)
 #define VIRGL_CAP_TEXTURE_VIEW         (1 << 1)
+#define VIRGL_CAP_COPY_IMAGE           (1 << 3)
 
 struct virgl_caps_bool_set1 {
         unsigned indep_blend_enable:1;
diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c
index 1bf33f1..05d9035 100644
--- a/src/vrend_renderer.c
+++ b/src/vrend_renderer.c
@@ -7367,6 +7367,9 @@  static void vrend_renderer_fill_caps_gles(uint32_t set, UNUSED uint32_t version,
 
    /* Not available on GLES */
    caps->v2.texture_buffer_offset_alignment = 0;
+
+   if (vrend_state.have_copy_image)
+      caps->v2.capability_bits |= VIRGL_CAP_COPY_IMAGE;
 }
 
 void vrend_renderer_fill_caps(uint32_t set, uint32_t version,
@@ -7597,6 +7599,9 @@  void vrend_renderer_fill_caps(uint32_t set, uint32_t version,
 
    if (gl_ver >= 43 || epoxy_has_gl_extension("GL_ARB_texture_view"))
       caps->v2.capability_bits |= VIRGL_CAP_TEXTURE_VIEW;
+
+   if (vrend_state.have_copy_image)
+      caps->v2.capability_bits |= VIRGL_CAP_COPY_IMAGE;
 }
 
 GLint64 vrend_renderer_get_timestamp(void)