From 6e3459eaf4481193aedfa313b81ace8369a83234 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Tue, 5 Dec 2017 14:22:17 +0100 Subject: [PATCH] radv: make descriptor BOs read-only for the GPU Signed-off-by: Samuel Pitoiset Reviewed-by: Bas Nieuwenhuizen --- src/amd/vulkan/radv_descriptor_set.c | 6 ++++-- src/amd/vulkan/radv_device.c | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/amd/vulkan/radv_descriptor_set.c b/src/amd/vulkan/radv_descriptor_set.c index e815939a67c..19a560a6b34 100644 --- a/src/amd/vulkan/radv_descriptor_set.c +++ b/src/amd/vulkan/radv_descriptor_set.c @@ -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; diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c index cbf8f5cf49c..5f78af624b5 100644 --- a/src/amd/vulkan/radv_device.c +++ b/src/amd/vulkan/radv_device.c @@ -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 -- 2.30.2