[Mesa-dev] [PATCH v2 2/9] anv: Set the values for the VkPhysicalDeviceSampleLocationsPropertiesEXT

Jason Ekstrand jason at jlekstrand.net
Wed Mar 13 12:49:09 UTC 2019


On Tue, Mar 12, 2019 at 5:35 AM Eleni Maria Stea <estea at igalia.com> wrote:

> 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)
>
> Reviewed-by: Sagar Ghuge <sagar.ghuge at intel.com>
> ---
>  src/intel/vulkan/anv_device.c  | 19 +++++++++++++++++++
>  src/intel/vulkan/anv_private.h |  3 +++
>  2 files changed, 22 insertions(+)
>
> diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c
> index 729cceb3e32..bf6f03ebb1a 100644
> --- a/src/intel/vulkan/anv_device.c
> +++ b/src/intel/vulkan/anv_device.c
> @@ -1401,6 +1401,25 @@ 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);
> +
> +         props->maxSampleLocationGridSize.width = SAMPLE_LOC_GRID_W;
> +         props->maxSampleLocationGridSize.height = SAMPLE_LOC_GRID_H;
>

Here youhave #defines which you sue for the min/max but in a later patch,
you just hard-code 1.  I'm not sure the #defines are gaining us anything.
Why not just put in 1 and add a quick comment:

/* See also anv_GetPhysicalDeviceMultisamplePropertiesEXT */


> +
> +         props->sampleLocationCoordinateRange[0] = 0;
> +         props->sampleLocationCoordinateRange[1] = 0.9375;
> +         props->sampleLocationSubPixelBits = 4;
> +
> +         props->variableSampleLocations = VK_FALSE;
>

I just sent out a patch series to kill VK_TRUE/FALSE.  Sagar, sorry to
contradict.


> +
> +         break;
> +      }
> +
>        default:
>           anv_debug_ignored_stype(ext->sType);
>           break;
> diff --git a/src/intel/vulkan/anv_private.h
> b/src/intel/vulkan/anv_private.h
> index eed282ff985..5905299e59d 100644
> --- a/src/intel/vulkan/anv_private.h
> +++ b/src/intel/vulkan/anv_private.h
> @@ -195,6 +195,9 @@ struct gen_l3_config;
>
>  #define anv_printflike(a, b) __attribute__((__format__(__printf__, a, b)))
>
> +#define SAMPLE_LOC_GRID_W 1
> +#define SAMPLE_LOC_GRID_H 1
> +
>  static inline uint32_t
>  align_down_npot_u32(uint32_t v, uint32_t a)
>  {
> --
> 2.20.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20190313/421e86bf/attachment-0001.html>


More information about the mesa-dev mailing list