{
struct prog_src_register coord;
struct prog_dst_register tmpcoord;
+ GLuint unit = c->fp->program.Base.SamplerUnits[inst->TexSrcUnit];
if (inst->TexSrcTarget == TEXTURE_CUBE_INDEX) {
struct prog_instruction *out;
search_or_add_param5( c,
STATE_INTERNAL,
STATE_TEXRECT_SCALE,
- inst->TexSrcUnit,
+ unit,
0,0 );
tmpcoord = get_temp(c);
* conversion requires allocating a temporary variable which we
* don't have the facility to do that late in the compilation.
*/
- if (!(c->key.yuvtex_mask & (1<<inst->TexSrcUnit))) {
+ if (!(c->key.yuvtex_mask & (1<<unit))) {
emit_op(c,
OPCODE_TEX,
inst->DstReg,
inst->SaturateMode,
- inst->TexSrcUnit,
+ unit,
inst->TexSrcTarget,
coord,
src_undef(),
src_undef());
}
else {
- GLboolean swap_uv = c->key.yuvtex_swap_mask & (1<<inst->TexSrcUnit);
+ GLboolean swap_uv = c->key.yuvtex_swap_mask & (1<<unit);
/*
CONST C0 = { -.5, -.0625, -.5, 1.164 }
OPCODE_TEX,
tmp,
inst->SaturateMode,
- inst->TexSrcUnit,
+ unit,
inst->TexSrcTarget,
coord,
src_undef(),
{
struct brw_compile *p = &c->func;
struct brw_reg dst[4], src[4], payload_reg;
+ GLuint unit = c->fp->program.Base.SamplerUnits[inst->TexSrcUnit];
+
GLuint i;
payload_reg = get_reg(c, PROGRAM_PAYLOAD, PAYLOAD_DEPTH, 0, 1, 0, 0);
for (i = 0; i < 4; i++)
retype(vec8(dst[0]), BRW_REGISTER_TYPE_UW),
1,
retype(payload_reg, BRW_REGISTER_TYPE_UW),
- inst->TexSrcUnit + MAX_DRAW_BUFFERS, /* surface */
- inst->TexSrcUnit, /* sampler */
+ unit + MAX_DRAW_BUFFERS, /* surface */
+ unit, /* sampler */
inst->DstReg.WriteMask,
BRW_SAMPLER_MESSAGE_SIMD16_SAMPLE_BIAS,
4,
{
struct brw_compile *p = &c->func;
struct brw_reg dst[4], src[4], payload_reg;
+ GLuint unit = c->fp->program.Base.SamplerUnits[inst->TexSrcUnit];
+
GLuint msg_len;
GLuint i, nr;
GLuint emit;
- GLboolean shadow = (c->key.shadowtex_mask & (1<<inst->TexSrcUnit)) ? 1 : 0;
+ GLboolean shadow = (c->key.shadowtex_mask & (1<<unit)) ? 1 : 0;
payload_reg = get_reg(c, PROGRAM_PAYLOAD, PAYLOAD_DEPTH, 0, 1, 0, 0);
retype(vec8(dst[0]), BRW_REGISTER_TYPE_UW),
1,
retype(payload_reg, BRW_REGISTER_TYPE_UW),
- inst->TexSrcUnit + MAX_DRAW_BUFFERS, /* surface */
- inst->TexSrcUnit, /* sampler */
+ unit + MAX_DRAW_BUFFERS, /* surface */
+ unit, /* sampler */
inst->DstReg.WriteMask,
BRW_SAMPLER_MESSAGE_SIMD8_SAMPLE,
4,