isl: Embed brw_device_info in isl_device

Suggested-by: Jason Ekstrand <jason.ekstrand@intel.com>
This commit is contained in:
Chad Versace 2015-11-13 11:12:46 -08:00
parent ba467467f4
commit 738eaa8acf
3 changed files with 9 additions and 17 deletions

View file

@ -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;

View file

@ -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;
}
/**

View file

@ -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,