From: Samuel Pitoiset Date: Tue, 5 Dec 2017 13:22:17 +0000 (+0100) Subject: radv: make descriptor BOs read-only for the GPU X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6e3459eaf4481193aedfa313b81ace8369a83234;p=mesa.git radv: make descriptor BOs read-only for the GPU Signed-off-by: Samuel Pitoiset Reviewed-by: Bas Nieuwenhuizen --- 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