<div dir="ltr"><div dir="ltr"><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Mar 12, 2019 at 5:35 AM Eleni Maria Stea <<a href="mailto:estea@igalia.com">estea@igalia.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">The VkPhysicalDeviceSampleLocationPropertiesEXT struct is filled with<br>
implementation dependent values and according to the table from the<br>
Vulkan Specification section [36.1. Limit Requirements]:<br>
<br>
pname | max | min<br>
pname:sampleLocationSampleCounts   |-            |ename:VK_SAMPLE_COUNT_4_BIT<br>
pname:maxSampleLocationGridSize    |-            |(1, 1)<br>
pname:sampleLocationCoordinateRange|(0.0, 0.9375)|(0.0, 0.9375)<br>
pname:sampleLocationSubPixelBits   |-            |4<br>
pname:variableSampleLocations      | false       |implementation dependent<br>
<br>
The hardware only supports setting the same sample location for all the<br>
pixels, so we only support 1x1 grids.<br>
<br>
Also, variableSampleLocations is set to false because we don't support the<br>
feature.<br>
<br>
v2: 1- Replaced false with VK_FALSE for consistency. (Sagar Ghuge)<br>
    2- Used the isl_device_sample_count to take the number of samples<br>
    per platform to avoid extra checks. (Sagar Ghuge)<br>
<br>
Reviewed-by: Sagar Ghuge <<a href="mailto:sagar.ghuge@intel.com" target="_blank">sagar.ghuge@intel.com</a>><br>
---<br>
 src/intel/vulkan/anv_device.c  | 19 +++++++++++++++++++<br>
 src/intel/vulkan/anv_private.h |  3 +++<br>
 2 files changed, 22 insertions(+)<br>
<br>
diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c<br>
index 729cceb3e32..bf6f03ebb1a 100644<br>
--- a/src/intel/vulkan/anv_device.c<br>
+++ b/src/intel/vulkan/anv_device.c<br>
@@ -1401,6 +1401,25 @@ void anv_GetPhysicalDeviceProperties2(<br>
          break;<br>
       }<br>
<br>
+      case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLE_LOCATIONS_PROPERTIES_EXT: {<br>
+         VkPhysicalDeviceSampleLocationsPropertiesEXT *props =<br>
+            (VkPhysicalDeviceSampleLocationsPropertiesEXT *)ext;<br>
+<br>
+         props->sampleLocationSampleCounts =<br>
+            isl_device_get_sample_counts(&pdevice->isl_dev);<br>
+<br>
+         props->maxSampleLocationGridSize.width = SAMPLE_LOC_GRID_W;<br>
+         props->maxSampleLocationGridSize.height = SAMPLE_LOC_GRID_H;<br></blockquote><div><br></div><div>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:</div><div><br></div><div>/* See also anv_GetPhysicalDeviceMultisamplePropertiesEXT */<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+<br>
+         props->sampleLocationCoordinateRange[0] = 0;<br>
+         props->sampleLocationCoordinateRange[1] = 0.9375;<br>
+         props->sampleLocationSubPixelBits = 4;<br>
+<br>
+         props->variableSampleLocations = VK_FALSE;<br></blockquote><div><br></div><div>I just sent out a patch series to kill VK_TRUE/FALSE.  Sagar, sorry to contradict.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+<br>
+         break;<br>
+      }<br>
+<br>
       default:<br>
          anv_debug_ignored_stype(ext->sType);<br>
          break;<br>
diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h<br>
index eed282ff985..5905299e59d 100644<br>
--- a/src/intel/vulkan/anv_private.h<br>
+++ b/src/intel/vulkan/anv_private.h<br>
@@ -195,6 +195,9 @@ struct gen_l3_config;<br>
<br>
 #define anv_printflike(a, b) __attribute__((__format__(__printf__, a, b)))<br>
<br>
+#define SAMPLE_LOC_GRID_W 1<br>
+#define SAMPLE_LOC_GRID_H 1<br>
+<br>
 static inline uint32_t<br>
 align_down_npot_u32(uint32_t v, uint32_t a)<br>
 {<br>
-- <br>
2.20.1<br>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/mesa-dev</a></blockquote></div></div></div>