anv: Implement physical device properties for VK_EXT_sample_locations
authorEleni Maria Stea <estea@igalia.com>
Thu, 14 Mar 2019 19:52:00 +0000 (21:52 +0200)
committerMarge Bot <eric+marge@anholt.net>
Wed, 27 Jan 2021 23:25:27 +0000 (23:25 +0000)
commit983cebb5d2f1230fba8d450be95a393de483e5ee
tree911ca39972f5b7a23b99e4c7ea2009bbfb0a049f
parentecd8477e932d522c7866c3f73e9f1b4720d96a50
anv: Implement physical device properties for VK_EXT_sample_locations

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      | true        |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 true because we can set sample
locations per draw.

Implement the vkGetPhysicalDeviceMultisamplePropertiesEXT according to
the Vulkan Specification section [36.2. Additional Multisampling
Capabilities].

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)

v4: Fix properties reporting in GetPhysicalDeviceProperties2, not
    GetPhysicalDeviceFeatures2 (Lionel)
    Use same alignment as other functions (Lionel)
    Report variableSampleLocations=true (Lionel)

v5: Don't overwrite the pNext in GetPhysicalDeviceMultisamplerPropertiesEXT

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com> (v3)
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/1887>
src/intel/vulkan/anv_device.c