aboutsummaryrefslogtreecommitdiffstats
path: root/src/glsl/lower_ubo_reference.cpp
Commit message (Collapse)AuthorAgeFilesLines
* glsl: Accept nonconstant array references in lower_ubo_referenceChris Forbes2014-07-261-11/+32
| | | | | | | | | | | | Instead of falling back to just the block name (which we won't find), look for the first element of the block array. We'll deal with the rest in the backend by arranging for the blocks to be laid out contiguously. V2: Squashed together patches 3, 5 of V1, plus a naming tweak. Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Convert uniform_block in lower_ubo_reference to ir_rvalue.Chris Forbes2014-07-261-7/+8
| | | | | | | | | | Previously this was a block index with special semantics for -1. With ARB_gpu_shader5, this need not be a compile-time constant, so allow any rvalue here and convert the -1 to a NULL pointer. Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Fix lack of i2u in lower_ubo_reference.Kenneth Graunke2014-04-081-3/+7
| | | | | | | | | | | | | | | | | ir_binop_ubo_load takes unsigned integer operands. However, the array index used to compute these offsets may be a signed integer. (For example, see Piglit's spec/glsl-1.40/uniform_buffer/fs-bvec-array). For some reason, we were missing an ir_binop_i2u cast, and ir_validator was failing to catch that. Without this change, ir_builder's type inference code broke for me when writing a new optimization pass. Cc: [email protected] Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* glsl: move variables in to ir_variable::data, part IITapani Pälli2013-12-121-1/+1
| | | | | | | | | | | | | This patch moves following bitfields and variables to the data structure: explicit_location, explicit_index, explicit_binding, has_initializer, is_unmatched_generic_inout, location_frac, from_named_ifc_block_nonarray, from_named_ifc_block_array, depth_layout, location, index, binding, max_array_access, atomic Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* glsl: Make accessor functions for ir_variable::interface_type.Paul Berry2013-10-091-1/+2
| | | | | | | In a future patch, this will allow us to enforce invariants when the interface type is updated. Reviewed-by: Jordan Justen <[email protected]>
* glsl: Generated masked write instead of vector array index for UBO loweringIan Romanick2013-03-291-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 <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Jordan Justen <[email protected]> Cc: Eric Anholt <[email protected]>
* glsl: Lower UBO references using link-time data instead of compile-time dataIan Romanick2013-01-251-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 <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* glsl: Make the align function available elsewhere in the linkerIan Romanick2013-01-251-12/+7
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Carl Worth <[email protected]>
* glsl: Add ir_variable::is_in_uniform_block predicateIan Romanick2013-01-251-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 <[email protected]> Reviewed-by: Carl Worth <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Add a lowering pass to turn complicated UBO references to vector loads.Eric Anholt2012-08-071-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 <[email protected]>