[Mesa-dev] [PATCH 3/4] r600g: Don't repeat tgsi_scan_shader(), just use result

Marek Olšák maraeo at gmail.com
Wed Aug 26 04:07:52 PDT 2015


On Tue, Aug 25, 2015 at 1:56 PM, Edward O'Callaghan
<edward.ocallaghan at koparo.com> wrote:
> From: Edward O'Callaghan <eocallaghan at alterapraxis.com>
>
> tgsi_shader_scan() has already happened so just use the results.
>
> Signed-off-by: Edward O'Callaghan <eocallaghan at alterapraxis.com>
> Signed-off-by: Dave Airlie <airlied at redhat.com>

Did Dave really give you this sign-off?

> ---
>  src/gallium/drivers/r600/r600_shader.c | 35 ++++++++++------------------------
>  1 file changed, 10 insertions(+), 25 deletions(-)
>
> diff --git a/src/gallium/drivers/r600/r600_shader.c b/src/gallium/drivers/r600/r600_shader.c
> index b830479..009a8f2 100644
> --- a/src/gallium/drivers/r600/r600_shader.c
> +++ b/src/gallium/drivers/r600/r600_shader.c
> @@ -1809,7 +1809,6 @@ static int r600_shader_from_tgsi(struct r600_context *rctx,
>         struct tgsi_token *tokens = pipeshader->selector->tokens;
>         struct pipe_stream_output_info so = pipeshader->selector->so;
>         struct tgsi_full_immediate *immediate;
> -       struct tgsi_full_property *property;
>         struct r600_shader_ctx ctx;
>         struct r600_bytecode_output output[32];
>         unsigned output_done, noutput;
> @@ -1968,6 +1967,16 @@ static int r600_shader_from_tgsi(struct r600_context *rctx,
>         ctx.nliterals = 0;
>         ctx.literals = NULL;
>         shader->fs_write_all = FALSE;
> +       if (ctx.info.properties[TGSI_PROPERTY_FS_COLOR0_WRITES_ALL_CBUFS])
> +               shader->fs_write_all = TRUE;
> +
> +       shader->vs_position_window_space = FALSE;
> +       if (ctx.info.properties[TGSI_PROPERTY_VS_WINDOW_SPACE_POSITION])
> +               shader->vs_position_window_space = TRUE;
> +
> +       pipeshader->selector->gs_output_prim = ctx.info.properties[TGSI_PROPERTY_GS_OUTPUT_PRIM];
> +       pipeshader->selector->gs_max_out_vertices = ctx.info.properties[TGSI_PROPERTY_GS_MAX_OUTPUT_VERTICES];
> +       pipeshader->selector->gs_num_invocations = ctx.info.properties[TGSI_PROPERTY_GS_INVOCATIONS];

Same as in the previous patch. The selector isn't owned by shader
variants, so shader variants shouldn't modify it.

Marek


More information about the mesa-dev mailing list