summaryrefslogtreecommitdiff
path: root/src/glsl/lower_ubo_reference.cpp
AgeCommit message (Collapse)AuthorFilesLines
2013-03-29glsl: Generated masked write instead of vector array index for UBO loweringIan Romanick1-7/+3
When reading a column from a row-major matrix, we would slot the single value read into the vector using an ir_dereference_array of the vector with a constant index. This will (eventually) get optimized to a masked-write, so just generate the masked write in the first place. v2: Remove unused variable 'chan'. Suggested by Ken. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Cc: Eric Anholt <eric@anholt.net>
2013-01-25glsl: Lower UBO references using link-time data instead of compile-time dataIan Romanick1-3/+86
Pretty much all of the compile-time, per-compilation unit block data is about to get the axe. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-01-25glsl: Make the align function available elsewhere in the linkerIan Romanick1-12/+7
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Carl Worth <cworth@cworth.org>
2013-01-25glsl: Add ir_variable::is_in_uniform_block predicateIan Romanick1-1/+1
The way a variable is tested for this property is about to change, and this makes the code easier to modify. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Carl Worth <cworth@cworth.org> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-07glsl: Add a lowering pass to turn complicated UBO references to vector loads.Eric Anholt1-0/+313
v2: Reduce the impenetrable code in emit_ubo_loads() by 23 lines by keeping the ir_variable as the variable part of the offset from handle_rvalue(), and track the constant offsets from that with a plain old integer value, avoiding a bunch of temporary variables in the array and struct handling. Also, fix file description doxygen. v3: Fix a row vs col typo, and fix spelling in a comment. Reviewed-by: Eric Anholt <eric@anholt.net>