summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorNicolai Hähnle <nicolai.haehnle@amd.com>2016-12-06 21:03:03 +0100
committerEmil Velikov <emil.l.velikov@gmail.com>2016-12-15 15:53:30 +0000
commitcf07f78f7e6b1365bae8bb00e2f9dea0648c5f40 (patch)
tree63db0aa06a5f97eb7b03d754716634dd733033b3 /src/gallium
parentcf4316a9ced99327ba6760b806bdb15014112b5a (diff)
downloadexternal_mesa3d-cf07f78f7e6b1365bae8bb00e2f9dea0648c5f40.zip
external_mesa3d-cf07f78f7e6b1365bae8bb00e2f9dea0648c5f40.tar.gz
external_mesa3d-cf07f78f7e6b1365bae8bb00e2f9dea0648c5f40.tar.bz2
radeonsi: fix an off-by-one error in the bounds check for max_vertices
The spec actually says that calling EmitStreamVertex is undefined when you exceed max_vertices. But we do need to avoid trampling over memory outside the GSVS ring. Cc: mesa-stable@lists.freedesktop.org Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> (cherry picked from commit 88509518b01d7c1d7436a790bf9be5cf3c41a528)
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/radeonsi/si_shader.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c
index 16346a1..60c2401 100644
--- a/src/gallium/drivers/radeonsi/si_shader.c
+++ b/src/gallium/drivers/radeonsi/si_shader.c
@@ -5314,7 +5314,7 @@ static void si_llvm_emit_vertex(
* further memory loads and may allow LLVM to skip to the end
* altogether.
*/
- can_emit = LLVMBuildICmp(gallivm->builder, LLVMIntULE, gs_next_vertex,
+ can_emit = LLVMBuildICmp(gallivm->builder, LLVMIntULT, gs_next_vertex,
lp_build_const_int32(gallivm,
shader->selector->gs_max_out_vertices), "");