summaryrefslogtreecommitdiffstats
path: root/src/glsl/lower_packed_varyings.cpp
diff options
context:
space:
mode:
authorPaul Berry <stereotype441@gmail.com>2013-10-30 17:01:01 -0700
committerPaul Berry <stereotype441@gmail.com>2013-11-04 19:04:29 -0800
commit86cdff56353a223d3c9c1cd24bc83a1799eaa6d9 (patch)
tree30cf559195402f2f14aa81754051f3a064c0f8ee /src/glsl/lower_packed_varyings.cpp
parent749cb8909714fed57b0213f4ad92def3bb24f153 (diff)
downloadexternal_mesa3d-86cdff56353a223d3c9c1cd24bc83a1799eaa6d9.zip
external_mesa3d-86cdff56353a223d3c9c1cd24bc83a1799eaa6d9.tar.gz
external_mesa3d-86cdff56353a223d3c9c1cd24bc83a1799eaa6d9.tar.bz2
glsl: Don't generate misleading debug names when packing gs inputs.
Previously, when packing geometry shader input varyings like this: in float foo[3]; in float bar[3]; lower_packed_varyings would declare a packed varying like this: (declare (shader_in flat) (array ivec4 3) packed:foo[0],bar[0]) That's confusing, since the packed varying acutally stores all three values of foo and all three values of bar. This patch causes it to generate the more sensible declaration: (declare (shader_in flat) (array ivec4 3) packed:foo,bar) Note that there should be no functional change for users of geometry shaders, since the packed name is only used for generating debug output. But this should reduce confusion when using INTEL_DEBUG=gs. Reviewed-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'src/glsl/lower_packed_varyings.cpp')
-rw-r--r--src/glsl/lower_packed_varyings.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/glsl/lower_packed_varyings.cpp b/src/glsl/lower_packed_varyings.cpp
index 2bcadfd..61ee692 100644
--- a/src/glsl/lower_packed_varyings.cpp
+++ b/src/glsl/lower_packed_varyings.cpp
@@ -506,17 +506,16 @@ lower_packed_varyings_visitor::lower_arraylike(ir_rvalue *rvalue,
ir_constant *constant = new(this->mem_ctx) ir_constant(i);
ir_dereference_array *dereference_array = new(this->mem_ctx)
ir_dereference_array(rvalue, constant);
- char *subscripted_name
- = ralloc_asprintf(this->mem_ctx, "%s[%d]", name, i);
if (gs_input_toplevel) {
/* Geometry shader inputs are a special case. Instead of storing
* each element of the array at a different location, all elements
* are at the same location, but with a different vertex index.
*/
(void) this->lower_rvalue(dereference_array, fine_location,
- unpacked_var, subscripted_name,
- false, i);
+ unpacked_var, name, false, i);
} else {
+ char *subscripted_name
+ = ralloc_asprintf(this->mem_ctx, "%s[%d]", name, i);
fine_location =
this->lower_rvalue(dereference_array, fine_location,
unpacked_var, subscripted_name,