[Mesa-dev] [PATCH v5 02/11] anv: Set the values for the VkPhysicalDeviceSampleLocationsPropertiesEXT

Jason Ekstrand jason at jlekstrand.net
Fri Mar 15 00:08:21 UTC 2019


From: Eleni Maria Stea <estea at igalia.com>

The VkPhysicalDeviceSampleLocationPropertiesEXT struct is filled with
implementation dependent values and according to the table from the
Vulkan Specification section [36.1. Limit Requirements]:

pname | max | min
pname:sampleLocationSampleCounts   |-            |ename:VK_SAMPLE_COUNT_4_BIT
pname:maxSampleLocationGridSize    |-            |(1, 1)
pname:sampleLocationCoordinateRange|(0.0, 0.9375)|(0.0, 0.9375)
pname:sampleLocationSubPixelBits   |-            |4
pname:variableSampleLocations      | false       |implementation dependent

The hardware only supports setting the same sample location for all the
pixels, so we only support 1x1 grids.

Also, variableSampleLocations is set to false because we don't support the
feature.

v2: 1- Replaced false with VK_FALSE for consistency. (Sagar Ghuge)
    2- Used the isl_device_sample_count to take the number of samples
    per platform to avoid extra checks. (Sagar Ghuge)

v3: 1- Replaced VK_FALSE with false as Jason has sent a patch to replace
    VK_FALSE with false in other places. (Jason Ekstrand)
    2- Removed unecessary defines and set the grid size to 1 (Jason Ekstrand)

Reviewed-by: Sagar Ghuge <sagar.ghuge at intel.com>
---
 src/intel/vulkan/anv_device.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c
index 83fa3936c19..52ea058bdd5 100644
--- a/src/intel/vulkan/anv_device.c
+++ b/src/intel/vulkan/anv_device.c
@@ -1401,6 +1401,26 @@ void anv_GetPhysicalDeviceProperties2(
          break;
       }
 
+      case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLE_LOCATIONS_PROPERTIES_EXT: {
+         VkPhysicalDeviceSampleLocationsPropertiesEXT *props =
+            (VkPhysicalDeviceSampleLocationsPropertiesEXT *)ext;
+
+         props->sampleLocationSampleCounts =
+            isl_device_get_sample_counts(&pdevice->isl_dev);
+
+         /* See also anv_GetPhysicalDeviceMultisamplePropertiesEXT */
+         props->maxSampleLocationGridSize.width = 1;
+         props->maxSampleLocationGridSize.height = 1;
+
+         props->sampleLocationCoordinateRange[0] = 0;
+         props->sampleLocationCoordinateRange[1] = 0.9375;
+         props->sampleLocationSubPixelBits = 4;
+
+         props->variableSampleLocations = false;
+
+         break;
+      }
+
       default:
          anv_debug_ignored_stype(ext->sType);
          break;
-- 
2.20.1



More information about the mesa-dev mailing list