radv: make descriptor BOs read-only for the GPU
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 5 Dec 2017 13:22:17 +0000 (14:22 +0100)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 8 Jan 2018 20:24:49 +0000 (21:24 +0100)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_descriptor_set.c
src/amd/vulkan/radv_device.c

index e815939a67ca7b7f1638a807fc5232bfc36af4d9..19a560a6b3449f3fd4a242f6755de8869929e7de 100644 (file)
@@ -454,8 +454,10 @@ VkResult radv_CreateDescriptorPool(
        }
 
        if (bo_size) {
-               pool->bo = device->ws->buffer_create(device->ws, bo_size,
-                                                       32, RADEON_DOMAIN_VRAM, RADEON_FLAG_NO_INTERPROCESS_SHARING);
+               pool->bo = device->ws->buffer_create(device->ws, bo_size, 32,
+                                                    RADEON_DOMAIN_VRAM,
+                                                    RADEON_FLAG_NO_INTERPROCESS_SHARING |
+                                                    RADEON_FLAG_READ_ONLY);
                pool->mapped_ptr = (uint8_t*)device->ws->buffer_map(pool->bo);
        }
        pool->size = bo_size;
index cbf8f5cf49c08da2f00d273c335af04cb993f40a..5f78af624b5da5d733eac002e1b611cafa2a6587 100644 (file)
@@ -1603,7 +1603,9 @@ radv_get_preamble_cs(struct radv_queue *queue,
                                                                 size,
                                                                 4096,
                                                                 RADEON_DOMAIN_VRAM,
-                                                                RADEON_FLAG_CPU_ACCESS|RADEON_FLAG_NO_INTERPROCESS_SHARING);
+                                                                RADEON_FLAG_CPU_ACCESS |
+                                                                RADEON_FLAG_NO_INTERPROCESS_SHARING |
+                                                                RADEON_FLAG_READ_ONLY);
                if (!descriptor_bo)
                        goto fail;
        } else