vrend: guard minigbm usage bit in vrend_fromat_can_sample()

GBM_BO_USE_TEXTURING is available in minigbm's gbm.h but not in
mesa's gbm.h. Texture usage is implied with usage 0 in mesa gbm.

Signed-off-by: Jason Macnak <jmacnak@gmail.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
macos/master
Jason Macnak 5 years ago
parent cdbc4296b6
commit 6f3cfe1069
  1. 8
      src/vrend_renderer.c

@ -689,7 +689,13 @@ static inline bool vrend_format_can_sample(enum virgl_formats format)
if (!gbm || !gbm->device || !gbm_format)
return false;
return gbm_device_is_format_supported(gbm->device, gbm_format, GBM_BO_USE_TEXTURING);
#ifdef MINIGBM
uint32_t gbm_usage = GBM_BO_USE_TEXTURING;
#else
uint32_t gbm_usage = 0;
#endif
return gbm_device_is_format_supported(gbm->device, gbm_format, gbm_usage);
#else
return false;
#endif

Loading…
Cancel
Save