iris: Serialize the NIR to a blob we can use for shader cache purposes.
[mesa.git] / src / gallium / drivers / iris / iris_context.h
index b6d44d637a64a04a56b041c3f1c43c1688b5c277..a3e4da792e90ea09e4160cc97c11bf3d6768a20e 100644 (file)
@@ -246,6 +246,33 @@ enum iris_predicate_state {
 
 /** @} */
 
+/**
+ * An uncompiled, API-facing shader.  This is the Gallium CSO for shaders.
+ * It primarily contains the NIR for the shader.
+ *
+ * Each API-facing shader can be compiled into multiple shader variants,
+ * based on non-orthogonal state dependencies, recorded in the shader key.
+ *
+ * See iris_compiled_shader, which represents a compiled shader variant.
+ */
+struct iris_uncompiled_shader {
+   struct nir_shader *nir;
+
+   struct pipe_stream_output_info stream_output;
+
+   /* The serialized NIR (for the disk cache) and size in bytes. */
+   void *ir_cache_binary;
+   uint32_t ir_cache_binary_size;
+
+   unsigned program_id;
+
+   /** Bitfield of (1 << IRIS_NOS_*) flags. */
+   unsigned nos;
+
+   /** Have any shader variants been compiled yet? */
+   bool compiled_once;
+};
+
 /**
  * A compiled shader variant, containing a pointer to the GPU assembly,
  * as well as program data and other packets needed by state upload.