Mesa (10.4): radeonsi: increase coords array size for radeon_llvm_emit_prepare_cube_coords
Emil Velikov
evelikov at kemper.freedesktop.org
Thu Mar 19 00:33:00 UTC 2015
Module: Mesa
Branch: 10.4
Commit: 832c94a55c50bd3d05c17d2651ede6d3859095c2
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=832c94a55c50bd3d05c17d2651ede6d3859095c2
Author: Marek Olšák <marek.olsak at amd.com>
Date: Tue Mar 17 17:47:17 2015 +0100
radeonsi: increase coords array size for radeon_llvm_emit_prepare_cube_coords
radeon_llvm_emit_prepare_cube_coords uses coords[4] in some cases (TXB2 etc.)
Discovered by Coverity. Reported by Ilia Mirkin.
Cc: 10.5 10.4 <mesa-stable at lists.freedesktop.org>
Reviewed-by: Michel Dänzer <michel.daenzer at amd.com>
(cherry picked from commit a984abdad39df2d8ceb4c46e11f4ce1344c36c86)
---
src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c | 2 +-
src/gallium/drivers/radeonsi/si_shader.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c b/src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c
index c30a9d0..1f1484d 100644
--- a/src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c
+++ b/src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c
@@ -748,7 +748,7 @@ static void txp_fetch_args(
const struct tgsi_full_instruction * inst = emit_data->inst;
LLVMValueRef src_w;
unsigned chan;
- LLVMValueRef coords[4];
+ LLVMValueRef coords[5];
emit_data->dst_type = LLVMVectorType(bld_base->base.elem_type, 4);
src_w = lp_build_emit_fetch(bld_base, emit_data->inst, 0, TGSI_CHAN_W);
diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c
index c15e8111..19e1781 100644
--- a/src/gallium/drivers/radeonsi/si_shader.c
+++ b/src/gallium/drivers/radeonsi/si_shader.c
@@ -1505,7 +1505,7 @@ static void tex_fetch_args(
const struct tgsi_full_instruction * inst = emit_data->inst;
unsigned opcode = inst->Instruction.Opcode;
unsigned target = inst->Texture.Texture;
- LLVMValueRef coords[4];
+ LLVMValueRef coords[5];
LLVMValueRef address[16];
int ref_pos;
unsigned num_coords = tgsi_util_get_texture_coord_dim(target, &ref_pos);
More information about the mesa-commit
mailing list