Implemented the requirements from the VK_EXT_sample_locations extension specification to allow setting custom sample locations on Intel Gen >= 7.
Some decisions explained: The grid size was set to 1x1 because the hardware only supports a single set of sample locations for the whole framebuffer. The user can set custom sample locations either per pipeline, by filling the extension provided structs, or dynamically the way it is described in sections 26.5, 36.1, 36.2 of the Vulkan specification. Sections 6.7.3 and 7.4 describe how to use sample locations with images when a layout transition is about to take place. These sections were ignored as currently we aren't using sample locations with images in the driver. Variable sample locations aren't required and have not been implemented. (v2): Initially, we were sorting the samples because according to the Skylake PRM (vol 2a SAMPLE_PATTERN) the samples should be sent in a monotonically increasing distance from the center to get the correct centroid computation in the device. However the Vulkan spec seems to require that the samples occur in the order provided through the API. As long as this requirement only affects centroid calculations we should be ok without the ordering because OpenGL and Vulkan only require the centroid to be some lit sample and that it's the same for all samples in a pixel. They have no requirement that it be the one closest to the center. (Jason Ekstrand) We have 754 vk-gl-cts tests for this extension: 690 of the tests pass on Gen >= 9 (where we can support 16 samples). The remaining 64 tests aren't supported because they test the variable sample locations. Eleni Maria Stea (9): anv: Added the VK_EXT_sample_locations extension to the anv_extensions list anv: Set the values for the VkPhysicalDeviceSampleLocationsPropertiesEXT anv: Implemented the vkGetPhysicalDeviceMultisamplePropertiesEXT anv: Added support for non-dynamic sample locations on Gen8+ anv: Added support for dynamic sample locations on Gen8+ anv: Added support for dynamic and non-dynamic sample locations on Gen7 anv: Optimized the emission of the default locations on Gen8+ anv: Removed unused header file anv: Enabled the VK_EXT_sample_locations extension src/intel/Makefile.sources | 1 + src/intel/common/gen_sample_positions.h | 53 ++++++++++ src/intel/vulkan/anv_cmd_buffer.c | 19 ++++ src/intel/vulkan/anv_device.c | 21 ++++ src/intel/vulkan/anv_extensions.py | 1 + src/intel/vulkan/anv_genX.h | 7 ++ src/intel/vulkan/anv_private.h | 18 ++++ src/intel/vulkan/anv_sample_locations.c | 96 ++++++++++++++++++ src/intel/vulkan/anv_sample_locations.h | 29 ++++++ src/intel/vulkan/genX_blorp_exec.c | 1 - src/intel/vulkan/genX_cmd_buffer.c | 24 +++++ src/intel/vulkan/genX_pipeline.c | 92 +++++++++-------- src/intel/vulkan/genX_state.c | 128 ++++++++++++++++++++++++ src/intel/vulkan/meson.build | 1 + 14 files changed, 450 insertions(+), 41 deletions(-) create mode 100644 src/intel/vulkan/anv_sample_locations.c create mode 100644 src/intel/vulkan/anv_sample_locations.h -- 2.20.1 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev