anv/device: Embed isl_device
authorChad Versace <chad.versace@intel.com>
Fri, 13 Nov 2015 18:12:51 +0000 (10:12 -0800)
committerChad Versace <chad.versace@intel.com>
Fri, 13 Nov 2015 18:44:09 +0000 (10:44 -0800)
Embed struct isl_device into anv_physical_device and anv_device.  It
will later be used for surface layout calculations.

src/vulkan/anv_device.c
src/vulkan/anv_private.h

index af27711d9a4ce081d53b94d31410ed693b6c085c..5d53deeb599fb4400dcd3fdd2ff1e49adc2b3a4f 100644 (file)
@@ -56,6 +56,7 @@ 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)
@@ -81,6 +82,10 @@ 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");
@@ -128,6 +133,8 @@ 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);
+
    return VK_SUCCESS;
 
 fail:
@@ -672,6 +679,7 @@ VkResult anv_CreateDevice(
    anv_block_pool_init(&device->scratch_block_pool, device, 0x10000);
 
    device->info = *physical_device->info;
+   device->isl_dev = physical_device->isl_dev;
 
    anv_queue_init(device, &device->queue);
 
index cf6f415141a746e4947ee8f0b8e0d1c4bb27cd5e..8269c7e85094dcf425cf5452c18b21c977272412 100644 (file)
@@ -428,6 +428,7 @@ struct anv_physical_device {
     const struct brw_device_info *              info;
     uint64_t                                    aperture_size;
     struct brw_compiler *                       compiler;
+    struct isl_device                           isl_dev;
 };
 
 bool anv_is_scalar_shader_stage(const struct brw_compiler *compiler,
@@ -485,6 +486,7 @@ struct anv_device {
     struct anv_instance *                       instance;
     uint32_t                                    chipset_id;
     struct brw_device_info                      info;
+    struct isl_device                           isl_dev;
     int                                         context_id;
     int                                         fd;