On Wednesday, December 02, 2015 10:54:39 AM Connor Abbott wrote: > On Wed, Dec 2, 2015 at 3:26 AM, Kenneth Graunke <kenn...@whitecape.org> wrote: > > Normally, get_nir_src() won't return an immediate value - it moves it to > > a temporary VGRF. There are consumers of get_nir_src() that rely on > > this, and are unprepared to handle immediate values. > > > > This patch introduces new helpers which return immediates for single > > component constant values, and VGRFs for other values. > > Just curious, what are you going to use this for? Constant propagation > should always be smart enough to fold constants into the instruction, > since the constants are SSA values that turn into registers which are > only written once.
I'm using it for URB read/write messages for reading inputs/outputs. For TCS inputs, we separate out the vertex ID (using the per_vertex intrinsic variants). If the vertex ID is constant, I can directly access the register with the URB handle I want. Otherwise, I have do a register-indirect MOV using the address register to select the handle I want. Beyond that, URB messages have a a global constant offset baked into the instruction itself, and a per-channel non-constant offset in the message header. If I have an entirely constant offset, I don't have to emit any code to set up the per-slot offsets. In general, I agree, relying on constant propagation is a reasonable plan. But for inputs and outputs, it's really handy. --Ken
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev