summaryrefslogtreecommitdiffstats
path: root/src/vulkan
diff options
context:
space:
mode:
authorChad Versace <[email protected]>2015-11-13 11:12:46 -0800
committerChad Versace <[email protected]>2015-11-13 11:14:03 -0800
commit738eaa8acff2bc4a351a62303ac43d1195160ec4 (patch)
tree9a366b0b2fca09725b41202b67a0c67d99037ef4 /src/vulkan
parentba467467f49577381be651643dd7ff184b998590 (diff)
isl: Embed brw_device_info in isl_device
Suggested-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/vulkan')
-rw-r--r--src/vulkan/anv_device.c7
-rw-r--r--src/vulkan/isl.c6
-rw-r--r--src/vulkan/isl.h13
3 files changed, 9 insertions, 17 deletions
diff --git a/src/vulkan/anv_device.c b/src/vulkan/anv_device.c
index 5d53deeb599..fb608592c1f 100644
--- a/src/vulkan/anv_device.c
+++ b/src/vulkan/anv_device.c
@@ -56,7 +56,6 @@ anv_physical_device_init(struct anv_physical_device *device,
{
VkResult result;
int fd;
- uint32_t gen10x;
fd = open(path, O_RDWR | O_CLOEXEC);
if (fd < 0)
@@ -82,10 +81,6 @@ anv_physical_device_init(struct anv_physical_device *device,
goto fail;
}
- gen10x = 10 * device->info->gen;
- if (device->info->is_haswell)
- gen10x += 5;
-
if (device->info->gen == 7 &&
!device->info->is_haswell && !device->info->is_baytrail) {
fprintf(stderr, "WARNING: Ivy Bridge Vulkan support is incomplete\n");
@@ -133,7 +128,7 @@ anv_physical_device_init(struct anv_physical_device *device,
device->compiler->shader_debug_log = compiler_debug_log;
device->compiler->shader_perf_log = compiler_perf_log;
- isl_device_init(&device->isl_dev, gen10x);
+ isl_device_init(&device->isl_dev, device->info);
return VK_SUCCESS;
diff --git a/src/vulkan/isl.c b/src/vulkan/isl.c
index ecfa96973dd..ebfd2bfb104 100644
--- a/src/vulkan/isl.c
+++ b/src/vulkan/isl.c
@@ -38,10 +38,10 @@ isl_log2u(uint32_t n)
}
void
-isl_device_init(struct isl_device *dev, uint8_t gen10x)
+isl_device_init(struct isl_device *dev,
+ const struct brw_device_info *info)
{
- assert(gen10x % 5 == 0);
- dev->gen = gen10x;
+ dev->info = info;
}
/**
diff --git a/src/vulkan/isl.h b/src/vulkan/isl.h
index 4c38170fc72..fb0b6f4a75c 100644
--- a/src/vulkan/isl.h
+++ b/src/vulkan/isl.h
@@ -35,6 +35,8 @@
extern "C" {
#endif
+struct brw_device_info;
+
/**
* WARNING: These values differ from the hardware enum values, which are
* unstable across hardware generations.
@@ -320,13 +322,7 @@ enum isl_txc {
};
struct isl_device {
- /**
- * @brief Hardware generation, 10x.
- *
- * For example, gen is 70 for Ivybridge and Baytrail; gen is 75 for
- * Haswell.
- */
- uint8_t gen;
+ const struct brw_device_info *info;
};
struct isl_extent2d {
@@ -369,7 +365,8 @@ struct isl_format_layout {
};
void
-isl_device_init(struct isl_device *dev, uint8_t gen10x);
+isl_device_init(struct isl_device *dev,
+ const struct brw_device_info *info);
void
isl_tiling_get_extent(const struct isl_device *dev,