[Mesa-dev] [PATCH] nir: Fix gcc-4.4 build error.
Jason Ekstrand
jason at jlekstrand.net
Thu May 26 22:40:38 UTC 2016
On Thu, May 26, 2016 at 3:20 PM, Vinson Lee <vlee at freedesktop.org> wrote:
> CC nir/nir_lower_tex.lo
> nir/nir_lower_tex.c: In function ‘convert_yuv_to_rgb’:
> nir/nir_lower_tex.c:202: error: unknown field ‘f32’ specified in
> initializer
> nir/nir_lower_tex.c:202: warning: missing braces around initializer
> nir/nir_lower_tex.c:202: warning: (near initialization for
> ‘m[0].<anonymous>.f32’)
> nir/nir_lower_tex.c:203: error: unknown field ‘f32’ specified in
> initializer
> nir/nir_lower_tex.c:204: error: unknown field ‘f32’ specified in
> initializer
>
> Fixes: a41b57679fd6 ("nir: Add a lowering pass for YUV textures")
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96221
> Signed-off-by: Vinson Lee <vlee at freedesktop.org>
>
This patch is correct. However, I think a better solution is to make
nir_const_value a union rather than a struct of anonymous union. I'll send
a patch to do that. It'd be nice if you could compile-test it for me.
--Jason
> ---
> src/compiler/nir/nir_lower_tex.c | 6 +++---
> 1 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/src/compiler/nir/nir_lower_tex.c
> b/src/compiler/nir/nir_lower_tex.c
> index 195cb1d..594abf7 100644
> --- a/src/compiler/nir/nir_lower_tex.c
> +++ b/src/compiler/nir/nir_lower_tex.c
> @@ -199,9 +199,9 @@ convert_yuv_to_rgb(nir_builder *b, nir_tex_instr *tex,
> nir_ssa_def *y, nir_ssa_def *u, nir_ssa_def *v)
> {
> nir_const_value m[3] = {
> - { .f32 = { 1.0f, 0.0f, 1.59602678f, 0.0f } },
> - { .f32 = { 1.0f, -0.39176229f, -0.81296764f, 0.0f } },
> - { .f32 = { 1.0f, 2.01723214f, 0.0f, 0.0f } }
> + { { .f32 = { 1.0f, 0.0f, 1.59602678f, 0.0f } } },
> + { { .f32 = { 1.0f, -0.39176229f, -0.81296764f, 0.0f } } },
> + { { .f32 = { 1.0f, 2.01723214f, 0.0f, 0.0f } } }
> };
>
> nir_ssa_def *yuv =
> --
> 1.7.1
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160526/7e61c88e/attachment.html>
More information about the mesa-dev
mailing list