diff options
author | Timur Kristóf <[email protected]> | 2020-02-28 15:27:41 +0100 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-03-11 08:34:11 +0000 |
commit | 926bdfae7dcc8bb0c3f5748b5563fb417cd6b5fe (patch) | |
tree | 1da2e92ef8a2c1c51dc1fec0b1f50af25ed4cf9b /src | |
parent | ec56a7093ce21ee63ca3e153613e494872a403f3 (diff) |
aco: Implement loading TES inputs.
Signed-off-by: Timur Kristóf <[email protected]>
Reviewed-by: Rhys Perry <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3964>
Diffstat (limited to 'src')
-rw-r--r-- | src/amd/compiler/aco_instruction_selection.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/amd/compiler/aco_instruction_selection.cpp b/src/amd/compiler/aco_instruction_selection.cpp index 364e04e2ee4..6e69a287ecd 100644 --- a/src/amd/compiler/aco_instruction_selection.cpp +++ b/src/amd/compiler/aco_instruction_selection.cpp @@ -3818,6 +3818,13 @@ void visit_load_input(isel_context *ctx, nir_intrinsic_instr *instr) bld.insert(std::move(vec)); } + } else if (ctx->shader->info.stage == MESA_SHADER_TESS_EVAL) { + Temp ring = bld.smem(aco_opcode::s_load_dwordx4, bld.def(s4), ctx->program->private_segment_buffer, Operand(RING_HS_TESS_OFFCHIP * 16u)); + Temp soffset = get_arg(ctx, ctx->args->oc_lds); + std::pair<Temp, unsigned> offs = get_tcs_per_patch_output_vmem_offset(ctx, instr); + unsigned elem_size_bytes = instr->dest.ssa.bit_size / 8u; + + load_vmem_mubuf(ctx, dst, ring, offs.first, soffset, offs.second, elem_size_bytes, instr->dest.ssa.num_components); } else { unreachable("Shader stage not implemented"); } @@ -3906,6 +3913,22 @@ void visit_load_tcs_per_vertex_input(isel_context *ctx, nir_intrinsic_instr *ins load_lds(ctx, elem_size_bytes, dst, offs.first, offs.second, lds_align); } +void visit_load_tes_per_vertex_input(isel_context *ctx, nir_intrinsic_instr *instr) +{ + assert(ctx->shader->info.stage == MESA_SHADER_TESS_EVAL); + + Builder bld(ctx->program, ctx->block); + + Temp ring = bld.smem(aco_opcode::s_load_dwordx4, bld.def(s4), ctx->program->private_segment_buffer, Operand(RING_HS_TESS_OFFCHIP * 16u)); + Temp oc_lds = get_arg(ctx, ctx->args->oc_lds); + Temp dst = get_ssa_temp(ctx, &instr->dest.ssa); + + unsigned elem_size_bytes = instr->dest.ssa.bit_size / 8; + std::pair<Temp, unsigned> offs = get_tcs_per_vertex_output_vmem_offset(ctx, instr); + + load_vmem_mubuf(ctx, dst, ring, offs.first, oc_lds, offs.second, elem_size_bytes, instr->dest.ssa.num_components, 0u, true, true); +} + void visit_load_per_vertex_input(isel_context *ctx, nir_intrinsic_instr *instr) { switch (ctx->shader->info.stage) { @@ -3915,6 +3938,9 @@ void visit_load_per_vertex_input(isel_context *ctx, nir_intrinsic_instr *instr) case MESA_SHADER_TESS_CTRL: visit_load_tcs_per_vertex_input(ctx, instr); break; + case MESA_SHADER_TESS_EVAL: + visit_load_tes_per_vertex_input(ctx, instr); + break; default: unreachable("Unimplemented shader stage"); } |