[virglrenderer-devel] [PATCH 2/2] send depthstencil capabilities to guest

Erik Faye-Lund erik.faye-lund at collabora.com
Mon Jul 9 15:03:37 UTC 2018


We compute these capabilities per format, but we don't end up
padding them to the guest. In turn, the guest ends up using
the wrong capabilites (sampling) to reject incompatible depth
formats. This obviously only works for sampleable depth/stencil
targets, which are much more rare than non-sampleable.

Signed-off-by: Erik Faye-Lund <erik.faye-lund at collabora.com>
---
 src/vrend_renderer.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c
index d0a53bf..11e14b2 100644
--- a/src/vrend_renderer.c
+++ b/src/vrend_renderer.c
@@ -436,11 +436,17 @@ static inline bool vrend_format_can_sample(enum virgl_formats format)
 {
    return tex_conv_table[format].bindings & VREND_BIND_SAMPLER;
 }
+
 static inline bool vrend_format_can_render(enum virgl_formats format)
 {
    return tex_conv_table[format].bindings & VREND_BIND_RENDER;
 }
 
+static inline bool vrend_format_can_depthstencil(enum virgl_formats format)
+{
+   return tex_conv_table[format].bindings & VREND_BIND_DEPTHSTENCIL;
+}
+
 static inline bool vrend_format_is_ds(enum virgl_formats format)
 {
    return tex_conv_table[format].bindings & VREND_BIND_DEPTHSTENCIL;
@@ -7171,6 +7177,8 @@ static bool vrend_renderer_fill_caps_common(uint32_t set, UNUSED uint32_t versio
             caps->v1.sampler.bitmask[offset] |= (1 << index);
          if (vrend_format_can_render(i))
             caps->v1.render.bitmask[offset] |= (1 << index);
+         if (vrend_format_can_depthstencil(i))
+            caps->v1.depthstencil.bitmask[offset] |= (1 << index);
       }
    }
 
-- 
2.18.0.rc2



More information about the virglrenderer-devel mailing list