[Mesa-dev] [PATCH 11/13] i965: Make backend_instruction usable from C.

Pohjolainen, Topi topi.pohjolainen at intel.com
Wed Jul 2 06:59:23 PDT 2014


On Mon, Jun 30, 2014 at 02:40:42PM -0700, Matt Turner wrote:
> With a hack to place an exec_node in the struct in C to be at the same
> location as the inherited exec_node in C++.

Are you planning to eventually have one but not the other? If this is just
temporary it does not make a lot difference but otherwise I would rather
have these with different names.
How big a task would it be to teach plusplus logic to use the C-type?

> ---
>  src/mesa/drivers/dri/i965/brw_shader.h | 11 +++++++----
>  1 file changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/src/mesa/drivers/dri/i965/brw_shader.h b/src/mesa/drivers/dri/i965/brw_shader.h
> index e021820..f866249 100644
> --- a/src/mesa/drivers/dri/i965/brw_shader.h
> +++ b/src/mesa/drivers/dri/i965/brw_shader.h
> @@ -78,12 +78,10 @@ struct backend_reg
>     bool abs;
>  };
>  
> -#ifdef __cplusplus
> -
>  struct cfg_t;
>  
> +#ifdef __cplusplus
>  struct backend_instruction : public exec_node {
> -public:
>     bool is_tex() const;
>     bool is_math() const;
>     bool is_control_flow() const;
> @@ -98,7 +96,10 @@ public:
>      * optimize these out unless you know what you are doing.
>      */
>     bool has_side_effects() const;
> -
> +#else
> +struct backend_instruction {
> +   struct exec_node link;
> +#endif
>     /** @{
>      * Annotation for the generated IR.  One of the two can be set.
>      */
> @@ -124,6 +125,8 @@ public:
>     bool saturate:1;
>  };
>  
> +#ifdef __cplusplus
> +
>  enum instruction_scheduler_mode {
>     SCHEDULE_PRE,
>     SCHEDULE_PRE_NON_LIFO,
> -- 
> 1.8.3.2
> 
> _______________________________________________
> 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