[Mesa-dev] [PATCH 1/5] st/mesa: also emit labels for TGSI_OPCODE_BGNSUB

Ilia Mirkin imirkin at alum.mit.edu
Tue Apr 14 09:58:57 PDT 2015


Nothing against this patch per se, but are there any actual users of
BGNSUB/CAL/etc? Was it done in anticipation of ARB_shader_subroutines
(and/or whatever corresponding feature in DirectX)?

On Tue, Apr 14, 2015 at 12:56 PM, Brian Paul <brianp at vmware.com> wrote:
> Subroutines need labels so they can be identied by CAL instructions.
> ---
>  src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 19 +++++++++++++------
>  1 file changed, 13 insertions(+), 6 deletions(-)
>
> diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> index 67a4da7..eb0ce07 100644
> --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
> @@ -4771,18 +4771,25 @@ compile_tgsi_instruction(struct st_translate *t,
>     }
>
>     switch(inst->op) {
> +   case TGSI_OPCODE_BGNSUB:
>     case TGSI_OPCODE_BGNLOOP:
>     case TGSI_OPCODE_CAL:
>     case TGSI_OPCODE_ELSE:
>     case TGSI_OPCODE_ENDLOOP:
>     case TGSI_OPCODE_IF:
>     case TGSI_OPCODE_UIF:
> -      assert(num_dst == 0);
> -      ureg_label_insn(ureg,
> -                      inst->op,
> -                      src, num_src,
> -                      get_label(t,
> -                                inst->op == TGSI_OPCODE_CAL ? inst->function->sig_id : 0));
> +      {
> +         int sig_id = 0;
> +         if (inst->op == TGSI_OPCODE_CAL ||
> +             inst->op == TGSI_OPCODE_BGNSUB) {
> +            sig_id = inst->function->sig_id;
> +         }
> +         assert(num_dst == 0);
> +         ureg_label_insn(ureg,
> +                         inst->op,
> +                         src, num_src,
> +                         get_label(t, sig_id));
> +      }
>        return;
>
>     case TGSI_OPCODE_TEX:
> --
> 1.9.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list