Signed-off-by: Rob Clark <robclark@freedesktop.org>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
PIPE_SHADER_IR_TGSI = 0,
PIPE_SHADER_IR_LLVM,
PIPE_SHADER_IR_NATIVE,
+ PIPE_SHADER_IR_NIR,
};
/**
*/
void (*query_memory_info)(struct pipe_screen *screen,
struct pipe_memory_info *info);
+
+ /**
+ * Get IR specific compiler options struct. For PIPE_SHADER_IR_NIR this
+ * returns a 'struct nir_shader_compiler_options'. Drivers reporting
+ * NIR as the preferred IR must implement this.
+ */
+ const void *(*get_compiler_options)(struct pipe_screen *screen,
+ enum pipe_shader_ir ir,
+ unsigned shader);
};
*
* TODO pipe_compute_state should probably get similar treatment to handle
* multiple IR's in a cleaner way..
+ *
+ * NOTE: since it is expected that the consumer will want to perform
+ * additional passes on the nir_shader, the driver takes ownership of
+ * the nir_shader. If state trackers need to hang on to the IR (for
+ * example, variant management), it should use nir_shader_clone().
*/
struct pipe_shader_state
{
union {
void *llvm;
void *native;
+ void *nir;
} ir;
struct pipe_stream_output_info stream_output;
};