summaryrefslogtreecommitdiffstats
path: root/src/intel/isl
diff options
context:
space:
mode:
authorJason Ekstrand <jason.ekstrand@intel.com>2016-04-15 16:53:31 -0700
committerJason Ekstrand <jason.ekstrand@intel.com>2016-04-21 20:44:27 -0700
commit90576ac96303941ffefe50e56aad15ba09459aa8 (patch)
treeb8ee5adadf3e014c499c801ca1d12af1cf1668be /src/intel/isl
parent37f6f21b1f65d13c706a5de00e531608fea9ea66 (diff)
downloadexternal_mesa3d-90576ac96303941ffefe50e56aad15ba09459aa8.zip
external_mesa3d-90576ac96303941ffefe50e56aad15ba09459aa8.tar.gz
external_mesa3d-90576ac96303941ffefe50e56aad15ba09459aa8.tar.bz2
isl: Take a devinfo in lower_storage_image_format instead of an isl_device
We want to call this function from the shader compiler and having a full isl_device available at that point isn't practical. Reviewed-by: Chad Versace <chad.versace@intel.com>
Diffstat (limited to 'src/intel/isl')
-rw-r--r--src/intel/isl/isl.h2
-rw-r--r--src/intel/isl/isl_storage_image.c30
-rw-r--r--src/intel/isl/isl_surface_state.c3
3 files changed, 18 insertions, 17 deletions
diff --git a/src/intel/isl/isl.h b/src/intel/isl/isl.h
index 62d3769..6c417b2 100644
--- a/src/intel/isl/isl.h
+++ b/src/intel/isl/isl.h
@@ -900,7 +900,7 @@ enum isl_format isl_format_rgb_to_rgbx(enum isl_format rgb) ATTRIBUTE_CONST;
bool isl_is_storage_image_format(enum isl_format fmt);
enum isl_format
-isl_lower_storage_image_format(const struct isl_device *dev,
+isl_lower_storage_image_format(const struct brw_device_info *devinfo,
enum isl_format fmt);
static inline bool
diff --git a/src/intel/isl/isl_storage_image.c b/src/intel/isl/isl_storage_image.c
index 2b5b5cd..8d9bea3 100644
--- a/src/intel/isl/isl_storage_image.c
+++ b/src/intel/isl/isl_storage_image.c
@@ -76,7 +76,7 @@ isl_is_storage_image_format(enum isl_format format)
}
enum isl_format
-isl_lower_storage_image_format(const struct isl_device *dev,
+isl_lower_storage_image_format(const struct brw_device_info *devinfo,
enum isl_format format)
{
switch (format) {
@@ -100,8 +100,8 @@ isl_lower_storage_image_format(const struct isl_device *dev,
case ISL_FORMAT_R32G32_UINT:
case ISL_FORMAT_R32G32_SINT:
case ISL_FORMAT_R32G32_FLOAT:
- return (ISL_DEV_GEN(dev) >= 9 ? format :
- ISL_DEV_GEN(dev) >= 8 || dev->info->is_haswell ?
+ return (devinfo->gen >= 9 ? format :
+ devinfo->gen >= 8 || devinfo->is_haswell ?
ISL_FORMAT_R16G16B16A16_UINT :
ISL_FORMAT_R32G32_UINT);
@@ -117,31 +117,31 @@ isl_lower_storage_image_format(const struct isl_device *dev,
*/
case ISL_FORMAT_R8G8B8A8_UINT:
case ISL_FORMAT_R8G8B8A8_SINT:
- return (ISL_DEV_GEN(dev) >= 9 ? format :
- ISL_DEV_GEN(dev) >= 8 || dev->info->is_haswell ?
+ return (devinfo->gen >= 9 ? format :
+ devinfo->gen >= 8 || devinfo->is_haswell ?
ISL_FORMAT_R8G8B8A8_UINT : ISL_FORMAT_R32_UINT);
case ISL_FORMAT_R16G16_UINT:
case ISL_FORMAT_R16G16_SINT:
case ISL_FORMAT_R16G16_FLOAT:
- return (ISL_DEV_GEN(dev) >= 9 ? format :
- ISL_DEV_GEN(dev) >= 8 || dev->info->is_haswell ?
+ return (devinfo->gen >= 9 ? format :
+ devinfo->gen >= 8 || devinfo->is_haswell ?
ISL_FORMAT_R16G16_UINT : ISL_FORMAT_R32_UINT);
case ISL_FORMAT_R8G8_UINT:
case ISL_FORMAT_R8G8_SINT:
- return (ISL_DEV_GEN(dev) >= 9 ? format :
- ISL_DEV_GEN(dev) >= 8 || dev->info->is_haswell ?
+ return (devinfo->gen >= 9 ? format :
+ devinfo->gen >= 8 || devinfo->is_haswell ?
ISL_FORMAT_R8G8_UINT : ISL_FORMAT_R16_UINT);
case ISL_FORMAT_R16_UINT:
case ISL_FORMAT_R16_FLOAT:
case ISL_FORMAT_R16_SINT:
- return (ISL_DEV_GEN(dev) >= 9 ? format : ISL_FORMAT_R16_UINT);
+ return (devinfo->gen >= 9 ? format : ISL_FORMAT_R16_UINT);
case ISL_FORMAT_R8_UINT:
case ISL_FORMAT_R8_SINT:
- return (ISL_DEV_GEN(dev) >= 9 ? format : ISL_FORMAT_R8_UINT);
+ return (devinfo->gen >= 9 ? format : ISL_FORMAT_R8_UINT);
/* Neither the 2/10/10/10 nor the 11/11/10 packed formats are supported
* by the hardware.
@@ -154,23 +154,23 @@ isl_lower_storage_image_format(const struct isl_device *dev,
/* No normalized fixed-point formats are supported by the hardware. */
case ISL_FORMAT_R16G16B16A16_UNORM:
case ISL_FORMAT_R16G16B16A16_SNORM:
- return (ISL_DEV_GEN(dev) >= 8 || dev->info->is_haswell ?
+ return (devinfo->gen >= 8 || devinfo->is_haswell ?
ISL_FORMAT_R16G16B16A16_UINT :
ISL_FORMAT_R32G32_UINT);
case ISL_FORMAT_R8G8B8A8_UNORM:
case ISL_FORMAT_R8G8B8A8_SNORM:
- return (ISL_DEV_GEN(dev) >= 8 || dev->info->is_haswell ?
+ return (devinfo->gen >= 8 || devinfo->is_haswell ?
ISL_FORMAT_R8G8B8A8_UINT : ISL_FORMAT_R32_UINT);
case ISL_FORMAT_R16G16_UNORM:
case ISL_FORMAT_R16G16_SNORM:
- return (ISL_DEV_GEN(dev) >= 8 || dev->info->is_haswell ?
+ return (devinfo->gen >= 8 || devinfo->is_haswell ?
ISL_FORMAT_R16G16_UINT : ISL_FORMAT_R32_UINT);
case ISL_FORMAT_R8G8_UNORM:
case ISL_FORMAT_R8G8_SNORM:
- return (ISL_DEV_GEN(dev) >= 8 || dev->info->is_haswell ?
+ return (devinfo->gen >= 8 || devinfo->is_haswell ?
ISL_FORMAT_R8G8_UINT : ISL_FORMAT_R16_UINT);
case ISL_FORMAT_R16_UNORM:
diff --git a/src/intel/isl/isl_surface_state.c b/src/intel/isl/isl_surface_state.c
index cac59fa..dd88531 100644
--- a/src/intel/isl/isl_surface_state.c
+++ b/src/intel/isl/isl_surface_state.c
@@ -308,7 +308,8 @@ isl_genX(surf_fill_state_s)(const struct isl_device *dev, void *state,
}
if (info->view->usage & ISL_SURF_USAGE_STORAGE_BIT) {
- s.SurfaceFormat = isl_lower_storage_image_format(dev, info->view->format);
+ s.SurfaceFormat =
+ isl_lower_storage_image_format(dev->info, info->view->format);
} else {
s.SurfaceFormat = info->view->format;
}