radv: for secure compile exit early from radv_shader_variant_create()
authorTimothy Arceri <tarceri@itsqueeze.com>
Wed, 31 Jul 2019 03:57:16 +0000 (13:57 +1000)
committerTimothy Arceri <tarceri@itsqueeze.com>
Sat, 26 Oct 2019 02:04:12 +0000 (13:04 +1100)
We don't have permission to be creating shared memory etc.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_shader.c

index 06e8edf9ea2ef2f163ef630379b43a9ab71216eb..a5ad594207d990d472ab7ebdb8510c1619988a87 100644 (file)
@@ -973,7 +973,14 @@ radv_shader_variant_create(struct radv_device *device,
        variant->info = binary->info;
        radv_postprocess_config(device->physical_device, &config, &binary->info,
                                binary->stage, &variant->config);
-       
+
+       if (radv_device_use_secure_compile(device->instance)) {
+               if (binary->type == RADV_BINARY_TYPE_RTLD)
+                       ac_rtld_close(&rtld_binary);
+
+               return variant;
+       }
+
        void *dest_ptr = radv_alloc_shader_memory(device, variant);
 
        if (binary->type == RADV_BINARY_TYPE_RTLD) {