summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorNicolai Hähnle <nicolai.haehnle@amd.com>2016-07-25 18:05:46 +0200
committerNicolai Hähnle <nicolai.haehnle@amd.com>2016-07-28 10:46:02 +0100
commit185b0c15abfba8b011f5b009e9f1890305e40ff6 (patch)
treeb74e8aad5c2bd6d21c15afc6519235303b559cc2 /src/mesa
parent041b330a3204d894fe95b5bae6a740936a7ebc0f (diff)
downloadexternal_mesa3d-185b0c15abfba8b011f5b009e9f1890305e40ff6.zip
external_mesa3d-185b0c15abfba8b011f5b009e9f1890305e40ff6.tar.gz
external_mesa3d-185b0c15abfba8b011f5b009e9f1890305e40ff6.tar.bz2
st_glsl_to_tgsi: only skip over slots of an input array that are present
When an application declares varying arrays but does not actually do any indirect indexing, some array indices may end up unused in the consuming shader, so the number of input slots that correspond to the array ends up less than the array_size. Cc: mesa-stable@lists.freedesktop.org Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/state_tracker/st_glsl_to_tgsi.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index 7564119..38e2c4a 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -6058,7 +6058,11 @@ st_translate_program(
inputSemanticName[i], inputSemanticIndex[i],
interpMode[i], 0, interpLocation[i],
array_id, array_size);
- i += array_size - 1;
+
+ GLuint base_attr = inputSlotToAttr[i];
+ while (i + 1 < numInputs &&
+ inputSlotToAttr[i + 1] < base_attr + array_size)
+ ++i;
}
else {
t->inputs[i] = ureg_DECL_fs_input_cyl_centroid(ureg,