[Mesa-dev] [PATCH 3/4] i965: let if_stack just store the instruction index

Eric Anholt eric at anholt.net
Tue Nov 29 10:35:42 PST 2011


On Tue, 29 Nov 2011 16:08:38 +0800, Yuanhan Liu <yuanhan.liu at linux.intel.com> wrote:
> Let if_stack just store the instruction pointer(an index). This is
> somehow more flexible than store the instruction memory address.

I'd be more specific: This lets us realloc the instruction store.

> diff --git a/src/mesa/drivers/dri/i965/brw_eu.c b/src/mesa/drivers/dri/i965/brw_eu.c
> index b5a858b..d6e5c09 100644
> --- a/src/mesa/drivers/dri/i965/brw_eu.c
> +++ b/src/mesa/drivers/dri/i965/brw_eu.c
> @@ -191,8 +191,7 @@ brw_init_compile(struct brw_context *brw, struct brw_compile *p, void *mem_ctx)
>     /* Set up control flow stack */
>     p->if_stack_depth = 0;
>     p->if_stack_array_size = 16;
> -   p->if_stack =
> -      rzalloc_array(mem_ctx, struct brw_instruction *, p->if_stack_array_size);
> +   p->if_stack = rzalloc_array(mem_ctx, GLuint, p->if_stack_array_size);
>  }

Please use plain types instead of the awful GL-decorated types, unless
it's something directly exposed in the GL API.

(if you want sized types, the standard ones in inttypes.h are good)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20111129/986c0488/attachment.pgp>


More information about the mesa-dev mailing list