anv: implement EDS2.extendedDynamicState2PatchControlPoints

We make the compiler assume the worst possible case (it's not great
because we have to burn 32 GRFs of potential input data) and then we
push the actual value through push constants.

This enables VK_EXT_gpl usage on zink, which causes two traces to change
their results.  Raven is an imperceptible change, blender has missing
original pngs but looks plausible.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22378>
This commit is contained in:
Lionel Landwerlin
2023-04-08 23:21:29 +03:00
committed by Marge Bot
parent 429ef02f83
commit e9fa840eed
16 changed files with 240 additions and 45 deletions

View File

@@ -78,7 +78,8 @@ anv_shader_bin_create(struct anv_device *device,
const struct brw_compile_stats *stats, uint32_t num_stats,
const nir_xfb_info *xfb_info_in,
const struct anv_pipeline_bind_map *bind_map,
const struct anv_push_descriptor_info *push_desc_info)
const struct anv_push_descriptor_info *push_desc_info,
enum anv_dynamic_push_bits dynamic_push_values)
{
VK_MULTIALLOC(ma);
VK_MULTIALLOC_DECL(&ma, struct anv_shader_bin, shader, 1);
@@ -179,6 +180,8 @@ anv_shader_bin_create(struct anv_device *device,
shader->xfb_info = NULL;
}
shader->dynamic_push_values = dynamic_push_values;
typed_memcpy(&shader->push_desc_info, push_desc_info, 1);
shader->bind_map = *bind_map;
@@ -226,6 +229,8 @@ anv_shader_bin_serialize(struct vk_pipeline_cache_object *object,
blob_write_uint32(blob, 0);
}
blob_write_uint32(blob, shader->dynamic_push_values);
blob_write_uint32(blob, shader->push_desc_info.used_descriptors);
blob_write_uint32(blob, shader->push_desc_info.fully_promoted_ubo_descriptors);
blob_write_uint8(blob, shader->push_desc_info.used_set_buffer);
@@ -292,6 +297,8 @@ anv_shader_bin_deserialize(struct vk_pipeline_cache *cache,
if (xfb_size)
xfb_info = blob_read_bytes(blob, xfb_size);
enum anv_dynamic_push_bits dynamic_push_values = blob_read_uint32(blob);
struct anv_push_descriptor_info push_desc_info = {};
push_desc_info.used_descriptors = blob_read_uint32(blob);
push_desc_info.fully_promoted_ubo_descriptors = blob_read_uint32(blob);
@@ -328,7 +335,8 @@ anv_shader_bin_deserialize(struct vk_pipeline_cache *cache,
kernel_data, kernel_size,
&prog_data.base, prog_data_size,
stats, num_stats, xfb_info, &bind_map,
&push_desc_info);
&push_desc_info,
dynamic_push_values);
if (shader == NULL)
return NULL;
@@ -371,7 +379,8 @@ anv_device_upload_kernel(struct anv_device *device,
uint32_t num_stats,
const nir_xfb_info *xfb_info,
const struct anv_pipeline_bind_map *bind_map,
const struct anv_push_descriptor_info *push_desc_info)
const struct anv_push_descriptor_info *push_desc_info,
enum anv_dynamic_push_bits dynamic_push_values)
{
/* Use the default pipeline cache if none is specified */
if (cache == NULL)
@@ -384,7 +393,8 @@ anv_device_upload_kernel(struct anv_device *device,
prog_data, prog_data_size,
stats, num_stats,
xfb_info, bind_map,
push_desc_info);
push_desc_info,
dynamic_push_values);
if (shader == NULL)
return NULL;