radeonsi: fail compilation if non-GS non-CS shaders have rodata
authorMarek Olšák <marek.olsak@amd.com>
Thu, 11 Feb 2016 21:04:35 +0000 (22:04 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Sun, 21 Feb 2016 20:08:57 +0000 (21:08 +0100)
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/radeonsi/si_shader.c

index 1a852c5cba25ffc7c6f7a8a3f87de789660ec8e1..50154c210be860df90b1f7626493cde48e0ddcf2 100644 (file)
@@ -4239,6 +4239,19 @@ int si_compile_llvm(struct si_screen *sscreen,
        FREE(binary->global_symbol_offsets);
        binary->config = NULL;
        binary->global_symbol_offsets = NULL;
+
+       /* Some shaders can't have rodata because their binaries can be
+        * concatenated.
+        */
+       if (binary->rodata_size &&
+           (processor == TGSI_PROCESSOR_VERTEX ||
+            processor == TGSI_PROCESSOR_TESS_CTRL ||
+            processor == TGSI_PROCESSOR_TESS_EVAL ||
+            processor == TGSI_PROCESSOR_FRAGMENT)) {
+               fprintf(stderr, "radeonsi: The shader can't have rodata.");
+               return -EINVAL;
+       }
+
        return r;
 }