mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-22 11:20:11 +01:00
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 <kenneth@whitecape.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3932>
This commit is contained in:
parent
89f3d116a8
commit
b54d37a867
3 changed files with 7 additions and 2 deletions
|
|
@ -981,7 +981,8 @@ anv_isl_format_for_descriptor_type(const struct anv_device *device,
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER:
|
case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER:
|
||||||
case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC:
|
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:
|
||||||
case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC:
|
case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC:
|
||||||
|
|
|
||||||
|
|
@ -509,6 +509,7 @@ anv_physical_device_try_create(struct anv_instance *instance,
|
||||||
device->info.gen < 8 || !device->has_context_isolation;
|
device->info.gen < 8 || !device->has_context_isolation;
|
||||||
device->compiler->supports_shader_constants = true;
|
device->compiler->supports_shader_constants = true;
|
||||||
device->compiler->compact_params = false;
|
device->compiler->compact_params = false;
|
||||||
|
device->compiler->indirect_ubos_use_sampler = device->info.gen <= 7;
|
||||||
|
|
||||||
/* Broadwell PRM says:
|
/* Broadwell PRM says:
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -2607,7 +2607,10 @@ anv_pipe_invalidate_bits_for_access_flags(struct anv_device *device,
|
||||||
* port) to avoid stale data.
|
* port) to avoid stale data.
|
||||||
*/
|
*/
|
||||||
pipe_bits |= ANV_PIPE_CONSTANT_CACHE_INVALIDATE_BIT;
|
pipe_bits |= ANV_PIPE_CONSTANT_CACHE_INVALIDATE_BIT;
|
||||||
|
if (device->physical->compiler->indirect_ubos_use_sampler)
|
||||||
pipe_bits |= ANV_PIPE_TEXTURE_CACHE_INVALIDATE_BIT;
|
pipe_bits |= ANV_PIPE_TEXTURE_CACHE_INVALIDATE_BIT;
|
||||||
|
else
|
||||||
|
pipe_bits |= ANV_PIPE_DATA_CACHE_FLUSH_BIT;
|
||||||
break;
|
break;
|
||||||
case VK_ACCESS_SHADER_READ_BIT:
|
case VK_ACCESS_SHADER_READ_BIT:
|
||||||
case VK_ACCESS_INPUT_ATTACHMENT_READ_BIT:
|
case VK_ACCESS_INPUT_ATTACHMENT_READ_BIT:
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue