diff options
author | Jason Ekstrand <[email protected]> | 2018-06-27 18:25:17 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2018-08-01 18:02:28 -0700 |
commit | 4d57e543b8e3bc0c5e0e6ced1f0d171a2cab3b8c (patch) | |
tree | e0d4d2e279dbdca448ecdfbaa4d94591e0fb26a7 | |
parent | 7f75cf2a9408b9af562e033ef6c1d1fd15141421 (diff) |
anv/pipeline: Fix up deref modes if we delete a FS output
With the new deref instructions, we have to keep the modes consistent
between the derefs and the variables they reference. Since we remove
outputs by changing them to local variables, we need to run the fixup
pass to fix the modes.
Reviewed-by: Timothy Arceri <[email protected]>
-rw-r--r-- | src/intel/vulkan/anv_pipeline.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/intel/vulkan/anv_pipeline.c b/src/intel/vulkan/anv_pipeline.c index fa3d3e7a309..e2116e24807 100644 --- a/src/intel/vulkan/anv_pipeline.c +++ b/src/intel/vulkan/anv_pipeline.c @@ -930,6 +930,7 @@ anv_pipeline_compile_fs(struct anv_pipeline *pipeline, num_rts++; } + bool deleted_output = false; nir_foreach_variable_safe(var, &nir->outputs) { if (var->data.location < FRAG_RESULT_DATA0) continue; @@ -937,6 +938,7 @@ anv_pipeline_compile_fs(struct anv_pipeline *pipeline, const unsigned rt = var->data.location - FRAG_RESULT_DATA0; if (rt >= key.nr_color_regions) { /* Out-of-bounds, throw it away */ + deleted_output = true; var->data.mode = nir_var_local; exec_node_remove(&var->node); exec_list_push_tail(&impl->locals, &var->node); @@ -948,6 +950,9 @@ anv_pipeline_compile_fs(struct anv_pipeline *pipeline, var->data.location = rt_to_bindings[rt] + FRAG_RESULT_DATA0; } + if (deleted_output) + nir_fixup_deref_modes(nir); + if (num_rts == 0) { /* If we have no render targets, we need a null render target */ rt_bindings[0] = (struct anv_pipeline_binding) { |