anv/pipeline: Add shader lowering for multiview

v2 (Jason Ekstrand):
 - Take a view_mask rather than a whole subpass
 - Build the view mask into the VS shader key

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
This commit is contained in:
Jason Ekstrand
2017-03-22 15:37:17 -07:00
parent ca5bdfdfc6
commit 0db7070330
4 changed files with 244 additions and 0 deletions

View File

@@ -339,6 +339,10 @@ anv_pipeline_hash_shader(struct anv_pipeline *pipeline,
struct mesa_sha1 ctx;
_mesa_sha1_init(&ctx);
if (stage != MESA_SHADER_COMPUTE) {
_mesa_sha1_update(&ctx, &pipeline->subpass->view_mask,
sizeof(pipeline->subpass->view_mask));
}
if (pipeline->layout) {
_mesa_sha1_update(&ctx, pipeline->layout->sha1,
sizeof(pipeline->layout->sha1));
@@ -372,6 +376,9 @@ anv_pipeline_compile(struct anv_pipeline *pipeline,
NIR_PASS_V(nir, anv_nir_lower_push_constants);
if (stage != MESA_SHADER_COMPUTE)
NIR_PASS_V(nir, anv_nir_lower_multiview, pipeline->subpass->view_mask);
nir_shader_gather_info(nir, nir_shader_get_entrypoint(nir));
/* Figure out the number of parameters */