summaryrefslogtreecommitdiffstats
path: root/src/intel/isl/isl_surface_state.c
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2016-07-26 11:47:05 -0700
committerJason Ekstrand <[email protected]>2016-08-29 12:17:34 -0700
commitf4314d06e8b7ac2ecd0adf67a885f9af84dcf557 (patch)
tree0a7eeab79a8f28b3727d4027ae5fa3e38e402ea7 /src/intel/isl/isl_surface_state.c
parent87214414fd584aac80bb88f337ba119cac5109f3 (diff)
isl/state: Add some asserts about format capabilities
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. Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
Diffstat (limited to 'src/intel/isl/isl_surface_state.c')
-rw-r--r--src/intel/isl/isl_surface_state.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/intel/isl/isl_surface_state.c b/src/intel/isl/isl_surface_state.c
index 4a7e921a798..979e1402e8c 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