intel: Add command buffer shader cache
The command buffer shader cache accumulates all the shader kernels
for a particular command buffer. It also checks that it includes a
shader only once.
diff --git a/icd/intel/cmd.h b/icd/intel/cmd.h
index 46f05b1..f7afa9b 100644
--- a/icd/intel/cmd.h
+++ b/icd/intel/cmd.h
@@ -28,6 +28,7 @@
#include "intel.h"
#include "obj.h"
#include "view.h"
+#include "shader.h"
struct intel_pipeline;
struct intel_pipeline_delta;
@@ -37,9 +38,15 @@
struct intel_blend_state;
struct intel_ds_state;
struct intel_dset;
+struct intel_pipe_shader;
struct intel_cmd_reloc;
+struct intel_cmd_shader {
+ struct intel_pipe_shader *shader;
+ XGL_UINT kernel_pos;
+};
+
/*
* States bounded to the command buffer. We want to write states directly to
* the command buffer when possible, and reduce this struct.
@@ -53,6 +60,12 @@
} pipeline;
struct {
+ uint32_t size;
+ uint32_t used;
+ struct intel_cmd_shader *shaderList;
+ } shaderCache;
+
+ struct {
const struct intel_viewport_state *viewport;
const struct intel_raster_state *raster;
const struct intel_msaa_state *msaa;