[2/2] send depthstencil capabilities to guest

Submitted by Erik Faye-Lund on July 9, 2018, 3:03 p.m.

Details

Message ID 20180709150337.2389-3-erik.faye-lund@collabora.com
State New
Series "more accurate format capabilities"
Headers show

Commit Message

Erik Faye-Lund July 9, 2018, 3:03 p.m.
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@collabora.com>
---
 src/vrend_renderer.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Patch hide | download patch | download mbox

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);
       }
    }