Mesa (master): microsoft/compiler: Add scope for declaration in case statement.
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Wed Nov 18 03:44:32 UTC 2020
Module: Mesa
Branch: master
Commit: 791fecfae126a784be4f59d7b6a148bcd79419a5
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=791fecfae126a784be4f59d7b6a148bcd79419a5
Author: Vinson Lee <vlee at freedesktop.org>
Date: Wed Nov 11 14:08:48 2020 -0800
microsoft/compiler: Add scope for declaration in case statement.
This patch fixes this build error.
../src/microsoft/compiler/dxil_nir.c: In function 'extract_comps_from_vec32':
../src/microsoft/compiler/dxil_nir.c:52:10: error: a label can only be part of a statement and a declaration is not a statement
52 | unsigned dst_offs = i * comps_per32b;
| ^~~~~~~~
Fixes: b9c61379ab4 ("microsoft/compiler: translate nir to dxil")
Signed-off-by: Vinson Lee <vlee at freedesktop.org>
Reviewed-by: Jesse Natalie <jenatali at microsoft.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7563>
---
src/microsoft/compiler/dxil_nir.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/microsoft/compiler/dxil_nir.c b/src/microsoft/compiler/dxil_nir.c
index a79c8f57ca5..e6c7a091653 100644
--- a/src/microsoft/compiler/dxil_nir.c
+++ b/src/microsoft/compiler/dxil_nir.c
@@ -48,12 +48,13 @@ extract_comps_from_vec32(nir_builder *b, nir_ssa_def *vec32,
dst_comps[i] = nir_channel(b, vec32, i);
break;
case 16:
- case 8:
+ case 8: {
unsigned dst_offs = i * comps_per32b;
tmp = nir_unpack_bits(b, nir_channel(b, vec32, i), dst_bit_size);
for (unsigned j = 0; j < comps_per32b && dst_offs + j < num_dst_comps; j++)
dst_comps[dst_offs + j] = nir_channel(b, tmp, j);
+ }
break;
}
More information about the mesa-commit
mailing list