[Mesa-dev] i965 handling of ubo_load

Dave Airlie airlied at gmail.com
Sun Nov 25 01:04:28 PST 2012


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.

Dave.


More information about the mesa-dev mailing list