Dave Airlie <airl...@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.
pgpIyZPTggoGm.pgp
Description: PGP signature
_______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev