vrend: check with gbm in vrend_format_can_sample() when gbm enabled

This will allow additional formats to be reported as supported in caps
when gbm allocation is enabled (VIRGL_FORMAT_NV12/VIRGL_FORMAT_YV12).
macos/master
Jason Macnak 5 years ago committed by Gurchetan Singh
parent 10854be913
commit 32c50df297
  1. 16
      src/vrend_renderer.c

@ -678,7 +678,21 @@ static struct vrend_format_table tex_conv_table[VIRGL_FORMAT_MAX_EXTENDED];
static inline bool vrend_format_can_sample(enum virgl_formats format)
{
return tex_conv_table[format].bindings & VIRGL_BIND_SAMPLER_VIEW;
if (tex_conv_table[format].bindings & VIRGL_BIND_SAMPLER_VIEW)
return true;
#ifdef ENABLE_GBM_ALLOCATION
uint32_t gbm_format = 0;
if (virgl_gbm_convert_format(&format, &gbm_format))
return false;
if (!gbm || !gbm->device || !gbm_format)
return false;
return gbm_device_is_format_supported(gbm->device, gbm_format, GBM_BO_USE_TEXTURING);
#else
return false;
#endif
}
static inline bool vrend_format_can_readback(enum virgl_formats format)

Loading…
Cancel
Save