diff options
author | Dave Airlie <[email protected]> | 2017-04-18 15:50:10 +1000 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2017-04-19 10:02:53 +1000 |
commit | dd17e4ceb40efdd8895b24eb3940771bf64208f1 (patch) | |
tree | fdf445a25e0f295c61dd6c9fb6bbe27c5ef135e9 /src/amd/vulkan/radv_meta.c | |
parent | 84b9e3a831b7e5af047792cc9dd1bea4e07827ac (diff) |
radv/meta: reduce vertex buffer usage in clear shaders
For depth clears we have to pass the depth in the 2nd
component, we can use push constants for some of this
later to drop the vertex buffer completely
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/amd/vulkan/radv_meta.c')
-rw-r--r-- | src/amd/vulkan/radv_meta.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/amd/vulkan/radv_meta.c b/src/amd/vulkan/radv_meta.c index bb95b36b56b..3584396b727 100644 --- a/src/amd/vulkan/radv_meta.c +++ b/src/amd/vulkan/radv_meta.c @@ -417,7 +417,7 @@ radv_meta_save_graphics_reset_vport_scissor_novertex(struct radv_meta_saved_stat cmd_buffer->state.dirty |= dirty_state; } -nir_ssa_def *radv_meta_gen_rect_vertices(nir_builder *vs_b) +nir_ssa_def *radv_meta_gen_rect_vertices_comp2(nir_builder *vs_b, nir_ssa_def *comp2) { nir_intrinsic_instr *vertex_id = nir_intrinsic_instr_create(vs_b->shader, nir_intrinsic_load_vertex_id_zero_base); @@ -443,9 +443,14 @@ nir_ssa_def *radv_meta_gen_rect_vertices(nir_builder *vs_b) comp[1] = nir_bcsel(vs_b, c1cmp, nir_imm_float(vs_b, -1.0), nir_imm_float(vs_b, 1.0)); - comp[2] = nir_imm_float(vs_b, 0.0); + comp[2] = comp2; comp[3] = nir_imm_float(vs_b, 1.0); nir_ssa_def *outvec = nir_vec(vs_b, comp, 4); return outvec; } + +nir_ssa_def *radv_meta_gen_rect_vertices(nir_builder *vs_b) +{ + return radv_meta_gen_rect_vertices_comp2(vs_b, nir_imm_float(vs_b, 0.0)); +} |