[Mesa-dev] i965 handling of ubo_load
Eric Anholt
eric at anholt.net
Sun Nov 25 11:46:50 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.
Ah, I understand the question now. Yeah, I think you need a TGSI
equivalent because you need to be able to pass which ubo is being
dereferenced from, even if you still decide to use the weird old
ARL/offset+ADDR pattern for loading constants with a varying index.
-------------- 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/036d99e3/attachment.pgp>
More information about the mesa-dev
mailing list