OSDN Git Service

glsl/lower_ubo_reference: split array copies into element copies
authorIago Toral Quiroga <itoral@igalia.com>
Mon, 23 Nov 2015 12:53:08 +0000 (13:53 +0100)
committerIago Toral Quiroga <itoral@igalia.com>
Tue, 1 Dec 2015 12:29:57 +0000 (13:29 +0100)
commit867c436ca841b4196b4dde4786f5086c76b20dd7
tree4581d299302d7b8902b375d40fbd3151353e7f16
parente483cba9f5ff45395fdb1cd40a796799707eb1e0
glsl/lower_ubo_reference: split array copies into element copies

Improves register pressure, since otherwise we end up emitting
loads for all the elements in the RHS and them emitting
stores for all elements in the LHS.

v2:
  - Mark progress properly. This also fixes some instances where the added
    nodes with individual element copies where not being lowered, which is
    expected behavior as explained in the documentation for
    visit_list_elements.
  - Only need to do this if the RHS is a buffer-backed variable.
  - We can also have arrays inside structs. A later patch will make it so
    we also split struct copies and end up with multiple
    ir_dereference_record assignments, so make sure that if any of these
    is an array copy, we also split it.

Fixes the following piglit tests:
tests/spec/arb_shader_storage_buffer_object/execution/large-field-copy.shader_test
tests/spec/arb_shader_storage_buffer_object/linker/copy-large-array.shader_test

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
src/glsl/lower_ubo_reference.cpp