1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-22 10:42:36 +01:00

vk: Improve compute->compute barrier before detiling

This commit is contained in:
kd-11 2024-02-06 03:20:43 +03:00 committed by kd-11
parent 041daab068
commit ed93bbd16d

View File

@ -189,13 +189,16 @@ namespace vk
// Compute -> Compute barrier
vk::insert_buffer_memory_barrier(cmd, working_buffer->value, 0, task_length,
VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT,
VK_ACCESS_SHADER_WRITE_BIT, VK_ACCESS_SHADER_READ_BIT);
VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_SHADER_WRITE_BIT, VK_ACCESS_SHADER_READ_BIT);
// We don't need to calibrate write if two conditions are met:
// 1. The start offset of our 2D region is a multiple of 64 lines
// 2. We use the whole pitch.
// If these conditions are not met, we need to upload the entire tile (or at least the affected tiles wholly)
// FIXME: There is a 3rd condition - write onto already-persisted range. e.g One transfer copies half the image then the other half is copied later.
// We don't need to load again for the second copy in that scenario.
if (valid_range.start != dma_sync_region.start || real_pitch != tiled_region.tile->pitch)
{
// Tile indices run to the end of the row (full pitch).