[Mesa-dev] [PATCH 5/5] isl/state: Add some asserts about format capabilities

Nanley Chery nanleychery at gmail.com
Wed Jul 27 23:47:41 UTC 2016


On Tue, Jul 26, 2016 at 10:04:26PM -0700, Jason Ekstrand wrote:
> This keeps invalid surface states from leaking through and potentially
> hanging the GPU.  We shouldn't actually be hitting this on a regular basis,
> but a helpful assert is better than a hang.

Patches 4 and 5 are,
Reviewed-by: Nanley Chery <nanley.g.chery at intel.com>

> ---
>  src/intel/isl/isl_surface_state.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/src/intel/isl/isl_surface_state.c b/src/intel/isl/isl_surface_state.c
> index d1c8f17..a30086d 100644
> --- a/src/intel/isl/isl_surface_state.c
> +++ b/src/intel/isl/isl_surface_state.c
> @@ -210,6 +210,11 @@ isl_genX(surf_fill_state_s)(const struct isl_device *dev, void *state,
>     struct GENX(RENDER_SURFACE_STATE) s = { 0 };
>  
>     s.SurfaceType = get_surftype(info->surf->dim, info->view->usage);
> +
> +   if (info->view->usage & ISL_SURF_USAGE_RENDER_TARGET_BIT)
> +      assert(isl_format_supports_rendering(dev->info, info->view->format));
> +   else if (info->view->usage & ISL_SURF_USAGE_TEXTURE_BIT)
> +      assert(isl_format_supports_sampling(dev->info, info->view->format));
>     s.SurfaceFormat = info->view->format;
>  
>  #if GEN_IS_HASWELL
> -- 
> 2.5.0.400.gff86faf
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list