[Freedreno] [RFC PATCH 5/5] freedreno: HACK: Missing alloc for vertex shader pixsize

Rob Clark robdclark at gmail.com
Tue Aug 4 12:55:50 PDT 2015


On Tue, Aug 4, 2015 at 1:53 PM, Martin Fuzzey <mfuzzey at parkeon.com> wrote:
> The simplest vertex shader was missing ALLOC PARAM/PIXEL SIZE(0x0) which,
> on A205 at least, causes GPU hang.
>
> This is a hack until I figure out the right way of fixing it.
>
> Signed-off-by: Martin Fuzzey <mfuzzey at parkeon.com>
> ---
>  src/gallium/drivers/freedreno/a2xx/fd2_compiler.c |    9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/src/gallium/drivers/freedreno/a2xx/fd2_compiler.c b/src/gallium/drivers/freedreno/a2xx/fd2_compiler.c
> index b48fb46..251aa43 100644
> --- a/src/gallium/drivers/freedreno/a2xx/fd2_compiler.c
> +++ b/src/gallium/drivers/freedreno/a2xx/fd2_compiler.c
> @@ -983,8 +983,15 @@ translate_instruction(struct fd2_compile_context *ctx,
>         struct ir2_instruction *instr;
>         static struct ir2_cf *cf;
>
> -       if (opc == TGSI_OPCODE_END)
> +       if (opc == TGSI_OPCODE_END) {
> +               /* MF Hack */
> +               if (ctx->type == TGSI_PROCESSOR_VERTEX) {
> +                       ctx->cf = NULL;
> +                       ir2_cf_create_alloc(ctx->so->ir, SQ_PARAMETER_PIXEL, 0);
> +                       next_exec_cf(ctx);
> +               }

hmm, going back and looking at my logic for emitting the "ALLOC
PARAM/PIXEL SIZE" section is a bit scary..  I suspect they way you
have it now would, for anything that actually had a varying, emit two
SQ_PARAMETER_PIXEL sections.. which seems like something the hw would
dislike.

Probably better to drop the strange logic of resetting
num_position/num_param to zero when we emit
SQ_POSITION/SQ_PARAMETER_PIXEL sections and just add booleans to track
whether we've already emitted them..  that would make it easier at the
end to detect that we need to emit an empty SQ_PARAMETER_PIXEL section
and be somewhat less convoluted than the way it is now ;-)

BR,
-R

>                 return;
> +       }
>
>         if (inst->Dst[0].Register.File == TGSI_FILE_OUTPUT) {
>                 unsigned num = inst->Dst[0].Register.Index;
>


More information about the Freedreno mailing list