summaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan/anv_pipeline.c
diff options
context:
space:
mode:
authorJason Ekstrand <jason.ekstrand@intel.com>2016-11-01 16:03:12 -0700
committerEmil Velikov <emil.l.velikov@gmail.com>2016-11-09 13:44:32 +0000
commite016945bdd739811cde46b640e07627386361343 (patch)
tree8c64642fc616f7285e46dbc6a90a51ce249e6a94 /src/intel/vulkan/anv_pipeline.c
parent78fbafedf1bd619161e3f58cff2c1d412ae87bd1 (diff)
downloadexternal_mesa3d-e016945bdd739811cde46b640e07627386361343.zip
external_mesa3d-e016945bdd739811cde46b640e07627386361343.tar.gz
external_mesa3d-e016945bdd739811cde46b640e07627386361343.tar.bz2
anv/pipeline: Put actual pointers in anv_shader_bin
While we can simply calculate offsets to get to things such as the prog_data and the key, it's much more user-friendly if there are just pointers. Also, it's a bit more fool-proof. While we're at it, we rework the pipeline cache API to use the brw_stage_prog_data type directly. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98012 Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com> Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com> Cc: "13.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit ff3185e3ba85b3635a1f645e8e951954f4022afe)
Diffstat (limited to 'src/intel/vulkan/anv_pipeline.c')
-rw-r--r--src/intel/vulkan/anv_pipeline.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/intel/vulkan/anv_pipeline.c b/src/intel/vulkan/anv_pipeline.c
index 4817de1..fde8f4e 100644
--- a/src/intel/vulkan/anv_pipeline.c
+++ b/src/intel/vulkan/anv_pipeline.c
@@ -388,7 +388,8 @@ anv_pipeline_upload_kernel(struct anv_pipeline *pipeline,
struct anv_pipeline_cache *cache,
const void *key_data, uint32_t key_size,
const void *kernel_data, uint32_t kernel_size,
- const void *prog_data, uint32_t prog_data_size,
+ const struct brw_stage_prog_data *prog_data,
+ uint32_t prog_data_size,
const struct anv_pipeline_bind_map *bind_map)
{
if (cache) {
@@ -476,7 +477,8 @@ anv_pipeline_compile_vs(struct anv_pipeline *pipeline,
bin = anv_pipeline_upload_kernel(pipeline, cache, sha1, 20,
shader_code, code_size,
- &prog_data, sizeof(prog_data), &map);
+ &prog_data.base.base, sizeof(prog_data),
+ &map);
if (!bin) {
ralloc_free(mem_ctx);
return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
@@ -486,7 +488,7 @@ anv_pipeline_compile_vs(struct anv_pipeline *pipeline,
}
const struct brw_vs_prog_data *vs_prog_data =
- (const struct brw_vs_prog_data *)anv_shader_bin_get_prog_data(bin);
+ (const struct brw_vs_prog_data *)bin->prog_data;
if (vs_prog_data->base.dispatch_mode == DISPATCH_MODE_SIMD8) {
pipeline->vs_simd8 = bin->kernel.offset;
@@ -563,7 +565,8 @@ anv_pipeline_compile_gs(struct anv_pipeline *pipeline,
/* TODO: SIMD8 GS */
bin = anv_pipeline_upload_kernel(pipeline, cache, sha1, 20,
shader_code, code_size,
- &prog_data, sizeof(prog_data), &map);
+ &prog_data.base.base, sizeof(prog_data),
+ &map);
if (!bin) {
ralloc_free(mem_ctx);
return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
@@ -686,7 +689,8 @@ anv_pipeline_compile_fs(struct anv_pipeline *pipeline,
bin = anv_pipeline_upload_kernel(pipeline, cache, sha1, 20,
shader_code, code_size,
- &prog_data, sizeof(prog_data), &map);
+ &prog_data.base, sizeof(prog_data),
+ &map);
if (!bin) {
ralloc_free(mem_ctx);
return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
@@ -758,7 +762,8 @@ anv_pipeline_compile_cs(struct anv_pipeline *pipeline,
bin = anv_pipeline_upload_kernel(pipeline, cache, sha1, 20,
shader_code, code_size,
- &prog_data, sizeof(prog_data), &map);
+ &prog_data.base, sizeof(prog_data),
+ &map);
if (!bin) {
ralloc_free(mem_ctx);
return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);