summaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan/anv_private.h
diff options
context:
space:
mode:
authorKristian Høgsberg Kristensen <[email protected]>2016-03-04 08:15:16 -0800
committerKristian Høgsberg Kristensen <[email protected]>2016-03-05 13:50:07 -0800
commit2b29342fae14d8626ca58f8a7ec358b70886ced3 (patch)
tree136be1f486e9f0c5bc042300b3ca70046a87d3f7 /src/intel/vulkan/anv_private.h
parent37c5e7025333fed2943630fa94e59ef2d413030b (diff)
anv: Store prog data in pipeline cache stream
We have to keep it there for the cache to work, so let's not have an extra copy in struct anv_pipeline too.
Diffstat (limited to 'src/intel/vulkan/anv_private.h')
-rw-r--r--src/intel/vulkan/anv_private.h35
1 files changed, 28 insertions, 7 deletions
diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h
index 32c8b13c952..70b6dd995a1 100644
--- a/src/intel/vulkan/anv_private.h
+++ b/src/intel/vulkan/anv_private.h
@@ -640,12 +640,13 @@ void anv_pipeline_cache_init(struct anv_pipeline_cache *cache,
struct anv_device *device);
void anv_pipeline_cache_finish(struct anv_pipeline_cache *cache);
uint32_t anv_pipeline_cache_search(struct anv_pipeline_cache *cache,
- const unsigned char *sha1, void *prog_data);
+ const unsigned char *sha1,
+ const struct brw_stage_prog_data **prog_data);
uint32_t anv_pipeline_cache_upload_kernel(struct anv_pipeline_cache *cache,
const unsigned char *sha1,
const void *kernel,
size_t kernel_size,
- const void *prog_data,
+ const struct brw_stage_prog_data **prog_data,
size_t prog_data_size);
struct anv_device {
@@ -1404,12 +1405,8 @@ struct anv_pipeline {
bool use_repclear;
- struct brw_vs_prog_data vs_prog_data;
- struct brw_wm_prog_data wm_prog_data;
- struct brw_gs_prog_data gs_prog_data;
- struct brw_cs_prog_data cs_prog_data;
bool writes_point_size;
- struct brw_stage_prog_data * prog_data[MESA_SHADER_STAGES];
+ const struct brw_stage_prog_data * prog_data[MESA_SHADER_STAGES];
uint32_t scratch_start[MESA_SHADER_STAGES];
uint32_t total_scratch;
struct {
@@ -1457,6 +1454,30 @@ struct anv_pipeline {
} gen9;
};
+static inline const struct brw_vs_prog_data *
+get_vs_prog_data(struct anv_pipeline *pipeline)
+{
+ return (const struct brw_vs_prog_data *) pipeline->prog_data[MESA_SHADER_VERTEX];
+}
+
+static inline const struct brw_gs_prog_data *
+get_gs_prog_data(struct anv_pipeline *pipeline)
+{
+ return (const struct brw_gs_prog_data *) pipeline->prog_data[MESA_SHADER_GEOMETRY];
+}
+
+static inline const struct brw_wm_prog_data *
+get_wm_prog_data(struct anv_pipeline *pipeline)
+{
+ return (const struct brw_wm_prog_data *) pipeline->prog_data[MESA_SHADER_FRAGMENT];
+}
+
+static inline const struct brw_cs_prog_data *
+get_cs_prog_data(struct anv_pipeline *pipeline)
+{
+ return (const struct brw_cs_prog_data *) pipeline->prog_data[MESA_SHADER_COMPUTE];
+}
+
struct anv_graphics_pipeline_create_info {
/**
* If non-negative, overrides the color attachment count of the pipeline's