summaryrefslogtreecommitdiffstats
path: root/src/intel/isl/isl_storage_image.c
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2018-06-06 09:54:17 -0700
committerJason Ekstrand <[email protected]>2018-06-07 11:23:34 -0700
commit778e2881a04817e8c10c7a400bf1e37414420194 (patch)
tree79343863145c4222a59af8d73f6f79bff29575d1 /src/intel/isl/isl_storage_image.c
parentc267f46ef2910cb72438bf6d9fe4de9fc33d6931 (diff)
intel/isl: Add bounds-checking assertions in isl_format_get_layout
We add two assertions instead of one because the first assertion that format != ISL_FORMAT_UNSUPPORTED is more descriptive and checks for a real but unsupported enumerant while the second ensures that they don't pass in garbage values. We also update some other helpers to use isl_format_get_layout instead of using the table directly so that they get bounds checking too. Cc: [email protected] Reviewed-by: Lionel Landwerlin <[email protected]>
Diffstat (limited to 'src/intel/isl/isl_storage_image.c')
-rw-r--r--src/intel/isl/isl_storage_image.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/intel/isl/isl_storage_image.c b/src/intel/isl/isl_storage_image.c
index ed1c6008aeb..e2bd4ddebad 100644
--- a/src/intel/isl/isl_storage_image.c
+++ b/src/intel/isl/isl_storage_image.c
@@ -316,6 +316,6 @@ isl_buffer_fill_image_param(const struct isl_device *dev,
{
*param = image_param_defaults;
- param->stride[0] = isl_format_layouts[format].bpb / 8;
+ param->stride[0] = isl_format_get_layout(format)->bpb / 8;
param->size[0] = size / param->stride[0];
}