[Mesa-dev] [PATCH 2/2] st/nine: pass NULL to ureg_get_tokens()
Axel Davy
axel.davy at ens.fr
Wed Mar 8 22:00:04 UTC 2017
Reviewed-by: Axel Davy <axel.davy at ens.fr>
On 03/03/2017 00:12, Timothy Arceri wrote:
> The number of tokens in never used and the pointer is NULL checked
> so just pass NULL.
> ---
> src/gallium/state_trackers/nine/nine_ff.c | 3 +--
> src/gallium/state_trackers/nine/nine_shader.c | 3 +--
> 2 files changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/src/gallium/state_trackers/nine/nine_ff.c b/src/gallium/state_trackers/nine/nine_ff.c
> index 279ba37..2175bdb 100644
> --- a/src/gallium/state_trackers/nine/nine_ff.c
> +++ b/src/gallium/state_trackers/nine/nine_ff.c
> @@ -164,22 +164,21 @@ static int nine_ff_fvf_key_comp(void *key1, void *key2)
> {
> return *(DWORD *)key1 != *(DWORD *)key2;
> }
>
> static void nine_ff_prune_vs(struct NineDevice9 *);
> static void nine_ff_prune_ps(struct NineDevice9 *);
>
> static void nine_ureg_tgsi_dump(struct ureg_program *ureg, boolean override)
> {
> if (debug_get_bool_option("NINE_FF_DUMP", FALSE) || override) {
> - unsigned count;
> - const struct tgsi_token *toks = ureg_get_tokens(ureg, &count);
> + const struct tgsi_token *toks = ureg_get_tokens(ureg, NULL);
> tgsi_dump(toks, 0);
> ureg_free_tokens(toks);
> }
> }
>
> #define _X(r) ureg_scalar(ureg_src(r), TGSI_SWIZZLE_X)
> #define _Y(r) ureg_scalar(ureg_src(r), TGSI_SWIZZLE_Y)
> #define _Z(r) ureg_scalar(ureg_src(r), TGSI_SWIZZLE_Z)
> #define _W(r) ureg_scalar(ureg_src(r), TGSI_SWIZZLE_W)
>
> diff --git a/src/gallium/state_trackers/nine/nine_shader.c b/src/gallium/state_trackers/nine/nine_shader.c
> index 95bc6ec..7760a1c 100644
> --- a/src/gallium/state_trackers/nine/nine_shader.c
> +++ b/src/gallium/state_trackers/nine/nine_shader.c
> @@ -3698,22 +3698,21 @@ nine_translate_shader(struct NineDevice9 *device, struct nine_shader_info *info,
> ureg_DECL_constant2D(tx->ureg, 0, 4095, 0);
> ureg_DECL_constant2D(tx->ureg, 0, 4095, 1);
> ureg_DECL_constant2D(tx->ureg, 0, 2047, 2);
> ureg_DECL_constant2D(tx->ureg, 0, 511, 3);
> }
>
> if (info->process_vertices)
> ureg_DECL_constant2D(tx->ureg, 0, 2, 4); /* Viewport data */
>
> if (debug_get_bool_option("NINE_TGSI_DUMP", FALSE)) {
> - unsigned count;
> - const struct tgsi_token *toks = ureg_get_tokens(tx->ureg, &count);
> + const struct tgsi_token *toks = ureg_get_tokens(tx->ureg, NULL);
> tgsi_dump(toks, 0);
> ureg_free_tokens(toks);
> }
>
> if (info->process_vertices) {
> NineVertexDeclaration9_FillStreamOutputInfo(info->vdecl_out,
> tx->output_info,
> tx->num_outputs,
> &(info->so));
> info->cso = ureg_create_shader_with_so_and_destroy(tx->ureg, pipe, &(info->so));
More information about the mesa-dev
mailing list