summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichel Zou <xantares09@hotmail.com>2021-08-28 13:45:40 +0200
committerEric Engestrom <eric@engestrom.ch>2022-01-12 19:54:25 +0000
commitf78a30946c6c8b27ac4e015c35548f1957c47eac (patch)
tree67b675f7a7709b051173085a4fba6395dd1bd31a
parentaf943229b12925fd715ad1f6e41380d310d1183e (diff)
zink: fix -Warray-bounds warning
It would seems msvc and mingw dont pack across disparate types so zink_bind_rasterizer_state is too big for int32 string.h:202:10: warning: ‘__builtin___memcpy_chk’ forming offset [4, 7] is out of the bounds [0, 4] of object ‘rast_bits’ with type ‘uint32_t’ {aka ‘unsigned int’} [-Warray-bounds] 202 | return __builtin___memcpy_chk(__dst, __src, __n, __mingw_bos(__dst, 0)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../src/gallium/drivers/zink/zink_state.c: In function ‘zink_bind_rasterizer_state’: ../src/gallium/drivers/zink/zink_state.c:586:16: note: ‘rast_bits’ declared here Fixes: 9c5a2ab6 Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12609> (cherry picked from commit 4ff57e5aba0e2d89c86ac896206750aa98c21f11)
-rw-r--r--.pick_status.json2
-rw-r--r--src/gallium/drivers/zink/zink_state.h12
2 files changed, 7 insertions, 7 deletions
diff --git a/.pick_status.json b/.pick_status.json
index b6f553c327e..bfb6e7cfd3d 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -1984,7 +1984,7 @@
"description": "zink: fix -Warray-bounds warning",
"nominated": true,
"nomination_type": 1,
- "resolution": 0,
+ "resolution": 1,
"main_sha": null,
"because_sha": "9c5a2ab6a9d8ffe61178a0f0850deacafb2ff155"
},
diff --git a/src/gallium/drivers/zink/zink_state.h b/src/gallium/drivers/zink/zink_state.h
index 1254498377c..fef90d1c18a 100644
--- a/src/gallium/drivers/zink/zink_state.h
+++ b/src/gallium/drivers/zink/zink_state.h
@@ -63,12 +63,12 @@ struct zink_rasterizer_hw_state {
unsigned polygon_mode : 2; //VkPolygonMode
unsigned cull_mode : 2; //VkCullModeFlags
unsigned line_mode : 2; //VkLineRasterizationModeEXT
- bool depth_clamp:1;
- bool rasterizer_discard:1;
- bool pv_last:1;
- bool line_stipple_enable:1;
- bool force_persample_interp:1;
- bool clip_halfz:1;
+ unsigned depth_clamp:1;
+ unsigned rasterizer_discard:1;
+ unsigned pv_last:1;
+ unsigned line_stipple_enable:1;
+ unsigned force_persample_interp:1;
+ unsigned clip_halfz:1;
};
#define ZINK_RAST_HW_STATE_SIZE 12