radv: Stop shadowing the result in radv_GetQueryPoolResults.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Tue, 11 Apr 2017 22:45:51 +0000 (00:45 +0200)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Wed, 12 Apr 2017 05:38:58 +0000 (07:38 +0200)
The outer result was referred to, which meant bugs.

Signed-off-by: Bas Nieuwenhuizen <basni@google.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
src/amd/vulkan/radv_query.c

index bd293b58e69949d44ccdd6e1ea33fedb0dece60c..fa5a3b6df24cf536b62a1814b05d2fb28c39ce6f 100644 (file)
@@ -876,7 +876,7 @@ VkResult radv_GetQueryPoolResults(
                }
                case VK_QUERY_TYPE_OCCLUSION: {
                        volatile uint64_t const *src64 = (volatile uint64_t const *)src;
-                       uint64_t result = 0;
+                       uint64_t sample_count = 0;
                        int db_count = get_max_db(device);
                        available = 1;
 
@@ -890,7 +890,7 @@ VkResult radv_GetQueryPoolResults(
                                if (!(start & (1ull << 63)) || !(end & (1ull << 63)))
                                        available = 0;
                                else {
-                                       result += end - start;
+                                       sample_count += end - start;
                                }
                        }
 
@@ -901,10 +901,10 @@ VkResult radv_GetQueryPoolResults(
                        }
 
                        if (flags & VK_QUERY_RESULT_64_BIT) {
-                               *(uint64_t*)dest = result;
+                               *(uint64_t*)dest = sample_count;
                                dest += 8;
                        } else {
-                               *(uint32_t*)dest = result;
+                               *(uint32_t*)dest = sample_count;
                                dest += 4;
                        }
                        break;