[Mesa-dev] i965 handling of ubo_load

Eric Anholt eric at anholt.net
Sun Nov 25 11:44:54 PST 2012


Dave Airlie <airlied at gmail.com> writes:

> Hi Eric,
>
> so I've been playing around with gallium/ubos a bit more,
>
> I noticed something I wasn't sure abuot between the i965 vs and fs backends
>
> FS does
>      ir_constant *offset = ir->operands[1]->as_constant();
> fs_inst *pull = emit(fs_inst(FS_OPCODE_PULL_CONSTANT_LOAD,
>                                    packed_consts,
>                                    surf_index,
>                                    fs_reg(offset->value.u[0])));
>
> so it gets offset and derefs it later,
>
>      ir_constant *const_offset_ir = ir->operands[1]->as_constant();
>       unsigned const_offset = const_offset_ir ? const_offset_ir->value.u[0] : 0;
>
> does a check around it.
>
> What are the different ways ubo_load can get used?  I think I need to
> create a tgsi IR equivalent of it, since I don't think I can resolve
> the offset into the constant buffer at the glsl->tgsi translation
> stage.

ubo_load could have a non-constant offset, it's just that in the FS it's
been lowered to conditional moves because we were slackers (there's a
patch series out for it).  The VS side of things should look more
like you expected, I think.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20121125/e8f8eba6/attachment.pgp>


More information about the mesa-dev mailing list