From: Jason Ekstrand Date: Fri, 21 Feb 2020 17:45:37 +0000 (-0600) Subject: anv: Use the data cache for indirect UBO pulls on Gen8+ X-Git-Tag: upstream/21.0.0~4508 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b54d37a8676acbd725ef1817479f2630d3ea95be;p=platform%2Fupstream%2Fmesa.git anv: Use the data cache for indirect UBO pulls on Gen8+ On Gen7, the data cache is pretty terrible so we'd rather avoid it there. On Gen8+, it should be fine and is less likely to conflict with texturing so we should get less cache thrashing there. Reviewed-by: Kenneth Graunke Part-of: --- diff --git a/src/intel/vulkan/anv_cmd_buffer.c b/src/intel/vulkan/anv_cmd_buffer.c index 6634836..ffc9adf 100644 --- a/src/intel/vulkan/anv_cmd_buffer.c +++ b/src/intel/vulkan/anv_cmd_buffer.c @@ -981,7 +981,8 @@ anv_isl_format_for_descriptor_type(const struct anv_device *device, switch (type) { case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER: case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC: - return ISL_FORMAT_R32G32B32A32_FLOAT; + return device->physical->compiler->indirect_ubos_use_sampler ? + ISL_FORMAT_R32G32B32A32_FLOAT : ISL_FORMAT_RAW; case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER: case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC: diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c index 5519a7d..3b0a121 100644 --- a/src/intel/vulkan/anv_device.c +++ b/src/intel/vulkan/anv_device.c @@ -509,6 +509,7 @@ anv_physical_device_try_create(struct anv_instance *instance, device->info.gen < 8 || !device->has_context_isolation; device->compiler->supports_shader_constants = true; device->compiler->compact_params = false; + device->compiler->indirect_ubos_use_sampler = device->info.gen <= 7; /* Broadwell PRM says: * diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h index b045918..afe60b8 100644 --- a/src/intel/vulkan/anv_private.h +++ b/src/intel/vulkan/anv_private.h @@ -2607,7 +2607,10 @@ anv_pipe_invalidate_bits_for_access_flags(struct anv_device *device, * port) to avoid stale data. */ pipe_bits |= ANV_PIPE_CONSTANT_CACHE_INVALIDATE_BIT; - pipe_bits |= ANV_PIPE_TEXTURE_CACHE_INVALIDATE_BIT; + if (device->physical->compiler->indirect_ubos_use_sampler) + pipe_bits |= ANV_PIPE_TEXTURE_CACHE_INVALIDATE_BIT; + else + pipe_bits |= ANV_PIPE_DATA_CACHE_FLUSH_BIT; break; case VK_ACCESS_SHADER_READ_BIT: case VK_ACCESS_INPUT_ATTACHMENT_READ_BIT: