summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGert Wollny <gert.wollny@collabora.com>2023-06-30 12:53:01 +0200
committerMarge Bot <emma+marge@anholt.net>2023-06-30 11:12:12 +0000
commitac61162e2a903f973d0f98979c2b974346820d8b (patch)
tree3c0703952cfd5812bf42f536db26c809f2ee0ffd
parent48737626c80f17590889612df8ec0d38322e2a48 (diff)
r600/sfn: Fix filling FS output gaps
in `a << b` with gcc 13 the shift count c is masked by the bit count, and a value larger than 32 will result in shifts by (c & 0x1f), which will add empty instructions if all color outputs are written and this will eventually result in an OOM error. Fixes: 201b46e487d3aecda005973b0b46a514184eec4b r600/sfn: on R600/R700 write a dummy pixel output if there is a gap Signed-off-by: Gert Wollny <gert.wollny@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23945>
-rw-r--r--src/gallium/drivers/r600/sfn/sfn_shader_fs.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gallium/drivers/r600/sfn/sfn_shader_fs.cpp b/src/gallium/drivers/r600/sfn/sfn_shader_fs.cpp
index 434501505ea..f0804c2115e 100644
--- a/src/gallium/drivers/r600/sfn/sfn_shader_fs.cpp
+++ b/src/gallium/drivers/r600/sfn/sfn_shader_fs.cpp
@@ -595,7 +595,7 @@ FragmentShader::do_finalize()
unsigned i = 0;
unsigned mask = m_color_export_mask;
- while (mask & (1u << (4 * i))) {
+ while (i < m_max_color_exports && (mask & (1u << (4 * i)))) {
if (!(m_color_export_written_mask & (1u << i))) {
RegisterVec4 value(0, false, {7, 7, 7, 7});
m_last_pixel_export = new ExportInstr(ExportInstr::pixel, i, value);