radv/winsys: fix hash when adding internal buffers
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 30 Jan 2019 11:07:29 +0000 (12:07 +0100)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 30 Jan 2019 11:29:10 +0000 (12:29 +0100)
This fixes serious stuttering in Shadow Of The Tomb Raider.

Fixes: 50fd253bd6e ("radv/winsys: Add priority handling during submit.")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c

index d3b1e2cd4c66a20939330baa248a5f9f4947b4cb..438ed594edef1338dc2330f9a819171dec13d269 100644 (file)
@@ -543,7 +543,7 @@ static void radv_amdgpu_cs_add_buffer_internal(struct radv_amdgpu_cs *cs,
        cs->handles[cs->num_buffers].bo_handle = bo;
        cs->handles[cs->num_buffers].bo_priority = priority;
 
-       hash = ((uintptr_t)bo >> 6) & (ARRAY_SIZE(cs->buffer_hash_table) - 1);
+       hash = bo & (ARRAY_SIZE(cs->buffer_hash_table) - 1);
        cs->buffer_hash_table[hash] = cs->num_buffers;
 
        ++cs->num_buffers;