anv/device: init timestampPeriod from devinfo
authorRobert Bragg <robert@sixbynine.org>
Fri, 17 Mar 2017 15:54:07 +0000 (15:54 +0000)
committerRobert Bragg <robert@sixbynine.org>
Fri, 17 Mar 2017 16:10:22 +0000 (16:10 +0000)
Now that there's a timebase_scale in gen_device_info which is
effectively the 'period' this switches anv_GetPhysicalDeviceProperties
to using this common device info to initialize the timestampPeriod
device limit.

Signed-off-by: Robert Bragg <robert@sixbynine.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/intel/vulkan/anv_device.c

index fcfbd5fd6b148f85f574766f8af1644faac2cd78..748d70327eda245f827be563c60cf0875fce34e0 100644 (file)
@@ -535,8 +535,6 @@ void anv_GetPhysicalDeviceProperties(
    ANV_FROM_HANDLE(anv_physical_device, pdevice, physicalDevice);
    const struct gen_device_info *devinfo = &pdevice->info;
 
-   const float time_stamp_base = devinfo->gen >= 9 ? 83.333 : 80.0;
-
    /* See assertions made when programming the buffer surface state. */
    const uint32_t max_raw_buffer_sz = devinfo->gen >= 7 ?
                                       (1ul << 30) : (1ul << 27);
@@ -641,7 +639,7 @@ void anv_GetPhysicalDeviceProperties(
       .storageImageSampleCounts                 = VK_SAMPLE_COUNT_1_BIT,
       .maxSampleMaskWords                       = 1,
       .timestampComputeAndGraphics              = false,
-      .timestampPeriod                          = time_stamp_base,
+      .timestampPeriod                          = devinfo->timebase_scale,
       .maxClipDistances                         = 8,
       .maxCullDistances                         = 8,
       .maxCombinedClipAndCullDistances          = 8,