spirv: Rework logging
[mesa.git] / src / compiler / spirv / nir_spirv.h
index 8864a8f73d71c0afb2303347663fd52753a3db20..f129a205764a683ae897ed0669f9fd0e4ace5221 100644 (file)
@@ -25,8 +25,6 @@
  *
  */
 
-#pragma once
-
 #ifndef _NIR_SPIRV_H_
 #define _NIR_SPIRV_H_
 
@@ -44,21 +42,40 @@ struct nir_spirv_specialization {
    };
 };
 
-struct nir_spirv_supported_extensions {
-   bool float64;
-   bool image_ms_array;
-   bool tessellation;
-   bool draw_parameters;
-   bool image_read_without_format;
-   bool image_write_without_format;
+enum nir_spirv_debug_level {
+   NIR_SPIRV_DEBUG_LEVEL_INFO,
+   NIR_SPIRV_DEBUG_LEVEL_WARNING,
+   NIR_SPIRV_DEBUG_LEVEL_ERROR,
+};
+
+struct spirv_to_nir_options {
+   struct {
+      bool float64;
+      bool image_ms_array;
+      bool tessellation;
+      bool draw_parameters;
+      bool image_read_without_format;
+      bool image_write_without_format;
+      bool int64;
+      bool multiview;
+      bool variable_pointers;
+   } caps;
+
+   struct {
+      void (*func)(void *private_data,
+                   enum nir_spirv_debug_level level,
+                   size_t spirv_offset,
+                   const char *message);
+      void *private_data;
+   } debug;
 };
 
 nir_function *spirv_to_nir(const uint32_t *words, size_t word_count,
                            struct nir_spirv_specialization *specializations,
                            unsigned num_specializations,
                            gl_shader_stage stage, const char *entry_point_name,
-                           const struct nir_spirv_supported_extensions *ext,
-                           const nir_shader_compiler_options *options);
+                           const struct spirv_to_nir_options *options,
+                           const nir_shader_compiler_options *nir_options);
 
 #ifdef __cplusplus
 }